Pink Petal Games

Game Editing And Additions => User Mods => Topic started by: aevojoey on September 04, 2014, 02:08:44 AM

Title: Ani and Gif files - And image texts
Post by: aevojoey on September 04, 2014, 02:08:44 AM
Ani files were added a long time ago as a work around for them not being able to add GIF support to SDL.
It has been suggested that this can be done now so I will see if I can do it.
I am repurposing this thread to be an update on adding GIF support to the game.


.06.01.18
Gif files have been added to the girls' image lists but they do not animate yet, they only display the first frame.

Update:4/14/15
I attempted to load gif files into the game but failed.
They exceedingly bloated the memory of the game and crashed it.
I will need to change how the game handles images entirely to make gifs feasible.
Images currently are checked and their stats are stored in the memory every time the game is loaded.
Instead, I want to have the game look for images only when they are needed.
This will save memory and load time and should not noticeably affect game time.

I have added a check in ani loading so it will test if both the .ani file and the ./ani/.jpg folder/file matches.
This should prevent bad ani files from loading thus not causing the game to crash.

.06.02.00-.02
The image handling was completely rewritten.

.06.02.03
GIFs finally work.








Original text of this post:

I just did an experiment of creating an ani file to see if/how it works.
https://mega.co.nz/#!wc83BCwJ!lHr38ZMn9Ih3XY6d8Oo8dzga1kct4wD3-XwdFxA4Kag (https://mega.co.nz/#!wc83BCwJ!lHr38ZMn9Ih3XY6d8Oo8dzga1kct4wD3-XwdFxA4Kag)


There were no ani files in any of the girls folders I have so I took a gif from one, extracted the frames into jpgs and created an ani file for it.
It was not too hard to make the files, just a lot of copy/pasteing.
When I loaded it into the game, the gallery showed it fine.
However when trying it out from the interactions button, it did not animate and showed the frames as a tiled block.
I am not sure if there is something I am missing when looking at the code but I can't see anything wrong with it.
It may just be that the display window is not setup to allow animated images.



Now for the question,
Should I remove the ani section from the code, saving some processing time, or should I leave it in?
Title: Re: Ani files
Post by: Sharkey on September 04, 2014, 04:03:26 AM
Is there any reason why don't you just add gif support?
Look at last post:
http://forums.libsdl.org/viewtopic.php?p=7737&sid=aa7a8b141d3dc3d20c697e22da8553ea (http://forums.libsdl.org/viewtopic.php?p=7737&sid=aa7a8b141d3dc3d20c697e22da8553ea)
it's for SDL1 and it's working.


Title: Re: Ani files
Post by: Yukinohki on September 04, 2014, 05:13:01 AM
I, for my part don't have any ani files so you can delete it, in my opinion.
Support for gifs may be a good idea but it can bring additional problems
when people start including really large animated gifs and then complain about their game
crashing or lagging or something.
I wouldn't call gif support important, again just my opinion.
Title: Re: Ani files
Post by: Sharkey on September 04, 2014, 08:01:59 AM
Support for gifs may be a good idea but it can bring additional problems
when people start including really large animated gifs and then complain about their game
crashing or lagging or something.

I don't know how game is managing resources, but if it's done correctly, then it shouldn't happened.

After few minutes of code browsing i would say that there's few things to improve performance and seriously why don't you use PCH?
Title: Re: Ani files
Post by: 0nymous on September 04, 2014, 08:28:59 AM
Making animated images was nice, but it really took a lot of work per image.
Also, from my experience, a single girl could only have so many animated images - after adding more than 4 or 5 I think, some of them would refuse to animate at all.

Best solution IMO is what someone mentioned already - full gif support.

