OpenXcom Forum

Modding => Work In Progress => Topic started by: bladum on January 07, 2015, 10:20:26 pm

Title: animation for standard terrain tiles
Post by: bladum on January 07, 2015, 10:20:26 pm
Simple thing I made.

I duplicate larger vegetation images and add simple effect of moving by wind. Similar to what was made in settlers 1. Effect is almost noticeable during battlescape but gives feeling that environment is more alive. Still different plant objects have its animation shifted so they are not moving at the same time.

What do you think about it ? hot or not ? Does anyone care about it ? Does any one want to improve tilesets to add animations properly ?

PS: just don't kill me for the "settlers 1" thing :)

Tin
Title: Re: animation for standard terrain tiles
Post by: BlackLibrary on January 07, 2015, 11:00:58 pm
+1 here.  When OpenTFTD is lifting off the ground, more undersea life that does just that and then some would be awesome.
Title: Re: animation for standard terrain tiles
Post by: bladum on January 07, 2015, 11:25:04 pm
actually it can be done even today. It is just a matter of small changes in current images via mcd editor. In vanilla ufo 1 only few items were animated. in vanilla tftd there was much more.
Title: Re: animation for standard terrain tiles
Post by: volutar on January 08, 2015, 05:51:18 pm
Problem is that every tile onscreen will be "synchronized", i.e. in one phase. It's only the smoke which has phase randomized. To make them look a bit diversed, you'll have to make extra MCDs with another "phases", but that will lead to altering maps too.
In UFOEU only arctic tileset has terrain animation (water). TFTD has more animated things, but sometimes it feels even overly.
But really, i would like to invent "random phased" bit in the MCD, to avoid map rebuilding, and in the same time provide visual "evenness" of terrain animation.
For example, byte38, is always 3. For no reason. Unused byte in the MCD. We can use it. If byte38==0 and MCD is animated - init tile with random phase (0..7).
Title: Re: animation for standard terrain tiles
Post by: BlackLibrary on January 08, 2015, 06:12:39 pm
Interesting. 

Sounds like you would need the following:
1.  Non animated
2.  Animated, sequential
3.  Animated, random

Title: Re: animation for standard terrain tiles
Post by: volutar on January 08, 2015, 06:19:33 pm
No.
Most of tiles have all 8 frames equal === they aren't animated
Some tiles are using different PCKs. But "vanillish" way to treat them - by starting from 0. And animating simultaneously, i.e. one phase for whole map.
We can add visual diversity for "animated" terrain tiles, by adding special flags to them - random starting phase.
And frankly, 2 frames is too few. At least there should be 3.
I think I am clear enough here.
Title: Re: animation for standard terrain tiles
Post by: bladum on January 08, 2015, 06:22:22 pm
not true. I can setup different phase for different pck. Tested on vanilla and works fine.
Title: Re: animation for standard terrain tiles
Post by: volutar on January 08, 2015, 06:26:30 pm
not true. I can setup different phase for different pck. Tested on vanilla and works fine.
There's single MCD for the wheat (CULTIVAT#4). And map is using single value for it. How are you gonna setup different phases across that map module with field of wheat?
Title: Re: animation for standard terrain tiles
Post by: bladum on January 08, 2015, 06:30:37 pm
as shown in first post. and its working fine. I never said that every tile will animate seperately. This is your assumption volutar :) Every tile animated separately would be very distracting.
Title: Re: animation for standard terrain tiles
Post by: volutar on January 08, 2015, 06:33:28 pm
It can't work fine. Where did you see field of wheat which is waving as one?
Did you see smoke with phase0 as initial? It looks awful. And any terrain animation "flashing" with same frames in same time, will look awful.
Title: Re: animation for standard terrain tiles
Post by: bladum on January 08, 2015, 06:40:19 pm
This is your opinion it will looks awful. Luckily there are players who has their own opinions :) I asked them and they agreed. Players, not moders or developers.

Btw I just shown simple way how game could be enhanced. If you like it, it is cool. if you don't then its ok. You don't have to add comments that brings no value especially when it comes to very subjective as visuals.
Title: Re: animation for standard terrain tiles
Post by: volutar on January 08, 2015, 07:06:27 pm
It's not serious to be "fine" with totally unison, synched "fullframe" terrain animation. It seems like you simply didn't see it looking better, and people you were asking didn't see either. Making terrain slightly more dynamic is great idea, and it should be carried out properly to look really worthy. And I can't admit this "synched" way is good. It can, and must be better.
My comment is simply about getting it better and worthy.
This idea deserves more polished and higher quality look.
Title: Re: animation for standard terrain tiles
Post by: bladum on January 08, 2015, 07:32:36 pm
done in my fork, can be merged with original one, no impact on standard tiles

