Animated textures

The animations are stored in the VANM chunks inside SET.BAS files. They are found in the same EMBD container chunk as SKLT and VBMP chunks.

Animations can be mapped directly onto polygons in the OTL2 chunks.

General structure

An animation file defines the VBMP bitmap files/chunks from which the graphics are loaded, the regions inside the bitmap files where the graphics are picked, and the sequence in which these are displayed.

FORM VANM and DATA chunk identifiers
bitmap class ID (ilbm.class)
bitmap file names
polygon coordinates  (file + polygon set = frame, these are not directly related to SKLT polygons)
frame sequence

The structure is easiest to understand via the following examples.

Examples

This is LICHT2 which displays the “akku <46>” animation that can be seen in some buildings:

46 4F 52 4D     ;FORM
00 00 00 50     ;<length>
56 41 4E 4D     ;VANM
44 41 54 41     ;DATA
00 00 00 43     ;<length>

00 0B    ;<length of class identifier>
69 6C 62 6D 2E 63 6C 61 73 73    ;ilbm.class
00    ;terminator

00 0C    ;<length of filename>
43 49 54 59 31 2E 49 4C 42 4D    ;CITY1.ILBM
00 00    ;terminator/pad

00 0A    ;number of short integers (2 bytes) to read to get all polygons

00 04    ;vertices per polygon (this is a square)
FF 01 FF 26 F0 26 F0 01    ;(x, y) coordinate pairs (one byte per coordinate) define a region in the bitmap files

00 04   
FF 26 FF 4B F0 4B F0 26   ;as above


00 02    ;number of frames in the animation

00 00 00 C8    ;time to show this frame in milliseconds
00 00    ;file where the frame is picked from - 0 is the first file
00 00    ;polygon of the frame - 0 is the first polygon

00 00 00 C8    ;as above
00 00   ;file
00 01   ;polygon - 1 is the second polygon

00    ;pad byte (length of DATA chunk is usually odd)


The second example is FHUBI.ANM that displays a helicopter firing animation. It picks the graphics from two bitmap files.

46 4F 52 4D    ;FORM
00 00 00 4E    ;<length>
56 41 4E 4D    ;VANM
44 41 54 41    ;DATA
00 00 00 41    ;<length>

00 0B    ;<length of class identifier>
69 6C 62 6D 2E 63 6C 61 73 73    ;ilbm.class
00    ;terminator
00 16    ;<length of filenames>
46 48 55 42 49 2E 49 4C 42 4D    ;FHUBI.ILBM
00    ;separator
48 55 42 49 2E 49 4C 42 4D    ;HUBI.ILBM
00 00    ;terminator/pad

00 04    ;number of short integers to read to get all polygons

00 03    ;number of vertices (this is a triangle)
58 50 73 6A 58 83    ;(x, y) pairs

00 02    ;number of frames in the animation

00 00 00 28    ;time to display this frame
00 00    ;file -> FHUBI.ILBM is the first file
00 00    ;polygon

00 00 00 28    ;time
00 01    ;file -> HUBI.ILBM is the second file
00 00    ;same polygon as previously, same coordinates

00    ;pad/terminator


Editing tools

Currently, there are no graphical tools to edit the animations so hex editors must be used. Recommended editors for Windows include Frhed and HxD.

modding/vanm_file.txt · Last modified: 2016/01/20 07:51 by ormu
Back to top
CC Attribution-Noncommercial-Share Alike 4.0 International
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0