Any tips for Efficient object animation

Started by nneader, Mon 01/07/2013 19:24:40

Previous topic - Next topic

nneader

I have background that has 4 or 5 houses spanning the background. I want to create an object or objects that animate smoke coming out of the chimneys. 

I can do it one of two ways:
1. large object that spans all of the houses, then animate using a large sized png. 

2. use smaller, more precise objects that animate each chimney individually with smaller pngs.

I spend more time with the 2nd procedure, however, if I sacrifice the speed of the game...it is not worth it.

Any suggestions would be great.

NickyNyce

I'm pretty sure the speed would not be an issue.

This kind of depends on whether you want to be able to look at each individual house with a different response. If you do one large animation, you'll have to describe the whole BG screen when it's looked at, but if you do individual animations, each one will have its own hotspot.

san.daniele

From what I understand this is just for 'decorative' purposes. I'd go with option 1 to save time (the result is probably the same, the graphic might use a little more space).

elegantmechanic

AGS has a built in function of animating backgrounds through up to 5 frames, and it doesn't slow down the engine.  You can then draw as many or as few hotspots as you need, which seems to address the problem. Is there a reason you want the smoke to be an additional object on top of the background instead of just including it in the background animation?

Snarky

Maybe from reading all the previous threads advising others to NOT use animated backgrounds? Seriously, it's bad practice, don't do it! (And five frames is very much on the low end of what you can get away with for a looping animation such as this, anyway.)

None of the options are likely to case any game slow-down, unless the smoke plumes are part-transparent objects covering most of the screen.

I would use separate objects, because that way you can animate them at different rates or with different numbers of frames, and it won't loop so obviously. (If you have three smoke animations with 5, 6 and 7 frames, for example, it'll be 210 frames before the exact same configuration comes up again.)

nneader

I know about the 5 frame background animation, however, it seems a little limiting for my use.  I use a program called Anime Studio and have used it personally and professionally for years.  Using 5 frames in the type of animation I am trying to present to my client is, let's just say, unacceptable.

Back to my original question.  Which one of the two scenarios, if any, would slow down my game to the point that it is a chore to play.

Maybe this is a moot point now since most people have dual and quad cores with dedicated graphic cards.  Not to mention Gbs of ram stacked in their box.

Khris

Like Snarky said, using one object for each plume will allow you to animate them independently. I guess it comes down to how you create the frames in Anime Studio.
Performance-wise the difference should be negligible, even on older machines.

Snarky

Quote from: nneader on Mon 01/07/2013 21:50:35
Back to my original question.  Which one of the two scenarios, if any, would slow down my game to the point that it is a chore to play.

Neither. This is not a resource-intensive scenario, the engine and any decent modern computer can handle it without problem.

On the question of background animation, I think this set of screens demonstrates the issue: http://imgur.com/a/GPlx4

The graphics and animation are great, but having everything looping on the same rhythm makes it look like one of those clockwork displays with little puppets acting out various scenarios. (I assume that's just on the animated GIFs, and in the actual games they didn't all run in sync like that.)

nneader

Your examples are precisely why I do not want to use the 5 frame background.  Y'know, you should have given me an epilepsy warning.

In AGS, you can have multiple, random animations using the same set of sprites. They can  fire off every...say...10 or 20 seconds using random on a timer and using a different delay in the loop for each object.   I already have multiple animations using both of these processes (crows flying around a castle wall, smoke billowing from chimneys afar, etc.) and they work really well.  I think my biggest challenge will be staying under 30,000 sprites....YIKES :)

SMF spam blocked by CleanTalk