GRIM Editor
Matt Weir

This is just for the person who asked to have a look but anyone else is welcome.
(Mentioned in this thread.)

GRIM 2d Skeletal Animation Editor

This is the editor for the animation engine I have made for my game. It uses a series of 'bones' with 'skins' attached and can interpolate between any 'frame' smoothly.

I'm doing all the graphics myself (especially since the majority of the engine programming is now done) so this editor has never really been designed with other people in mind. It is not meant to be a finished product, just something to have a look at! The actual game uses Openlayer as opposed to the GRIM editor which uses Allegro (because of GUI) so ignore the slower framerate...

Read the 'Readme.txt' for additional info...

GRIM

(I've never posted any exe before, should I include the alleg42.dll too?)

Thanks!
Matt Weir. :)

Screenshots
http://www.angelfire.com/funky/feartheweasel/pics/GRIM_ScreenShots_3_2_2007.jpg

EDIT: Fixed download link

Paul whoknows
Angelfire said:

Angelfire does not allow direct linking
from offsite, non-Angelfire pages,
to files hosted on Angelfire.

I thought GRIM was a vector based animation program, I did not know it was your own editor, I am impressed, those screenshots looks like a really professional animation program:o

Mark Oates

Looks really cool. Too bad I don't have anything that I could use it for.

Matt Weir

@Paul whoknows: Thanks! Sorry I didn't realize angelfire didn't allow direct linking RAR's, it works for the screenshots. ::)

I'll prob release the whole system as a lib if anyones interested but maybe even just the whole source of everything. The source is pretty complex though with the data structures alone. It's definately not as easy as you first think especially with making drawing order (linear) be independant of calculation order (tree structure) etc....

I've got a few ideas for projects after my current one (side scroller). I'd really like to do a game like 'Sam and Max hit the road' or 'Day of the Tenticle' (prob 10+years old now if you haven't heard of them) with this system at some point later. :)

Here it is attached... GRIM

Hard Rock

This looks really cool. I'm actually working on an animation editor myself, although it functions very differently then yours.(I might post it soon, but who knows when I'll get to working on it)

The interpolation is very smooth and it looks really nice, good job!

Michael Jensen

I've contemplated and even tried building a skeletal animation engine, but it's been too hard for me to accomplish in the past -- I'll pull some joint and all the other joints get broken... -- never got around to allowing the joints to be skinned... the cool thing about this approach is that it makes walking animations easy to build. -- I'd love to check out your GRIM editor; but for now I'm not working on a project that can use it (Isometric/top down game)

Is there a tutorial? Also -- is there a way to "render" frames? like have the program go thru and just output a bmp file with transparency for every frame?

Also, for depth perception, it looks like you're not doing it now, but possibly you might make frames farther back in the z-order smaller, and closer up bigger. The closest bone might have +2 px to w/h and the farthest will have -2px from w/h, and in the middle area they all get normal w/h .... (in the top right frame, you can see the bottom of the far foot by about 2 pixels, when the fron is mostly overlapping it -- this is because they're not aligned perfectly, the bottom line is that this should never be possible.) -- Just thinking out loud.

Wilson Saunders

I made a similar program to this. But mine does not look as professional as this. Does yours do key frame interpolation?

Matt Weir

Thanks everyone for the nice words. :)

I don't have a tutorial or anything for this yet, this is basically the first version with all the main functionality working.

Quote:

the cool thing about this approach is that it makes walking animations easy to build.

Definately! One of the reasons of motivation to do this was so I could have better animations in my projects. Because your only saving the skin bitmaps and a file full of lengths and relative angles you can make lots of different animations quite easily and you won't have a huge file size or have to draw thousands of frames.

Quote:

Also -- is there a way to "render" frames? like have the program go thru and just output a bmp file with transparency for every frame?

Personally I'm just using the same engine in my game so I get proper interpolation but it definately would only be a few minutes work to code a 'Render' function into the editor if anyone wanted it.

Quote:

Also, for depth perception, it looks like you're not doing it now, but possibly you might make frames farther back in the z-order smaller, and closer up bigger.

Good idea! I havent implemented scaled drawing in the graphics part yet and you would have to scale the bones as well for it to work right. The only thing is I'd have to implement some sort of 'grouping' of bones in the editor to do this properly. It's on the cards anyway because I'm making it so that bones tagged 'at the back' are drawn, they will be drawn tinted darker.

Quote:

this is because they're not aligned perfectly...

