Hammerwatch Forum

Custom mapping and Mods => Resources => Topic started by: Thein on July 07, 2014, 03:12:43 AM

Title: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: Thein on July 07, 2014, 03:12:43 AM
Hammersprite is a little tool that lets you easily get your custom sprites ready for the editor. With it, you can easily create tilemaps, doodads, items, and enemies without needing to write out every single sprite coordinate and dimension. It also generates default values for item behaviors, actor behaviors, and lights, which you can easily edit in the xml file.

Supported:
Single tiles
Bordered tiles
Single-state doodads
All item types (unless I forgot some?)
Both 1-Directional and 8-Directional enemies
Melee and ranged enemy behaviors
Collision polygons for doodads and items
Circle collision for actors
Static/Non-static colliders and shoot-through
Glow effect
Attached lights
Automatic updates
And more!

Not yet supported:
Multi-state doodads
Default doodad layers
Projectiles
Particle Effects
Spawners
Composite, caster, boss, and tower enemy behaviors
Possibly more? Let me know!

Video Tutorials (Watch in HD):
http://www.youtube.com/watch?v=0-W-TJEPCSA

http://www.youtube.com/watch?v=YntTaVQ_gVE

Hopefully the videos will be enough to learn how to use Hammersprite, but if anyone needs further help just ask! There is no video yet for creating actors, but it's very similar to creating doodads and items. If you want a video for actor creation just let me know. Also, please leave feedback, bug reports, and suggestions below! I know the Resources section of this forum isn't super active, so feel free to tell other people about this if you find it useful. Thanks  ;D

Installation instructions
Just download and run Hammersprite.application. You might get security warnings from Windows, but I promise it's completely safe. If you can't open the .application file, try installing the Microsoft .NET Framework:
http://www.microsoft.com/en-us/download/details.aspx?id=30653 (http://www.microsoft.com/en-us/download/details.aspx?id=30653)

Download link (extract folder and install using Hammersprite.application)
https://www.dropbox.com/s/ul7g7gjgt6d4z85/Hammersprite.zip?dl=0 (https://www.dropbox.com/s/ul7g7gjgt6d4z85/Hammersprite.zip?dl=0)

Source Code (C# Visual Studio Project. Released under MIT License)
https://www.dropbox.com/s/0uzzv5edd2w91lc/Hammersprite%20Source.7z?dl=0 (https://www.dropbox.com/s/0uzzv5edd2w91lc/Hammersprite%20Source.7z?dl=0)
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: hoffa911 on July 07, 2014, 04:31:31 AM
When I try to run the application, it just opens as a .txt document. What can I do to get it running properly? I can't wait to use this program.
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: Thein on July 07, 2014, 04:52:35 AM
Sorry about that! I think you need to install the .NET Framework in order to run .application files:

http://www.microsoft.com/en-us/download/details.aspx?id=30653
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: Finn on July 07, 2014, 06:17:13 AM
I just started learning to use the editor, and I found this post looking for a way to make custom sprites. So glad I found this, and I can't wait to get started using it. Thanks!

Also, if it's not too much to ask, could you post a download of your current sprites (the ones from the video)? Unless they are already included, of course.
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: Thein on July 07, 2014, 06:40:08 AM
Hey Finn,

All the sprites from the videos are posted in the YouTube descriptions, but here they are:
http://opengameart.org/content/lpc-sandrock-alt-colors (http://opengameart.org/content/lpc-sandrock-alt-colors)
http://opengameart.org/content/lpc-dungeon-elements (http://opengameart.org/content/lpc-dungeon-elements)
http://opengameart.org/content/simple-broad-purpose-tileset (http://opengameart.org/content/simple-broad-purpose-tileset)

Opengameart is a great place to find sprites, sounds and music for custom levels. Enjoy!
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: Hipshot on July 07, 2014, 09:36:10 AM
I can't get the application file to run either and I have all the frameworks installed. I tried the alpha version you sent me and that one worked, but it was also on .exe file. I have windows 7.

From what I could see on the video, you can't make circular collisions, I think you want to add that, cause those collisions are much easier to work with, costs less and for a lot of times fits better.
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: Hipshot on July 07, 2014, 10:08:11 AM
Now it works, it renames the app to txt for some reason when you just click the link and also when downloading it. You should put it inside a zip, might work better.
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: Thein on July 07, 2014, 10:12:38 AM
Yeah, apparently computers don't like .application files. I have added another download link for the setup.exe instead of the .application file. Maybe it will work better. Thanks for the info about circle collisions, I'll definitely add them. I already have circle collisions for actor creation, but I haven't added them for doodads and items. Also I need to add support for multiple colliders on one object.
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: Hipshot on July 07, 2014, 02:38:09 PM
Ok, I actually started using this for "official" production on a new large sprite sheet, however, I quickly noted several "missing" features or "bugs" that ended the experience pretty fast for me =)

