Overview Screenshots Downloads News Documentation Thanks Simugraph Home Page

H-World - User graphics manual

User defined monster and item graphics are available since H-World 0.1.3. H-World 0.1.6 also features user-defined recolorable images and user-defined image overlays for the player character.

Configuring new item/monster graphics

At startup the H-World engine reads the file ./data/custom/things.sects

There you can configure your own items and monsters. I.e. to configure a new monster you need to add a description section there, and supply the monster gfx as PNG file. The PNG file must go in the data/custom directory, too.

Example: New monster "Grass Bug"

The config section:

begin section grass_bug
name = scale
ident = grass bug
alive = true
image = ./data/custom/grass_bug.png
width = 3
height = 2
image.inventory = -1
love = 0
hate = 8
fear = 8
type = body
vital = true
HPmax = 10
HPcurr = 10
cp = 15
bp = 30
hitchance = 100
direction = 0
attacks = 1
attack[0].name = Pinch
attack[0].verb = pinch
attack[0].delay = 6
attack[0].pierce = 50
attack[0].damages = 2
attack[0].damage[0].type = cut
attack[0].damage[0].damage = %1d2
attack[0].damage[1].type = blunt
attack[0].damage[1].damage = %1d1
end section

The important line is this one:
image = ./data/custom/grass_bug.png

It defines which image to load. The image must be a 128x128 pixel sized PNG file. (H-World 1.1.5 and older used 64x64 pixel images.) H-World uses chroma keying. The transparency color is RGB:128,128,136 (hex: 80,80,88). Transparency information from the PNG header is ignored.

grass_bug.png

That's all you need to do. For more information about item/monster configuration see: Item configuration

The H-World/The Jungle downlaod contain this example and some more, so you can start experimenting by modifying the supllied examples which is probably easier than working from scratch.

Example: Item "Torso Plate"

The config section:

begin section torso_plate
name = Torso plate
ident = Torso plate
type = torso_plate
width = 5
height = 5
weight = 10000
bulk = 5
value = 2000
Bprotection = 40
Cprotection = 40
HPmax = 900
HPcurr = 900
image = ./data/custom/torso_plate.png
image.inventory = ./data/custom/torso_plate_inv.png
overlay.hum_f = ./data/custom/torso_plate_ovl_f.png
overlay.hum_m = ./data/custom/torso_plate_ovl_m.png
throw.cut = %1d1
throw.blunt = %1d5
throw.pierce = 0
desc = Iron makes wimps to heroes
end section

A wearable item needs at least three or four images:

If the overlays for female/male characters do not differ you can use the same image for both properties:

overlay.hum_f = ./data/custom/overlay.png
overlay.hum_m = ./data/custom/overlay.png

In case of the torso plate these are the four images (H-World 1.1.6 and newer use 128x128 pixel images):

torso_plate.png torso_plate_inv.png torso_plate_ovl_f.png torso_plate_ovl_m.png

Recolorable items

The graphics subsystem used in the H-World CRPG engine can recolor items on the fly. This feature uses chroma keying. There are 8 distinct shades of a blueish color that will be recognized as colors to be replaced:

Chroma keys for recoloring

There are 15 replacement color sets. They are defined as RGB triplets in ./data/colorshades.pal. This is a text file that can be edited with a text editor. The first line is the total number of colors defined in this file. Then following in groups of 8 lines, the color sets are defined. The first set cannot be used due to some restructions of the graphics engine. The following 15 sets are used by the engine. The entries 128 to 255 are unused currently. Colors are specified as RGB triplets, the value range for each color component is 0..255. The numbers are given in decimal notation.

You can use the recoloring feature in two ways:

  1. Using the item property kind you can select one of the 15 replacement color sets.
  2. Using the item property flavor you can select a random one of the 15 replacement color sets. The H-World engine shuffles the sets for each new game, so the player will not be able to tell the item type from the color without identifiying it first.

see: ./data/potions.sects for examples how to use kind and flavor properties.

Because items and monsters are actually the same data structure in H-World, the recoloring feature works with both equally well.

Example: Item "Potion"

You can use this example to derive the colors for your own recolorable items.

potion.png potion_inv.png

In the game the potions might look like this (recolored potions among other items from a traders offer):

Recolored potions
from inventory.
All available
color shades
Hansjörg Malthaner
Last modified: 13-May-2003