Mostly due to my not caring if the test model is perfect. ie. his legs are different lengths... ;)

Quote:

Does yours do key frame interpolation?

I'm afraid I'm not too sure what key frame interpolation is... In the test model there is a (poor) running animation which has four frames defined and the program works out all the frames in between. I'm only using linear interpolation but I find since I'm interpolating between lengths and relative angles (instead of just points) you can make things seem smooth with some tweaking of the model.

If anyone wants any more info on how things are done for anything their working on I don't mind at all. I'm not big on the 'keeping trade secrets' philosophy and I'll most probably release the source when I'm done anyway since there's a bit of interest. Sorry for the long post, but I try and answer all questions... ;)

PS: Does anyone know any commercial games that use this sort of thing? 2D not 3D...

Michael Jensen

I don't know of any 2D games that have this in their actual engine, but I wouldn't doubt that a few have used this approach with pre-rendered frames (I suppose any 2D game that uses pre-rendered 3d modles, is in a way, doing this?)

Quote:

Personally I'm just using the same engine in my game so I get proper interpolation but it definately would only be a few minutes work to code a 'Render' function into the editor if anyone wanted it.

and

Quote:

they will be drawn tinted darker.

Neato!!!!11

Quote:

key frame interpolation

key frames are the hard coded frames, so it sounds like you're implementing linear key frame interpolation, which is mega cool -- it would be cool if the render function mentioned above could render a variable amount of frames (ex: I have a 5 key-frame animation, and I want it to output 50, making the ones in between, and smoothely.)

Matt Weir

Sweet, it's on the todo list. As I've said it won't take too long to implement, the codes pretty much already there. This editor/graphics engine is the main priority at the mo because I need to get more graphics into the game engine. :) I'm just working out the logistics of supporting dynamic modification of the skeletons in the game so you could do something like shoot an enemies arm off and then attach it to you if you so wished. That particular scenario prob won't happen in the game but the idea is a laugh. Again all the main code is already there it's more a case of game design...

Also scanning in some of the art for my game right now so I should have a decent testing model instead of that weird cactus guy in the near future... (he will be missed though :P)

juvinious
Quote:

I don't know of any 2D games that have this in their actual engine, but I wouldn't doubt that a few have used this approach with pre-rendered frames (I suppose any 2D game that uses pre-rendered 3d modles, is in a way, doing this?)

On the NintendoDS, in both Castlevanias there exists a few characters that use this kind of technique for some large enemies. It's pretty interesting which makes this editor pretty awesome, keep up the good work Matt.

Matt Weir

Thanks for the encouraging words! :)

Yeah, I used to love Castlevania! They remember they used every trick in the book when it came to their bosses. Good times. I vaugly remember the final boss in Sonic the Hedgehog 2 was similar too, probably why I'm doing this now! (I was sooo addicted to that game when I was a kid, noone could beat me at two player!)

Michael Jensen

I seem to remember some bosses like that in CV: Symphony of the Knight (PSX) ... I'm not sure if this is how they were implemented though -- I'd guess that they were all separate enemies that were just hard coded not to drift too far from each other, or stored their positions as offsets of one another rather than act as actual joints -- could be just me thinking that though...

MW: I still haven't tried the program out, sorry, I've been swamped with work -- but I want to ask: is there anyway, that you can save frame files, without textures attached? So that if I made a whole bunch of running/jumping animations, etc, I could just attach them to new "skins" and have it all work? I think this would save the most time... especially if someone went thru the trouble to make complicated gestures and emotes...

edit: Also when they render, is it possible to place the characters all on an output bitmap of the same size (say, maybe, have it autodetect the largest bitmap it would need and just use that size) so that when I'm animating in my game, I can blit whatever bitmap needs to be blitted at the same exact point, and not worry about offsets or the character moving around within the image...?)

Sorry if I'm asking too much -- this is getting me excited enough to finally write my own platform-shoot-em-up-er...

Audric

There's this boss Galamoth, and I've seen several others in the Castlevania games on the GBA.

Quote:

I'm not sure if this is how they were implemented though -- I'd guess that they were all separate enemies that were just hard coded not to drift too far from each other, or stored their positions as offsets of one another rather than act as actual joints -- could be just me thinking that though...

It's the same thing ??? On the abstract level you design an animated character, on the implementation level you draw it by a series of rotated blits... Or whatever hardware sprites (or GL quads) the console uses.
Complex enemies (made of several animated joints) were certainly designed in a GRIM-like editor, then the data was translated for the console as hard-coded instructions: (x, y, angle) for each sprite.

