Project Ironfist distinguishes itself by the ability to add new content, and new creatures are the most important type. When we added our first creature, we needed to modify data tables in assembly, . Now, it can be done using little more than a text editor and a paint program. There's still a lot that goes into making a polished creature -- sound, animation, and game design -- but it is now possible to get a rough version up and moving in minutes.
It is recommended you already have the Project Ironfist repository set up, which you learn how to do in the Setting up the Repository tutorial.
To add a new creature, you will need to do the following:
- Create its art
- Set the frame info to control its animation
- Select sounds
- Package the resources
- Select its stats and metainformation
Unfortunately, putting creatures into a map still requires either getting your hands dirty with a hex editor, or removing an existing creature from the game. We're currently working on a new map editor.
Also, at time of writing, we are unable to add new shooters, as we have not yet made it possible to set the graphics for a creature's projectile.
Making the Sprite
A creature starts off as a set of BMP 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. More detail on how to put art in the game is given in the Adding Artwork tutorial.
One issue specific to creature art is that, for the walking animation, the creature should be moving forward within the frame. However, for flying animations, the creature should be stationary; the game will smoothly move them to their destination. (This has the unfortunate consequence that, when flyers walk [because they are slowed], they will jerk from one hex to the next.)
Setting the Frame Info
Once you've packagedWhile 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:
On the left is a binary view of the creature form file. The grammar file tells SynalyzeIt how to break up the file into various fields. On the right you will see an entry for each field.
The most important fields are the last 68 fields of the file: 34 fields giving the number of frames in each animation, followed by 34 lists giving, for each animation, the indices of the frames used in that animation. Remember how the ICNWriter program (usually) inserts frames in alphabetical order? You will need that information here.
Adding Sounds
You'll need to give your creature a short name, a four-letter abbreviation. For kobolds, we'll use "kbld."
Every creature needs four sounds, for attacking, moving, taking damage, and dying. For kobolds, these must be named "kbldattk.82M", "kbldmove.82M", "kbldwnce.82M", and "kbldkill.82M", and similarly for other creatures, depending on the short name. Shooters need an additional fifth sound for shooting. If kobolds could shoot, this would be called "kbldshot.82M".
An "82m=M" file is a raw WAV file with playback rate 22050 Hz. At some point, we'll write a tutorial on how to package sounds for the game. For now, copy the sounds from another creature and rename it.
Packing Resources
The artwork, creature form, and sounds together give everything the game needs to display your creature. The final step in getting the data into the game is to package them together with the other game resources.
All game data is packed into AGG (aggregate) files. These are archive files, similar to ZIP or RAR files, which can contain thousands of other files, including virtually all the game artwork. All the resources for the original game lie in HEROES2.AGG; everything for the Price of Loyalty expansion lies in HEROES2X.AGG. Everything you produce will be placed into ironfist.agg .
Making an AGG file is similar to making an ICN, but simpler. You will again need to use the Java compiler and the command line. You will first need to navigate to the tools/agg folder in the repository and compile the Agg tool with the following command:
javac Agg.java
Now, place everything you wish to place into ironfist.agg into a folder named "ironfist". Place this folder in the same directory as the Agg tool, and run the following command.
java Agg ironfist
This will create your "ironfist.agg" file. Place ironfist.agg in the Heroes2 DATA folder. Congratulations! Your resources will now be loaded into the game. Now we need to tell the game to use your creature.
Setting Creature Data
Adding to Maps
We have not yet modded the map editor, so we really don't have a proper way of putting creatures into maps. Still, if you want to see your creature moving, you can manually hex-edit a map to add it in.
In the normal Heroes 2 map editor, create a neutral town, and put 1337 Water Elementals in the garrison. Save the map. Open the map file in a hex editor, and search for the number "1337." This should bring you to the part of the map that specifies that the garrison has 1337 Water Elementals. You should see the number 65, the ID of Water Elementals, adjacent to the 1337. Change the ID to the ID of your creature, and change the quantity to whatever you want. Load the map in the game. Congratulations! You've fully added a creature.
Why are we adding them to the garrison of a neutral town? There are still a few things we have not put work into figuring out how to do: primarily adding in the portraits that display when you view a creature in your own army. We do know that the biggest challenges will be legal ones though: To do this, we will either need to substantially modify the code, or put your artwork in the same file as original artwork from the game.
Comments (0)
You don't have permission to comment on this page.