Counter Animation

Got a cool idea that should be in R'n'D? Let's hear it!

Moderators: Flumminator, Zomis

Post Reply
User avatar
Alan
Posts: 661
Joined: Fri Jun 18, 2004 7:48 pm

Counter Animation

Post by Alan »

I'm not sure how hard this would be to implement into RnDs, but here goes....

How about a new graphicinfo.conf animation command "counter" (or whatever the current counters are going to be called)
The CEs animation would be a single frame decided by its counter.

This means you could "program" animation yourself. :-)

You could also use this to construct massively detailed scenes with using only two CEs!

For example you have CE1 moving left to right and it leaves behind a trail of CE2s.
As CE2 is dropped its counter is set to +1, and if we where using "counter" as an animation
control in a GIC, it would leave behind the next frame sequence from the PCX.

Using spiral or snake like movement for CE1 you could fill a screen with a full bitmap
and only at the cost of 2 CEs (and memory ;-) )

Plus I'd imagine it would have lots of other uses.


------------------------------------------------------------

Global counter.

Has anyone said this already?

As well as setting a counter for single element, how about setting (or adding etc.)
to all CEs of that type?

Like subtract 1 from all CE23s

Combined with the "Counter" animation you could animate groups of CEs in one go.
Say you made a level with CE1 walls using counter animation. Setting the global
counter for CE1 to 2 would change all the walls in the level to frame 2.
User avatar
Holger
Site Admin
Posts: 4081
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger »

Very good idea! I really like it.

I think I should implement it exactly as you described it! :-)

Please stand by...
User avatar
Holger
Site Admin
Posts: 4081
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger »

OK... Done!

Seems to work fine now (after some quirks in the first try, which also revealed an error in copying the CE value for moving CEs when there is no change, but only an action).

> As well as setting a counter for single element, how about setting (or
> adding etc.) to all CEs of that type?
>
> Like subtract 1 from all CE23s

This is already possible by using "CE score" instead of "CE value", which is not connected to every single instance of a certain CE, but to all CEs of that kind on the playfield. I've also added this to your new artwork idea implementation!

You can now define the following in the GIC:

custom_255: RocksFontEM.pcx
custom_255.xpos: 1
custom_255.ypos: 2
custom_255.frames: 26
custom_255.anim_mode: ce_value

custom_256: RocksFontEM.pcx
custom_256.xpos: 0
custom_256.ypos: 1
custom_256.frames: 10
custom_256.anim_mode: ce_score

This uses all characters "A"-"Z" for CE 255 and "0"-"9" for CE 256! :-)

It will all be in the next pre-release. :)
Tomi
Posts: 339
Joined: Wed Aug 03, 2005 3:37 pm
Location: Slovakia

Post by Tomi »

The disadvantage is that you can't animate those. When you have ce 255 with value 1, it always look the same until you change the value.
User avatar
Holger
Site Admin
Posts: 4081
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger »

But that's exactly the way to *animate* the CEs! That's a real advantage, especially as you can change the animation depending on engine interaction, and still only need to use one single CE! Before, you needed several CEs, just to change graphical (animation) properties!

Alan is right here, this is a huge improvement for more graphical possibilities while saving CEs at the same time! :-)
Tomi
Posts: 339
Joined: Wed Aug 03, 2005 3:37 pm
Location: Slovakia

Post by Tomi »

