Asset creation notes - gemrb/gemrb GitHub 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:
- Open the demo as a bg2 game
- Main menu: Edit -> String Table
- Add
- Input desired text and don't forget to set at least the flag bit "Has text"
- Save and note the strref
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 was implemented, all frames in any animation shared the same 256 colour palette and supported a single transparency. Just like the assets in the original games. Now that PVRZ based formats are supported, make sure you choose them, eg. a BAMv2 when importing through NearInfinity.
Higher animation rendering speed (FPS)
The default animation speed was hardcoded in the originals, with most animations defaulting to 15 FPS. You can change that in GemRB per-animation file, by creating or modifying animfps.2da
. An example is included with the demo: demo/override/animfps.2da
.
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.
- SimDing0's guide for area creation: http://www.simpilot.net/~sc/dltcep/areamaking/main.htm
- A newer guide is available here: https://www.gibberlings3.net/forums/topic/38344-area-creation-an-overview/
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 fonts
GemRB supports the TTF format, but depending on your use case, it still has some problems we don't expect to go away until we switch to using SDL_ttf. In the interim you can emulate the originals by creating BAMv1 fonts. Shekn provided instructions for best results on a light background:
Render each letter in black on a pure white background. With AA, some pixels are neither black nor white, but something in between. Next, I made each pixel of the letter image that is pure white a transparent pixel (set alpha=0). All other are graduation between black to white. Finally, save it as a png, load it into Nearinfinity and save all the glyphs as a bamV1 file. As a result the engine does a nice background blending and colouring of the font.
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
-
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.
-
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
It used to not be needed, but NI now requires an up to date chitin.key. Regenerate it whenever you add or
remove a file with the bundled updater: python tools/demo_key_file.py demo
.
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