Title: Re: animation for standard terrain tiles
Post by: Yankes on January 08, 2015, 08:05:58 pm
is hard to show animation using only one screenshoot :) YT video or gif would be better.

Another thing that I must agree with volutar, adding random seed to phase add lot more natural feel. In many games when you see big surfaces of repeating pattern, every thing look 10 time worse.

Good example is globe shading, without random part (poor man dithering) you will see multiple lines passing through ocean, that was very distracting.
Title: Re: animation for standard terrain tiles
Post by: bladum on January 08, 2015, 08:20:41 pm
https://www.youtube.com/watch?v=DgBrmUp3k9Y&feature=youtu.be
Title: Re: animation for standard terrain tiles
Post by: Yankes on January 08, 2015, 08:54:51 pm
First impression is good, its hard to say exactly because you move camera to much around, but overall it seem it will not require random offset.
Where I could get working version of this?
Title: Re: animation for standard terrain tiles
Post by: ivandogovich on January 08, 2015, 09:00:26 pm
https://www.youtube.com/watch?v=DgBrmUp3k9Y&feature=youtu.be
That looks pretty good.  It doesn't look really synched at all.
Title: Re: animation for standard terrain tiles
Post by: bladum on January 08, 2015, 09:00:56 pm
actually this is simple random offset. I used LightBlock MCD data to determine if tile is using this feature or not ;-) now you can kill me he
Title: Re: animation for standard terrain tiles
Post by: bladum on January 08, 2015, 09:01:54 pm
regardless of does it work nice or not we need GFX person to actually nice update the sprites.

@robin ?
Title: Re: animation for standard terrain tiles
Post by: volutar on January 08, 2015, 10:53:29 pm
So it's not synched. And thus looking rather good.
But using actual value "light block" is really bad idea.
We (developers) will not support this ever.
And it's obvious 2 frames is not enough.
Title: Re: animation for standard terrain tiles
Post by: bladum on January 08, 2015, 11:07:43 pm
@volutar

Actually there is no way to add new flag to MCD file to be backwards compatible and "block light" is never used anyway. If this is going to be used in TFTD then of course it cannot be used for this feature. But block light was never used in vanilla neither. So there is no point not to use it for something else, unless you plan to use it. I can find a way to calculate it somehow on the fly without need to use "block light flag" (if not door, if not special tile etc) but it could be not error proof this way.

Btw how you calculated that 2 frames are not enough ? On which objective measures you make it "obvious" ? I am very curious. 
Title: Re: animation for standard terrain tiles
Post by: volutar on January 08, 2015, 11:26:50 pm
@volutar

Actually there is no way to add new flag to MCD file to be backwards compatible and "block light" is never used anyway.
Wrong. Wrong.
byte38 will work nicely. It's not used and not even referenced. While BlockLight is referenced and _almost_ used in vanilla and was used in the oxc (Daiky has made a version using it, and code is still there, and it might be used later).
You can make your own version with blocklight used for that, but it will never be merged into master. While byte38 could.

Blocklight is actually filled with different values, and in order not to screw any vanilla animation you'll have to change every animated MCD to make them rendered synched (by default). Which is, well, quite off.

Quote
Btw how you calculated that 2 frames are not enough ? On which objective measures you make it "obvious" ? I am very curious.
Because any animation consisting of 2 frames is just perceived as SWITCH, while 3 framed animation can be rendered seamlessly.
Title: Re: animation for standard terrain tiles
Post by: bladum on January 08, 2015, 11:35:07 pm
1) ok i see now, byte38 is ok but cannot be accessed via MCD editor. Do you plan to update it in the future to support all bytes in MCD ?

2) that is a good point ! is it better to have 4 frames as it can be better put into 8 frames instead of 3 ? (3 + 3 + 2 ?)