* I coulden't drag a outline on top of another, let's say I have a set of walk frames and I want one of them to be an idle frame, I just couldent draw another square on top of that one w/o selecting it.
* I wanted to move my square and manipulate them when I made a mistake
* You should add so that you can snap to the entire grid when you drag, It's nice to see the entire 64x64 grid, but I still had to drag as if I had a 1x1 grid.
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: hoffa911 on July 07, 2014, 03:21:36 PM
Thanks for putting the zip up, it works now. Can't wait to play around with it.
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: Thein on July 08, 2014, 02:14:19 AM
Alright, I just updated Hammersprite with quite a few great changes! Thanks for the feedback Hipshot. Maybe someone can let me know if the automatic updating worked? It should either prompt you upon launch or you can go to Help > Check for Updates. After updating, it should say version 1.0.0.1 in the Help > About option.

Also, I'm not sure why you would want to drag multiple rectangles in the same spot. You can always assign the same rectangle to different animations with no problems. Although one current issue is that you can't use the same frame twice in a single animation. For example, if you need to use the same "in-between steps" sprite multiple times in a walking animation. That's something I'll have to fix later.

Changelog:
Gave "Custom Grid" a menu of it's own
Added "Snap to Custom Grid" option
You can now resize and move rectangles
Resizing and moving also snaps to custom grid
Optimized grid drawing for much better performance
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: Hipshot on July 08, 2014, 10:09:33 AM
Auto updates works, I will try the other things a bit later.
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: Hipshot on July 08, 2014, 10:56:48 AM
Took me one sec to do this with the autoframe option.
(http://zfight.com/misc/images/hammerwatch/2014/july/chaos.gif)

Btw, I misunderstood how to use the editor before, so that's why I wanted to draw a square on top of a square.
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: hoffa911 on July 08, 2014, 03:57:56 PM
Took me one sec to do this with the autoframe option.
(http://zfight.com/misc/images/hammerwatch/2014/july/chaos.gif)

Btw, I misunderstood how to use the editor before, so that's why I wanted to draw a square on top of a square.

And now there is the potential to create a total conversion into an entirely different game within Hammerwatch.
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: Hipshot on July 08, 2014, 04:11:07 PM
Well, if we had the ability to mod your own classes, you could. I already had an idea to port several top down games into this, the graphics's easy and level building and scripting is enough to create several classics. But this tool made it so simple to just take these in.
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: hoffa911 on July 08, 2014, 06:44:43 PM
So I've been playing around with Hammersprite for a bit, and it really is helping with the custom map making experience. However I am having a problem with creating items. I've made two different items, a food item and a collectable item, and they don't seem to have any problems. They show up in the level editor just fine, yet when I run the level, they do not appear. In the level editor they are the top layer so I don't think that's the issue. Is anyone else encountering this?

All tilemaps and doodads I've created work fine.
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: Thein on July 08, 2014, 08:47:15 PM
That's awesome Hipshot. I'm glad to see Hammersprite is working for you. I agree, allowing custom classes would open up so many possibilities for total conversion mods.

Hoffa: It's weird that the item would show up in the editor and not in the game. Did you make sure to save your level before running it? A lot of times I forget to save and I end up playing on a blank level. If that's not the problem, I'll be sure to look into it.  ;)
Title: one question!
Post by: shiftyBOT on July 08, 2014, 10:35:45 PM
will it run on linux? I have mono-complete and all the other things need to make HammerEditor run.
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: Thein on July 08, 2014, 10:51:15 PM
Hey shiftyBOT. To be honest, I have no idea if it will run on Linux, but you are free to try. I don't have enough experience with Linux to test it myself. Hammersprite was written entirely with the .NET Framework, so it looks like you might be able to run it using mono. If you can't use the installer on Linux, I can upload the application executable for you, but I don't think the auto-updates would work.
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: hoffa911 on July 09, 2014, 02:14:07 AM
That's awesome Hipshot. I'm glad to see Hammersprite is working for you. I agree, allowing custom classes would open up so many possibilities for total conversion mods.

Hoffa: It's weird that the item would show up in the editor and not in the game. Did you make sure to save your level before running it? A lot of times I forget to save and I end up playing on a blank level. If that's not the problem, I'll be sure to look into it.  ;)

I save my levels like three times haha. Twice through "File" in the toolbar, and one more time when it asks as I close the editor. But yeah, it wont show in the level, and then I'll have to reopen the editor, and it's still sitting there on my map in the editor.
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: t0werblade on July 09, 2014, 02:16:15 AM
This is perfect.

#igot99probsbutaspriteaint1
#yoloswag
#spriteisbetterthanpepsi
#praisethein
#icanfinishthemodnow
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: Thein on July 09, 2014, 02:40:12 AM
Hoffa: Could you attach the image and xml file so I can see what's going on? Or if you don't want to post it publicly send me a private message. Items work fine for me, but there could be bugs that I haven't discovered.

Haha thanks t0werblade. Let me know if there's any particular features you want to see.  ;D
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: hoffa911 on July 09, 2014, 03:36:58 AM
No problem, it's not an important item for anthing more than a series of levels I'm messing around with to get better used to doing things in the editor.

I do have to use the editor from a copy of 1.01 that I had to pirate on account of the current version I bought on steam doesn't work (intel graphics chipset issues). Could this be a problem?
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: shiftyBOT on July 09, 2014, 04:15:34 AM
I put it in a custom folder I made in my home folder,try to run it.
Permission denied.
...what the heck is going on here?
(this was the second link as I was unable to get the first to work)
does it explicitly need to my in my hammerwatch/editor folder?
and will it even run with the linux file paths?

oh also as a side note.
how exactly does the hammerwatch engine work?
would you mind if I decompiled it and took a look inside?
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: Thein on July 09, 2014, 05:06:12 AM
Hoffa: I tried to load the item, and it gave me the error "Editor can only read RGB or RGBA textures". I've had this error before, to fix it you just have to convert your PNG to a 32 bit depth. My way of doing this is to open the image in Paint.NET (http://www.getpaint.net/ (http://www.getpaint.net/)), go to Save As, save over your PNG image, and choose 32 bit depth. I attached the fixed 32-bit sprite, so see if it works. If not, I'm afraid it might have something to do with the editor version you are using.   :'(

shiftyBOT: The setup.exe doesn't need to be in your Hammerwatch folder, but I figured it wouldn't let you use the installer on Linux. I have attached a zip containing the application exe itself, let me know if it works for you.

Also, I just updated Hammersprite to version 1.0.0.2. Only a couple changes:

Changelog:
Added pixel border around image boundaries so you don't accidentally drag outside
Added "Auto-Fit" option. When enabled, it automatically shrinks rectangle borders based on transparency (only when dragging new rectangles)
Fixed crash when you resize a rectangle negatively
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: Thein on July 09, 2014, 05:17:29 AM
oh also as a side note.
how exactly does the hammerwatch engine work?
would you mind if I decompiled it and took a look inside?

I don't work for Crackshell, so I'm not the person you should be asking ;D. You should ask Myran or Hipshot.

Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: hoffa911 on July 09, 2014, 05:26:27 AM
That fixed the problem I was having! I created the sprite using asesprite, maybe I need to check the settings to be sure that anything I make from scratch is saved as 32bit. Thanks!
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: Hipshot on July 09, 2014, 09:34:27 AM
If it's ok, I'll pin this, cause this tool is very helpful?
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: Thein on July 09, 2014, 09:48:24 AM
Sure, that would be great! Thanks  :)
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: shiftyBOT on July 15, 2014, 01:43:02 AM
will you keep updating the hammersprite version you put there for linux users?
(sorry for the late response)
and I was directing my question at Hipshot :P
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: Thein on July 15, 2014, 02:07:03 AM
I'm assuming that version worked for you on Linux? If it did, I will be sure to update it when I release new versions. Although I have been busy with other things lately, so 1.0.0.2 is still the latest version.
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: Hipshot on July 15, 2014, 04:47:18 PM
http://hammerwatch.com/forum/index.php?topic=2092.msg4716#msg4716
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: Kashlavor on October 01, 2014, 07:13:07 PM
Oh this is cool.
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: Dai Tou Zai on December 14, 2014, 04:21:31 AM
any idea when you will update this for projectiles?

i don't understand how to make them at all -.-
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: SG2Tiger on January 06, 2015, 01:27:14 AM
Hey all, I'm new to using the editor and Hammersprite, so bear with me...but I'm trying to add a custom lava tilemap. I managed to get my basic tile for the animated lava working as expected (well, except I can walk on it, but that's because I need to learn how to do collisions still and is unrelated to Hammersprite) but when I try to make my bordered tiles I'm running into issues. I followed the video tutorial exactly for creating a bordered tile, but rather than having multiple border pieces in the editor (like the defaults) I only have one...

Basically these are my borders:

(http://i.imgur.com/6gAa5Zu.png)

Since the lava is animated, it's transparent with the intent of painting over the lava, but I didn't think that would make a difference? In any case, when it's all saved and loaded in the editor, I only see a single option instead of multiple borders to choose from...

(http://i.imgur.com/RThPgo5.png)

And when I try to place the tile it basically places all the corners down as one...

(http://i.imgur.com/JyXcgqA.png)

I followed the video tutorial as far as setting up a bordered tile, so what am I doing wrong? I just want to create 'shores' between the land and the lava.

If it helps, the xml Hammersprite generated is as follows:

Code: [Select]
<tileset level="201">
   <sprite scale="16">
      <texture>tilemaps/lava_border.png</texture>
      <frame>16 16 16 16</frame>
   </sprite>
   <borders>
      <sprite name="north" scale="16">
         <texture>tilemaps/lava_border.png</texture>
         <frame>16 0 16 16</frame>
      </sprite>
      <sprite name="northeast" scale="16">
         <texture>tilemaps/lava_border.png</texture>
         <frame>32 0 16 16</frame>
      </sprite>
      <sprite name="east" scale="16">
         <texture>tilemaps/lava_border.png</texture>
         <frame>32 16 16 16</frame>
      </sprite>
      <sprite name="southeast" scale="16">
         <texture>tilemaps/lava_border.png</texture>
         <frame>32 32 16 16</frame>
      </sprite>
      <sprite name="south" scale="16">
         <texture>tilemaps/lava_border.png</texture>
         <frame>16 32 16 16</frame>
      </sprite>
      <sprite name="southwest" scale="16">
         <texture>tilemaps/lava_border.png</texture>
         <frame>0 32 16 16</frame>
      </sprite>
      <sprite name="west" scale="16">
         <texture>tilemaps/lava_border.png</texture>
         <frame>0 16 16 16</frame>
      </sprite>
      <sprite name="northwest" scale="16">
         <texture>tilemaps/lava_border.png</texture>
         <frame>0 0 16 16</frame>
      </sprite>
      <sprite name="northeastpit" scale="16">
         <texture>tilemaps/lava_border.png</texture>
         <frame>64 0 16 16</frame>
      </sprite>
      <sprite name="southeastpit" scale="16">
         <texture>tilemaps/lava_border.png</texture>
         <frame>64 16 16 16</frame>
      </sprite>
      <sprite name="southwestpit" scale="16">
         <texture>tilemaps/lava_border.png</texture>
         <frame>48 16 16 16</frame>
      </sprite>
      <sprite name="northwestpit" scale="16">
         <texture>tilemaps/lava_border.png</texture>
         <frame>48 0 16 16</frame>
      </sprite>
   </borders>
</tileset>
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: Thein on January 06, 2015, 04:26:57 AM
It's been a while since I've worked with Hammerwatch, but it seems like your problem is the way you've set up the bordered tilemap. It should look something like what I have attached. It's just something I made quickly, so it's not perfect, but you should have the borders surrounding the basic floor tile. Then, you can use the bordered tile in the Hammerwatch Editor, and it will look something like my second attachment.
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: SG2Tiger on January 06, 2015, 08:28:24 PM
Oh, I think I get it...because I made both versions more like the 'pit' variety, compared to the 'sand mound' type you used for the bordered tiles in the tutorial video? I knew it must have been something silly like that. Thank you for your quick response!!
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: Flemse on August 01, 2015, 10:14:05 PM
This is really nice. You guys(Crackshell) should consider making an official program like this for the new engine, maybe with integration into the editor.
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: Hipshot on August 03, 2015, 12:57:47 PM
I know, I think it would be a great asset to the community. It's not on my table though.
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: ChocolatechunkDE on November 10, 2015, 12:28:43 AM
Hey, there i have sucessfully used the tool, but there are no new doodads in the editor
and yes, i have reload the resources.

Thanks in advance

ChocchunkDE
Title: Re: [Release][Tool] Hammersprite - Easily generate the XML for custom sprites
Post by: MIUPC on December 28, 2018, 04:08:39 PM

Hey!
So i tried to install this tool the other day and the link from where it downloads the tool seems to be missing? Is there any other way for me to download the tool?