Let me explain on an example: imagine a bitmap made with this technique (see Alan's post above). Well let's try to make it animated - for example, when you press some guy that looks like red player, a "bitmap" gets created with a text "Hello." Then, the text changes to "Kill the Bad Dragon and you'll get incredible reward - 1000 gems." "But his cave is big. Free his prisoners to get more information." That could make endless story possibilities. But such an animation is almost impossible when you already use CE values for the bitmap. (Or isn't it? Correct me.)
User avatar
Holger
Site Admin
Posts: 4081
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger »

Hm, now I'm really confused. It works exactly as you described. So why is it impossible?
Tomi
Posts: 339
Joined: Wed Aug 03, 2005 3:37 pm
Location: Slovakia

Post by Tomi »

> Hm, now I'm really confused.
Strange... that confused me. :) Nevermind.
Maybe it is possible but it's hard to time it right etc. Well, I'll try to make it (and explain it better) when the pre-release version comes out.

Btw: counter animation could be used even to make simple level backgrounds... (see some other thread, probably named "level backgrounds")
Zomis
Posts: 1502
Joined: Mon Jun 21, 2004 1:27 pm
Location: Sweden
Contact:

Post by Zomis »

Holger wrote:This uses all characters "A"-"Z" for CE 255 and "0"-"9" for CE 256! :-)
*Mathematic Zomis comes in*... hmm... this would make it possible for a CE to show all numbers (0-9)... but then the question might be how to handle those numbers into more mathematics... hmm... seems like I will have to play around with the new pre-release when it comes out... (which better be soon! ;))
User avatar
Holger
Site Admin
Posts: 4081
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger »

> but then the question might be how to handle those numbers into more
> mathematics...

It works pretty nice -- already played around with exactly these things!

Use two CEs with the "0-9" artwork, depending on CE value, and then just set the CE value to change the appearance for a two-digit counter etc... :-)
(You even don't have to reset the CE value from 9 -> 0, as 10 results again in "0" (artwork frame is calculated as "CE value % 10")...)
Zomis
Posts: 1502
Joined: Mon Jun 21, 2004 1:27 pm
Location: Sweden
Contact:

Post by Zomis »

Holger wrote:Use two CEs with the "0-9" artwork, depending on CE value, and then just set the CE value to change the appearance for a two-digit counter etc... :-)
(You even don't have to reset the CE value from 9 -> 0, as 10 results again in "0" (artwork frame is calculated as "CE value % 10")...)
Ok... but what about if there's two CEs with this animation between each other, and they have the value of 25. Then the first CE should show '2' and the second '5'. They won't in this case, they will both show 5. So the first value must be divided by 10, to return 2. And so it will show correctly.
That's the mathematic I'm thinking about... and it could be possible with some machine controlling CEs... we'll see.
User avatar
Alan
Posts: 661
Joined: Fri Jun 18, 2004 7:48 pm

Post by Alan »

Good one Holger!
Great you could get it to work (almost) first go.
If you see an idea that isn't mentioned in this thread, please contact me.
Yeah right Zomis. Run my new ideas past you first....HA!.

You compleatly ignored this thead/idea until Holger started posting! :roll:
And now you're going off topic...... :roll:
User avatar
Alan
Posts: 661
Joined: Fri Jun 18, 2004 7:48 pm

Post by Alan »

Let me explain on an example: imagine a bitmap made with this technique (see Alan's post above). Well let's try to make it animated - for example, when you press some guy that looks like red player, a "bitmap" gets created with a text "Hello." Then, the text changes to "Kill the Bad Dragon and you'll get incredible reward - 1000 gems." "But his cave is big. Free his prisoners to get more information." That could make endless story possibilities. But such an animation is almost impossible when you already use CE values for the bitmap. (Or isn't it? Correct me.)
I'm sure you could animate a full bitmap using counter animation, (god knows why you'd want to though......maybe an FMV intro).

Lets say we have a large PCX with 3 big frames each 10x10 tiles, to
animate the whole set we first lay down the 1st frame (using CE2 with it's counter set to +1, 1-100 in total).

Now simply by adding 100 to all of these frames (using the global add) we can make them all jump 100 frames ahead, and since it's 10x10 that means the next large frame. Adding 200 will go to frame 3 etc..

This is all theory btw, so I'm not sure it would work!
Tomi
Posts: 339
Joined: Wed Aug 03, 2005 3:37 pm
Location: Slovakia

Post by Tomi »

I also think it could work. As I said, I'll wait while it gets released and try it, and if it will work, everything is OK.
User avatar
Alan
Posts: 661
Joined: Fri Jun 18, 2004 7:48 pm

Post by Alan »

Here's a large single colour 992x2816 PCX with each frame numbered (0-2727 frames). I think it will come in handy since you could visually debug counter animation using it.


http://www.ambience.2restinpeace.com/counter_2727.zip

(I didn't type the numbers by hand btw ;-) )
Post Reply