Sprite Animation Editor

Content and general development discussion, including quest scripts and server code. TMW Classic is a project comprising the Legacy tmwAthena server & the designated improved engine server based on evolHercules.


Forum rules

This forum houses many years of development, tracing back to some of the earliest posts that exist on the board.

Its current use is for the continued development of the server and game it has always served: TMW Classic.

User avatar
Vasily
TMW Adviser
TMW Adviser
Posts: 15
Joined: 11 Nov 2013, 18:03
Location: Saint Petersburg

Sprite Animation Editor

Post by Vasily »

Good time everyone!
Due to some reasons we decided to publish the Sprite Animation Editor, written with GTK+ and gtksourceview about three years ago.
SAE allows user to edit text and to view animation at same time using local data folder. Also it includes features like grid, background tiles and character images, for example, for viewing chest armor animation. Of course editor supports real-time editing with XML highlighting (yes, it is gtksourceview-3.0 =D).
I hope you will enjoy SAE as soon as it will be published!
User avatar
Reid
Lead Developer (SoM)
Lead Developer (SoM)
Posts: 1549
Joined: 15 May 2010, 21:39
Location: Artis
Contact:

Re: Sprite Animation Editor

Post by Reid »

SAE is available from our official GIT on gitorious, thanks to 4144 for the upload.

This tool has been and is still pretty useful for Evol, it's not just an animation viewer, it's also an animation editor, thus the utility.
It's pretty easy to use, you just need to pre-seleft the clientdata folder, to open the XML that you want to edit, to parse it, and here you go.
You can play a specific action and direction, you can pause/play/go to the next frame/go to the next animation/etc...

Here a little example: (Sorry for the dark theme, gnome3.8 default theme alt38)
SAE preview.png
SAE preview.png (107.19 KiB) Viewed 14697 times
"Time is an illusion. Lunchtime doubly so."
-- Ford Prefect
User avatar
Micksha
Lead Developer (SoM)
Lead Developer (SoM)
Posts: 225
Joined: 18 Dec 2015, 15:34

Re: Sprite Animation Editor

Post by Micksha »

Bump this one because I like saedit so much :) it simplifies sprite development alot. I wonder if there is any kind of documentation.. if there isnt, I may prepare a how-to help including links to the rules for pixel art (gimp), maps (tiled) and sprites (saedit) in our nice new dev academy.. its all fragmented and a bit messy these days.

Just one request, could you please provide the tag required in the .xml to add the playersprite? I tried with <player>(insert-spritename-or-some-path-here)</player> as proposed by 4144 but unfortunately didnt work.

Thanks Reid and Vasily for that nice tool!

- Mick
User avatar
Vasily
TMW Adviser
TMW Adviser
Posts: 15
Joined: 11 Nov 2013, 18:03
Location: Saint Petersburg

Re: Sprite Animation Editor

Post by Vasily »

Hi Mick!

I'm very happy you enjoyed our editor tool.

To answer your question: there's special tag "<sae />" for a features such as player background tiles. To specify such background tile, you should place '<sae player="human-male" />' somewhere in the XML, I would suggest near the imageset tag. It will take the player animation from "races/human-male.xml" then. Yes, it is hard-coded (and I somehow hate that, though it was written a long ago), so if your player animation is stored in other-than-evol style of directories, say, in "path/to/animation/human-male.xml", you should use '<sae player="../path/to/animation/human-male"/>' ('..' just to leave hard-coded 'races' folder =D).

Also, along with the 'player' attribute, sae tag can have the 'ground' attribute specified. This is used for backgrounding some basic map tiles, I guess you can find them in saedit 'grounds' folder. To specify ground, just place, for example, 'ground="grass"' attribute in the sae tag. You can do it along with the player attribute, like '<sae player="human-male" ground="grass"/>'.

In conclusion I should say that I actually tried to rewrite saedit, my progress is stored in this repo:
https://gitlab.com/vasily_makarov/saedit2. Hope to continue on it!

--
Vasily
User avatar
Micksha
Lead Developer (SoM)
Lead Developer (SoM)
Posts: 225
Joined: 18 Dec 2015, 15:34

Re: Sprite Animation Editor

Post by Micksha »

Thanks alot for adding the zoom function! Now its possible to easily locate single pixels and improve the spritesets. Keep up the good work!
User avatar
Micksha
Lead Developer (SoM)
Lead Developer (SoM)
Posts: 225
Joined: 18 Dec 2015, 15:34

Re: Sprite Animation Editor

