Tallowmere 2
Work in progress. Subject to change. More fun than you can shake a kitten at.
Tallowmere 2

Lady Tallowmere has begun expanding her empire.

Tallowmere 2 is an upcoming 2D dungeon platformer game, currently in its early stages, being developed by Chris McFarland in Auckland, New Zealand.

Delve Further
Blog Post

Mod support

24 January 2016  •  Chris McFarland

Mod support will be part of Tallowmere II.

I want to make it easy for players to import custom sprites and sound effects to create new creatures.

This post gives a run-down on how a custom humanoid can be created at the moment.

Further down the development line, I hope to make many parts of the game moddable, but for starters I'm letting just the creatures be moddable.

The base character

This is the current basic humanoid character:

Next, let's add some clothes for the game to import so we can play dress-up.

The Mods folder

The current implementation has a Mods folder located at:
Tallowmere II/TallowmereII_Data/StreamingAssets/Mods

StreamingAssets is a special folder that Unity knows the location to easily enough, and lets me sync my development Mods folder when I build the standalone executable. Later on, I might see about having the Mods folder sit beside the Tallowmere II executable for easy access, but its deeper location will suffice for now.

Anyway, within the Mods folder, I plan to have folders for Creatures, Weapons, etc. For now, there's just a Creatures folder.

Creature creation

Within the Creatures folder, you can have multiple folders, one folder for each custom creature you want to create.

As an example, I've created a PinkWarrior folder:

Within this PinkWarrior folder, this is where you'll place:

  • a custom JSON file, and
  • your custom PNG sprites, audio files, and more.

For this example, I've tinted the green warrior's clothing pink.

It doesn't matter what you title your JSON file as, long as it ends with .json. The game currently finds the first JSON file it comes across and imports its data.

Sprite filenames can also be whatever you please and are defined within the JSON file:

    "CreatureName":                 "Pink Warrior",

    "HairSpriteFilename":           "PinkWarrior_Hair.png",
    "HairBehindSpriteFilename":     "PinkWarrior_HairBehind.png",
    "HeadSpriteFilename":           "PinkWarrior_Head.png",
    "ShoulderPadSpriteFilename":    "PinkWarrior_ShoulderPad.png",
    "ShirtSpriteFilename":          "PinkWarrior_Shirt.png",
    "BracerSpriteFilename":         "PinkWarrior_Bracer.png",
    "RightPantSpriteFilename":      "PinkWarrior_RightPant.png",
    "LeftPantSpriteFilename":       "PinkWarrior_LeftPant.png",

    "ExclamationAudioClipFilename": "PinkWarrior_Exclamation.ogg",
    "JumpAudioClipFilename":        "PinkWarrior_Jump.ogg",
    "TakeDamageAudioClipFilename":  "PinkWarrior_TakeDamage.ogg",
    "DeathAudioClipFilename":       "PinkWarrior_Death.ogg"

You can leave the left column alone and just define your creature's name, sprite filenames, and audio filenames on the right. (I haven't implemented audio importing yet, but it will probably follow the same example)

Sprite requirements

For best results, each sprite must be an 8-bit PNG. If you're using Photoshop, you can go File > Export > Export As... and choose PNG with Smaller File (8-bit).

8-bit is needed because otherwise the default of a 24-bit PNG will result in white borders appearing around the sprite, due to how Unity imports textures using this method.

The result

Voila, the game has read the JSON file, imported the specified PNG files, applied it to a CreatureSpriteSet, and applied the sprite set to a CreatureModule:

(note that I don't think Lady Tallowmere will be beating you up personally in the actual game ;))

Future ideas

I imagine an in-game creature creator will be a thing with an in-game file browser so you can select your required custom PNG files, audio files, etc. There will also be the need to specify body parts on death, where the blood will shoot out from and at what angle, how many body parts, etc. Might also need to be able to resize the creature's physics collider, as well as slightly offset the position of certain sprites.

In any case, this early exercise shows that user files can be imported at run-time, which paves the way for proper mod support for Tallowmere II.

‒ Chris