Animation

In order for houses and vehicles to move, the bitmaps are cleverly assembled from the file op2_art.BMP.

Published on 06/10/2018, updated on 06/10/2018

ADR x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF
0000 0000 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx
Number of animations Data type: uint32
How many animation records are available
Number of frames Data type: uint32
How many frames should be present in total
Number of subframes Data type: uint32
How many subframes should be present in total
Number of optional entries Data type: uint32
How many "optional entries" there are.

Now we come to the premier class of disciplines within Outpost 2 data formats: The animations.

The animation lists are introduced with a global header, which is primarily used for data verification. This is followed by the concrete animation definitions, which are divided into 3 steps:

  1. Animation
    An animation is the topmost instance; it represents an animation of a unit, a building or a 'particle animation' (comet beat, weather, explosion) in a certain starting position.
  2. Frame
    A frame is a single image within an animation. An animation can contain one or more frames.
  3. Subframe
    A subframe is the information that a certain bitmap is to be drawn under certain criteria at a certain position of a frame. A frame can contain one or more subframes.

Then the individual animation definitions follow directly.

Animation

ADR x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF
0000 0000 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx
0000 0010 xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx
0000 0020 xx xx xx xx Frame data - flexible length
0000 0030 xx xx xx xx Window data - 16 bytes per window
Unknown 1 Data type: uint32
Unknown information
Bounding Box: Left Data type: uint32
Specifies the left start (in pixels) of the bounding box.
Bounding Box: Top Data type: uint32
Specifies the top beginning (in pixels) of the bounding box.
Bounding Box: Width Data type: uint32
Specifies the width (in pixels) of the bounding box.
Bounding Box: Height Data type: uint32
Specifies the height (in pixels) of the bounding box.
Offset: X Data type: uint32
Specifies the horizontal center of the animation.
Offset: Y Data type: uint32
Specifies the vertical center of the animation.
Unknown 2 Data type: uint32
Unknown information
Number of frames Data type: uint32
Specifies how many animation frames are included in this animation.
Number Windows Data type: uint32
Specifies how many windows are to be used when drawing.

The data of the top layer, the animation, are primarily administrative data - the bounding box indicates the coordinates of the marking around the vehicle/building, if the same is selected, and at the same time indicates which area should be clickable.

The offset primarily determines the "zero point"; the point to be calculated or subtracted to internal coordinates of the game. One could also say more mathematically: the offset here refers to the origin of the coordinates.

The Windows values, just like the offset, are 4 uint32 values (per window), specifying a range that is considered usable for individual subframes. Outside of Windows, drawing is not allowed, as long as it is intended for the bitmap.

Frame

ADR x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF
0000 0000 xx xx [xx] [xx] [xx] [xx] Subframe data - flexible length
Subframe number and toggle for optional 1.2 Data type: uint8
This value contains
  • 0x7F: The number of subframes that are used in this frame.
  • 0x80: The information whether optional 1 and 2 are available.
Unknown1 and Toggle for Optional 3.4 Data type: uint8
This value contains
  • 0x7F: Unknown - I strongly suspect that this is the number of gameticks that elapse before the next frame is displayed
  • 0x80: The information whether optional 3 and 4 are available.
Optional 1 Data type: uint8
Unknown
Optional 2 Data type: uint8
Unknown
Optional 3 Data type: uint8
Unknown
Optional 4 Data type: uint8
Unknown

Subframe

ADR x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF
0000 0000 xx xx xx xx xx xx xx xx  
Bitmap-Id Data type: uint16
Specifies which bitmap to use for this subframe.
Unknown1 Data type: uint8
Is unknown - but I strongly suspect that this is a render priority (Z-layer).
Subframe-Id Data type: uint8
Specifies which subframe we are in.
Offset - Horizontal Data type: sint16
Attention: Note sign
Specifies where the subframe is to be placed within the frame or by how many pixels the bitmap is to be shifted horizontally.
Offset - Vertikal Data type: sint16
Attention: Note sign
Specifies where the subframe is to be placed within the frame or by how many pixels the bitmap is to be shifted vertically.

Now we can assemble single frames as well as complete animations accordingly, here demonstrated exemplarily with a more complex animation:

Animation 500

Animation 500 shows how a Plymouth transporter loaded with ordinary ore is unloaded. This is one of the few animations that uses the windowing functionality.

And so the complete animation can be put together.
Unfortunately, there is still a problem with the upper loading hatch, because the corresponding bit in the graphic type information is not set here:

In conclusion, it can be said that reverse engineering was a lot of fun, even though it has not yet been completed.
Here are a few more beautifully animated sprites from the game - for more I recommend to develop a viewer based on this documentation and buy the game, because e.g. on eBay you can still buy it for little money without any problems. Of course I can only recommend to play the game myself, because it offers interesting game mechanics.

comments

add a comment

Your comment may not be displayed immediately and will be moderated for spam prevention reasons.