Richard Phipps

I think Another World and Flashback used interpolation in their sprites..

Michael Jensen

Might you mean, Out of this world? That game was awesome... I think it did use a skeletal system, but it was also only vector based (everything was filled triangles)

But awesome games.

Nice Link RP,

Quote:

See, way back in the day, the Egyptians had a lot of weird things: mummified people, a fixation with cats, large triangular buildings, and magical dinosaurs that had control of the elements and guarded the tombs of the dead. You may wonder why it is that, if they had these creatures, we've never found bones of them, but I tell you, we've never found Jimmy Hoffa either, so yeah...

Quote:

It's the same thing

I was thinking maybe they weren't rotated or maybe my head was just being strange. It does that.

Audric

They are rotated by fine angles, this explains why they have sometimes hard, yet "fuzzy" edges, instead of artistically anti-aliased. See for yourself on the picture of Galamoth.

It's easier when you have no rotation : You can animate pretty centipedes or asian dragons, with several blocks touching each other.

Michael Jensen

you're right.

edit: I also did some googling and found this (very cool):
{"name":"142_full.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/0\/40e978470b9a6c27d86ee52bbfe5ea65.png","w":544,"h":398,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/0\/40e978470b9a6c27d86ee52bbfe5ea65"}142_full.png

Matt Weir
Quote:

is there anyway, that you can save frame files, without textures attached? So that if I made a whole bunch of running/jumping animations, etc, I could just attach them to new "skins" and have it all work?

It's one of the things that is definately planned. At the moment you can just load a skeleton, manually change all the skins, then save it to do the same sort of thing but I plan on integrating it a lot better. The thing is I want to accomodate it if your second set of skins needs different lengths of bones (ie. a creature is basically the same, same gestures etc. but has longer arms). It all starts to get pretty complicated after a while if you want to have a heap of 'one button' features like 'change entire skin' though in how you store the info to disk. Still all very possible though. I'm planning on grouping everything together in it's own file format which should make this stuff easier. (At the moment it's all seperate PNG's and generated textfiles while features are still being added.)

Quote:

They are rotated by fine angles, this explains why they have sometimes hard, yet "fuzzy" edges, instead of artistically anti-aliased.

In the game I'm using this in it's all aliased by OpenLayer and displayed in 800x600 which does a nice job of hiding the jaggies but yup, you would definately have problems in low resolution. ;)

Quote:

I also did some googling and found this

Haha, that's so cool!

gnolam
Quote:

Might you mean, Out of this world?

Yes. "Out of this world" is the US title; "Another world" is the European (and original) title.

Richard Phipps

And Another World is a better title anyway.

Matt Weir

Well the graphics for my game have finally started their migration from the sketchbook into the digital world so as promised, here's a better example...

{"name":"591195","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/e\/de5613ef9ed751ab3721ccdd706b393c.jpg","w":645,"h":506,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/e\/de5613ef9ed751ab3721ccdd706b393c"}591195

Takes quite a while to draw all the graphics because you have to draw everything that lies behind other things as well. It will be a few long nights copying over and colouring/shading some of the bosses that's for sure! Thanks to photoshop though all the detail is done on different layers to the coloring so I can easily have the same skin but different colours and textures. (The baby blue on the above guy prob isn't permanent in other words! ;))

I'll release another demo of the editor for people to play with in a few days as new features are being added all the time as I need them (eg. proper offsetting for skins added today). Proper timing for the frames is next so that certain frames can be longer/shorter than others. (already working in the game but not the editor... ::))

Thanks for all the suggestions on features etc, much appreciated! Have a nice day all.

Matt.

Michael Jensen
Quote:

It's one of the things that is definately planned. At the moment you can just load a skeleton, manually change all the skins, then save it to do the same sort of thing

That's good enough, so long as the animations are preserved, and just replacing the skins in one frame does it globally to all the other frames...

or hmmm... does changing a bone length in one frame change it in other frames too? This might be very useful...

Matt Weir
Quote:

so long as the animations are preserved, and just replacing the skins in one frame does it globally to all the other frames...

That's exactly how it works. Only 1 skin per bone but the skin can have infinite animation frames and infinite frame sets.

Quote:

does changing a bone length in one frame change it in other frames too? This might be very useful...

