Class WallBlock
- Namespace
- LlamaLogic.Architecture
- Assembly
- LlamaLogic.Architecture.dll
Represents a block: a room, platform, wall line, fence line, pool or fountain, as loops of segments on one level, with the catalog products along them
public sealed class WallBlock
- Inheritance
-
WallBlock
- Inherited Members
Remarks
This is the game's WallInfo, which WallBlocksSection and PlexesSection both store; the layout follows the game's reader and writer. Versions 17 through 36 are supported, and the game writes version 36. The game reads versions 18 through 36; in the lots examined, version 17 appears only where the LotSizeSection is version 2, and its layout is the game's layout for version 18 plus Unknown1. The lots examined hold versions 17, 22, 29, 31, 32, 33, 35 and 36; the layouts of the other versions follow the game's reader.
Layout, with version gates: Version (ushort), Id, Level, Unknown1 (17), BlockType (after 24), PlexId (after 35), HasFloor, Unknown3 (after 27), BaseElevation, FloorHeightOffset (after 33), Unknown4 (31 and 32), then before 27: Unknown5, Unknown6 (before 22), LegacyKeys (type, group, instance), Unknown7, Unknown8; then a ushort loop count (after 23; one loop before), the Loops, Unknown9 (before 19), Products (after 19), LegacyStamp (12 through 25), and before 27 Unknown10, Unknown11 and Unknown12.
Each segment stores these product slots: none before version 20 (the game takes all from LegacyKeys), slots 0 through 3 in versions 20 through 26 (the game takes slots 4 through 8 from LegacyKeys), 0 through 6 in versions 27 and 28, 0 through 7 in versions 29 and 32 through 34, and all nine in versions 30, 31, 35 and 36.
Properties
BaseElevation
Gets/sets the elevation of the block's base, in meters
public float BaseElevation { get; set; }
Property Value
Remarks
The game sets it to the elevation of Level plus the lot's offset; adding a foundation raised it by 0.25 (in-game test). It is −0.375 or −0.125 for fountains in the lots examined, and it was −3 for a new pool (in-game test).
BlockType
Gets/sets the type of the block
public WallBlockType BlockType { get; set; }
Property Value
Remarks
Stored from version 25 on; the game treats older blocks as Standard.
FloorHeightOffset
Gets/sets the offset of the floor from BaseElevation, in meters
public float FloorHeightOffset { get; set; }
Property Value
Remarks
The game checks it with FloorHeightOffsetOutOfBounds before setting it and takes the block's bottom as the lower of BaseElevation and BaseElevation plus this offset. Raising a room's floor one step changed it from 0 to 0.25, and a platform had 0.25 when drawn and 0.5 after one raise (in-game tests); the game stores a platform as a block like a room, so a raised room floor and a platform differ in the data only by their segments, which are Open where a platform has no walls. Stored from version 34 on.
HasFloor
Gets/sets whether the block has a floor
public bool HasFloor { get; set; }
Property Value
Remarks
Deleting the entire floor of a room changed only this value of the room's block, from true to false (in-game test). The game keeps it at offset 0x80 of the block, sets it to whether the level is at most 0 when it copies blocks into a plex and needs it for FloorHeightOffset. In the lots examined it is 1 for every pool and fountain block, for 36,076 of the 51,425 Standard blocks and for 5,271 of the 11,629 Fence blocks.
Id
Gets/sets the id of the block
public ushort Id { get; set; }
Property Value
Remarks
The game keys its blocks by this id and drops a block whose id is 0. The game renumbers the blocks when it saves: the same rooms had different ids from one save to the next (in-game test).
LegacyKeys
Gets the catalog keys that versions before 27 store for the whole block
public Collection<ResourceKey> LegacyKeys { get; }
Property Value
Remarks
Versions before 21 store 15 keys, versions 21 through 26 store 9. Of 15, the game uses positions 1, 2 and 5 for slots 0, 1 and 2, positions 3 and 4 for slot 7 (the later one wins), position 8 for slot 3 and positions 12 through 14 for slots 4 through 6; of 9, it uses positions 6 through 8 for slots 4 through 6. It reads the other positions as four uint values and discards them; in the lots examined they hold floor, window set and object catalog keys or the null key.
LegacyStamp
Gets/sets the value versions 12 through 25 store once for the whole block in place of each segment's FenceStamp and CeilingRailStamp
public uint LegacyStamp { get; set; }
Property Value
Remarks
The game copies it into both values of every segment.
Level
Gets/sets the lot level of the block
public sbyte Level { get; set; }
Property Value
Remarks
The game restricts the level by BlockType and takes the block's level height from it.
Loops
Gets the loops of the block
public Collection<WallBlockLoop> Loops { get; }
Property Value
Remarks
Versions before 24 hold exactly one loop. 1 through 12 in the lots examined.
PlexId
Gets/sets the id of the plex (unit) the block belongs to
public ushort PlexId { get; set; }
Property Value
Remarks
The game's plex manager sets it; 300 is the shared plex. The values match the ids of the PlexesSection plexes. Stored from version 36 on.
Products
Gets the table of the catalog products the segments refer to
public ProductTable Products { get; }
Property Value
Remarks
Stored from version 20 on.
Unknown1
Gets/sets a byte version 17 stores after Level
public byte Unknown1 { get; set; }
Property Value
Remarks
It equals Level in every lot examined. The game's reader has no such byte.
Unknown10
Gets/sets a ushort versions before 27 store at the end of the block
public ushort Unknown10 { get; set; }
Property Value
Remarks
The game reads it and discards it. 4 in every lot examined.
Unknown11
Gets/sets a byte versions before 27 store after Unknown10
public byte Unknown11 { get; set; }
Property Value
Remarks
The game reads it and discards it. 1 in every lot examined.
Unknown12
Gets/sets a byte versions before 27 store after Unknown11
public byte Unknown12 { get; set; }
Property Value
Remarks
The game reads it and discards it. 1 in every lot examined.
Unknown3
Gets/sets a Boolean the game keeps at offset 0x81 of the block
public bool Unknown3 { get; set; }
Property Value
Remarks
Hypothesis: whether the block has an automatic ceiling. The game sets it to whether every outer segment has a wall or the level is below 0, and clears it when it copies blocks into a plex. In the lots examined it is 0 for every Fence block, 1 for every fountain block, 1 for 466 of the 482 pool blocks and for 22,161 of the 51,182 Standard blocks that store it. In in-game tests a new fence block and a platform had 0 and enclosed rooms had 1, which is consistent with the hypothesis. Stored from version 28 on.
Unknown4
Gets/sets a byte versions 31 and 32 store after BaseElevation
public byte Unknown4 { get; set; }
Property Value
Remarks
The game reads it and discards it. 0 in every version 31 block examined.
Unknown5
Gets/sets a byte versions before 27 store before LegacyKeys
public byte Unknown5 { get; set; }
Property Value
Remarks
The game reads it and discards it. 2 in every lot examined.
Unknown6
Gets/sets a byte versions before 22 store before LegacyKeys
public byte Unknown6 { get; set; }
Property Value
Remarks
The game reads it and discards it. 0 or 2 in the lots examined.
Unknown7
Gets/sets the first of two Booleans versions before 27 store after LegacyKeys
public bool Unknown7 { get; set; }
Property Value
Remarks
The game reads it as a Boolean and discards it.
Unknown8
Gets/sets the second of two Booleans versions before 27 store after LegacyKeys
public bool Unknown8 { get; set; }
Property Value
Remarks
The game reads it as a Boolean and discards it.
Unknown9
Gets/sets a byte versions before 19 store after the Loops
public byte Unknown9 { get; set; }
Property Value
Remarks
The game's reader would discard it. 0 through 3 in the lots examined.
Version
Gets/sets the version of the block, which decides its layout
public ushort Version { get; set; }
Property Value
Remarks
Encoding throws an InvalidOperationException when a field the version lacks holds a value other than its default, or a collection the version lacks is not empty.
Exceptions
- ArgumentOutOfRangeException
The version is not 17 through 36