Asset creation notes - gemrb/gemrb Wiki

Adding new strings (text) to the game

Strings are in dialog.tlk, indexed by their reference number (strref, string ref).

It's easiest to do it with NearInfinity or WeiDU (instructions). If you want to do it via NearInfinity:

Quick dump of all strings

weidu --game demo/ --traify-tlk

This plaintext format can also be converted back to a TLK, see weidu --help.

New animation limitations

Until #1099 is implemented, all frames in any animation share the same 256 colour palette and support a single transparency. If you try to import a rich non-indexed image in NearInfinity to convert it to a BAM, make sure to check the preview, since it will make any palette problems completely obvious.

NearInfinity

If you want to use it to explore or modify data, you can open files one by one while having any other game open.

If you want the full experience install Near Infinity v2.2-20210501 or later.

Area creation

DLTCEP has the most comprehensive capabilities. You can open files one by one to work on them, however, if you want to add polygons or use any previews, you'll have to copy the area file and its TIS file to the host game data folder. You can't add travel regions, traps, infopoints or work on the searchmap otherwise.

New dialog

Easiest to write in the plaintext D format that all mods use and then converted to DLG via weidu, eg.:

weidu --game demo/ riddler.d
mv -v riddler.dlg demo/data

New colors for clown-colored actors

Add new entries to pal16.bmp and use their row index in the creature's CRE file. For pcs, one can do it through python via GemRB.SetPlayerStat and stats like IE_MAJOR_COLOR.

The gradients are used together with the area lightmap, so when you're in a shade, a darker color is displayed. Therefore they should be simple, two-color based, with varying luminosity.

Specific image notes

  1. Inventory items. While PNG is supported for them, if you want a larger icon while dragging the item around the inventory, make a BAM. The first frame should be the normal icon, the second frame the bigger dragging one. To make the interaction more natural, make sure to set the center coordinates of the second frame to the image center. That way the image won't jump when you start dragging.

  2. When an actor drops an item to the ground (deliberately or by dying), a loot pile container is created on the map. In the ITM, you can specify what image to use for it. Use a BAM image! The engine uses the shadow color (second color in the palette) to distinguish drawing the pile normally and while hovering over it with the mouse (typically with an outline). So draw the image, add an outline, make sure the image looks good without it, generate the BAM and make sure the outline color is at the shadow color index.

Adding entries to chitin.key

Usually not needed, but helps with area editing in NI to have the ARE/WED/TIS inside. The process is not scripted, I don't know of any tools, so the first time it was done manually with a hex editor. See https://gibberlings3.github.io/iesdp/file_formats/ie_formats/key_v1.htm#keyv1_ResIndices and gemrb/includes/SClassID.h for the resource types.

To fix this it's probably easiest to extend iesh, since it can already read and write KEY files. It just needs a method or two to add new entries: https://github.com/gemrb/iesh/blob/master/infinity/formats/key.py

GemRB demo specific notes

Add any optional big files to the gemrb-assets repo instead, then to cmake/fetch-demo-data.cmake. They will get installed into release builds, while if you want to enjoy them locally, build the fetch-demo-data target (eg. make fetch-demo-data).

Misc

Reduce the sizes of imported pngs significantly with https://tinypng.com/!

See also https://github.com/gemrb/gemrb/wiki/Production-workflow-for-sprite-creation