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 «Previous 1 2 3 Last »
#1
04/26/2007 (6:51 pm)
Wowza! Neo man, you never cease to amaze, this stuff looks fantastic! :)

Cheers,
-Justin
#2
04/26/2007 (6:55 pm)
Looking great Neo. I'm so glad you're still working on this pack. :) Keep up the excellent work!
#3
04/26/2007 (7:11 pm)
Woah ...
#4
04/27/2007 (1:36 am)
Nice to see that progress continues! :) Good stuff
#5
04/27/2007 (2:32 am)
This looks like its coming along nicely! I look forward to the completion! :0)
#6
04/27/2007 (2:38 am)
I was just thinking to myself, I wonder how Neo's iso project is coming. Very cool and as Leroy said, I am loooking forward to completion :D
#7
04/27/2007 (8:06 am)
I'm so totally jealous every time I read one of your blogs!
#8
04/27/2007 (8:28 am)
Was already excited about the possibilities of your iso pack.. now this (faint).
#9
04/27/2007 (8:48 am)
This work is awesome Neo. I can see many uses for it. Do you know when it will be ready for sale?
#10
04/27/2007 (10:36 am)
OFF TOPIC: Bullets, how do you put them in posts using GG's little code system? No one'll tell me. :(
#11
04/27/2007 (11:28 am)
Nice, now all we need is an EA realease. *grin*
#12
04/27/2007 (11:42 am)
Wow Neo. You gave me a bit of a double-take this morning as I was reading my morning blogs. :) It was a little (shocking/humbling/exciting) to see my female walking sprite actually get used somewhere -- it's always odd to see one's work pop up in places that one least expects. :)

I'm really glad to see that you've gotten some good use out of her as a sprite. I've just been thinking this past week that I would like to have seen my isometric sprites get finished -- sadly, I never took the time to create a camera setup in my .blend file, and so never rendered the rest of the angles for her walking. I'd still love to see this get picked up at some point, as I could really use more of these grahpics. If a Blender artist would like to help out on this, I would be much appreciative.

Quote: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.
I hope you didn't get too much trouble from ripping those graphics from the animated gifs I posted. I have higher quality rendered .pngs that should have better border alpha blending if you're interested (though you might have already re-rendered your own .pngs from the original .blend, I don't know).

Anyways, thanks so much for putting my graphics to use! It's encouraging to see them being used, and if nothing else, it really reinforces in my mind the need for a publicly-available set of resources for creating artwork like this.

I'm also really looking forward to buying your Iso pack -- posts like this really make me appreciate your eye for quality, your attention to detail, and your hard work.

Thanks!

--clint
#13
04/28/2007 (2:11 am)
Nice work Neo. Looks like a very useful tool and a good extension to TGB.

I'm not sure youre naming of channels and slots I agree with though. Slots in Torque parlance are usually the "add-on" parts. so your channel in TGE would be called a Slot. I would think that the switching of what appears would be something else too (not a slot, but perhaps a frame?).

Guess I'm being picky, but you really should consider what you call things, because people WILL get confused if you dont get it right.
#14
04/28/2007 (1:26 pm)
@Clint:

Aha! I was looking everywhere for the link of where I got those pics, it was perfect for testing the composite visual stuff, and spurred me to just get to it.

Thanks for the kind praise, and let's hope that my perfectionist bent does not drag the iso builder release out to 2010 ;p

@Phil:

The naming is something that I did actually put a lot of thought in and channels are standard terms when it comes to animation/video etc. I chose slots as that is really what they are, a slot in a channel for a frame sequence. I was never truly happy with it so you may have a point there. I will stick with channels I think and come up with something less confusing for slots, perhaps FrameSequence, FrameList or FrameBuffer or whatever.

And picky is good, can only lead to better quality in the end ;p

@All:

Thanks for the encouragement and interest.
#15
04/29/2007 (6:05 pm)
Bullets, how do you put them in posts using GG's little code system?
#16
04/30/2007 (3:14 am)
I used standard html unordered list just with square brackets:

[edit]
Ok that didnt show the code, use (ul) and (/ul) for the list and (li) for the items.
(Replace round brackets with square brackets)
#17
05/01/2007 (4:04 pm)
Thanks! :)
#18
05/03/2007 (5:38 pm)
Hi Neo,
Have you any plans to code some sort of lighting control for tiles and sprites ala Diablo etc for your engine? I've yet to work my way through all the previous blogs so you might have mentioned it already, I apologise. My other question is pretty predictable; how complete (in %) would you consider the project? You can see Im pretty keen to have a bash at an isometric game :).

Neil
#19
05/03/2007 (5:55 pm)
@Neil:

Hiya, yeah it already has ambient control and I am working on prototype for a general lighting solution as well as fog of war etc. Although they would be pretty easy to do with custom tile blending and overlays in script too.

As for % done, anywhere between 60% and inifinity, I keep getting ideas of things it should just have and things that would be really cool and am constantly trying to find a good balance between basic requirements and feature creep ;p

I have been considering releasing it as an EA as soon as the code base stabilizes but still need to give it some thought as well as discuss it with GG, etc. I will try to update more frequently as well to keep everyone in the loop and show more of what it can do.
#20
05/27/2007 (12:22 pm)
Every time I check in on your blog, I see another list of reasons to be very, very excited about this.
Page «Previous 1 2 3 Last »