I decided against doing that as a default action because quite often I use different bone lengths in frames as special effects. A hand can squeeze a trigger, guns have moving parts etc. Coupled with the skins having their own animations (eg. blinking lights, gun muzzle flash) you can get some nice stuff happening. There is a function in the menu to 'Normalise Bone Lengths' though which takes the current frame and makes all the bone lengths in every frame the same. I'll also put in 'Normalise Selected Bone Length' to do the same but just with a single bone. I am however avoiding the feature creep scenario by not writing any features until I actually need them for the moment... ;)

Richard Phipps

The new gfx look great!

James Stanley

Is there a Linux version?
Or perhaps the source?
It looks like my game could really benefit this, as I've written a really crap stick man animator on my own (no editing software). Btw, congratulations on such a professional looking editor.

Michael Jensen

Yeah, sorry to be causing so much of the feature creep, whenever you feel like you've hit a "final" version just post it up, and say "no more" ;)

Matt Weir
Quote:

The new gfx look great!

Cheers! A bit time consuming but plenty more are on their way.

Quote:

Is there a Linux version?
Or perhaps the source?
It looks like my game could really benefit this, as I've written a really crap stick man animator on my own (no editing software). Btw, congratulations on such a professional looking editor.

1) I don't run linux so not yet but when it's finished if someone wants to port then no probs. I'm not really sure what's involved but to my knowledge there's no OS dependant stuff, it's all Allegro and standard C/C++.
2) At the moment my game engine and the GRIM editor share the same source since changes to structures and file formats are happening every day. When things are more permanent and the codes split off I'll release a proper version of the editor (with some tuts) and most probably the source. :)
3) Thanks! Things are happening pretty fast with this so it shouldn't be too long until it's all finished enough for others to use if they want.

Quote:

Yeah, sorry to be causing so much of the feature creep, whenever you feel like you've hit a "final" version just post it up, and say "no more" ;)

No problems at all! I'm all for hearing peoples ideas and opinions, makes a nice change from just having my own floating around. :) If people want certain things and I have the time to put them in (and they're possible) then I will try. The priority just depends on whether I need the features or not! ;) Keep the ideas coming.

James Stanley

OK, cool :)
I'll keep checking back as it looks really good.

Paul Pridham

It runs reeeally slow on my box. Granted, I don't have the fastest machine on the planet, but what you're doing isn't really graphics intensive, so I'm a little confounded by what's causing the slowdown. Perhaps a bit o' optimization is in order? :)

Matt Weir
Quote:

It runs reeeally slow on my box.

What in particular runs slowly? Just clicking and moving the bones around or animating between frames?

If it's the animating then it will be a bit slow at the moment the delta for the interpolation is just supplied by a 'for' loop as opposed to based on the actual time passed. Under options there's an option to take out the 'rest' that's in the for loop to run it as fast a possible but it still will try and do a set number of interpolations. I'll make an option to change this number in the near future as a temp fix.

In the actual game engine the delta is calculated the proper way based on actual time so it all works perfectly but I just have to code it that way in the editor. Won't be too differcult as the skin animations do it properly already but they were just an 'Animation' class I'd already written dropped straight in (took about 1 minute!). Same class that's used in the game for non-skeletal entities, tiles, and other graphics.

Quote:

but what you're doing isn't really graphics intensive

Masked rotations using Allegro's software routines at 800x600 isn't the greatest and there's a lot of calculating being done each frame using Sine and Cos. There are already lookup tables for these but I'm still tweaking them to get the accuracy right so in the meantime it's just being done with the actual functions. My actual game engine runs using Openlayer with alpha blended rotations, and is much faster. After all that, optimizing will be in order sometime but one thing I've learnt is to get it finished and working THEN optimize or it might never get finished. ;)

Francois Lamini

It doesn't work. You need to put MSCP80.DLL.

Michael Jensen

it works for me... and I love it so far.

Couple of issues though:

1.) When I change frames, all the changes I made to a frame are lost when I go back to it... what happend?

2.) Why does add frame insert a frame before the one I'm working on instead of add one after it?

3.) When I play the animation, the buttons to stop or control the animation become unresponsive, what the heck?

4.) Why do the textures have to be in png format?

5.) Can we get some kind of tooltips so that when I hover over a pretty icon that I don't know what it does, maybe it can say something to tell me what it is? Even in a status bar at the bottom of the window would be nice...

Finally: How soon can we expect a bmp-out feature? (or png-out, since you seem to like that format! ;))

Edit: Also I've been playing castlevania:SOTN lately and a LOT of the bad guys are actually vector based (and that evil dino bastard is one of them). Blah.

Thread #589864. Printed from Allegro.cc