Title: Re: Ani files
Post by: crazy on September 04, 2014, 03:58:35 PM
Leave it I say. I have several girls with ani files some with 10 or more a girl that work fine. I don't share as other people always say they mess there game up even when they work fine for me
Title: Re: Ani files
Post by: Fightback on September 04, 2014, 04:06:33 PM
As a Developer, if I'm not currently using something I usually comment it out. That way it won't accidentally conflict with anything else I may be doing.
Title: Re: Ani files
Post by: aevojoey on April 06, 2015, 12:28:33 PM
I have fixed the .ani problem and they should work properly for .06.01.17.

I am also looking into adding the gif support suggested above.
Title: Re: Ani files
Post by: Jaxter on April 06, 2015, 06:29:16 PM
Seen no girlpacks with ani files.
Gifs are easier, so if we get that there's no need to retain .ani support.
Title: Re: Ani files
Post by: _rhetorik_ on April 06, 2015, 09:39:17 PM
I don't know how game is managing resources, but if it's done correctly, then it shouldn't happened.

After few minutes of code browsing i would say that there's few things to improve performance and seriously why don't you use PCH?


AFAIK PCHs just speed up the compiler not the final code.
Title: Re: Ani files
Post by: Sharkey on April 08, 2015, 03:14:16 AM

AFAIK PCHs just speed up the compiler not the final code.

That's right.
Due to large WM code base, every small testing/debugging process only takes more time than it should.
That's why I wonder why they don't use PCH.
Title: Re: Ani files
Post by: aevojoey on April 08, 2015, 10:44:43 AM
That's why I wonder why they don't use PCH.
I don't use PCHs because I did not know what they are.  :P
I am learning C++ while working on the game.
I had no experience programming with C++ before I started here and had little other programming experience either.
I use VSE2013 to edit and compile the game which I guess uses PCH in the background because when I compile after changing something minor, it only recompiles the minor change.
If I change a .h file it does recompile a lot more and if I change a core file like Constants.h it recompiles everything.

Title: Re: Ani files
Post by: Sharkey on April 08, 2015, 01:37:36 PM
I use VSE2013 to edit and compile the game which I guess uses PCH in the background because when I compile after changing something minor, it only recompiles the minor change.
If I change a .h file it does recompile a lot more and if I change a core file like Constants.h it recompiles everything.

