Image layers

From Wildermyth Wiki
Revision as of 06:04, 6 June 2024 by Ironskink (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Image layers are used by themes, equipment and even regular aspects to affect the appearance of a character. Characters in Wildermyth are created by layering a number of .png files overtop each other based on their "depth" value, with higher values appearing overtop lower values in their group.

Images are clumped into five groups: the main body, the head, the main/equipped weapon, the inactive/stowed weapon, and the offhand weapon/item. Regardless of depth values, image layers within the head group or an item will all be "flat" with respect to the body layers. An axe that uses two layers can have depth values of 1 and 2 and it will always be drawn in front of the body & armour layers when equipped and behind the torso when inactive.

Note: In most game files, image layers are grouped under a heading called "layers", while in aspect files they are called "skinLayers". This guide applies regardless of which of these headings is used.

Default Layer Depths

Layer depths used by the base game
Layer Depth Used for Notes
10-11 Cloak Backs
55-58 Wings Includes Crow Wings, Hawk Wings, Moth Wings, Drauven Wings and Teeny Wings
70 Shoulder Pets Includes Drauven Bird and Netherowl
100-103 Tails
1000 Human Torso Hard-coded, not visible in game files
1001-1003 Bear (Tattoo) Arms, Tree (Willow) Arms
1100 Left & Right Human Legs Hard-coded, not visible in game files
1101-1106 Theme Legs, some Theme Arms
1150 Bandaged & Prosthetic Legs
1200 Human Right & Left Arms, Human Upper Left Arm (2-handed pose) Hard-coded, not visible in game files
1200 Most Spelltouched (Tattoo) Layers Exceptions: Torso (1211), Lower 2-Handed Left Arm (3000)
1201-1204 Most Right & Left Theme Arms
1211 Spelltouched (Tattoo) Torso
1212 Morthagi Captain Torso Not normally available to players
1300 Bandaged & Prosthetic Arms
1500-1503 Mortificial Arms
2000 Foothill Neck Tattoos
2000-2400 Clothing/Armor Excluding Clothing/Armor that covers the Lower Left Arm (2-Handed Pose). Some Warrior armor layers go as high as 2500.
2490-2491 Some Sash Augments
2900-2901 Belt Augments, Bracelet Augments (1-Handed Pose), Kneepad Augments
2910 Starheart Belt
2940-2495 Some Sash Augments
2950-2955 Some Cloak Augments (Front), Talisman Augments
2970-2971 Tortoiseshell Pendant
3000 Human Lower Left Arm (2-Handed Pose) Hard-coded, not visible in game files
3000 Spelltouched Tattoos - Lower Left Arm (2-Handed Pose)
3020-3499 Clothing/Armor Layers, Lower Left Arm (2-Handed Pose)
3550-3555 Some Cloak Augments (Front)
3560-3565 Some Strap Augments, Some Scarf Augments
3570-3575 Necklace Augments
3580-3582 Pauldron Augments, Some Theme Arms Includes Child of the Hills, Elmsoul and Crystalline
3590-3592 Broach Augments
3999 Neck Theme Layers
4000-4003 Bracelet Augments
4900 Left Hand, Book Grip (Back) Hard-coded, not visible in game files
5000+ Held Item (Offhand) Hard-coded, not visible in game files. For multi-layer items, the default layer starts at 5000 and additional layers are added on top of that. For example, if an offhand item draws a shading layer at a depth of 1, when equipped in the off-hand the layer will have a value of 5001.
6000 Left Hand: Closed, Open, and Book (front) Grips Hard-coded, not visible in game files
6100-6103 Shield Offhand Items
7000 Held Item (Main Hand) Hard-coded, not visible in game files. For multi-layer items, the default layer starts at 5000 and additional layers are added on top of that. For example, if an offhand item draws a shading layer at a depth of 1, when equipped in the off-hand the layer will have a value of 7001.
8000 Right Hand: Closed, Open and Book Grips Hard-coded, not visible in game files
8100-8105 Ring Augments

Modding Head Layers (Heads, Hair, Faces, Scars, etc.)

Head layers are used by the "peopleParts" files (to customize character appearance) and several aspects (such as the various scars).

Head layers are all drawn as a separate group from the body layers, so 'depth' values are only relative to other images being drawn on the head. The base game gives the various possible heads a depth value of 4000, so layers with a lower depth value will be drawn behind the head.

Layer Definition

Inside the peoplePart or aspect file, the layer definition will look something like this:

"layers": [
	{
		"name": "hairFB3_behind",
		"tint": "hair",
		"bodyPart": "hair",
		"depth": 3900,
		"headOffset": true
	},
	{
		"name": "hairFB3",
		"tint": "hair",
		"bodyPart": "hair",
		"depth": 4200,
		"rigMode": "femaleHead",
		"headOffset": true
	},
	{
		"name": "hairFB3M",
		"tint": "hair",
		"bodyPart": "hair",
		"depth": 4200,
		"rigMode": "maleHead",
		"headOffset": true
	},
	{
		"name": "hairFB3_streaks",
		"tint": "streaks",
		"bodyPart": "hair",
		"depth": 4201,
		"headOffset": true
	}
]

Some important fields:

  • name (required): The name of the image to be used, not including the .png file extension.
  • headOffset (required): Setting this to true is what defines this as a head layer.
  • depth (recommended): Determines the order of drawing the images. High numbers go above lower numbers.
  • tint: Which of the character's tint colours to apply to this layer. Possible values are skin, hair, primary, secondary and streaks. (If omitted, no tint will be applied.)
  • tintAmount: How strongly the layer should be tinted on a scale from 0.0 (not at all) to 1.0 (full strength). (If omitted, any tint will be applied at full strength.)
  • bodyPart: If set, will only be drawn if the character has that body part and body part hasn't been transformed by a theme.
  • rigMode: If set, will only be drawn for the appropriate rig. Possible values are maleHead and femaleHead
  • ifOwnerHasPart: If set, will only draw this layer if the character also has this other body part. (Often used to make beards fit exactly to faces.)
  • expandFaceToExpressions: If set and the keyword $face is used in the "name" value, the game will substitute $face for the character's current expression (Often used to make beards fit exactly to faces)
  • facialExpression: An array of the facial expressions that this layer applies to. (Often used with theme heads to allow the same head to apply to multiple expressions)
  • ifOwnerAspect: Only draw this layer if the character also has some other aspect on them. Ending the value with a wildcard character (*) will match any aspect beginning with everything before the *.
  • ifOwnerAspects: Character must have all of these aspects in order for the layer to be drawn.
  • ifNoOwnerAspect: Only draw this layer if the character does not have some other aspect on them. Ending the value with a wildcard character (*) will match any aspect beginning with everything before the *.
  • ifNoOwnerAspects: Character must not have any of these aspects in order for the layer to be drawn.

File Names

If using expandFaceToExpressions, you will need to provide separate images for all 17 facial expressions ("neutral", "interested", "grim", "sad", "skeptical", "dubious", "open", "surprised", "scared", "angry", "rage", "scheming", "hit", "dead", "happy", "joke" and "joy"). Otherwise, your file name will simply be the name that you specified plus a .png file extension.

Canvas Size

Head image layers are defined in a rig's associated skeleton file. All human heads are expected to be 192 x 256 pixels. Any images of different dimensions will be stretched or squashed to this size.

Known Exceptions: Custom rigs may specify custom dimensions for the head layer. See "Mods with Special Considerations" below for known cases where custom head sizes are being used.

Image Location

Your mod should place all images for these layers inside the assets/figures/images/human/misc folder of your mod. (The first time you add an image to your mod, you may need to create these folders.)

Any images that share the exact same name as images in the base game's assets/figures/images/human/misc or assets/figures/images/human/unpacked folder will overwrite the base game's version of the file.

Modding Body Layers (Limbs, Augments, Armor, etc.)

Most of the layers that appear on your character are part of the body set. The body layer includes the torso, the character's limbs, armour, augments, shields, and all of the theme parts that can replace the torso or limbs.

Body layers are rig-specific, meaning that the game will determine which image to use based on the character's rig. The base game has a total of 6 rigs: Male/Female body shapes for each of the three classes (Warrior/Hunter/Mystic), and modders can create their own custom rigs and apply them using the rigOverride aspect.

Layer Definition

Inside the aspect, theme or armour file, the definition of a layer for the body will look something like this:

"layers": [
	{
		"name": "replaceArmL_wolfA_tint",
		"tint": "hair",
		"depth": 1201,
		"ifNoOwnerAspect": "themeSkin_wolf*"
	},
	{
		"name": "replaceArmL_wolfB_untinted",
		"depth": 1202,
		"ifNoOwnerAspect": "themeSkin_wolf*"
	}
],

Some important fields:

  • name (required): The name of the image to be used. (Body layers are special - see below)
  • depth (recommended): Determines the order of drawing the images. High numbers go above lower numbers. (See below for list of depths used by base-game assets)
  • tint: Which of the character's tint colours to apply to this layer. Possible values are skin, hair, primary, secondary and streaks. (If omitted, no tint will be applied.)
  • tintAmount: How strongly the layer should be tinted on a scale from 0.0 (not at all) to 1.0 (full strength). (If omitted, any tint will be applied at full strength.)
  • ifOwnerAspect: Only draw this layer if the character also has some other aspect on them. Ending the value with a wildcard character (*) will match any aspect beginning with everything before the *.
  • ifOwnerAspects: Character must have all of these aspects in order for the layer to be drawn.
  • ifNoOwnerAspect: Only draw this layer if the character does not have some other aspect on them. Ending the value with a wildcard character (*) will match any aspect beginning with everything before the *.
  • ifNoOwnerAspects: Character must not have any of these aspects in order for the layer to be drawn.
  • rigMode: If set, only draw this layer in the specified mode. Possible values are oneHanded and twoHanded.
  • ifRightHandGrasp: If set, only draw this layer based on the right hand's grasp value. Possible values are open, closed and book.
  • ifLeftHandGrasp: If set, only draw this layer based on the left hand's grasp value. Possible values are open, closed and book.

It is possible to create some very complicated effects using the above fields, such as including multiple layers that are each tinted separately, allowing augments or alternate arms/hands to grasp weapons and items, and making layers depend on multiple aspects to have them show or hide automatically based on other factors.

File Names and Rigs

As mentioned above, body layers are generally rig-specific. This means that the file the game will look for when drawing the character will be a combination of the name of the rig and the name specified in your layer, in the form <rigName>_<layer name>.png. For example, if you set the name field for your layer as myNewLayer, a female warrior (which uses the rig warriorF) would use the image file warriorF_myNewLayer.png while a male mystic (which uses the rig mysticM) would use the image file mysticM_myNewLayer.png

For body layers, you must therefore provide separate images for each rig that you wish to support.

The six rigs used in the base game are:

  • hunterF
  • hunterM
  • mysticF
  • mysticM
  • warriorF
  • warriorM

It is possible for mods to define and use custom rigs in addition to the base-game rigs above. See "Mods with Special Considerations" below for more information.

Canvas Size

Body image layers are all expected to be 512 x 512 pixels. Any images of different dimensions will be stretched or squashed to this size.

Image Location

Your mod should place all images for these layers inside the assets/figures/images/human/misc folder of your mod. (The first time you add an image to your mod, you may need to create these folders.)

Any images that share the exact same name as images in the base game's assets/figures/images/human/misc or assets/figures/images/human/unpacked folder will overwrite the base game's version of the file.

Modding Held Item Layers

Items are the things that can be held in the character's main or off hand and are sometimes stowed behind the character's back when inactive.

Layer Definition

Inside the item, the layer definition will look something like this:

"layers": [
	{
		"name": "item_axe1Fang_t1A_tint1_50",
		"tint": "primary",
		"tintAmount": 0.5,
		"scaleX": 0.5,
		"scaleY": 0.5,
		"rigUsage": "rigGeneral",
		"grip": "mainHand",
		"inactiveGrip": "highBack",
		"gripOffset": { "x": 114, "y": 210 }
	},
	{
		"name": "item_axe1Fang_t1B_untinted",
		"scaleX": 0.5,
		"scaleY": 0.5,
		"rigUsage": "rigGeneral",
		"grip": "mainHand",
		"inactiveGrip": "highBack",
		"gripOffset": { "x": 114, "y": 210 }
	}
]

Some important fields:

  • name (required): The name of the image to be used. (The game seems to like item images to be prefixed with item_)
  • depth (recommended): Determines the order of drawing the images. High numbers go above lower numbers.
  • rigUsage (recommended): Setting this to rigGeneral means this layer will always be drawn regardless of the rig used by the character.
  • gripOffset (recommended): Specifies the anchor point where a character will hold this item.
  • grip (recommended): Which hand a character uses to hold this. Possible values are "mainHand" and "offHand".
  • inactiveGrip (recommended for weapons): Where to stow this item when inactive. Possible values are "highBack" "midBack" "lowBack" and "hide".
  • grasp: How the item is held. Defaults to "closed". Can be set to "book" or "open".
  • scaleX: Scaling multiplier to size the item appropriately to the character.
  • scaleY: Scaling multiplier to size the item appropriately to the character.
  • rotation: Rotates the item.
  • tint: Which of the character's tint colours to apply to this layer. Possible values are skin, hair, primary, secondary and streaks. (If omitted, no tint will be applied.)
  • tintAmount: How strongly the layer should be tinted on a scale from 0.0 (not at all) to 1.0 (full strength). (If omitted, any tint will be applied at full strength.)

Canvas Size

Item image layers can be any size. Use the scaleX and scaleY properties in the layer definition to ensure the item is sized appropriately for the character.

Image Location

Your mod should place all images for these layers inside the assets/figures/images/human/items folder of your mod. (The first time you add an image to your mod, you may need to create these folders.)

Any images that share the exact same name as images in the base game's assets/figures/images/human/items folder will overwrite the base game's version of the file.

Mods with Special Considerations

The following mods use custom setups in some way.

Drauven PCs

Author: Drauven Mod Squad (Lead: David Bilsky, AKA Ironskink/BoldestDungeon)

Website: Project Page on GitHub

Primary Contact: Dedicated Discord server

New Rigs

  • DrauvenHunter
  • DrauvenMystic
  • DrauvenWarrior
  • Drauven

Notes:

The Warrior, Hunter and Mystic rigs are based on the Stump, Haunt and Deeven models, respectively. Raw .psd files for the rigs at the project's public GitHub page. The plain Drauven rig is used for farmers and is an exact copy of the Warrior (Stump) rig.

The Drauven rigs use a larger canvas size for the head layers than the normal human rigs do (256 x 384 px) to better fit all the various head ornamentations that the Drauven have.

Return of the Centauri

Author: Pinhat

New Rigs

  • centaurWarriorM
  • centaurWarriorF
  • centaurHunterM
  • centaurHunterF
  • centaurMysticM
  • centaurMysticF

Notes:

The centaur rig essentially shifts all of the upper-body assets up and to the right to make room for the centaur's lower body. The upper human body is unchanged except for the position.