Paths#
The player-facing path builder (PATH-I), traced in PATH-plan. Everything below without a PATH-NNN tag is traced from the Feral Mac binary; the BIN labels sit at the code sites.
Data: one cell map#
ParkCellMap (World, CPU-only) is the source of truth for path (type 1) and queue (type 3) cells: type byte, flags (NoModify 0x20, Unowned 0x40), the same-type placement counter, the cardinal links 1/4/16/64 (−Y, +X, +Y, −X) and the queue link. GuestPathGrid is a view over it: a cell is walkable when its type is path, and its links are the map's links. The cached flow fields follow ParkCellMap.Version, so a write through the builder, the grid or the map is seen by guests at once.
ParkCellMap.FromOriginal(map, save) loads the Easymode save's path cells with their saved links, else MAP InitialPath cells linked in every direction. MAP InitialPath path cells get NoModify. Object footprints stay in ParkObjects and are checked through a callback rather than copied into the map. The map is in the canonical hash (WorldStateHash schema 5).
Rules#
Per cell, in this order (ParkPathBuilder.Validate):
inside the map and the build grid, else
OutsideTerrain;Unownedrefuses (NotOwned);CanChangeCellType(empty, path, or queue under its own rules), elseOccupied;path over path is
Existing: free, the placement counter goes up;path over a queue cell is refused (
QueueCell), except over a queue end: a queue cell with one link bit, toward another queue cell (the unconnected back of a queue; tp.exe's code 8,0x535D06), which the write turns into a path cell charged as one; it keeps its link to the queue, so the queue's new back is connected to it, and the ride's queue is recomputed with the next map edit;objects, fixed items and the sandbox Totem refuse (
Occupied);the terrain rule must allow the cell: the map start's cell type, so holes are refused and
Blockedground is not (tp.exe's validator0x535670never reads the MAP byte); the save's own path cells count as buildable (Terrain);money: balance − cost ≥ 0 (
NotEnoughMoney); the preview tests the pending line cost.
Writing a cell stores the type and spends Costs.PathCell (20 in Standard.sam) as other costs (tp.exe 0x534879: Spend adds it to the total costs, shown as total costs minus staff costs). There is no batch purchase. A played park always pays: the original's debit skips only while the layout replay of a visited online park runs (bank mWithdrawalsEnabled, tp.exe 0x404140), and only a builder without a park economy is free here. A refused cell stops the line; earlier cells stay built and charged.
The commit then runs its link pass, as the original does (tp.exe 0x52744E): every cell of the line goes through the link writer (PathLinkWriter, tp.exe 0x5348D0 mode 1), which ORs bits into the link byte (map cell +0x0C): each cardinal path neighbour on both sides, a type-10 or type-9 neighbour by its queue link, the diagonal bits 2, 8, 0x20 and 0x80 toward diagonal path cells whose two sides are paths (and on a neighbour toward this cell's side neighbours, unless the corner beyond is a queue), and no link to a queue cell; a link to a queue cell clears the two diagonals beside it. A queue cell under the writer becomes a path cell and keeps its links. A queue neighbour that links back is refreshed and plays cat_ui 139.
The area clear tool (AreaClearTool, tp.exe tool mode 0x3a: the buy window's Clear Land row and the Clear key, Delete by default) takes two clicks: the first stores a corner, the second clears the rectangle and ends the tool (tp.exe 0x525da3). Row by row, each object cell met (type 4, 9 or 10) starts four scans along the cells of the same owner word (cell +0x10, ParkCellMap.OwnerAt) and of an object type; the object is demolished when the runs end inside the rectangle and none of the scanned cells (the first cell past each run included) has the cell flag 0x10; then every path cell in the rectangle is removed. Queue cells stay (tp.exe 0x52bdd0). The owner word of an object's cells is the cell word (y × 128 + x + 1) of its anchor, written by the placement (0x528A70, 0x539210); Easymode's saved cells carry exactly these words (mParentID, tested on every cell of the Jungle park's footprints). The flag 0x10 is written only by the placement's + and # footprint cells, the track add-ons (ParkCellMap.WriteFootprint). APPROX:PATH-005 (the missing owner word and the untraced writer of the flag) is retired. A park whose objects do not type their cells (a read-only visit) clears by the object standing on each cell. The developer panel's one-click remove tool (an object, else a queue cell, else a path cell) is [EXT:dev-one-click-remove]: it is OpenTPW's and has no original counterpart. Removal is ClearCell's forced path case (tp.exe 0x52c11f): every bit of the cell's link byte, diagonals included, is cleared on both sides (tp.exe 0x5367A0), no refund. A NoModify cell that still has linked neighbours stays; without neighbours the flag is dropped and the cell is removed. The one exception is [EXT:removable-access-cells]: the cells a placement lays outside an entrance or exit (the queue front and the path stubs, all NoModify) can be removed by the path and queue removal tools, which the original's cell clear keeps (0x5367D4). The map start's initial path stays fixed. The ride's entrance and exit then resolve to the nearest walkable path as for a ride nothing laid cells for, the guests standing on the emptied cells are set down (queued guests leave the queue, QUEUE-015), a queue or path can be laid on the cell again, and demolishing the ride clears what is left. The entrance and exit stay where they resolved until a removal like this one takes a cell they use; a path laid nearer later moves neither, and nor does removing the plain path cell an entrance fell back to. A save keeps them as they stand, so a load (and a shared park's join) puts them back there before it finds the queues from them, instead of resolving them on the loaded grid; a save from before keeps the cells the load resolves. Backspace over a path cell with no tool on uses the counted case (tp.exe 0x40BE8B, ClearCell(0, 1)): the cell loses one placement and goes only when it was laid once (ParkPathBuilder.RemoveOnce). The original's key does nothing over a queue cell (it backtracks only a type-1 cell, tp.exe 0x40BE3C); OpenTPW also removes a queue there, from the cell under the cursor to the queue's back with the remove tool's refund ([EXT:queue-backtrack]). A queue cell that no ride's queue reaches (a stray piece, such as one an older save left) goes alone there and with the remove tool, refunding nothing, as the original's ClearCell clears one queue cell (tp.exe 0x5367A0). With the pools extension on, Backspace with no tool on also removes a pool bridge, or one pool water cell, under the cursor ([EXT:pools-bridges], [EXT:pools-tool], docs/POOLS.md "Removing with Backspace"). That is OpenTPW's: the original has no pools, and its key does nothing over such a cell. A bridge wins over the water under it, and over a path laid on one of its approach cells before the bridge: the first press takes the bridge, the next one the path.
Tool#
CellBuildTool is shared by the path tool (mode 1) and the queue tool (mode 3). SnapEnd keeps the dominant axis (a tie keeps X); LayLine walks one axis and ignores the other end coordinate. A hover previews the snapped line (the ghost, no writes), drawn as the original's blue blueprint markers with the refused cell in red (blueprint markers); a click pushes the end onto the 1024-entry vertex stack and commits the line. A click whose ghost has a refused cell ends the tool and lays nothing (tp.exe 0x524a63). A click back on the start ends the tool; once a line exists it lays nothing, as in the original. The tool also ends when the commit reaches a last cell that already was a path or queue cell, the ride's own queue included (tp.exe end flag 0x5345ad, read by the pass 0x81 at 0x527517); otherwise the snapped end is the next start. Backspace takes back the last segment without a refund, as the original's Back (tp.exe 0x52fe50) does: each cell of that segment loses one placement count and goes when it falls below zero. Right click, Escape and Back cancel. Escape or Back inside the tool only ends the tool; the next one opens the pause menu (tp.exe key dispatch 0x488921, Escape row 0x40c180). While the pause menu is open the tool takes no clicks; the click handler does not itself test the speed flag. The separate P-window input owner has ordinary-WM pointer routing and takes the camera's input too while it is up (PATH-017, narrowed).
In the park view the hover help is 441 over an empty owned cell, 442 over a path and 444 over a queue; inside the tools it is 443 and 445. A left press on a queue cell (444, "Left-click to edit this queue") chooses the HasQueue ride that owns it (tool 0x14, 0x4879d0); the release starts the queue tool for it at that queue's back cell, wherever the pointer is then ([EXT:queue-click-at-back-cell], an OpenTPW design choice; the original's first click enters tool 0x14, QUEUE-021). A left press on an empty owned cell or a path cell enters the path tool without a start (tp.exe 0x4879d0, SetMode(1) 0x52f200; there is no menu button), and the release of that click is the tool's first click, at the cell under the pointer then (every line click of the tool object is the release handler's, 0x524960; a press moved to another cell before it lets go clicks that other cell): a refused single-cell ghost ends the tool again (with the refused click's sound), otherwise the start check (0x535670(1, 0)) makes the cell the start, or leaves the tool on without one when it refuses the cell; a later click without a start does the same. The second click of a line commits at its release too, never at its press (docs/UI.md, "The park view's pointer"). After a HasQueue ride is placed, the queue tool starts at the entrance's outside cell and lays QUEUE-I's queue cells through the same tool. The remove tool clears an object, else a queue cell, else a path cell. Built path and queue cells are drawn as described in Path textures.
Path textures#
Each theme's texture table (Jungle.tct etc., in terrain.wad) lists 22 PathTex entries. Entries 0–15 are the path shapes (14 repeats 13), 19 and 20 are second versions of the straight (2) and the edge (10), and 16–18 and 21 name tool markers (baseblue, grnarrow, redarrow, dark) that no archive ships; the original draws its build ghosts from Data/generic/dynamic/textures instead (blueprint markers). A path is not a layer over the ground (issue 829, package F9): see Path cells are terrain cells.
The save stores each path cell's choice (docs/TPWS-PAYLOAD.md): byte +17 is the PathTex index and the u16 at +21 is a clockwise turn in degrees. Both follow from the neighbour bits at +8 (0x01 −Y, 0x02 +X−Y, 0x04 +X, 0x08 +X+Y, 0x10 +Y, 0x20 −X+Y, 0x40 −X, 0x80 −X−Y) by one rule:
A diagonal counts only when both sides next to it are set. That leaves 15 shapes up to rotation, one per texture:
squ(no neighbour),end,str,cnr2(a corner),cnr1(a corner with its diagonal),tju1(a T),tju3andtju4(a T with one diagonal, mirrored),edg(a T with both diagonals: the edge of a wide path),xrd1(a crossing),xrd2(one diagonal),tju2(two diagonals on one side),icn2(two opposite diagonals),icn1(three) andctr(all eight).The turn is the quarter turn (−Y to +X) that brings the texture's base shape onto the cell's mask; symmetric shapes use the smallest turn.
The textures have +X to the right and +Y in the top row.
All 78 path cells of the Easymode save match this rule (PathTilesTests): every shape and turn. Which of the two straights or edges a cell has is the original's own choice and is not predicted. That includes cells whose extra diagonal bits the rule ignores (0x13, 0x53, 0x93, 0x9F, 0xF9). The PC original's tile chooser is tp.exe 0x535dd0 (49-row path table at 0x763138, 11-row queue table at 0x7630b0, called from the tile refresh 0x5365d0); OpenTPW's rule is still derived from the data.
OriginalTerrain draws a cell with the saved texture and turn when it was a path in the save and still has the same path neighbours. The saved bits also count ride entrances, which the cell map does not keep. Other path cells, such as built ones or the neighbours of built ones, follow the rule from their path neighbours. For straights and edges the original's chooser (tp.exe 0x535dd0) takes the second version when the roll its previous call stored is set, and every call stores a new rand() & 1 (0x53602c): each recomputation of a cell's tile (the refresh 0x5365d0: the world's set-up pass, the link writer's refreshes and the commit's refresh pass over the line) re-rolls. PathTileVariants keeps that rule with its own CRT-formula generator, a presentation stub: the original's is seeded from the clock and shared by the whole game. Queue cells get no path tile: the chooser gives a queue cell a class-2 result from its link byte (+0x0C, the 11-row table 0x7630b0: a dead end, a straight, a bend, turned by the row; a straight turns half way round unless its queue link is +X or +Y, a bend takes the other bend for some queue links, and a cell linked to a path that links back takes the end piece: queend, quebin1, quebin2), and the refresh places that model of the theme's queue archive on the cell (quedead, questra, quebnd1, quebnd2, queend, quebin1, quebin2; tp.exe 0x522900, 0x5229e0) at the yaw 360 minus the row's rotation, as a one-cell object would be placed (QueueModels). The models are baked into static batches of their own, each vertex draped onto the landscape as tp.exe does it (Queue models on the terrain), so the plank floor lies on the ground (the cell is a hole of the ground mesh) and the posts follow a sloped cell.
Path cells are terrain cells#
(October 26, 2026; issue 829, package F9.) [BIN:TPW-EXE:0x0046DF50 tile word] The tile refresh 0x5365D0 hands the chooser's result (group, tile, angle) to 0x450470 → 0x46DF50, the only writer of path art (0x46DF50 has the one caller 0x450470, whose callers are 0x5365D0 and 0x5366E0, the save restore). For a path cell the writer takes the slot of the tile's row in the theme's texture table (the PathTex list of the .tct), puts it in the high half of the cell's landscape word, clears the turn, mirror and hole bits (& 0xFF87, & 0xFFFE), sets 0x180 (art, dirty) and one turn bit for the angle (90: 0x20, 180: 0x10, 270: 0x08). PathCellWord. The terrain draw has no path layer: [BIN:TPW-EXE:0x0056F670 cell draw] it draws every cell with the texture of its slot, its four corners permuted by the word's turn bits (0x56F4F0, TerrainCellTexture), and nothing tests bit 0x80 there; the permutation is the one the former layer's PathTiles.TextureCoordinates computed (PathCellArtTests).
Procedural textures on. [BIN:TPW-EXE:0x0056F090 cell list] a listed cell whose word has
0x80gets the slot's texture as art; [BIN:TPW-EXE:0x00572440 cache] the cache builds the cell through0x55F780with that art (ProceduralTerrainTexturer.Compose: the base read in the orientation of the word's bits0x78, the art point sampled atwidth / N,base + ((art - base) * alpha >> 8)), and builds a hit again when the recorded word had0x100. The art is the file's image as the composite reads it (ObjectFloorBase.FlipRows). The base is read turned so that the drawn base stays upright while the art turns. The path tile's transparent border (alpha 0) is what shows the grass.ProceduralTerrain.SetCellArtis the writer's side: a changed tile marks the cell, which is built again the next time it is listed.Procedural textures off, outside the procedural rectangle, and in the camera modes that suspend them. The cell is a quad of its own with the path texture and no ground under it (the word replaced the ground's slot), and it draws opaque: [BIN:TPW-EXE:0x0056F753 terrain pass state] the cell draw gives every record the constant state word
0x1256(no blend, no alpha test;0x101256with bit0x2000of[0x8BCBC8]) and never asks0x590C40for the cell texture's own alpha type, so a tile's transparent texels are drawn with their stored colour, which is painted grass in the shipped tiles (alpha 0 texels such as (19, 134, 40) ofjpa_str1). OpenTPW's ground mesh leaves path cells out (OriginalTerrain.GroundSkips) and draws them as static cells without a lift.Restore. [BIN:TPW-EXE:0x0046DF50 word restore] a cleared path cell takes its backup word again with the dirty bit; the ground and, with the textures on, its plain procedural texture return.
Faint seams. The composite samples the art's first texel row and column (
Y * (height / N), never the far edge), and the shipped tiles' edge texels are not all opaque (for examplejpa_str1's first row has alpha 241 to 252, its side columns 0 to 70 for the stone fringe), so a thin line of the base can show at the border of two path cells. It is in the data and in the original's sampling (the composite equals the emulated tp.exe, and the page coordinates are the original's texel centres), not an offset of OpenTPW's.Snow. [EXT:winter-snow-paths] a path cell keeps the slush look under snow; with the textures on the flag is on the cell's whole quad (the procedural mesh), so it covers the painted-grass margin of the tile as well as the path.
Nothing else. The writer is called for path, queue and hole cells only; fences, hoardings and land purchases write no cell art (the land flag
0x400of0x450D10darkens the cell's vertex colour, see Land outside the park).
Land outside the park is darker#
(October 27, 2026.) [BIN:TPW-EXE:0x00450D10 land refresh] The land refresh (called by the level set-up 0x415140, the fence 0x5323F0 and the purchase 0x5327E0) sets bit 0x400 of a heightfield cell's landscape word when the map cell it reads (the column and row clamped to the map, 0x450D3D) has flag 0x40 (unowned) and not 0x80 (the entrance area), and clears it otherwise. [BIN:TPW-EXE:0x0056FB0E terrain colour] The terrain draw (0x56F670) halves the vertex colour of all four corners of such a cell (shr 1, and 0x7F7F7F) for static and procedural cells alike, unless the render flags [0x8BCBC8] have 0x800; [BIN:TPW-EXE:0x0044DC28 lighting option] the LIGHTING option sets 0x1800 when it is 0 and clears it when it is 1, so lighting on dims. UnownedLandDim is the rule, OriginalTerrain.LandFlagsSource reads the live cell flags, so a purchase brightens the bought cells at the next refresh; test.shader does the same arithmetic on a flagged corner's lighting colour (TextureSlotAddressing.LandDimFlag, after the lights, the point lights and the evening ambient, before the texture, snow and fog): each channel is rounded to a level (fistp of light times 255, round to nearest even), clamped to 0..255 as 0x574530 does, and the level's integer half is taken (shr 1, and 0x7F7F7F); UnownedLandDim.Level mirrors it on the CPU. Presentation only.
With the lighting option 0 (bit 0x800 set), [BIN:TPW-EXE:0x0057453A terrain colour table] 0x574530 does not light the terrain at all: the test of bit 0x800 at 0x57453A sends it to a loop that copies one constant, the light object's field +0x2C (0xFFFFFFFF from the object's creation, 0x574013; the other writers, 0x577120, 0x57AB61 and their restores, are temporary debug highlights of the mesh draw), into every colour, and the light sum 0x5741B0 (the sun, the ambient and OpenTPW's point lights) is not called. LIGHTING 0 is therefore an unlit white terrain without the dimming; TextureSlotAddressing.TerrainUnlitFlag marks every terrain corner (static, outside, path and procedural) at level load and test.shader shades it with 1 (UnownedLandDim.Unlit). [EXT:evening] the evening extension still darkens that white at dusk and night with the tint of its other unlit content (docs/EVENING.md); that is the extension's own behaviour on top. Without original detail data the option is taken as 1, as the original's zeroed render flags have it (IGraphicsSettings.FallbackDetail).
Queue models on the terrain#
The drape (October 26, 2026; issue 829, package D2). [BIN:TPW-EXE:0x00522900 queue models] The loader 0x522900 loads each of the eight queue models with 0x4629D0 and the load flags 0x12423 (the two quedead entries, whose table byte +5 is set, 0x112423). [BIN:TPW-EXE:0x004629D0 loader flags] Of these, bit 0x2 becomes the loader's flag 0x40, which makes 0x461F10 OR 0x20000 into every mesh node (0x462610..0x462631) and set the header's +0x30 bit 0x80 (0x4625F4): the same drape flag the kart and water kits carry (0x10422, TRACKS.md, "Terrain drape"). The other bits are the footprint skirt (bit 0x1 → 0x46A5A0: its footprint-mask scan is skipped for a header with bit 0x80, which 0x461F10 has set by then, so only 0x46AA10 with the 0x80 argument can matter), header +0x30 bits 0x800 (from 0x20) and 0x20000 (from 0x10000), the dummy flag pass 0x46A550 (bit 0x2000) and, for quedead, 0x100000 (the colour pulse, below). [BIN:TPW-EXE:0x005229E0 queue model] 0x5229E0 places a model with the creation flags 0x33A through 0x463060, the footprint {1, 1} that 0x522900 stores at 0x816D68, the cell (x, y) and the yaw 360 - rotation (0 for 0); flag 8 runs 0x469940 → 0x469A80, the routine that drapes the track pieces:
Instance height. [BIN:TPW-EXE:0x00466D70 base height]
0x463060asks0x466D70for the instance height: half the sum of the lowest and highest of the cell's four corner heights (the all-cells flag0x10of0x33Askips the footprint test). [BIN:TPW-EXE:0x00467030 root placement]0x467030(flag0x20) then multiplies the yaw into the root node's own matrix (0x46F650, which turns the x and z elements of each row by the table cosine and sine, the table at0x7B0968filled by0x4708D0withN = 4096: the cosine of 90 degrees is entry 2048,-8.74e-8, not 0) and overwrites only its translation (+0x40/+0x44/+0x48: cell x times size, the instance height, cell y times size; the cell advanced by0x466F90for the quarter turns). The Space bends and ends (quebnd1,quebnd2,queend,quebin1,quebin2) carry a quarter turn in that root matrix.QueueModelDrape.BaseHeight,QueueModelDrape.Placement.The drape. [BIN:TPW-EXE:0x00469A80 mesh drape] For every node with
0x20000each vertex goes through the node's chain matrix (0x4702D0,0x46FC00) into the grid's frame, takes the height(landscape - instance height) + its height there, and goes back through the inverse of the chain (0x470040); x and z are its own. The landscape value is the cell's triangle chosen by the cell word's bit0x4, always split, from the cell's four corners by index arithmetic over the(cells + 1)wide height array (the cell word at indexx + z * cells), with no0x800planar shortcut and no bounds test (LandscapeSampler.SampleDrape). The instance height cancels: the vertex stands at the landscape under it plus its own model height, up to the single-precision rounding of the two additions.No lift, no offset. The drape adds nothing else. The 0.01 cell lift that OpenTPW's path quads once carried (a stand-in for blending over the terrain) was never part of the models, and no path quad has it now (they are cells of their own); the queue models no longer have it either (they were baked with it and with a planar-shortcut sampler before). The root's own matrix and the table yaw are
QueueModelDrape.Placement(x86 oracle targettpw-exe-model-placement,ModelDrapeGolden.Placements).Arithmetic. tp.exe's thread runs the x87 at the 24-bit control word
0x7F(COAST-032), so the chain, the transform, the triangle and the two height operations are single-precision operations in the original's order (ModelDrape). The one deviation is that x and z are the transformed vertex's, not the same after the round trip through the float inverse (an ulp of a position, never of a height).No mode. The drape has no vehicle or bridge mode: the track pieces' modes 1 and 2 (TRACKS.md) belong to the vehicle height sampler
0x4511A0, which never reads a queue model (guests walk the cell's own height); the drape's arguments are the same for queue models and track pieces (the header bit0x100that would change them is not set by either).Slopes, joints, holes. A vertex on the line between two queue cells reads the same two corners from either cell, so the cells meet at the same height up to the rounding of their two instance heights (
QueueModelDrapeTests, a few1e-5model units). The drape reads only the corner heights and the cell word's bit0x4: a cell that is a hole of the ground (the pool holes, the procedural floors' skirt cells, the flag0x1of the cell word) drapes exactly like any other, and a vertex beyond the map's edge reads what the index arithmetic reaches there.Model indices past the table. [BIN:TPW-EXE:0x00763388 queue model table] The loader's table holds eight entries (
0x763388..0x7633E8; the 12-byte rows after it are other data, the first of them with a zeroed model slot). The chooser (0x535DD0) can answer a larger index (a class-2 base of 0 to 3, plus 1 for a corner, plus 3 for each linked path neighbour, up to 10), where the original would read past its slot array; there is no loaded model there to port. OpenTPW draws no model for such a cell (the cell stays a plain ground cell) andOriginalTerrain.BuildQueueModelslogs one warning per such cell (a player-built queue can reach it).Face normals. The refresh
0x473C30→0x473A40rewrites only the entry each face's first word points to; every face of every queue mesh (28 models, 74 meshes, 1536 faces in the four themes) points into the face-normal block, none into the corner block, so the stored normals light the draped models as they do the original's (QueueModelDrapeTests). No node of a queue model has the flag0x200that would take it out of the walk (the files' node types are0x1and0x401).Queue cells are holes of the ground. [BIN:TPW-EXE:0x0046DF50 tile writer] The refresh writes a queue cell the tile
(0, 8, 0)through0x450470→0x46DF50, whose first branch ORs0x101into the cell word and clears0x80; the ground draw0x56F670(the static and the procedural ground alike) and the visible-cell list0x56F090skip a cell whose word has bit0x1. OpenTPW makes every queue cell a render hole of the ground (ObjectCellHoles.IsHole, type 3, with the object cells), so the planks and the ground never compete for the same pixels. With the procedural textures on the composite is N x N texels (the art point sampled everywidth / Ntexels), so the painted planks of the base art are softer there than in the static mode, which draws the whole art.The skirt and the composite floor. [BIN:TPW-EXE:0x0046AA10 queue skirt] Every queue model has the base flag (header
0x09; the loader's drape flag adds0x80, so0x46A5A0skips its footprint-mask scan) and, from the 1 x 1 footprint{1, 1}, one skirt entry for its base mesh (C8,80,E0orA0, slot 0:QueueModelFloor,ObjectSkirt.BuildwithdrapeLoaded). The entry's slot draws opaque and clamped and the base mesh takes the normalised coordinates, in both texturing modes, so with the procedural terrain textures off the base decal (jpa_que1/jpa_que3, a dirt patch with a soft grass edge) is painted opaque over the hole. With them on, the placement0x463060(flags0x33A) writes the cell's skirt word (OriginalCellWords.SkirtWord, the entry turned with the yaw) and0x57ACE0blends the art over the cell's procedural ground (ObjectFloorBase.Compose, N x N); the refresh then writes the hole. The composites of the queue cells are tiles of an atlas page (ProceduralTerrainAtlas, 2048 texels a side, no mips), the base mesh's coordinates taken into the tile from its first texel's centre to its last (TileCoordinates), so the baked batches need no texture of their own per cell.Path cells are not draped. Only the chooser's class-2 result (queue cells) places a model (
0x5365D0→0x5229E0); a path cell's result is only written into the landscape cell (0x450470), a ground texture, so there is no mesh for0x469A80to drape. OpenTPW's static quads for path cells follow the ground triangles of the cell (AddCell), with no lift: the ground leaves the cell out.The depth compare. The original's device compares depth with LESSEQUAL (
0x57360F, once, in the device set-up), so the later draw wins a tie where the queue floor meets the ground of the neighbouring cells; OpenTPW's world materials now compare so too (Material.DepthComparison, the floors work of PR 854).Presentation only. The baked vertices are drawn as parts of their own; no simulation state, world hash or save field reads them (
QueueModelCountis a count).
Verification: oracle_x86/model_drape_reading.py is the plan side of the x86 oracle target tpw-exe-model-drape (0x469940 run in the emulator on synthetic landscapes and trees, bit for bit, ORACLE.md X34); ModelDrapeGolden.cs replays its cases in ModelDrapeTests without the executable.
Torches, clips and dead ends (PATH-015 retired, round 11 package O, November 1, 2026). [BIN:TPW-EXE:0x00522951 load flags] The loader 0x522900 passes 0x112423 for the table rows whose flag word is 0x100 (rows 0 and 1, the two quedead entries) and 0x12423 for the other six (QueueModels.LoadFlags). [BIN:TPW-EXE:0x004623A2 animation members] 0x461F10 probes (0x44A220) and loads (0x46D6D0) the twelve letters' members of every model, %s%s%c.md2 with the letters of the table 0x6FE6BC (C, D, I, L, S, M, E, U, W, B, R, O as the animation groups 0 to 11; the & 9 test at 0x462269 only guards a scratch copy of the name, the file names come from the buffer at esp+0x238, 0x4623A2 and 0x4623D1), and +0xA8 of the instance counts the clips. So queendm, quebin1m and quebin2m (Jungle, Halloween and Fantasy: the fire0 to fire04 frames of the torch slot, a key every 5 ticks) and the m clip of every Space queue model (scrolling texture coordinates of node 1, 100 ticks) are loaded. [BIN:TPW-EXE:0x00473C8A idle restart] The creator gives the instance's one channel the none animation 12 (0x473E30 at 0x4631D6). 0x5229E0 places with 0x33A, which has neither bit 0x1 (instance flag 0x4) nor 0x80 (0x8000), so (flags & 0x8004) == 0 and 0x473C70 (from the list pass 0x44E410 and the render callback 0x463030, whose body is 0x44E380; every frame) asks 0x473490 whether every channel is idle (animation 12 only for the first start; a frame past the clip's duration +0x1C otherwise) and then starts group 5, variant 0 (0x4732A0(instance, 5, 0, ...) at 0x473CAB, which goes to 0x472F60). The first start from the none animation 12 is fresh (0x472FBB); a restart keeps the overshoot: 0x47300E takes the carry (frame minus duration), 0x472BC0 caps it (0x472C12..0x472C25) and starts the clip at the stamp minus ftol(carry * 33.33 / speed) (0x472C27..0x472C41), on the scaled clock 0x7B496C. The clip therefore loops with its phase kept, a cycle exactly its duration, from the first frame after the instance's creation, each instance in its own phase. QueueClipPlayer is that channel (ObjectAnimator.Play with loop: true on group 5 for the first start from animation 12), QueueAnimationGroup and QueueAnimatedPart draw it: the cells of a model with a clip that were made in one frame share one player and one dynamic batch (a Space queue of a thousand cells is a handful of draws and one vertex upload per group, not one per cell; the meshes no track or frame slot touches stay in the shared batches), the texture-frame slots rebind their array element per group as an object's frame tracks do, and the animated texture coordinates are written into the group's vertices (through the composite's atlas page for a corner that shows it). A path edit remakes exactly the queue cells the tile refresh 0x5365D0 re-creates (0x522A90 removes the instance, 0x5229E0 places it again with a new channel at frame 0, even when the model is unchanged); a queue cell is the only class-2 cell (table 0x7630B0, the path table 0x763138 is class 1). The sites that reach one: the line commit of the path and queue tools (0x5340A7 on every cell of the line from the anchor 0x81EDE4/0x81EDE8 to the end inclusive; the anchor becomes the end, 0x527650, so the next line re-creates the old end too), the path link writer (0x534A8C, 0x534C9E, 0x534EB1, 0x5350BF: a queue neighbour whose link byte has the bit toward the new path cell), the clear 0x5367A0 (the path case re-creates each linked neighbour at 0x53687E over all eight bits, not gated by 0x81D7A8, which is what the type pass reaches when a queue is laid over a path, 0x5346D0; the queue and entrance case at 0x536B9E, from SetCell case 0x32 and Back 0x52FE50), the corner walk 0x530120 (0x530387, 0x5303A3), the fence fill 0x5311C0 (the scan blocks that carry 0x40 in each of its four directions, 0x53132E, 0x53146A, 0x5315A6, 0x5316E3, and every post the walk did not mark, 0x531926..0x531965; the fence set-up 0x5323F0 and Buy Land 0x5327E0 run it) and the cell-op step 0x5370E0 with op 0x81 on a fence post (0x5385F0, 0x53865D, 0x5386CA, 0x538708, 0x53874B, reached by the line passes and the rewrite walk 0x52BA50). The link refresh sites 0x534A13, 0x534A40 and 0x534C51 re-create type-1 and type-10 neighbours only, and the dirty flag 0x40 is cleared by 0x53A530 and set only by the cell reset 0x536490, the cell-op step 0x5370E0 (on a fence post) and 0x539670. Level.NoteTileRecreated collects those cells from the existing ports (RefreshTile, ParkCellMap.Recreated for the clear, the corner walk and the fence engine) and QueueBirths.Assign restarts exactly them as a group of their own; every other cell keeps its phase, a parallel lane next to a new cell included. Every clip of the shipped archives is of those two kinds (QueueClipPlayerTests); a clip with a node, vertex, path or node-flag track is not played (none ships). The clock is the scene clock's gap (Level.AdvanceFrame), so a paused park holds its frame.
[BIN:TPW-EXE:0x00469840 quedead pulse] The raw flag 0x100000 of the two quedead entries becomes the inner 0x2000, which 0x461F10 turns into the template flag 0x2000000 (0x462230); the creator copies the template's flags into the instance (0x4557C0, 0x3F dwords) and 0x463060 registers such an instance with 0x469580 (0x4638E1, 0x4638EB): it joins the list 0x7AFE14, every part gets 0x1000000 and, where it shares its colour buffer with its parent, a buffer of its own; the lighting pass 0x57AA10 skips parts with 0x1000000 (0x57AA30, 0x57AA66). Once per frame from the main loop (0x54E301) 0x469840 writes one colour into every vertex colour of every listed instance: 0xFFFF0000 | t << 8 | t with t = ftol(255 * (x <= 1 ? x : 2 - x)) from the phase x ([0x7AFD04], 0 at the start), then x = fmod(x + 2 * dt, 2) with dt the scene clock's gap in seconds (0x7B497C, 0x473440). A dead end therefore blinks between red and white once a second, lit by nothing. QueueModelPulse is that pass (single precision), TextureSlotAddressing.PulseFlag marks the corners of the dead-end batches, test.shader shades them with red 1 and green and blue ModelEntity.PulseTint, and the evening tint still applies (unlit content). The pass runs once per rendered frame on the scene clock (Level.AdvanceFrame), so a paused park holds its colour. The other users of the list (0x469580 from 0x4418BA, 0x52CAD0, 0x52D130) are not ported here (TRACK-010, COAST-028).
Headless API#
var builder = new ParkPathBuilder( cells, walk, economy, terrain, isOccupied ); // or level.Paths
CellBuildResult check = builder.CheckCell( x, y ); // no writes
SegmentResult ghost = builder.Preview( start, cursor ); // no writes
SegmentResult result = builder.BuildSegment( start, end ); // snaps, writes, charges
bool ok = builder.TryLayLine( from, to, out result ); // BuildSegment, true when no cell was refused
CellBuildResult removed = builder.Remove( x, y ); // forced, no refund
SegmentResult has SnappedEnd, Built (new, charged cells), Charged, StoppedBy (Ok when complete), EndedOnExisting, Start, Line, Existing (counter bumped, free) and StoppedAt. Level.BuildPath(from, to) and Level.RemovePathCell(x, y) wrap it with the read-only visit check.
Land purchase (PATH-007, retired October 29, 2026)#
PATH-007 is retired: the land follows tp.exe's own routines (FenceEngine: the set-up 0x5323F0, the validator 0x531A50, the price 0x532303 and the purchase 0x5327E0, on a layer of the structure records and on a track tile's own record where a fence cell holds one), checked cell for cell against the four restart.INTS saves and the oracle runs (ORACLE.md X35, X39). What is left is one choice of OpenTPW's, a trace result and two storage notes:
[EXT:land-purchase-fault-refusal](approved by the user on 2026-10-29): a purchase on which the original's fill0x5311C0reads the block beyond the map's edge (a null block, a crash) or whose ring walk0x52BA50never ends (a cell that is no post, a hang) is refused and charges nothing. The original crashes or hangs there; OpenTPW refuses the click (the validator's answer isLandPurchaseRefusal.Fence), because a crash or a hang is no behaviour to copy. The case is reachable, for example on the open side of the gate (Jungle (45, 11)-(49, 17)).The six-click fence (bit
0x400of the level word0x79D86C) is traced never set: no instruction sets the bit (the writers0x44D993,0x44DA92,0x44DDF3,0x44DE34,0x44DEFD,0x44E306and0x44E322set other bits or clear it), only a whole-dword copy of the settings blob read fromdialog.tcfcould (0x424A60to0x78D8D8, then0x449E78copies+0x7C), and0x44DE2Bclears it when no settings load, so a stock install never lays it. The engine lays it when asked; OpenTPW reads nodialog.tcf, so nothing asks.Host storage: a track tile's fence links
+0x22stay in the fence layer (the track layer has no field for them), and a save without its structure records (written before the fence port) derives the layer from its ring.
Approximation register#
| ID | Plan name | Interim behaviour |
|---|---|---|
| PATH-017 | PATH-PAUSE-WINDOW | Bounded ordinary-WM pump/admission then drain is implemented for offline motion/button ownership: topmost eligible receiver, stable screen/element lifetime, separate movement capture and a saved release owner. the P key (0x409350, from the key row 0x40bf77 and the window's own procedure 0x4a2706) and the offline focus-loss pause (0x46b74c -> 0x4092a0(1) -> 0x481440 -> 0x4a2790) build the P window: a full-screen layer (0x65dd7b(1, 1, 1, 0, 0, 0x7ff, 0x5ff), flags 1, the 'lolight' backdrop), appended as the last child of the root (the tail of 0x65dd7b links a new window after its siblings) under the panel 5094 of table 0x752e00; every resume destroys it (0x409300 -> 0x4a27c0). The hit test 0x65db25 takes a shown window with flag bit 1 and lets the last such child win; the layer is the hit window of every point and, with the focus (0x65e59b ends 0x47ed80), of every key, over the windows that existed when it was built, so a window opened later (the Escape menu, a box) is above it. Its procedure 0x4a2680 uses only the P key and the panel's animation (0x65e72d, table 0x752ed0) and hands the rest to the default procedure 0x65f6d1, which turns a button pair into a click of its own window and forwards nothing: the park click handler 0x4879d0 (called only from the HUD window's procedure, 0x488768) and the camera's input 0x42a760 (called only by the procedures of the HUD, the hidden-HUD overlay and the chat mode) get no message under it. Here the backdrop owns every click over what lay below and the park camera takes no input (wheel, drag, edge scroll, keys) while it is up; the speed buttons, the numpad and a park loaded paused build no layer. The P window is drawn since round 11 N (the full-canvas lolight model over the windows that existed when it was made, then the paused banner of table 0x752e00 animating by table 0x752ed0 every 35 ms) and no key, text or wheel reaches the screens below it. Still open: the alternate buffered-input mode (its selector and pump are not read); unobserved focus-modifier limits; and the stored pick of the click dispatcher. Read: the click dispatcher 0x4879d0 (14 cases over the hover kind 0x7c24f4 through the table 0x488168, called from the HUD window's procedure 0x488768 right after the classifier 0x486d90, 0x48875f) takes no message coordinates; it acts on the stored pick word 0x7b05cc, which the world frame 0x54e2b0 rewrites every frame by ray-picking from the pointer (0x45bf90 -> 0x45d560: the cell z * 128 + x + 1, or 0) and skips while 0x790ab0 & 0x16 (bit 0x04 the ride eye camera, 0x02 the walk eye camera, 0x10 unnamed); its meaning depends on the hover kind 0x7c24f4 (4 a cell, 3 and 6 records of the park at +0x294, 5 records at +0x6cde). A click therefore acts on the previous world frame's pick under the pointer, where OpenTPW picks under the pointer when the click arrives; the dispatcher's 14 cases are the open part. |
Retired: APPROX:PATH-016 (the links of MAP InitialPath cells: the map init 0x536490 types each cell and links it with the link writer 0x5348d0 in mode 1, the cells in index order, so a cell links only toward the path cells before it and the later cells link back when their own turn comes; ParkCellMap.FromOriginal runs the ported writer in that order and no longer links toward non-path neighbours).
Source: docs/PATHS.md in the project repository.