• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!


Adding and Editing Creatures

This version was saved 12 years, 1 month ago View current version     Page history
Saved by James Koppel
on May 27, 2012 at 2:04:19 pm

Project Ironfist distinguishes itself by the ability to add new content, and new creatures are the most important type. A lot of this tutorial will change, as we're still improving the process, but overall it's surprisingly easy.


Parts of this tutorial require basic familiarity with the command line. Here are a few introductions to the command line.


Windows: http://www.voidspace.org.uk/python/articles/command_line.shtml

Mac & Linux: http://linuxcommand.org/learning_the_shell.php


You should already have the Project Ironfist repository set up, which you learn how to do in the Setting up the Repository tutorial.


Making the Sprite


A creature starts off as a set of PNG images, one for each frame. This is mostly outside the scope of this tutorial. You can find spriting tutorials elsewhere, but there is no substitute for the hard work and critical eye needed to make good art.


There are a few other considerations. First, the frames must be drawn using the HoMM II Palette, KB.PAL, pictured below, and also available in the ironfist/art/palette folder of the repository. You should select some color not in the palette to use as the background; our tools will convert it to be transparent. We have not yet added support for creature shadow and selection highlight, but they will work the same way as the background color.



Second, all frames should be have the same dimensions. For the walking animation, the creature should be moving forward within the frame.


Converting to ICN


The next task is to pack your frames together into the format used by the game, the ICN sprite archive format. We wrote a tool to do this. The ICNWriter is inefficient and dirty (it tends to produce less-compressed files than in the original game), but it gets the job done.


You will need the Java compiler installed for this, though it comes preinstalled on many machines.


The ICNWriter lies in the tools/icn directory in the repository. Fire up your command line and move to that directory.  Use the following command to compile it.


    javac ICNWriter.java

Now, make sure all your frames are in the same folder, and that nothing else is in that folder. You'll now need a path to that folder. This is easiest if you copy the folder to be in the same directory as the ICNWriter. If the folder is named 


You will now need to invoke the ICNWriter using three things: The path to the directory with the frames, the palette to use, and the background color. Give the color in ARGB format, which is like the common RGB format, but has an extra value in the front for the opacity. The ICNWriter will then print out a binary dump of the ICN file it creates; you can redirect this dump to a file using the ">" operator.


For example, if you had a folder named "kobold" in the same directory as the ICNWriter, you were using the HoMM II palette (KB.PAL), you used perfectly opaque bright purple (RGB FF00FF, or ARGB FFFF00FF) as the background color, and you wanted to save the final results in KOBOLD.ICN, you would run the following command. 


     java ICNWriter kobold KB.PAL FFFF00FF > KOBOLD.ICN


A file named "KOBOLD.ICN" ready for use in the game will now appear in the same directory as the ICNWriter.


Every frame is placed in the ICN in the order the PNG file is returned by the operating system, usually alphabetical order. Remember this!


Note that, if you did not use the palette, ICNConverter will convert each pixel to the nearest color in the palette.


Setting the form


While the ICN file stores your sprites, the FRM (creature form) file tells the game how to use them. Most importantly, it tells the game how to put frames together into animations.


This is a big area of improvement in this process. We still have not labeled all the animations, and we still do not fully understand everything that the creature form files do. We're editing them using a fairly general tool for Mac, and we still don't have a good solution for Windows and Linux. At some point, we will likely finish reverse-engineering the FRM format, and then create a specialized program to generate them.


We edit FRM files using SynalyzeIt ( http://www.synalysis.net/ ), a free hex editor for the Mac which makes it easy to work with fixed binary formats. There is a similar program for Windows called the 010 Editor, but it's a bit expensive.


First, in SynalyzeIt, open the "creatureform.grammar" file in the tools/creature-form directory in the repo. You will probably want to edit an existing creature-form; go ahead and open GOBLMFRM.BIN in the tools/creature-form/example folder. SynalyzeIt will ask you if you want to apply the grammar; click "Ok."


You will now see something like this


Packing Resources


Setting Stats


Adding to Maps

Comments (0)

You don't have permission to comment on this page.