PS: i am only interested in master compatibility :)
Title: Re: animation for standard terrain tiles
Post by: volutar on January 08, 2015, 11:38:50 pm
1. It already supports. You should just edit MCDEdit.txt
add in the list:
Code: [Select]
mcd 38 byte Stat_Phase | If 0 - animation starting phase is random, otherwise - static (started from 0).This field according ufopaedia is filled with 3. always. I don't know why.
2. 4 is better, but 3 could be enough in some cases.
You can ask Robin, I bet he knows about optimal minimum better. :P
Title: Re: animation for standard terrain tiles
Post by: bladum on January 08, 2015, 11:40:36 pm
thanks, now you are talking :) hope warboy will accept the pull
Title: Re: animation for standard terrain tiles
Post by: volutar on January 09, 2015, 09:54:18 am
Actually it's better to use "1" as "random" since "3" is default vanilla value used for byte38, but any custom MCDs might have 0 (for example made with my mcdedit, or any other editor). So 0 and 3 are "default", and "1" will work as "random" just fine. 3 or 4 frames of animated wheat, and trees, and picture will look much more dynamic.
Title: Re: animation for standard terrain tiles
Post by: bladum on January 09, 2015, 02:08:18 pm
Work is done. No changes to standard tiles that use animation like doors or power sources. Will pull request. Bit 38 is used with 0,1 and 3 values.

Still need someone to improve tiles like grass / wheat / trees etc...

btw: i think we could use special feature in MCD Editor that would work like this. This could be used for this feature even without graphic skills.

1) select pixels with specific colors
2) click new button "randomize"
3) each pixel has light color randomly choose with 30% -1 to lightness, 30% +1 to lightness and 40% no change to lightness.

This would allow to create noisy textures from large flat areas of the same color. What do you think ?
Title: Re: animation for standard terrain tiles
Post by: volutar on January 09, 2015, 02:34:49 pm
MCDEdit requests are in another place I think. But I could answer here.
This "add random noise" is a quite common thing for graphics editors. But it starting whole new editor section: Filters. Need to collect all really __useful__ filters, used by pixel artists, before starting that.

But.

Considering the topic, this "random noise" is not something that could work for wind or anything else. It really won't make sprites look any good. Pixel artists need to control each pixel value, without any "randomness". If you want to me to add this to MCDEditor, just make quick ugly "animation", I won't connive at this. Sorry, MCDEdit is not for "quick requests". If you want to make every tile noised - you can make "flat" animation, export these expanded sheets as pngs, edit them in any editor with this "noise", and import.
Title: Re: animation for standard terrain tiles
Post by: jackstraw2323 on January 09, 2015, 02:39:06 pm
Just from an art direction point of view, there's probably a limit to how many tiles should be animated at one time. I.E. if every tile seen is animated it might look like too much visual noise, but something like 50%-25% of tiles would probably be a comfortable range. I do think seeing a whole field of wheat animate would be a really nice touch. I'm just starting to get into mcd and maps so I may contribute a few tiles once I understand what's required.
Title: Re: animation for standard terrain tiles
Post by: volutar on January 09, 2015, 02:41:52 pm
Just from an art direction point of view, there's probably a limit to how many tiles should be animated at one time. I.E. if every tile seen is animated it might look like too much visual noise, but something like 50%-25% of tiles would probably be a comfortable range.
When screen is filled with smoke it really looks bad. And that kind of thing doesn't really look good as LP or any recorded video. I would say that 1/3 of a visible battlescape is a pretty comfort value.
Title: Re: animation for standard terrain tiles
Post by: bladum on January 09, 2015, 02:50:58 pm
Sorry for offtopic with MCDEdit.

Update of mcd is easy task. Iit can take less then hour to update all even non vanilla mcd records. Design of visual effect is much more complex and
Title: Re: animation for standard terrain tiles
Post by: HelmetHair on January 09, 2015, 05:53:15 pm
Pwn

Title: Re: animation for standard terrain tiles
Post by: bladum on January 09, 2015, 09:41:09 pm
code

https://github.com/Bladum/OpenXcom/commit/4685e01bd6c1aab5d4fef5ce1111de7629277061
Title: Re: animation for standard terrain tiles
Post by: bladum on January 13, 2015, 06:02:55 pm
i wonder if anyone could help in improving few tiles for this wind effect animation ?
Title: Re: animation for standard terrain tiles
Post by: kikimoristan on February 07, 2015, 09:07:03 am
Hey man this animated stuff looks fantastic! I wish there was a mod or something I can download to have this feature.