Sprite object editor

Started by
5 comments, last by iliak 15 years, 4 months ago
Are there any animated sprite object editors out there ? I'm looking for an editor that allows me to pick animationframes from a big texture and then export coordinates and framedelay (preferably for each frame) or something to binary. Ofcourse then I would only have the animations seperatly, playerWalkLeft, playerWalkRight etc. So it would be nice if there is any solution for grouping them together also. How do you set up your sprites and their animationframes ? Any tip greatly appreciated :-)
Advertisement
Quote:Are there any animated sprite object editors out there ?
I'm looking for an editor that allows me to pick animationframes from a big texture and then export coordinates and framedelay (preferably for each frame) or something to binary.

Hi. I'm not sure if the suggestion I'm about to give will work for you since its a bit hazy for what you are exactly looking for. So hopefully this will help, otherwise maybe someone else can lend a helping hand.

I use Graphics Gale. There's a free software version and it actually is pretty good. I find it easy to use and you can do 2D animations which can be exported to a sprite sheet; I also use a Python script to assist with sprite sheet creation and modifications.
Quote:Ofcourse then I would only have the animations seperatly, playerWalkLeft, playerWalkRight etc. So it would be nice if there is any solution for grouping them together also.
How do you set up your sprites and their animationframes ? Any tip greatly appreciated :-)

I believe most people use sprite sheets. You then arrange the sprite sheet efficiently and you basically sub-blit whichever frame slice you need onto yr display at whichever position you need. You can then incorporate these sprite sheets into C++, Python, C#, Java (whatever you use) programs and animate the sprites.
Hi and thanks for your answers.
Actually I have the sprites laid out in a spritesheet, but now I have hardcoded each animationframe in my init method.
I have an animation class that have an array of frames (coords in a spritesheet & framedelay). And I have different Sprite classes that have one or more animation objects. For instance my PlayerSprite class holds 5 animation objects, left, right, up, down & die.
I was wondering how other people set up their animations from a spritesheet.
Do you set up the sheet cords for each frame in the code or do you have an editor for this ?

So much to learn :-)
Quote:Original post by dataMorgana
Hi and thanks for your answers.
Actually I have the sprites laid out in a spritesheet, but now I have hardcoded each animationframe in my init method.

I'd definitely keep such data outside the code. Whether you store it in a plain text file or in a binary format or whatever matters less, as long as it's easy to modify (either by hand, which can make sense for small amounts of data, or via a tool, which is more efficient for larger amounts of data). Mixing logic and data (e.g. hardcoding data) often makes things hard to modify and can become quite confusing. Just imagine not having to recompile a project for every animation change: what a relief! ;)

A while ago I did a lot of prototyping with Flash (using haXe and swfmill together with some Python scripts to automate certain processes). I wrote a simple animation system that read animation data from text files. I didn't bother to write an animation tool because most games only contained a few simple animations.


For the game I'm currently working on, I plan to write an animation tool. One that accepts frames as separate images, allowing me to create sequences, and then outputting frame and animation data as well as packing the separate images into spritesheets (I already have code for that lying around so that's an easy addition).

Well, it's going to take some experimenting to find a good, easy workflow. It's perfectly possible that I'll eventually need to modify that, and other tools, to optimize my workflow. Which is why I usually write such tools in Python, because it's easy to work with and yields results pretty fast.
Create-ivity - a game development blog Mouseover for more information.
Quote:I was wondering how other people set up their animations from a spritesheet.
Do you set up the sheet cords for each frame in the code or do you have an editor for this ?

If you lay out yr sprite sheet efficiently then a lot of these coordinate issues go away.

If you allocate a constant area for each frame of a sprite animation then you will save some work. So let's say that you have (96 x 96) = (width x height) pixel sprite and that each sprite is aligned and centered in its 96x96 box on the sprite sheet. Furthermore, you can put different animation sequences on different rows of the sprite sheet.

For example, player move left might occupy row 0 and player move right might occupy row 1, row 2 (...), etc. If each animation has say 10 frames then you can do the following:

image_x = animationFrame * frameWidth;  // where animationFrame is the current image_y = animationType * frameHeight;  // displayed frame which is incremented // according to a frame delay you set.  animationType is an integer that // determines what type of animation on the sprite sheet we're after.//  In the example above, move left is row 0.//  so if we want move left animations set animationType = 0.  //  FrameWidth and frameHeight// would both be 96 this example.


This way you can set animationFrame and animationType to be integers. The frameWidth and frameHeight multipliers just put you at the correct spot on the sprite sheet. So to blit you can call (I'm just making this function up... it will be whatever function you use for blitting to the screen):

subblit(spritesheet, image_x, image_y, frameWidth, frameHeight, screen_location)// Basically blit from the sprite sheet the location starting at image_x // and image_y with a width and height of frameWidth and frameHeight// pixels to the screen_location.


This way you don't have to hard code sprite sheet coordinates; all you need to give is animationFrame and animationType integers; the width and height multipliers take care of the rest as long as yr sprite sheet is uniformly layed out.

As far as delay between frames goes, I normally just use a uniform delay, but you can use whatever method you want to change the animationFrame variable.

This is just a suggestion, there may be other/better ways to go about this....
Hey, I actually wrote a file format that stores all the information about how a sprite is animated and such. It stores the position of each frame on the sprite sheet, how long it should be displayed for, how the animations articulate, it has the filename of the sprite sheet it belongs to, hotspots, bounding boxes, and some other stuff.

The tool is a bit difficult to use, I never really intended to release it. However, it works, so I guess that is what counts.

Also, right click will place the hotspot, ctrl + left click will place the bounding box. here is the download link:

http://trygongame.googlecode.com/files/TGN.rar

Email me as CaseySClyde@gmail.com if you are going to use it, or if you have any questions about how to use it, or just have any comments. I'd love to help.
Hi

My project may interest you : ArcEngine
- Iliak -
[ ArcEngine: An open source .Net gaming framework ]
[ Dungeon Eye: An open source remake of Eye of the Beholder II ]

This topic is closed to new replies.

Advertisement