| 
  • 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!

View
 

Adding and Editing Creatures

Page history last edited by James Koppel 9 years, 11 months ago

This page has an associated video tutorial. See Modding with an Iron Fist: Episode 3: Adding New Creatures. http://www.youtube.com/watch?v=jLEjN6YkvEQ

 

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.

 

Adding New Creatures: The Quickest Way Possible

 

It is possible to add a new creature to the game in under a minute. The catch is that it will look and sound exactly like an existing creature. We'll show you the example of adding a new creature called the "Farmer" which looks and sounds exactly like a peasant.

 

After installing the game (see Running the Game), a file called creatures.xml will appear in your Heroes II DATA folder. Open creatures.xml. At time of writing, the last entry has an ID of 72, so we'll use 73 for the ID of our Farmer. The last line should read "</creatures>". Immediately before that line, enter the following:

 

    <creature id="73" name-singular="farmer" name-plural="farmers" icn="peasant.icn" frm="peas_frm.bin"
               cost="100" fight-value="50" fight-value-aux="20" growth="8" hp="10" faction="6"
               speed="4" attack="5" defense="5" shots="0" short-name="psnt">
        <range name="damage" min="4" max="5"/>
        <range name="random-spawn" min="20" max="40"/>
    </creature>
 

Save the file. You are done; creature number 73 is now a Farmer.

 

Adding entries to creatures.xml is the key step in adding new creatures. The rest of this tutorial is about how to make your new creature not look and sound the same as an existing one.

 

Adding New Creatures: The Full Way

 

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:

 

  1. Create its art
  2. Set the frame info to control its animation
  3. Select sounds
  4. Package the resources
  5. Select its stats and metainformation

 

Making the Art

 

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.)

 

If you wish to see your creatures outside of combat, you'll need to create two or three other versions of your creatures. First is the creature portrait, and will be seen when you view a hero with that creature or enter a town. Create this as a single image within MONH<4-digit creature ID>.ICN -- for example, the Farmer example from above will need a portrait in MONH0073.ICN. Next is a 32x32 pixel image seen when you right-click on a hero, when heroes swap creatures, and when tallying losses at the end of combat. Add this as an image in MONS32.ICN. Finally, if you want to view the creature on the adventure map, you'll need to add images for it to MINIMON.ICN. Each creature has 9 frames in MINIMON.ICN, so a creature with ID 73 will have frames 657-665. The first seven frames are its animation on the adventure map; the last two are used when a hero enters battle with it.

 

Setting the Frame Info

 

Once you've packaged the creature art into an ICN file, you will need do instruct the game how to piece the frames together into animations, as well as set other information about how the creature is animated, such as its walking speed. Full details on how to do this are in the Controlling Creature Animation tutorial. 

 

Adding Sounds

 

You'll need to give your creature a short name, a four-letter abbreviation. For example, we use "kbld" for kobolds. This should be four letters, even if your creature full name is shorter -- "roc_" is the short name for rocs.

 

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".

 

See Adding and Editing Sounds  for instructions on how to add sounds to the game. You can always skip the sound design by copying and renaming sounds from a different creature. 

 

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. Add the graphics, frame information, and sounds from the previous section to a folder, along with all other game resources, and then use the H2AggPack utility. Full details on how to do this are in the Packaging Resources tutorial.

 

Setting Creature Data

 

Finally, you will need to add an entry for your creature in the creatures.xml file. creatures.xml is stored in the ironfist/data directory in the repository. This is an XML file; see http://en.wikipedia.org/wiki/XML if you are unfamiliar with XML. Entries look like this:

 

    <creature id="42" name-singular="roc" name-plural="rocs" icn="roc.icn" frm="roc__frm.bin"
                  cost="400" fight-value="1739" fight-value-aux="43" growth="3" hp="40" faction="4"
                  speed="4" attack="7" defense="7" shots="0" short-name="roc_">
        <range name="damage" min="4" max="8"/>
        <creature-flag name="two-hex"/>
        <creature-flag name="flies"/>
        <range name="random-spawn" min="10" max="16"/>
    </creature>

 

Every creature needs a unique ID between 0 and 255; take the next available ID. The fight-value and fight-value-aux control the value of the creature to the AI. icn and frm are where you specify the names of the graphics and frame-info files you created earlier. random-spawn controls how many of that creature will appear whenever a stack of that creature randomly appears on the map (due to e.g.: "Month of the Roc" events). Most creature abilities are currently hardcoded, though a few can be specified here using the creature-flag tag  -- they are "flies", "two-hex", "shoots", "two-hex-attack", and "undead".

 

For more information, see Setting Creature Stats.

 

Adding to Maps

 

Once you have added your creature to creatures.xml, you can create maps with it! Load up the Ironfist map editor (not the normal one!) and edit a town. Your new creature will be available for placing in a custom garrison.

 

Limitations

 

At time of writing, the new map editor will let you place your new creatures in a town, but the map editor will not let you place them directly on the map without a programmer manually changing the editor. You will also not be able to directly put them in a hero's army. 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.

Comments (8)

GrayFace said

at 4:54 am on Jun 2, 2012

short_name stands for sounds name in Heroes 3.
As for legal challenges, it shouldn't be any problem as long as the mod requires the original game to run and doesn't use material from other copyrighted sources without permission.

James Koppel said

at 11:46 pm on Jun 5, 2012

I don't expect distributed a few graphics of the original game to be a problem. That being said, doing so is quite unambiguously copyright infringement

Solving this without distributing Ubisoft art is quite feasible. You just need to make an installer that unpacks the original game data, unpacks the sprite archives with all creature icons and creature portraits, repacks them with our own creatures appended, and the packs them into ironfist.agg. That's a major pain, and will require an installation process more complicated than "Copy the files to the folder," but it's not a real challenge.

James Koppel said

at 12:57 am on Jun 6, 2012

The short_name is also used for the sound names in Heroes 2, and the game will crash if the sounds are not present. It looks like I forgot something in this tutorial. Thanks GrayFace!

James Koppel said

at 1:32 am on Jun 6, 2012

(Lesson: Don't make a tutorial without following along from scratch yourself. Even if you invented the process. Especially if you invented the process.)

GrayFace said

at 12:35 am on Jun 7, 2012

Trusting Wikipedia this is quite unambiguously a case of "fair use" and thus not a copyright infringement.

James Koppel said

at 10:29 pm on Jun 7, 2012

Not trusting Wikipedia, I should probably speak to a lawyer sometime in the next few months. In the meantime, which article?

GrayFace said

at 4:08 am on Jun 8, 2012

James Koppel said

at 2:34 pm on Jun 8, 2012

I would not say "quite unambiguously," but this is enough to make me willing to use the easy distribution method for the near future.

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