Strange animation problem thet didn't happen earlier...

Found a bug in R'n'D? Report it here!

Moderators: Flumminator, Zomis

Post Reply
User avatar
Eizzoux
Posts: 567
Joined: Wed Oct 30, 2013 5:32 am
Location: Russia
Contact:

Strange animation problem thet didn't happen earlier...

Post by Eizzoux »

I've got very strange problem. I made few CEs use of animated sprite (frames:4,delay:8). And WITH 'global_sync: true'.
Then I made them change CE score every 25 frames but they just use only one first tile. And they becomes animated only when I disable function of changing CE score.
It works not with all these elements but earlier it worked fine. What's the matter? :(
𒈟
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Strange animation problem thet didn't happen earlier...

Post by Holger »

I'm not sure if I understand you right -- do you animate your CE using "global_sync: true" or using "anim_mode: ce_score"? Or are you trying to use both of them? Because, these two artwork configuration options cannot be combined (or at least it would not make sense). "global_sync" only makes sense with anim_mode's like "loop" etc., while "ce_score" directly specifies the animation frame to use.

If in doubt, it would help to have a minimal, fully working test level set that only contains the relevant configuration to show what went wrong. Also it would help much to know the last version with which it worked fine, and the first version with which it does not work anymore.
User avatar
Eizzoux
Posts: 567
Joined: Wed Oct 30, 2013 5:32 am
Location: Russia
Contact:

Re: Strange animation problem thet didn't happen earlier...

Post by Eizzoux »

Holger wrote:-- do you animate your CE using "global_sync: true" or using "anim_mode: ce_score"?
Only "global_sync: true" & "anim_mode: loop", CE_score is not needed for this.

I'm using global_sync: true and anim_mode: loop for few elements. And also these elements changes their CE_score every time. It shouldn't affect the anims. And it wasn't doing that for a while. But then I'd spotted that the animations just stopped working. Aimation begins working again only when I disable "change CE score". I just can't understand how the heck this happens.
Element uses only 4 frames and switches them every 8 frs. So, after 0,16 seconds the first frame must be replaced by next one. CE_score changes every 25 frs. (half of second) count of which is much more than 8 frs. (0,16 seconds)
The game might at least switch the frames two times and then move to first again but the animation is just... frozen... Even if I use these two commands...
𒈟
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Strange animation problem thet didn't happen earlier...

Post by Holger »

You're right, changing the CE score value should not affect animations if they don't use "anim_mode: ce_score".

It would help to have a minimal, fully working test level set that only contains the relevant configuration to show what goes wrong. Also it would also help to know the last version with which it worked fine, and the first version with which it does not work anymore. Or do you mean that it stopped working after you did some changes to the configuration (in the level editor or in the file "graphicsinfo.conf")? In this case you should try to compare the current version of your set with the last one that worked as it should.
User avatar
Eizzoux
Posts: 567
Joined: Wed Oct 30, 2013 5:32 am
Location: Russia
Contact:

Re: Strange animation problem thet didn't happen earlier...

Post by Eizzoux »

Holger wrote:Or do you mean that it stopped working after you did some changes to the configuration (in the level editor or in the file "graphicsinfo.conf")? In this case you should try to compare the current version of your set with the last one that worked as it should.
Affirmative! It appeared only after changing something in graphicsinfo.conf, but I really don't know after what change this happened. And it fixes only when I (you know) turn off Changing CE_score. This is such a weird bug or something. I'll try to change something in graphicsinfo.conf, maybe something will happen
𒈟
User avatar
Eizzoux
Posts: 567
Joined: Wed Oct 30, 2013 5:32 am
Location: Russia
Contact:

Loop animations vs CE animations

Post by Eizzoux »

Yeah, revisiting this topic nowadays, I can understand Holger's confusion, my English at that time was amateurish at best.

In brief, in CC2 in R'n'D levelset, there was an item called "Super Jewel", which is basically a trophy cup and behaves almost like normal jewels but `can't fall`. The problem was that I added, I think, pretty smart feature of combo chains where jewels increase their CE score every time the player collects any type of jewel and reset if no jewel is collected in next 25 frames (half'o'second), but for some reason, despite the "Super Jewels" being animated in "loop" without any relations to CE score/value/whatever, the CE score based CE change behaviors were affecting the animation and keeping it frozen.
I downloaded the levelset (the first demo) and... Unfortunately, it's still a problem.
Here's a level to test that out:
011.level
(695 Bytes) Downloaded 113 times

As you can see, the EMC Android makes clones of a custom element which uses Android as it's artwork, but for some reason it's frozen completely. Remove the "Change CE Score" function and it will be animated once again. I'll assume that when any CE value/score/count is accounted in CE change page, it tries to animate the element frame by frame depending on what CE counter is needed (CE score in our case), but since there's no CE-based animation on the element, it just keeps it frozen completely.
Oh, and, by the way, the element also gets animated again if you apply movement to it, whether if it moves or falls, and I think I remembered how I actually fixed that manually in next demo. I probably made "Super Jewels" fall, but changed their speed to "Not moving" to make them stationary. That's why normal Jewels were animated without any problems because they have falling capability, while the "Super Jewels" (man, that sounds stupid) are fixed just in one position.
𒈟
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Strange animation problem thet didn't happen earlier...

Post by Holger »

I just can't understand how the heck this happens.
I also had to do some debugging to find out what the heck is going on here, but finally the test level "011.level" you have provided in your last post was key to solving the problem! :D

In fact, this bug always occurred if the following conditions were met:

- a CE with animated graphics (easy to test by just using "use graphic of element" with an element with animated graphics, like the EMC android or firefly etc., for example, which are always animated)
- a CE delay on the CE's change page, but "element changes to" not checked (that is, no CE change defined)
- any CE action defined, which could even be "no action"

As a result, the in-game animation for this CE is frozen! :shock:

The cause for this mis-behavior was indeed tricky to find, as it was a bug deeply hidden in a lot of bad and confusing code. (The whole custom element stuff is a beast that's way to complex and complicated, unfortunately, but I don't dare to clean up that mess. :( )

After finding and understanding the problem, the bug was easy to fix, and I am quite optimistic that it should have no negative consequences anywhere else (besides maybe drawing the CE's animation more than once per frame maybe, which should not hurt much).

Thanks again for your test level, which helped a lot to understand and debug the problem! Everything that's already defined that way (including the test level) should instantly work fine again with the bugfix! :)
Post Reply