Jump to content

Sprite Animation Viewer/Editor


PaulJay

Recommended Posts

I have started implementing a Viewer (Java application with graphical user interface), which is able to replay any sprite animation of this game. At the moment the application is able to open an xml and play/pause the animation. Also it is possible to change the animation speed (time factor). Furthermore each frame of an animation can be exported to a single image file. I will post the application here as far I get the GUI finished.

The next step will be implementation of useful editing features. like editing sprites of particular frames. Also I plan to implement a layout editor to pack several sprite images of a single animation into a png file. There will also be some automatic layout strategies to reorganize the images in order to get them tightly packed.

Edited by PaulJay
Link to comment
Share on other sites

Hello people, currently it is possible to open a particular animation xml and work with it. I am thinking about making the app. able to set a root folder and displaying all the animations availabe in a hierarchical view. What do you think about it? Otherwise I could add this feature in the next step and keep the application as simple as possible for the moment.

Link to comment
Share on other sites

Hi PaulJay,

This sounds Epic!

Previously I was trying to add a whole load of shields to the existing animations, however overwriting the existing images led to issues in the fact that everything currently is packed so tightly.

I don't know how possible it is, however if your tool could take an animation resize the source image so that the frame pictures were a lot further apart (more space around them) and update the xml file to the new frame size that would be amazing. Then we could add extra bulky items to the existing soldier sprites.

Link to comment
Share on other sites

I have a little question concerning the <img>-tag in the animation xml files: Do anyone know what the attributes regx and regy do affect? I've already figured out what the equally named attributes do in <frame>-tag, they determine some kind of a fixed point(pixel) for all the sprite images when positioning them relative to each other.

This is currently not relevant for the viewer, but will certainly be when the app. will be extended to become an editor for editing or creating animations

Edited by PaulJay
Link to comment
Share on other sites

The regx and regy points are registration co-ordinates when placing the sprite on a tile on the map.

Thanks, Max :). You called it by the right name. After I got the program to successfully run particular animation files my next Goal would be implementing of the following ideas concerning the workflow. It is not really handy to upack all necessary *.pfp archives and copy all animation data to some particular directory. This is why I would like to organize the workfow as follows:

  1. When we start the program we specify the working directory (same way we do it when working with "Eclipse"), the program can remember this.

  2. For a particular working directory we could then add all folders containing the animation data (incl. *.pfp archives) that should be considered in the working directory (not copying them!)

  3. The user can replay any animation he want by selecting one he is interested in.

  4. When the user wants to edit an existing animation the program creates a copy in the working directory. In this case the program splits a spritesheet into single images for each frame and stores them in the working directory. After the user has finished his work he can recalulate a new spritesheet and export the animation back to its original location.

  5. Creating entirely new animations or new animations based on existing ones could work similar way.

Q1: Instead of unpacking the *.pfp archives I would like to make lookups for animation data. But to get this accomplished I need the specification of the *.pfp files. I am not sure if this format uses any compression.

Q2:The other question is, is there any known program that can be used to combine several frame images into a sprite sheet. If not, I've found some useful ideas/algorithms, but implementing them will cost more time than reusing an existing tool from inside the program.

Got the answer for Q1 concerning the specification of the PFP format last night, the archive begins with a 4 byte signature 'PFPK'. Immediately after that there is an int (4 byte) telling the number of files which are in the archive, followed by the file allocation table. Each entry of the table starts with a byte indicating the number of characters used to store the file's name, followed by the the name itself. The next two int values represent the address of the beginning of the file and the length of file in byte respectively. I am also pretty sure there is no encription or compression used by this archive file format.

The code to make lookups for particular files is also accomplished by now :P. I suppose the most challenging part would be implementing the algorithms to solve the "rectangle packing problem" which is equivalent to sprite packing problem.

Feel free to make further suggestions concerning interesting/useful functions

The following screenshot shows the AnimationPlayer (sub program) in action. It would be a good idea to draw the tile area in order to highlight the position of the sprite on the map.

animationPlayer.png

animationPlayer.png

animationPlayer.png.15f956ffbf530e55628a

Edited by PaulJay
Link to comment
Share on other sites

While watching the animation cycles I've noticed light source rotating with the soldier changing directions. This is probably a mistake made during rendering the sprites for different directions by rotating the light source together with the soldier's model. Actually the light source should stay stationary.

Link to comment
Share on other sites

While watching the animation cycles I've noticed light source rotating with the soldier changing directions. This is probably a mistake made during rendering the sprites for different directions by rotating the light source together with the soldier's model. Actually the light source should stay stationary.

When i try to recreate the game lightning at Poser for my mechs, i saw that too so i added some more lights but i never turned them. I think this is for cartoonish style rather then realistic one.

Link to comment
Share on other sites

I've got some questions concerning the following excerpt from an animation xml file:

<timeline name="main" frametime="..." totaltime="...">

Now I am not sure what the 'frametime' really means. I first thought it specifies the duration of a single frame and totaltime the duration of the entire animation (however this is very rarely used). But after playing with it I got confused :confused:. Need some clarification from experts here. Are there some restrictions for possible values for 'frametime'. Also most animations go too fast when playing the game (e.g. machinegun animations). Sometimes the element 'timeline' is not specified - what (default) value for 'frametime' is used in this case.

Link to comment
Share on other sites

  • 11 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...