Post by Micksha »

Vasily, hi :) its me again.
I have a question: would it be possible to add a function for testing particle effects too? I guess that would not be too hard to do, and it would help a lot in creating nice particle effects..
Thanks,
- Mick
User avatar
Vasily
TMW Adviser
TMW Adviser
Posts: 15
Joined: 11 Nov 2013, 18:03
Location: Saint Petersburg

Re: Sprite Animation Editor

Post by Vasily »

Hi!

I think that particle processing surely can be added to the tool, though it slightly differs from unambiguity and simplicity of the sprite animation parsing. To make it clear, as far as I can see, particles are hardly processed and drawn by the ManaPlus itself, and XML files only specify some parameters of the particle movement (on the other hand, sprite animations can be processed as in-game by just straightly parsing the corresponding XML). That is, with particle processing implemented, the editor will resemble the code written in the game client, and will hardly depend on the code itself, and I don't think that this is very good. I hope that this explanation clarifies the situation :alt-3:

I would be quite glad to hear 4144's thoughts about this. I'm not really familiar with the particle system. So 4144, please tell us, what do you think about resembling it within the editor? Maybe I don't understand it enough?

And I'm greatly encouraged by the fact that the editor is useful and nice work is done with its help, thank you for that!

Yours,
Vasily
4144
Knight
Knight
Posts: 965
Joined: 03 Aug 2009, 11:57

Re: Sprite Animation Editor

Post by 4144 »

Yes particles bit complicated. manaplus already can attach testing particle to player, and need external editor for update this particle file.

btw i remember old SAE version not had all animation features, probably new version not have them too.
User avatar
Vasily
TMW Adviser
TMW Adviser
Posts: 15
Joined: 11 Nov 2013, 18:03
Location: Saint Petersburg

Re: Sprite Animation Editor

Post by Vasily »

4144 wrote: 28 Oct 2018, 02:03 Yes particles bit complicated. manaplus already can attach testing particle to player, and need external editor for update this particle file.

btw i remember old SAE version not had all animation features, probably new version not have them too.
Thank you for the answer!

Well, if the situation is that SAE is not supporting all features and not just the particles, can you please guide me through what these features possibly are? Examples of usage of these features would be quite helpful as well. If we can make SAE support them, why not to try?


Yours,
Vasily
4144
Knight
Knight
Posts: 965
Joined: 03 Aug 2009, 11:57

Re: Sprite Animation Editor

Post by 4144 »

at first more animation commands: rand, goto, etc

about offsets you asked in irc, i not remember what implemented in SAE. if you give me example with wrong offset, i can check what this sprite using really in game.

Oh also now possible use animations for some effects connected to player (same as particle but with animation)
and cutins. separate window with big animation inside.
User avatar
Vasily
TMW Adviser
TMW Adviser
Posts: 15
Joined: 11 Nov 2013, 18:03
Location: Saint Petersburg

Re: Sprite Animation Editor

Post by Vasily »

4144 wrote: 28 Oct 2018, 15:57 at first more animation commands: rand, goto, etc
rand and goto are processed correctly by saedit2 by far =)
4144 wrote: 28 Oct 2018, 15:57 about offsets you asked in irc, i not remember what implemented in SAE. if you give me example with wrong offset, i can check what this sprite using really in game.
Ah, thank you! So for example, take monsters/frostiana.xml. It finely fits into the cell, with offsets being specified relatively to the cell center. On the other hand, if one takes monsters/mouboo.xml, poor Mouboo is lifted down from the cell. I'm not sure where is the difference between these two sprites.
4144 wrote: 28 Oct 2018, 15:57 Oh also now possible use animations for some effects connected to player (same as particle but with animation)
and cutins. separate window with big animation inside.
Will check that out!


Yours,
Vasily
User avatar
Micksha
Lead Developer (SoM)
Lead Developer (SoM)
Posts: 225
Joined: 18 Dec 2015, 15:34

Re: Sprite Animation Editor

Post by Micksha »

Hi Vasily,
perhaps I am too stupid, but this seems not to work here:
To answer your question: there's special tag "<sae />" for a features such as player background tiles. To specify such background tile, you should place '<sae player="human-male" />' somewhere in the XML, I would suggest near the imageset tag. It will take the player animation from "races/human-male.xml" then.
Can you help with that?
Yours,
-Mick
User avatar
Vasily
TMW Adviser
TMW Adviser
Posts: 15
Joined: 11 Nov 2013, 18:03
Location: Saint Petersburg

