PUNI
Which unit types each player may build. For every player and unit type there is an answer of its own and a flag saying whether to use the default answer instead, and one default answer per unit type. Only Use Map Settings reads it; melee lets everyone build everything.
| Name | PUNI (50 55 4E 49) |
|---|---|
| Size | 5700 bytes. |
| Read by | The game, at the start of a Use Map Settings game. Melee and the other game types never read it. |
| Required | For Use Map Settings. Without it a Use Map Settings game stops at the start with Error loading scenario file. Melee and the other game types play without it. |
| The game accepts | Exactly 5700 bytes. Any other length refuses the map. |
| More than one copy | The last copy replaces the others. Every copy must still be the right size, or the map is refused. |
| In scmJS | Read, and written again when you change what it holds. |
Layout:
| Offset | Type | Holds |
|---|---|---|
| 0 | u8 × 2736 | Per player, per unit type: 1 if the player can build it. Player 1's 228 bytes first |
| 2736 | u8 × 228 | Per unit type: 1 if it can be built, for every player that uses the default |
| 2964 | u8 × 2736 | Per player, per unit type: 0 to use this player's own byte above; anything else for the default |
Example#
The answer for a player and a unit type is the player's own byte, unless the player's
uses the default byte is anything but 0, in which case it is the unit type's default.
The byte for Player p and unit type u is at p × 228 + u in each of the two per-player
tables. The same three tables, in the same order, make up UPGR,
PTEC, PUPx and PTEx.
Here Carriers (unit type 72) are allowed by default, every player takes the default except Player 3, and Player 3's own byte says no:
72 00 Player 1, Carrier: may not build it, but see below
528 00 Player 3, Carrier: may not build it
2808 01 the default for Carriers: may build them
3036 01 Player 1 uses the default, so may build them
3492 00 Player 3 does not, so may not
Player 1's own byte also says no, but it is never read, because Player 1 takes the default.