devolution

Poll

Should gif support be able to be disabled?

Yes - both in config.xml and in game
13 (41.9%)
Yes - but only in config.xml
11 (35.5%)
Yes - but only in game
2 (6.5%)
No
5 (16.1%)

Total Members Voted: 30

Author Topic: Ani and Gif files - And image texts  (Read 15084 times)

0 Members and 1 Guest are viewing this topic.

Offline aevojoey

  • Hero Member
  • *****
  • Posts: 1413
  • Thats ok, I'm used to disappointment.
Ani and Gif files - And image texts
« on: September 04, 2014, 01: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


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?
« Last Edit: June 19, 2015, 07:53:18 AM by aevojoey »
Fixing the game is a better game than actually playing it.
Get the Current Version <|> Discuss the Game <|> Report a bug

Offline Sharkey

  • Newbie
  • *
  • Posts: 22
Re: Ani files
« Reply #1 on: September 04, 2014, 03: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
it's for SDL1 and it's working.



Offline Yukinohki

  • Full Member
  • ***
  • Posts: 120
Re: Ani files
« Reply #2 on: September 04, 2014, 04: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.

Offline Sharkey

  • Newbie
  • *
  • Posts: 22
Re: Ani files
« Reply #3 on: September 04, 2014, 07: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?

Offline 0nymous

  • Full Member
  • ***
  • Posts: 169
  • Date eam in verpa.
Re: Ani files
« Reply #4 on: September 04, 2014, 07: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.


Offline crazy

  • Hero Member
  • *****
  • Posts: 733
Re: Ani files
« Reply #5 on: September 04, 2014, 02: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

Offline Fightback

  • Newbie
  • *
  • Posts: 3
Re: Ani files
« Reply #6 on: September 04, 2014, 03: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.

Offline aevojoey

  • Hero Member
  • *****
  • Posts: 1413
  • Thats ok, I'm used to disappointment.
Re: Ani files
« Reply #7 on: April 06, 2015, 11:28:33 AM »
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.
Fixing the game is a better game than actually playing it.
Get the Current Version <|> Discuss the Game <|> Report a bug

Offline Jaxter

  • Newbie
  • *
  • Posts: 27
Re: Ani files
« Reply #8 on: April 06, 2015, 05: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.

Offline _rhetorik_

  • Jr. Member
  • **
  • Posts: 63
Re: Ani files
« Reply #9 on: April 06, 2015, 08: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.

Offline Sharkey

  • Newbie
  • *
  • Posts: 22
Re: Ani files
« Reply #10 on: April 08, 2015, 02: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.

Offline aevojoey

  • Hero Member
  • *****
  • Posts: 1413
  • Thats ok, I'm used to disappointment.
Re: Ani files
« Reply #11 on: April 08, 2015, 09: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.

Fixing the game is a better game than actually playing it.
Get the Current Version <|> Discuss the Game <|> Report a bug

Offline Sharkey

  • Newbie
  • *
  • Posts: 22
Re: Ani files
« Reply #12 on: April 08, 2015, 12: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/ (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

Offline aevojoey

  • Hero Member
  • *****
  • Posts: 1413
  • Thats ok, I'm used to disappointment.
Re: Ani files
« Reply #13 on: April 08, 2015, 01: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/ (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
OK, I see where that could help a little but I would have to agree with the responder to the freeorion.org 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
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.
« Last Edit: April 08, 2015, 01:36:51 PM by aevojoey »
Fixing the game is a better game than actually playing it.
Get the Current Version <|> Discuss the Game <|> Report a bug

Offline Sharkey

  • Newbie
  • *
  • Posts: 22
Re: Ani files
« Reply #14 on: April 09, 2015, 11:12:46 AM »
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 ;)