Game Development Community

dev|Pro Game Development Curriculum

TGB Isometric Add-On Pack - Part 6: nxAnimator!

by Neo Binedell · 04/26/2007 (6:38 pm) · 42 comments

www.neoji.co.za/neo/gg/logo50x50bc.gif

- TGB Iso Builder -

Continued from my previous blog post


I wanted to support composite visuals for the iso builder from the start for things like character clothing, weapons, items, etc and while prototyping it I realized that it would be useful for core TGB stuff as well (I have seen many a post about the need for overlay sprites or synchronised animations). And so I designed a nice generic system that could be used by both the core stuff as well as the iso builder and nxAnimator was born.
(Perhaps a new pack for core TGB???)

First a vid and a screenie to get us into the swing of things:
(Rather low quality I'm afraid to keep the size down)

nxAnimator_alpha_wmv.zip

www.neoji.co.za/neo/gg/nxAnimator.jpg
The workhorse of the system is the visual. Each visual can contain one or more channels that are overlaid at render time. Each channel can have one or more slots each of which contains an image map and frame list to use. Now while only one slot can be active per channel one can have as many slots as one needs and swap between them at runtime.

Each visual maintains animation state and has a base line duration and frame count to which all channels are either stretched or looped to fill. The animation can be played backward or forward, paused, play a specific frame or goto that frame and pause, loop/pingpong/or automatically switch the the next/prev slot when it reaches the first/last frame, etc. Rather similar to the way macromedia flash stuff works e.g:

  • play();
  • pause();
  • isPlaying();
  • getCurrentFrame();
  • setCurrentFrame();
  • getCurrentTime();
  • setCurrentTime();
  • getPlayDirection()
  • setPlayDirection()
  • togglePlayDirection()
  • gotoAndStop( frame )
  • gotoAndPlay( frame )
  • nextFrame();
  • prevFrame();
  • etc

It also has a plethora of callbacks like onFrameChange, onAnimationCycle, onPlayStateChange, onSlotChange, etc, to allow the user to hook into the play state and update game objects as required. A visual slot does not have to be animated however, it can be used simply as a frame buffer to store graphics and show the correct frame as needed, etc.

Something else I'm working on is custom keyframe channels which will allow cool things like per-frame collision polies, animated channel offsets, scale, which effectively provides a timeline animation system similar to flash.

Now these are just workhorse classes and to use them you need a container that will let the visual update and render itself at the appropriate time, and so enters our new best friend, wait for it - nxSprite. Derived from t2dSceneObject it acts just like its poorer cousins t2dStaticSprite/t2dAnimatedSprite but with all the visual power underneath.

The more I worked on this the more it became clear to me that this was a tremendously powerful way to do things as it could be used in so many different ways, for example:

  • A visual with e.g. 4 channels, a channel for the base character, a channel for pants, a channel for shirt, a chanel for hat, and each channel contains e.g 3 slots with different colored and shaped versions of each article of clothing. At runtime the character can switch between the slots as it picks up items, or according to user choices, etc.
  • Channels can be active as needed and only shown when state requires it, e.g. you have an open roof tent base channel and hide the tent roof channel when a character enters the tent.
  • It is a convenient way to store all related animations for e.g. a character together, e.g. stand/walk/run slots that can be easily switched as required.
  • Instead of having multiple state graphics for e.g. a truck that can have either some logs, or drums, or people or whatever on the back you simply have a base truck channel and slots containing just the overlay graphics for the stuff on the back of the truck. Saves a ton of texture space as well as allowing mixing overlays, etc.

It goes without saying that this all comes integrated with the LevelBuilder with fancy editors, a plethora of custom gui controls e.g. image map- and visual list and preview gui controls, the works.

More as the system progresses...

As for the iso builder, it got overhauled (again) to use the new visual stuff, a mini-map gui control and I've added element libraries that can be packaged up and shared and also makes things easier to manage. A built-in datablock manager takes care of tracking, reloading and managing datablocks as required as well as saving,loading and anything else datablocks get up to.

As I spent most of my time lately working on the iso editors and they are getting up to scratch I can now turn my attentions to fixing and adding features to the engine as well as implementing mini games to test and suggest new features, so the next update should have some more interesting piccies of the engine in action ;p

Some other things I have been working on are the sprite builder ( nxSpriteBuilder??? ;) which allows you to import/crop/offset/convert and join images into one image or set of images, automatically create cell or key image maps for them as well as do custom processing like replacing background colors with alpha, removing bad alpha outlines, and converting images with alpha channels to pre-multiplied alpha that can be rendered with additive blending (and so do not require sorting, etc), etc, etc, etc. All things that you could do manually that are just a pain in the butt and that saves time when going back and forth between art creation and utilizing it in TGB.

And that as they say, is it, ladies and germs... tune in next time when we watch all of this in action in the next adventure of the iso builder err... adventure...
Page«First 1 2 3 Next»
#41
02/29/2008 (10:56 am)
Is there still any plans to release this?
#42
03/05/2008 (12:34 am)
I really hope Neo has just got overloaded with other work, because it would be such a shame for this to never get released. I just started looking at Inet's World Creator and this would ISO pack would tie in so well. Are you still out there Neo? Can we entice you back into this little world?
Page«First 1 2 3 Next»