Re: Sprite Animation Editor

Post by Vasily »

Hi Mick!
Micksha wrote: 29 Oct 2018, 21:38 perhaps I am too stupid, but this seems not to work here:
You are not doing anything wrong - the feature is just not yet implemented in the second version. I am working on it currently, should finish it and something else in a couple of days, please be ready!


Yours,
Vasily
User avatar
Vasily
TMW Adviser
TMW Adviser
Posts: 15
Joined: 11 Nov 2013, 18:03
Location: Saint Petersburg

Re: Sprite Animation Editor

Post by Vasily »

Hey guys!

Glad to tell that SAE is now freshly updated and introduces some new features and bugfixes. As always, those who are interested can find the sources at https://gitlab.com/vasily_makarov/saedit2. If you have any problem with compiling the editor, please let me know.

So these are the new features and fixes:
  • File menu section is now hot-keyed and works as it should.
  • Editor is now reconfigured, font is monospace and tabs are of size 4.
  • Before changes, zooming was blurring the sprite picture, zoomed image is now clearly pixelized.
  • The drawing area is now translatable by the simple mouse drag. You can reset view back to the center with a menu item or by Ctrl+R.
  • Added functionality of drawing tile borders grid (with line width equal to one pixel, I tried to resemble the ManaPlus tile grid), and pixel grid, showing the borders of each pixels. They are available through menu items in the View menu section and by hotkeys. Please be careful with the pixel grid, because it significantly slows performance when there are too many pixels shown (I will probably fix that). Use it when picture is zoomed enough or animation is not being played at all.
  • And the main one! Now one is able to setup what to show apart from the sprite at the drawing area. That is mainly purposed for working with equipment sprite animations, so one could draw an additional player sprite behind the equipment sprite which is being worked on.
    Setup is done by specifying layer information right in the main XML source buffer. Let me start just with the code:

    Code: Select all

    <sprite>
    	<saedit>
    		<layer type="repeater" file="races/demon-male.xml"/>
    		<layer type="background" color="rgba(128,128,128,0.5)" zindex="-2"/>
    	</saedit>
    	
    	...
    </sprite>
    
    As you can see, setup is done through the "saedit" tag and the "layer" tags inside. Layers are now only of two types: "repeater" or "background". "repeater" is exactly the thing needed for placing player behind the equipment. "file" attribute specifies which file should be parsed to show the sprite of the layer, just like the include tag, the path is relative to the "sprites" folder. Since it is a "repeater", it would repeat any animation that you choose for the main sprite to play. If a chosen animation is not presented in the included sprite, it would probably not be shown.

    Note that there is a "zindex" attribute. It specifies the level of the layer which the respective layer will be drawn on. Layers with higher z-index are drawn above those with lower z-index values. If two layers share the same z-index, its not specified which of them will be drawn above other, but I think it's the one specified earlier in the setup. The main sprite layer has z-index 0, and each layer specified in the setup has z-index -1 if not specified.

    The only other type of layers is "background" layers. They are just filled with the same color, that is specified through the "color" attribute, in format like in code with alpha channel, or by usual #rrggbb HTML format. Note that you can also specify "offsetX" and "offsetY" attributes for any type layers, they are both 0 by default.

    "saedit" tag will be parsed only in the main buffer, "saedit" tags in included files would not be considered as actual setups.
I consider implementing "map"-type layers as well, so one could add a map background behind the sprite. Will see how hard it is to parse map files... I have also a doubt about whether XML setup is convenient at all. I have thoughts of making something GIMP-like, with layer windows in which you can dynamically manage layers, but I'm not sure if this is more convenient than specifying layers straightly through XML. What do you think?

Hope these changes are fine, and I have not made many bugs... Speaking about the bugs, please tell me about them if you find any. I'm not very proud of the code I write for SAE, but I'm trying to not to be a perfectionist so things get done quickier.

I think that the editor lacks verbosity, and I can focus on some logging-warning functionality. If you have any feature requests or just some thoughts, you always can write about them!


Yours,
Vasily
User avatar
Micksha
Lead Developer (SoM)
Lead Developer (SoM)
Posts: 225
Joined: 18 Dec 2015, 15:34

Re: Sprite Animation Editor

Post by Micksha »

Hey Vasily!

Hope all is fine with you, didn't see you for a while. However, sae is always a good reason to bug you a bit :)

Seems some of us are struggling with compiling sae2. Would it be possible for you to review, or even make an appimage or so?

Thanks in advance!

Yours,
Mick
Post Reply