No, it doesn't uses PCH.
Take a look at:
https://yxbenj.wordpress.com/2013/06/29/a-quick-guide-to-using-precompiled-headers-visual-studio/ (https://yxbenj.wordpress.com/2013/06/29/a-quick-guide-to-using-precompiled-headers-visual-studio/) (PCH file doesn't need to be stdafx.h, I recommend to choose one of existing header file or create new one)
http://freeorion.org/forum/viewtopic.php?f=9&t=2354 (http://freeorion.org/forum/viewtopic.php?f=9&t=2354)
Title: Re: Ani files
Post by: aevojoey on April 08, 2015, 02:25:55 PM
No, it doesn't uses PCH.
Take a look at:
https://yxbenj.wordpress.com/2013/06/29/a-quick-guide-to-using-precompiled-headers-visual-studio/ (https://yxbenj.wordpress.com/2013/06/29/a-quick-guide-to-using-precompiled-headers-visual-studio/) (PCH file doesn't need to be stdafx.h, I recommend to choose one of existing header file or create new one)
http://freeorion.org/forum/viewtopic.php?f=9&t=2354 (http://freeorion.org/forum/viewtopic.php?f=9&t=2354)
OK, I see where that could help a little but I would have to agree with the responder to the freeorion.org (http://freeorion.org/forum/viewtopic.php?f=9&t=2354) post:
Quote
A major issue I have with this is that we'd need to put stdafx.h into every source file for MSVC. This would be like adding a bunch of msvc-specific "#pragma once" commands into what is more or less platform-independent C++ code. This might be doable if it were just a matter of setting a switch in the MSVC project files, or if it worked like (I read about) GCC which just looks for the precompiled header files without requiring the source files to be modified.

If it were a simple update to save a ton of time, then I probably would have no problem with it.

When I do a clean rebuild for WM it takes about 3 minutes.
If spending several hours to add a PCH that only saves 1 minute each time I do a clean build (which I only do once or twice a week) I don't really see the need to do so.

It appears that the main advantage is it speeds up compiling for third party code that never changes.
WM only has 2 third party code sets, SDL1.2 and LUA.
They are both small and compile quickly so a few seconds would not make much of a difference.


If/when I rewrite the game from scratch, I will include a PCH.
It seems it would help more (and be easier) for new code than for existing code that already works.


Now back to the topic of this thread: ANI and GIF files.

Is there any reason why don't you just add gif support?
Look at last post:
http://forums.libsdl.org/viewtopic.php?p=7737&sid=aa7a8b141d3dc3d20c697e22da8553ea (http://forums.libsdl.org/viewtopic.php?p=7737&sid=aa7a8b141d3dc3d20c697e22da8553ea)
it's for SDL1 and it's working.
I have downloaded and looked at the code suggested.
It looks like I may be able to figure out how to add it to the game.
Not going to give a time frame for it but pack makers may want to start looking for gifs.
Title: Re: Ani files
Post by: Sharkey on April 09, 2015, 12:12:46 PM
Quote
A major issue I have with this is that we'd need to put stdafx.h into every source file for MSVC. This would be like adding a bunch of msvc-specific "#pragma once" commands into what is more or less platform-independent C++ code. This might be doable if it were just a matter of setting a switch in the MSVC project files, or if it worked like (I read about) GCC which just looks for the precompiled header files without requiring the source files to be modified.
For me this is not even issue.
I'm only using PCH to speed up compile time for tests and debugging purposes, which i only do on one platform.
Decreasing compile time of release build doesn't even matter, for other platforms too.

Quote
If/when I rewrite the game from scratch, I will include a PCH.
It seems it would help more (and be easier) for new code than for existing code that already works.
Yea, that's kinda true. I would probably do the same ;)
Title: Re: Ani and Gif files
Post by: aevojoey on April 10, 2015, 08:50:43 PM
Gif files will be added to the girls' image lists for version .06.01.18 but they do not animate yet.

If anyone is adding a gif to a girl pack, make the first frame something that can be used even if it is not animated.
Title: Re: Ani and Gif files
Post by: Linsroz on April 13, 2015, 08:29:26 PM
I feel like the biggest problem with ani files, aside from the not playing during an interaction/overview is that the application put the images out in bmp format. This confuses Whoremaster, and crashes the program for some reason. You have to convert the frames table to jpg format after running the application.
Title: Re: Ani and Gif files
Post by: aevojoey on April 14, 2015, 01:21:42 PM
I feel like the biggest problem with ani files, aside from the not playing during an interaction/overview is that the application put the images out in bmp format. This confuses Whoremaster, and crashes the program for some reason. You have to convert the frames table to jpg format after running the application.
I have added a catch for this so if either the .ani file or the .jpg file does not exist, the ani will not be loaded.
It will be in .06.01.19
Title: Re: Ani and Gif files
Post by: rxformula91 on May 01, 2015, 04:39:36 PM
Hi, just wondering if there's any news on the animated gifs,  great job adding it in btw, but just seeing if getting it to animate has been done yet.

Thanks and keep up the great and excellent work =D
Title: Re: Ani and Gif files
Post by: aevojoey on May 02, 2015, 12:14:04 PM
Hi, just wondering if there's any news on the animated gifs,  great job adding it in btw, but just seeing if getting it to animate has been done yet.

Thanks and keep up the great and excellent work =D
Sorry, I have been too busy with my new job to be able to work on the game much.

I have put off animating the gifs for now, I kindof hit a wall with it.
The memory needed to load animated gifs was extreme so I was going to wait until I rewrote the image loading.
I want to make the game only load images when they are needed instead of when the girl is loaded.
This will speed up the game and allow for less memory useage.
Title: Re: Ani and Gif files
Post by: Sorren on May 02, 2015, 01:15:57 PM
Sorry, I have been too busy with my new job to be able to work on the game much.

I have put off animating the gifs for now, I kindof hit a wall with it.
The memory needed to load animated gifs was extreme so I was going to wait until I rewrote the image loading.
I want to make the game only load images when they are needed instead of when the girl is loaded.
This will speed up the game and allow for less memory useage.

Another option could be to have a progressive load in, so the game would only load in girls in the market, anyone on an unlocked recruitment option, the brothel and the dungeon. The rest would load in as called per turn and only stay in memory if owned/hired.
Title: Re: Ani and Gif files
Post by: aevojoey on May 02, 2015, 02:14:35 PM
Another option could be to have a progressive load in, so the game would only load in girls in the market, anyone on an unlocked recruitment option, the brothel and the dungeon. The rest would load in as called per turn and only stay in memory if owned/hired.
I thought about doing it that way but if I'm going to rewrite it anyway, I may as well go all out.
With random girls it loads the images when the girl is created but it loads the image set for each girl and not for each folder.
So if you have 20 random girls using the same image folder, it gets loaded 20 times.
If the image is chosen when needed, the load time for it is only a few milliseconds so it would not seem like it takes any time.
Then the game will start faster, use less memory but still play at about the same rate.

If the image is chosen when needed, then the turn summary could store the image name and always have the same image for that event.
Expanding on this, each image could have its own text associated with it.
When chosen as a whore job event, the image's associated file could be set as the event text.
The pack makers could make event effects customized for each image.

Lots of thoughts coming to me but I have to go to work now.  :-[
Add your thoughts on this and when I get home, I will add more.
Title: Re: Ani and Gif files - And image texts
Post by: Jacko on May 29, 2015, 08:30:01 PM
Just wanted to say that .gif support would make this game absolutely amazing.  :P
Title: Re: Ani and Gif files - And image texts
Post by: aevojoey on June 19, 2015, 09:03:15 AM
Well folks, Gifs now work in .06.02.03 so I guess this thread will move on to another topic, Image Texts.  :-*

I would like to have each image have its own text so the girl's turn summary will tell a story based on the image instead of just a random pairing of story and image.
How could this be done? Should this be done?
Title: Re: Ani and Gif files - And image texts
Post by: 0nymous on June 19, 2015, 05:35:17 PM
Well folks, Gifs now work in .06.02.03 so I guess this thread will move on to another topic, Image Texts.  :-*

I would like to have each image have its own text so the girl's turn summary will tell a story based on the image instead of just a random pairing of story and image.
How could this be done? Should this be done?
Immersion wise - yay. No more mismatching descriptions.
Implementation wise- ehhh.
I mean, we're talking about girls who may have more than 100 images. We'd have to add a signature text to every single one of them?
I suppose as an optional way to replace the basic game text it's valid, but damn, considering hundreds of girl files alone setting them up in the editor is a lot of work. Describing every single image would take a looooong time.
Title: Re: Ani and Gif files - And image texts
Post by: FlamBurger on June 19, 2015, 08:06:31 PM
We don't have to do it for EVERY picture....Just the ones WE like. 8)
Title: Re: Ani and Gif files - And image texts
Post by: Romanul on June 20, 2015, 07:23:21 PM
It's not worth the hassle IMO.
Title: Re: Ani and Gif files - And image texts
Post by: Sorren on September 06, 2015, 01:37:34 PM
Well folks, Gifs now work in .06.02.03 so I guess this thread will move on to another topic, Image Texts.  :-*

I would like to have each image have its own text so the girl's turn summary will tell a story based on the image instead of just a random pairing of story and image.
How could this be done? Should this be done?

Resurrection.... I've started adding tags to images so their ready to multi-type, if you use that to determine the story text then it makes life easier....

So for instance GroupOral, LesOral, LesAnal, StripGroup, etc, etc.