OpenTPW

Pools (opentpw.pools)#

An official extension (docs/MODS.md), on by default (switch it off on the Extensions and mods screen), in which the player paints pool water cells of any size and shape on the park grid. It is modelled on the pool tiles of Roller Coaster Tycoon 3 Soaked! (ideas only; no asset of that game or of Theme Park World is used or shipped). The original Theme Park World has no pools: everything here is OpenTPW's own and carries [EXT:pools-*] labels in the code and in this page.

Phase P1 is the cell type, the paint tool, pricing, saves and rendering. Phase P2 (below, Changing rooms and swimming) lets guests really swim: a changing room is the pool complex's entrance, guests choose it like an attraction, change, swim freely through the connected pool cells with whole-body swim sprites, climb out, change back and return to the path. What is not done is in Not done yet.

For players#

The pools extension adds swimming pools to Theme Park World. It is OpenTPW's own invention (the original game has no pools), and it is on by default.

To turn it off: Options > OpenTPW > Extensions and mods, switch off Pools (and Pool guest art if you only want the original guests back); the change applies to the next park you start or load, without a restart. You can also edit mods.json ("opentpw.pools": false, "opentpw.pools-guest-art": false) or start once with --disable-extension opentpw.pools or --disable-extension opentpw.pools-guest-art. A park without pool cells or a changing room saves exactly the same whether pools is on or off; the extension is not available in a Theme Park Inc run. The extension's own models, textures and sprites ship in content/pools (content); nothing from Roller Coaster Tycoon 3 or from Theme Park World's art is used for it.

LabelWhat
[EXT:pools-extension]the extension, its switch (FeatureGates.Pools) and the save rule
[EXT:pools-cell-type]the cell type ParkCellTypes.PoolWater
[EXT:pools-cell-rules]the CanChangeCellType rule
[EXT:pools-tool]the paint tool, the builder, its placement rules
[EXT:pools-terrain-rule]the ground rule
[EXT:pools-cost]the price and the refund
[EXT:pools-save]saves, validators and the pins
[EXT:pools-ui]the buy-list rows, the hover help and messages
[EXT:pools-render]the mesh, the textures and the water shader; the swimmers' sprites and the swimwear slot table
[EXT:pools-guest-art]the 2x land guest sets (kids and heads) and the opentpw.pools-guest-art switch that applies them
[EXT:pools-changing-room]the changing room object and its placement rule
[EXT:pools-swim]the swim session: guest states, steering, the numbers, saves
[EXT:pools-content]the extension's own shipped content (content/pools)
[EXT:pools-slides]water slides: the tower, the track, the rules, the ride and the activity
[EXT:pools-activities]the activity extension point of the swim session
[EXT:pools-attractions]the water attractions: rope swing, jets, spa, wave machine objects, their rules and activities
[EXT:pools-waves]the wave machine's settings, the waves, the swimmers' bob, the wave happiness and the waves' push on the swimmers
[EXT:pools-river]the lazy river: the river option, rings, the current
[EXT:debug-pool], [EXT:debug-swimmers], [EXT:debug-attractions], [EXT:debug-slide]the smoke-only options that build a pool (with a river ring), a room, swimmers, a slide and water attractions for captures

The extension and the save rule#

opentpw.pools is registered in OfficialExtensions with DefaultEnabled: true and AffectsSimulation: true; the gate is FeatureGates.Pools, read the way FeatureGates.CrossEditionObjects is. It is on by default (since October 17, 2026). Turn it off in mods.json ("opentpw.pools": false), on the Extensions and mods screen, or for one run with --disable-extension opentpw.pools. --enable-mod opentpw.pools still works and changes nothing now.

Existing mods.json files. The file stores only the choices a player made (ModSettings.Enabled holds an entry per toggled mod or extension, and IsEnabled falls back to the extension's default for an id without an entry; the Extensions and mods screen writes the loaded entries plus the toggles, never the untouched defaults). So a player who never touched the pools toggle has no opentpw.pools entry and gets the extension on after the update, and a player who switched it off explicitly has "opentpw.pools": false and stays off. The browser's /config/mods.json has the same format and the same behaviour. A player who once switched it on has true, which is the new default too. (There is no case where an untouched old default "off" is stored, so no migration is needed.) A park without pool cells or a changing room saves and loads the same bytes with the extension on or off, so switching on changes no existing park.

Theme Park Inc. The pools UI is unavailable in a Theme Park Inc run (GameEditions.IsThemeParkInc) even with the extension on: FeatureGates.Pools is false there, so there is no pool row in the buy list, no pool tool, no render holes, no changing room, no pool extras and no swimmers, and PoolContent.CatalogRoot adds no objects to the Theme Park Inc catalog. The reason is that the styles (PoolStyles knows the four Theme Park World themes; a Theme Park Inc world would get Generic), the changing rooms and extras (objects.json lists only the four Theme Park World themes), the guest sprite sets (the eight Theme Park World kid sets) and the park layout were made and checked for Theme Park World only; Theme Park Inc is an experimental slice (docs/THEME-PARK-INC.md). It is covered by PoolsTests.ThePoolsUiIsUnavailableInThemeParkIncRunsEvenWithTheExtensionOn. Pools for Theme Park Inc can be added later with styles and rooms of its own.

Browser. The browser build embeds content/pools (objects, changing rooms, swim sprites) and resolves the extensions from the default set plus /config/mods.json, so pools is on there by default too.

A save records the extension only when the park actually has pool cells. AffectsSimulation: true alone would tag every save of every park once the extension is on (ModSet.SimulationMods), so the extension is one of ParkResumeMods.UsedOnlyExtensionIds: ParkResumeMods.Capture(active, inUse) leaves it out unless inUse names it, and Level.CaptureResumeSnapshot passes ParkResumeMods.InUse(cells), which names it when the cell map holds a PoolWater cell. So:

The asset manifest holds only what the park places. A save's AssetHashes hold, and a load requires, the mod:opentpw.pools: keys of the extension objects the park has placed (a changing room; none for a park of pool cells only), ParkResumeMods.AssetsForUse. The keys of unplaced extension objects are ignored in both directions, so a pool save made before the room existed still loads, and adding objects to the extension (more rooms, extras, slides) never invalidates an older save. A placed object keeps the exact-hash check: changing the files of an object a save places changes that save; adding objects does not (PoolsContentTests: a pool save without the room's keys loads, a placed room requires its keys, a placed room with another hash is refused).

A used-only record was feasible because ParkResumeMods.Capture sees the live cell map; nothing else had to give way.

The cell type#

ParkCellTypes.PoolWater = 0x40 (64), also ParkCellType.PoolWater and CellToolMode.Pool (a tool's mode is the cell type it writes). No original type uses the value: the original's cell types are 0, 1, 2, 3, 4, 5, 7, 9, 10, 11 to 13, 16, 18, 0x15, 0x19 and 30 (ParkCellTypes, TrackCellTypes, docs/MAP.md; the placement writes only the shape types 0 to 23, the map init 0, 1, 2, 7 and 30, and the saves hold the type in one byte). PoolsTests.ThePoolValueCollidesWithNoOriginalCellType pins that.

The tool#

PoolBuilder (headless, CPU-only, like ParkPathBuilder) validates, paints, charges and erases; PoolTool is the stroke tool on top of it (CellToolMode.Pool); the HUD and the tests drive both. Level.PoolBuilder and Level.PoolTool exist for original levels that are not read-only visits.

Painting. Press on a cell and drag: every cell between the previous and the current pointer cell is written (a 4-connected walk, so a fast pointer leaves no hole), the tool stays on for another stroke, right click or Escape leaves it, Backspace takes back the last stroke (PoolTool.Undo: refunds a paint stroke, charges an erase stroke again; switching between the paint and the erase row keeps the strokes). A drag that leaves the park view ends there: coming back with the button held does not join the two places. The path tool's snapped straight lines are not used: pools are areas. PoolBuilder.Rectangle fills a rectangle for headless callers. A refused cell is skipped and the stroke goes on; only a cell that cannot be paid for ends the stroke. The HUD plays the refusal sound and posts the message once, when the stroke ends, for the first refusal.

In a shared park ([EXT:online-coop-commands], docs/COOP.md, "A guest's pools"), a granted guest's strokes go to the host in batches of cells (PoolCellsCommand, LayPoolSlidePiecesCommand), which write each cell exactly as the host's tool writes it, and a stroke says its refusal once it is back; the host's tool writes at once, as above. A guest's Backspace in the paint or erase mode takes nothing back: undoing a stroke is the host's until undo comes to shared parks.

Erasing. The erase mode (a second buy-list row, "Remove pool water") takes pool cells back to empty cells the same way, in one drag over any number of cells. Backspace with no tool on takes away one pool water cell at a time, river cells included (see "Removing with Backspace" below). The path tool's own removal is the forced ClearCell (Backspace, the area clear) and refunds nothing; erasing pool water refunds the full cell price instead, a deliberate difference ([EXT:pools-cost]): a pool painted by mistake costs nothing once erased. The area clear and the developer remove tool leave pool cells alone.

Placement rules (PoolBuilder.Check, in order; each has its own PoolBuildResult reason and a refusal message):

  1. ExtensionOff: the extension is off;

  2. OutsideTerrain: outside the map or the terrain grid;

  3. NotOwned: land the park does not own (cell flag 0x40);

  4. Existing: already pool water (free, no change);

  5. Occupied: a path (a fixed one too), queue, entrance, exit, object cell, track cell or a fence post (ParkLand.IsPost) is there, or the host reserves the cell (a placed object, the Totem). The path tool has the same gap for fence posts (it does not look at ParkLand.IsPost); it is left as it is, because its pins and the saved parks that lay paths beside posts depend on it; 5b. Standing: a guest or an employee stands on the cell (Level.IsStoodOn), so no water is painted under anyone;

  6. Terrain: the terrain rule refuses the cell (water, a hole, rock, the entrance area, the fixed walkway: the object build grid's CheckTerrain);

  7. TooSteep: the ground is not level enough (below);

  8. NotEnoughMoney: balance minus the stroke so far minus the price would be negative.

The ground rule ([EXT:pools-terrain-rule]). The deck follows the ground and the water of a connected pool is level, so each cell must be nearly level. The rule is the corner height spread: the highest minus the lowest of the cell's four corner heights, in engine units (PoolBuilder.CornerSpread; a cell is 2 wide and the heightfield rises in steps of 0.2, one model unit). It must not exceed 0.25 (PoolBuilder.MaximumCornerSpread: one step of 0.2, plus a little), which is a slope of about 7 degrees across the cell. The corners are the very values LandscapeSampler interpolates inside the cell, and the sampler's surface of a cell never leaves their range, so the spread bounds how far the ground (and so the deck, which follows it) can lie from the level water. The original validates no slope for any tool (tp.exe 0x535670 has no float operation), so this is OpenTPW's own rule. Measured on the shipped land (PoolsTerrainCorpusTests, with OPENTPW_GAME_PATH): the buildable land of the four themes is already flat. About 27 to 29 percent of its cells are exactly level, almost all the rest differ by one step of 0.2, and the rule refuses 4 of 28,000 cells (the few two-step cells, spread 0.4). It is a safeguard for steeper maps and edits rather than a limit players meet on the original levels.

Pricing#

75 per cell (ParkEconomy.PoolCellCost), the price of a pool tile in Roller Coaster Tycoon 3 Soaked!, through the economy's cell costs (CellPurchase.Pool, ParkEconomy.CellCost, TrySpendCell): spent as other costs with a CellsBought event, tested like a path cell (the commit refuses when balance minus the price is negative, the ghost when the stroke's total exceeds the balance). The original's balance files have no pool price, so the number is a constant of the extension. Erasing credits 75 as other income (ParkEconomy.RefundPoolCell) and nothing while the bank's withdrawals are disabled (a debit then charges nothing, so there is nothing to give back and paint and erase cannot make money); a stroke's Charged and Refunded are what the balance really did. A pool cell is worth what empty land is in the park value ([EXT:pools-value], 2 points; it would otherwise score 0). A pool built with no economy (the headless sandbox) is free.

The HUD entry#

The original HUD has no entry for it, and the least invasive place is the buy window's Miscellaneous list, which already holds the two land rows (Buy Land, Clear Land). While the extension is on, two rows follow them (ParkHud.PoolPaintRow, PoolEraseRow, ids -3 and -4, ParkHud.Pools.cs; a bridge has no removal row, Backspace removes it): "Pool water" (value 75) and "Remove pool water" (value 0). Choosing a row closes the window and arms the tool; choosing the other row while the tool is on only switches its mode. The rows exist only while FeatureGates.Pools; with the extension off the list is exactly the original's. Hover help, the start hints and the "ground too steep" message are OpenTPW's own strings in SupplementaryStrings (OpenTpwText.PoolRowPaint and its siblings), translated for all nine languages the table has (English, Danish, Dutch, French, German, Korean, Polish, Spanish, Swedish); the other refusals reuse "You can't build here" and "Not enough money". The cursor is the path tool's (the cash pointer when the cell cannot be paid for); the hovered cell shows the blueprint marker, blue when it can be written and red when it is refused.

Removing with Backspace#

Removing pool water and pool bridges with Backspace is part of the pools extension ([EXT:pools-tool] for water, [EXT:pools-bridges] for bridges); the original game has no pools, and its own backtrack key does nothing over either. With no build tool on, Backspace over a cell does what it does over a path or a queue cell (Level.BacktrackAt, the BacktrackCommand; the key's sound cat_ui 95 plays at the cell, see AUDIO.md):

The buy list keeps the "Remove pool water" row for erasing a large pool in one drag, and has no remove-bridge row. The target reads only the cell map and the bridges; the removal's checks read simulation state only, so every peer resolves it identically; the command is the existing BacktrackCommand (no new kind). In a shared park a granted guest's press is a request to the host, as its Backspace over a path is (docs/COOP.md, "A guest's pools").

Rendering#

A pool is drawn dug into the ground, in the picture only. The terrain renderer treats pool cells as render-only holes while the extension is on: OriginalTerrain.RenderHoleSource (the level wires PoolRenderHoles.IsHole(cells, x, y, FeatureGates.Pools)) leaves those cells out of the drawn ground mesh (OriginalTerrain.HeightfieldCells), and nothing else. The heightfield, LandscapeSampler, the cell words (the real hole bit 0x1 is the heightfield's own and is not touched), placement, the cell map and every other part of the simulation never read the rule, so heights and every pin are the same whether or not a hole is drawn (PoolsTests.TheGroundMeshLeavesOutRenderHolesAndTheHeightsStayWhatTheyWere). With the extension off the ground is drawn whole. The mesh is rebuilt (one model, same material) when the set of holes changes; a stroke of pool cells changes no path or queue drawing, so those layers are not rebuilt for it (ParkCellMap.PoolWrites).

PoolRenderer (an Entity, created by Level.RefreshPools when the first pool cell exists) draws five parts from PoolMeshBuilder, which is CPU-only and unit-tested, rebuilt at most once a frame when the set of pool cells changes:

Styles#

The look follows the park's theme (PoolStyles.ForTheme(OriginalPark.LevelName), the way objects pick their theme's data), and all of it is one table, PoolStyles (PoolStyle: coping pattern and colours, wall and joint colours, the deep and shallow water colours, glow). A theme without a row, such as a Theme Park Inc world, gets Generic; a TPI row is a new line in the table. The textures are generated in code from the row (PoolTextures, 64 x 64, tiling, 16-pixel slabs); nothing from the original game and no binary asset is committed.

ThemeCopingWall and floorWaterGlow
junglewooden planks with grainsandy stone tileslagoon green-blue, turquoise shallowsnone
hallowdark mossy stonedark slate tilesmurky purple deep, sickly green shallowsfaint
spaceriveted metal panelsblue-grey metal tilesdeep blue, bright cyan shallowssoft emissive
fantasypastel candy tiles (pink, lilac, mint)pink tiles with white jointsblue-lilac deep, pink-lilac shallowsslight
genericpale stone slabsblue ceramic tilesbluenone

Tests#

PoolMeshTests: all 256 neighbour masks tile the cell exactly once and give the expected tile counts for the rim, the water and the floor; the named cases (interior, straight, outer and inner corner, lone cell) have the expected walls and skirt; the basin has the depth, the water level and the deck heights described above; the rim is a quarter cell wide; normals are unit, the top surfaces face up, walls are vertical and the winding agrees; coordinates are in range; the water is lighter toward the edge and cells agree at a shared vertex; for six shapes on flat and sloped ground the mesh is closed apart from the skirt-bottom edges (four per outline side); the textures tile, have joints and a bevel, and differ by style; each theme gets its style and anything else the generic one. PoolsLevelTests run on a real Level: real resume captures with and without pool cells, sharing, objects, access cells, track tiles and coaster pylons over water through the level's own hooks (Level.ConfigureObjectHooks, Level.ReservesCell), guests and employees standing on cells and fence posts. The GPU side (PoolRenderer, the shaders, the terrain rebuild) is exercised only by the on-screen check below.

Checking it on screen#

--debug-pool [x,y,w,h;...] ([EXT:debug-pool], smoke-only) paints pool cells through the tool's own builder once the original level is up. The shape is a list of rectangles, measured from the first place near the camera target (the --capture-camera target when one is given, so a capture is repeatable) that takes the whole shape and charged as the tool charges. The default shape is a 6 x 4 basin, an L-shaped arm and one single cell, which together show straight edges, inner and outer corners and an isolated cell. It needs the extension. The log prints the shape's engine centre, which --capture-camera can aim at:

bash scripts/run.sh --game-path '/path/to/Theme Park World' --load-original-level jungle \
  --debug-pool default --silent --capture-world pool.png --capture-frames 300 --capture-camera 28.2,-38.6,45,-90

First on-screen check (October 17, 2026; Jungle, 43 cells): the water animates, and the coping joins at straight edges, inner and outer corners and around the single cell. The basin sits on top of the land, so the water reads as a shallow tray rather than a deep pool.

Second check (October 17, 2026; all four parks, --debug-pool default, camera x,y,45,-90 and x,y,45,-150; the camera clamps the height to 70, so a lower height gives the same view): the pool is dug into the ground with a visible inner wall, a tiled floor seen through the translucent water, lighter water at the edge, the coping a quarter of a cell wide with joints, and each theme's own look (wooden coping and lagoon water in the jungle, mossy dark stone and murky purple water in hallow (made purpler after the first look, October 17, 2026), riveted metal and bright cyan water in space, candy tiles and lilac water in fantasy). The images are reports/pools-p1-<theme>-top.png and -angle.png.

Changing rooms and swimming (phase P2)#

The changing room ([EXT:pools-changing-room])#

A changing room is an object of the Features tab, available only while the extension is on: a 2 x 2 cabin whose entrance (the lower left cell of the shape ** / 2*, facing the path like a toilet's) is on the path side and whose back, opposite the entrance, touches the pool. It is a facility like a toilet (a feature that guests choose, Info.IsChoosable 1, no queue, a stand cell in front of the entrance), but it gives no relief. Its .sam carries OpenTPW's own key Pools.ChangingRoom 1, which the engine reads (PoolChangingRooms.IsChangingRoom; RideVisitorBridge.IsChangingRoom is set only while the extension is on).

Model inset ([EXT:pools-model-inset])#

A walker (guest or staff member) is a camera-facing sprite drawn at the depth of its feet, pulled 3.5 to 3.9 units towards the camera as the original pulls it since October 18, 2026 (GUESTS.md), and the steering (avoid_walls, radius 0.2 cell = 2 units) lets it come to 2 units from the edge of a path cell. A wall that reaches the edge of its footprint therefore cuts the sprite of whoever walks along it, most of all a tall staff costume. The pools' first models filled their footprint on every side (the cabin's walls were half a unit inside, its door frames and corner posts 0.0 to 0.3, and the slide towers' flight and posts 0.0), which is what clipped. The original buildings do not: measured with ObjectCatalog / ObjectAssets.LoadModel on the game's own models (each triangle edge cut by the plane 2 units above the ground, the nodes' transforms applied, the extent compared with the footprint of 10 units a cell), the 32 shops and 17 sideshows stand 0.5 units (the tightest sideshow side) to 0.9 (the tightest shop side) or more inside their footprint on every side; the 10th percentile of the sides is 1.0 (sideshows) to 2.2 (shops) and the median 2.3 (sideshows) to 4.4 (shops); per building the tightest side has a median of 1.5 (sideshows) to 3.5 (shops). The ground slab of an original (the plane near 0) does fill its footprint, and a few trees, rocks and the fries stall overhang by up to 0.8, none of them a building with walls. PoolsContentTests.TheOriginalShopsAndSideshowsKeepAtLeastHalfAUnitFromTheFootprintAtWalkerHeight pins the shop and sideshow measurement (it needs the game data).

The pool models now keep that gap on the sides a path can run along, and only there: the changing room's entrance wall stands 1.6 units inside (1.1 at the door frame), its flank walls 1.6 (corner posts 1.4), the roof overhangs them by 0.6 (1.0 inside the footprint), and a 0.15 high apron slab covers the whole footprint; its pool side stays 0.5 inside (the door frame reaches the edge), since that side is the water. The slide towers' flight and posts stand 1.5 inside on the entrance side and both flanks; the platform and rails, 24 units up and far above a sprite, still reach the whole footprint (the track attaches there), and the stairs' side, facing the pool, is flush. The pool extras (1.0 or more on their sides, the water side excepted) and the water attractions (0.7 or more above their base slab, which fills the footprint like an original's ground slab) already kept a gap and are unchanged. PoolsContentTests pin the cabin and the towers at 1 unit or more on the entrance side and the flanks at 1, 2, 3, 4 and 6 units above the ground. The sprite projection itself is not touched here; how much of the clipping is the model's gap and how much the sprite's width and orientation is judged in a native capture.

Choosing to swim#

The changing room is an attraction for the normal attraction choice, so no new decision point and no change of IGuestDecisions was needed. A guest scores it with the one score of every attraction (ScoreAttraction: distance, queue length, excitement against its taste, the needs and the rest); the default policy picks it like a ride, and so does any other policy that scores attractions. PoolsSwimSessionTests.ACheerfulGuestChoosesTheChangingRoomLikeAnyAttractionAndSwims has a guest choose, queue, change and swim with nothing forced, and in the fixed run with a room (below) guests choose it in a park that also has a shop. A swim-appeal term (warmer months more, rain less) is not part of P2: it would be an extension rule inside the host and is left for a later phase. A guest in a swim session makes no attraction choices (only a state-6 guest decides), so the room stays an ordinary attraction for the decision layer; the views of GuestDecisionViews did not change.

The swim session ([EXT:pools-swim])#

Host-side simulation in GuestSimulation.Swimming.cs and PoolSwimming.cs, gated by the room: a park without one reaches none of it, draws nothing from the world generator and hashes nothing extra.

StateValueWhat
changing in16 (Using)aboard the room, hidden: the script holds the guest for the changing time. Deviation from the brief: not a new enum value, because the guest is aboard the room's script exactly like a toilet visitor and a second state would duplicate every Using check (bridge membership, saves, demolition) for no difference in behaviour. GuestSimulation.IsChangingIn(guest) tells it, and the visitor window shows "Changing"
Swimming22in the water: a sub-cell position (16.16 cells), a heading of 64, a speed, a goal and its own random stream; drawn with the swim sprites
ClimbingOut23swimming back to the pool-side cell (still drawn in the water)
ChangingOut24hidden in the room, 12 park turns (about 3 s)

When the script releases a guest from a changing room (OnVisitorReleased), everything else of a release still happens (the visit counts, the used history, the visit's effects) and the guest steps into the water at the pool-side cell instead of walking on. If it cannot (no pool beside the room any more, or the park is closed) it walks on as any released guest. After ChangingOut it is put on the room's path-side exit through the existing ReturnToPath with the release's ExitingRide hold and decides again like any guest.

Steering (PoolSwimming.Step, integers only, 64 headings with a fixed table, 16.16 positions): a swimmer swims to a goal point drawn in the region (a random cell, a random point in it), picks another when it is within 0.3 cell, turns at most 2 steps (11.25 degrees) per park turn towards its wish, which is the unit step to the goal plus a push away from every body in the water within 1.2 cells (AvoidRadius; Spacing), and drifts a little (a heading step one turn in eight). It keeps to the water: the free water of a cell is the part 0.37 cell from the sides without a pool neighbour (the rim is a quarter of a cell and the body takes 0.12) and outside the corner square of an inner corner (PoolSwimRegion.IsWater); when the point ahead is not free water it tries the headings either side in turn and, boxed in, stands and picks a new goal. It never moves nearer than 0.7 cell to another body (MinimumDistance; a move that increases the distance is always allowed, so swimmers who start on one point swim apart). On the way out the crowd within 0.7 cell of the steps is ignored so nobody blocks the steps. Speed is the guest's base speed (60 to 140) times 90 in 16.16 cells per park turn: 0.08 to 0.19 cells a turn, about 0.33 to 0.78 cells a second (a park turn is 0.248 s).

Randomness. One draw of the world generator seeds the swimmer's own xorshift32 stream when the swim starts (BeginSwim, only for a guest released from a room); every later choice (the length, the stroke, the heading, the goals, the drift) comes from that stream, saved with the guest. A park without a changing room takes no draw, and one with a room perturbs the other guests only by that one draw per swim.

Numbers (PoolSwimSettings, all OpenTPW's own, none measured):

WhatValue
swim length160 to 279 park turns (40 to 70 seconds), drawn at the start
strokefront crawl 50 %, breaststroke 30 %, treading water 20 % (sprite slots 8, 9, 10)
climbing outends within 0.3 cell of the steps; at most 160 turns, then the guest is put in the room
changing back12 park turns
happiness+12 (meter 0 to 100) when the guest is back in the room
other metersunchanged by the swim (hunger, thirst, toilet and the rest run as in every state); the brief allowed "a little" relief and none is given

What else knows the new states.

Saves. GuestSnapshot has optional fields SwimHeading, SwimTurns, SwimStroke, SwimGoalX, SwimGoalY, SwimHasGoal, SwimRandom, written only inside a session (the JSON ignores default values), so older saves load with no swimmers and a park without swimmers saves the same bytes. The validators accept the three new states for a guest bound to an attraction, require a changing room for them and refuse swim fields outside a session. The canonical hash adds the swim fields only for a guest in a session (GuestSimulation.AddCanonicalState). The validators also bound SwimTurns per state (a swim by its longest, 279; the climb out by ClimbOutLimitTurns, 160; changing back by 12; at least 1) and refuse a session bound to an attraction that is no changing room. The asset manifest holds the extension's own files (mod:opentpw.pools: keys) only for the objects the park places (see the save rule): the catalog lists every room whenever the extension is on, and the manifest would otherwise make every park with the extension on refuse to save.

Rendering#

PoolSwimSprites loads the eight swim sets from content/pools/esprites/Swim beside the game's kid atlases: set n belongs to guests of type n (both lists are in name order). Level.SwimmerRenderer is a second GuestRenderer over them (Draws the swimming guests, SlotChooser picks slot 8, 9 or 10 and a frame from the clock at 6 frames a second, 3 for treading water, FeetChooser puts the hotspot, the torso at the water line, on the water surface of the cell's group, PoolRenderer.WaterLevelAt). It draws after the water: it is in the late group of Level.SplitLate (GuestRenderer.DrawsAfterWater), behind the pool water in the snapshot order, because the water now joins the late group after the translucent world pass and would otherwise be drawn over the sprites. The water writes no depth (MaterialFlags.DisableDepthWrite), so the lower half of a sprite, tinted blue by the art, shows through the surface; the opaque floor and walls still hide what is behind them. Only the slots whose hotspot is the feet (standing, walking, the shower: PoolSwimSlots.FeetAnchored) get the original's depth pull of a visitor's sprite (GUESTS.md), so a guest on the deck shows its feet as the kids do; the strokes and the torso slots keep the hotspot's depth, so a swimmer is not drawn over a pool's near wall. The kids' and the costume renderers skip swimmers. A swimmer in a costume swims in the swim sprites (the costume is kept for later). Guests changing are hidden like riders. The swim sets are looked for once per level (Level.RefreshPools); if there are none (the folder is missing or broken) one warning is logged and the swimmers are drawn by the normal guest renderer with their kid sprite (standing, not swimming), which is why Level.GuestRenderer skips swimmers only while the swimmer renderer exists. Picking a swimmer works like any visitor's (Level.PickVisitor).

Content ([EXT:pools-content])#

The extension ships content/pools (copied next to the program with the rest of content/, embedded in the browser build by OpenTPW.Web.csproj): objects.json and four object archives (a cabin per theme: cabin.MD2, a few 64 or 128 pixel TGA textures, Cabin.sam, Cabin.RSE), esprites/Swim/SPR_xx.ESP + .TPC, the swimwear sets of the eight Theme Park World kid sets with the 14 slots of PoolSwimSlots (stand, walk, ladder, dive, lying, shower, slide, the three strokes, splash-down, spa, ring, rope swing; slots 2 and 15 empty), and esprites/Generic/Kids and Kidsheads, the eight kid sets in clothes and their heads, which replace the game's land guests while the extension and the pool guest art switch are on (PoolGuestSprites, [EXT:pools-guest-art]). All of the sprites are drawn at 2x (frames with 256 pixels per unit, so a guest keeps its world size with twice the detail, GUESTS.md). The kids and the swimmers are seen from the camera of the original sets the game draws, 45 degrees above the ground, measured against their .TPC banks (CONTENT-KIT.md).

Checking it on screen#

--debug-swimmers N (smoke-only, [EXT:debug-swimmers]; it needs --debug-pool and the extension) builds the theme's changing room beside the painted pool through the level's own placement (it is charged, and the rule needs the pool at its back; Level.BuildChangingRoomBeside), opens the park door and starts N guests in the water at random points. --debug-pool-offset dx,dy moves the place the pool shape is searched from the camera target by whole cells, to frame the room:

bash scripts/run.sh --game-path '/path/to/Theme Park World' --load-original-level jungle \
  --debug-pool default --debug-swimmers 8 --debug-pool-offset 3,0 --silent --capture-world pool.png --capture-frames 400 --capture-camera -29.5,-50.6,45,-90

First on-screen check (October 17, 2026; all four parks, eight swimmers each, camera x,y,45,-90 and x,y,45,-150; 3024 x 1686 captures, shown at 1600 wide): the swimmers swim in all directions with different strokes (arms out of the water, the foam ring, the lower body tinted), keep inside the coping, and the cabin stands beside the pool with its themed textures. The images are reports/pools-p2-<theme>-top.png and -angle.png and a short clip reports/pools-p2-swimming.gif (--capture-sequence 40,4). The art was judged on these captures only, not against a capture of the original game (which has no pools).

The save roundtrip in the middle of a swim is also checked natively: OPENTPW_SMOKE_POOLS=1 bash scripts/run.sh ... --park-resume-smoke capture ... then restore (ParkResumeSmokeTest.Pools.cs) paints a pool, builds a room, puts three guests in the water at the save, and the restore phase finds the room and the swimmers in the water of the 24-cell pool and continues with the capture phase's canonical hashes.

Tests#

PoolSwimmingTests (the pure part): the heading table and the random stream, the region and the free water (rim, body, inner corner), steering in four shapes for thousands of turns (always in the water, a wander that reaches every cell, a turn at the rim, avoidance and the minimum distance, two swimmers on one point, determinism, boxed in). PoolsSwimSessionTests (a real GuestSimulation with a real ride script): the access cell and the region, the whole session (queue, change, swim in the water only, climb out, change back, path), the happiness, several swimmers, the walkers' lists, the catchable list and the counts, demolition at each stage, a closed park, the pool erased or shrunk, the pool tool's refusal, a guest who wants to leave, staff, the balloon, two rooms in one pool, the snapshot roundtrip in each state, an older snapshot, the validator, the hash and a guest that chooses the room. PoolsContentTests: the reserved ids, the four catalog entries (and none with the extension off), each cabin's model, textures and script (it releases after the changing time), the visitor bridge, the pool-side cells for every rotation, the placement rule, the eight sprite sets, the content's size, the asset keys of a save, and the whole chain with the shipped room and script. DeterminismTests.FixedRunWithAPoolAndAChangingRoomIsTheSameInEveryProcessAndGuestsSwim is the pin (docs/DETERMINISM.md, "Pools").

Activities ([EXT:pools-activities])#

An activity is something a swimmer does during its session besides swimming: a ladder to a diving board, a shower, a lounger, a water slide, a water attraction. Extras (P3), slides (P4) and water attractions (P5) are all IPoolActivitys (source/OpenTPW/World/Pools/PoolActivities.cs); the host is in GuestSimulation.Swimming.cs. Guests never reach them from the park paths (they are not attractions, IGuestDecisions has no entry for them): they are reachable only from the pool, as in RCT3, and they are free.

State 25, PoolActivity. The guest still names its changing room as its attraction and is part of the session (InSwimSession), visible, drawn with the swim sprites, in no walker cell list, counted with the walkers, and not catchable. Its generic fields (PoolActivityId, PoolActivityTarget, PoolActivityPhase, PoolActivityTurns, PoolActivityX/Y in 16.16 cells) belong to the activity, which keeps no per-guest state of its own. They are snapshotted (optional fields, written only in state 25, so every older JSON is byte-equal), validated (an id, non-negative phase and turns, a point inside the map, none of it outside state 25) and hashed only while the guest is in state 25.

The registry is GuestSimulation.PoolActivities (ordered by id; RegisterPoolActivity); Level fills it from PoolActivityRegistry.Create() (Level.RegisterPoolActivities) once, when the level's guests are made, while the extension is on, so no path runs with an empty registry. A simulation with an empty registry behaves exactly as before.

The cadence. Each turn of the water phase (Swimming, at least 24 turns left of the swim), the host asks the registered activities for an offer (Offer is pure), stopping at the first that has one. With no offer nothing is drawn. With an offer, one draw of the swimmer's own stream decides (one in 90 turns on average, PoolActivitySettings.OfferIntervalTurns); only when it is taken does the host collect every offer, in registry order, and a second draw pick one; then Start is called with the stream. An activity's Id and its target are saved with the guest: the target (PoolActivityOffer.TargetId, Guest.PoolActivityTarget) is always the thing id of the object that provides the activity (OriginalObject.ThingId), or 0 when there is none (a river); attraction ids are a separate counter and are never used. An activity whose StartOfferPercent is above 0 (the shower) is offered at the start of the session only: as the swim begins the host draws once per such activity that has an offer, and the guest does it with that chance before entering the water. A declined Start leaves the guest swimming.

A turn of the activity (Update): Continue goes on; BackInWater puts the guest back to Swimming (the host sets it at the pool-side cell if the activity left it outside the water); EndSession sends it to climb out like a finished swim. The swim's remaining turns do not run down during an activity, so an activity must bound itself. PlacePoolGuest and MovePoolGuest set or step the guest's position for an activity.

Ambient effects. A registered activity that also implements IPoolAmbient acts on every free swimmer (state 22 that took no offer this turn) once per park turn, before its stroke: a wave's push, a jet's spray. It must not draw from any random stream and must not move the guest. Drawn height. IPoolActivity.FeetHeight( simulation, guest, heights ) returns the engine height of the guest's feet for the frame, or null for heights.Default (the water surface on a pool cell, else the terrain); PoolFeetHeights also holds Water (the pool region's surface) and Deck (the terrain at the guest's point). A slide returns its track height, a ladder interpolates Water to Deck with the turns of its climb (on the spot), a board or swing uses Deck or Default plus its lift. Presentation only; GuestSimulation.PoolFeetHeight is what the swimmer renderer calls.

Aborts. Abort is called, and the session ends at once on the room's exit (EndSwimAtOnce), when the room is demolished, the pool beside it is gone or AbortPoolActivitiesOf( thingId ) is called for the object that provides the activity (it was erased; 0 aborts nothing). When the park closes, the activity is aborted and the guest is put back in the water (at the middle of its own cell when that is water of the region, else at the pool-side cell), then climbs out and changes back like a swimmer. A guest whose activity id this build does not register (a save made with an activity that is not registered now; the validator accepts it) ends its session on the room's exit at its next turn. An activity keeps PoolActivityTurns at most PoolActivitySettings.MaximumTurns (2400); the validator refuses a save above it, and the swim's own turns stay frozen in state 25 within the swim's range. The pool tool refuses to erase a cell under a guest in an activity.

Sprites. The swimwear slots are PoolSwimSlots (0 stand, 1 walk, 2 run, 3 ladder, 4 dive, 5 lying, 6 shower, 7 sliding, 8 to 10 the strokes, 11 splash-down, 12 sitting, 13 ring, 14 rope swing); the activity chooses the slot (IPoolActivity.SpriteSlot, default: treading water). A slot a set has no art for is drawn as tread water, then breaststroke, then crawl (GuestSpriteAtlas.UsableSlot, in the swimmers' renderer only). The hotspot of the strokes, the splash, the spa and the ring (8 to 13) is the torso at the water line, of standing, walking and the shower (0, 1, 6) the feet, and of the ladder, the dive, lying, sliding and the rope swing (3, 4, 5, 7, 14) the centre of the torso; the swimmers' renderer draws those five with their bottom edge at the guest's point (PoolSwimSlots.BottomAnchored, GuestRenderer.BottomAnchoredSlots), so the height an activity returns from FeetHeight is where the body rests in every slot: the feet on a rung, the back on a slide or a lounger.

Spacing of bodies in the water#

The numbers (PoolSwimSettings, PoolRiverSettings, PoolAttractionSettings; OpenTPW's own, picked from captures of a crowded pool):

WhatValueWhy
MinimumDistance0.7 cellthe hard minimum between two bodies. A 2x swim sprite is about a cell long and 0.4 wide; two side by side at 0.7 are clear, two in a row overlap only at nose and tail. A round test was chosen over a capsule: it needs no heading of the other body, and on the captures (a jungle pool of 80 cells with 40 swimmers, reports/pools-spacing-crowd.png) no bodies overlap visibly. 0.55 was tried first and still showed overlapping bodies
AvoidRadius1.2 cellsthe push away starts a cell and a fifth out, so a swimmer turns before the hard minimum stops it (a turn is limited to 11.25 degrees a park turn)
SwimmersPerWaterCell / MinimumCapacity1 / 2at 0.7 spacing a cell holds a body comfortably; a strip of two cells (1.26 cells of free length) holds two, and the smallest pools still take two
CrowdedRadius0.7 cellunchanged: the crowd at the steps is ignored on the way out, so nobody blocks the steps; this is the one place bodies may come closer than the minimum
FloatGap / FloatMinimumGap / DriftSpeed0.8 cell / 0.6 cell / 1/4 of the currenta floater with another body ahead within the gap only drifts; closer than the minimum gap it stands. A ring of cells takes a body a cell, so it never packs below 0.6 and the drift keeps a full ring turning; a float also runs out, so nobody floats for ever
LandingZoneRadius / LandingWaitTurns0.7 cell / 40 turnsa landing waits at the top for the zone to be free, at most 10 seconds, then goes anyway
JetSpotRadius0.42 cellthe three spots under a jet are 0.73 cell apart

Who is an obstacle. Free swimmers (state 22) and swimmers on their way out (23) keep to the minimum from every body in the water of their region: states 22 and 23 and the state-25 guests whose activity says it is in the water. The host's notion is IPoolActivity.InWater( simulation, guest ) (default false), asked of the guest's activity (GuestSimulation.IsWaterBody): a river floater and a wave pool's ring floater always; a guest under a jet always (swimming to it and standing); the rope swing, ladder, diving board and lounger while the guest swims to them and from the jump on (rope swing: phases 0 and 3; board: steps 0, 4 and 5; ladder and lounger: steps 0, 5 and 6); the spa while swimming to it. A guest on a ladder, a board, a platform, a lounger or a spa seat is not a body in the water. A guest in the water counts towards the pool's capacity the same way.

Activities in the water. River floaters keep their gap along the lane: a floater does not advance at the current's speed while another body in the water (a floater, or a swimmer in the lane) is ahead of it (on the side of its next step) within 0.8 cell, it drifts at a quarter of the speed, and stands only when that one is closer than 0.6 cell. Jets give each guest a spot: the first of a fixed list (three spots a third of a circle apart round the water-side cell's middle, three between, two wider rings of sixteen, the middle) that is free water and at least 0.7 cell from the other guests' spots at this jet; it is kept in PoolActivityX/Y, the guest steps onto it when it arrives, and a jet with no free spot declines (the guest swims on). Landings (ladder jump, lounger jump, diving board, rope swing) wait at the top until no other body is in the water within 0.7 cell of the landing point: the ladder and lounger at the rim (the wait is counted in the turns of that step), the board at the end of the board (its pause is the turns above LandingWaitTurns, then the wait), the rope swing on its platform (the turns of the climb run on). The wait is capped at 40 turns so a zone nobody leaves holds nobody. The approaches of the activities (rope swing, jets, spa) steer round the bodies in the way until they are within CrowdedRadius of their goal; the ladder, board and lounger approach on a straight line as before. Slides keep their own launch wait (P4). Floaters do not give way to swimmers: a swimmer steers away from a floater.

Lookup. The bodies are found through a cell-bucketed lookup, rebuilt once per tick when the first swimmer asks (GuestSimulation.GatherWaterBodies: buckets of 2 x 2 cells, the 3 x 3 buckets round the point, which covers the 1.2 cell avoid radius with the one-cell margin of a body's move, the live state and position tested at the query), so a swimmer reads the few guests near it instead of every guest in the park. Guests are bucketed in guest-list order, so the result is deterministic; no random number is drawn and everything is integer or 16.16.

Capture. --debug-pool-lead N (smoke-only) sets the frames between painting the pool and the capture (default 59), so swimmers can swim for a while first: --debug-pool default --debug-swimmers 40 --debug-pool-lead 1500 --capture-frames 2000 shows the crowd after about 25 seconds (reports/pools-spacing-crowd.png, 40 swimmers in an 80-cell jungle pool; reports/pools-spacing-river.gif, 30 swimmers and floaters in a 10 x 6 pool with a perimeter lane, captured with --capture-sequence 40,6). Judged on the captures only: no two bodies overlap, floaters in rings keep their distance along the lane.

Tests. PoolsSpacingTests: a crowded pool (30 swimmers) never has two bodies closer than the minimum; free swimmers keep clear of a guest held in an activity, of a jet's guests and of a river floater; floaters keep the gap (a ring of 28 floaters 0.7 cell apart) and every float of a packed ring runs out; the three jet spots are apart; a rope swing and a dive wait for an occupied landing zone, go when it is free and go anyway after 40 turns; the capacity; and the lookup equals a scan of every guest in a 1,600-cell pool with 500 swimmers within a loose time bound.

Tests. PoolsActivityHostTests proves the host with a test-only fake activity: offer, start, continue, back in the water, end of session, declined start, the shower-like start offer, no draws and no hash change with an empty registry or an activity that offers nothing, the aborts (demolish, pool erased, park closed, target erased, unknown id), a save in the middle of an activity, the validator and the hash.

Extras (phase P3, [EXT:pools-extras])#

Six objects of the pools extension, one set per theme (Info.Ids 65000 to 65035: a theme takes a block of ten, 65000 jungle, 65010 hallow, 65020 space, 65030 fantasy, in the order ladder, diving board, shower, lounger, lamp, underwater light). They are features in the build menu's Features tab with the .sam key Pools.Extra n (PoolExtras), no entrance and no exit (nobody walks in), and Info.IsChoosable 0 so the park's guests never choose them: swimmers meet them in the pool, as activities (above). They cost 50 (ladder), 250 (board), 80 (shower), 100 (lounger), 30 (lamp) and 120 (light), OpenTPW's own values.

Deck. There is no new deck cell type. The "deck" of a pool is ordinary empty owned ground beside the water, which every extra takes with its own paving slab (the slab is part of the object's model, so the ground under it needs no cell type and reads as deck). That keeps the cell map, the save and every pin as they are; a real walkable deck cell (guests walking around a pool on tiles) belongs with the later "pool deck" item below.

Orientation. The back of the object (the top row of Info.Shape, +Y of the model, as the changing room's) is the water side; the rotation turns it. A land cell and its water cell lie in a line, which the placement rules and the activities share (PoolExtras.WaterDirection).

ObjectFootprintPlacement rule (PoolExtras.PlacementRule, refused as "needs a straight pool edge")Activity
Ladder1 x 1the water cell behind it and the two beside that one (along the edge) hold water: a straight edge, not a cornerextra.ladder
Diving board1 x 1, the board reaches 1.4 cells over the waterthe same, for two water cells out (a pool at least 2 cells deep from the edge)extra.board
Shower1 x 1a changing room beside it (4-neighbour of the room's footprint)extra.shower
Sun lounger2 x 1, two seatswater beside any cell of the footprintextra.lounger
Pool lamp1 x 1water beside itnone (decoration)
Underwater light1 x 1, a glow disc over the first water cella straight edge, as the laddernone (decoration)

The water beside a ladder, board, lounger, lamp or light cannot be erased (PoolBuildResult.ExtraNeedsWater: "A pool object needs this pool water", and the second cell out of a board), so a save that holds an extra always holds its pool; the shower holds none, its changing room does. Removing or demolishing an extra aborts its activities at once (AbortPoolActivitiesOf).

The activities. All four share the host's rules (one swimmer per ladder, board or shower, one per seat, read from the host's exact occupancy GuestSimulation.IsPoolActivityTaken, rebuilt only when a guest starts or ends an activity or a save is restored; the placed extras are read through PoolExtraSites, a list rebuilt once per park turn and whenever an object is placed or removed, so an erased shower is never offered, not even in the same turn; offered only when the swimmer has a straight line of free water to the foot of the extra; integer 16.16 motion; draws only from the swimmer's stream). The swimmer stays in state 25 and the activity keeps its step in the low bits of PoolActivityPhase (the direction to the water in the rest).

ActivitySteps (sprite slot)Numbers
Ladderswim to the foot of the ladder (crawl 8; 0.78 cell from the land cell's middle, at the rungs, facing the land), climb on the spot (3; the guest does not move, the drawn feet rise from the water surface to the deck over 8 turns), step over the coping onto the deck (walk 1; 0.53 cell, about 5 turns, to 0.25 cell from the middle), stand (0), walk to the rim (1), jump in (4; the feet fall back to the water), splash (11), back in the water; steps 0 to 6stand 5 to 10 turns (1.25 to 2.5 s); happiness +2
Diving board1 x 1, the board reaches 1.4 cells over the waterthe same, for two water cells out (a pool at least 2 cells deep from the edge)extra.board
Shower1 x 1a changing room beside it (4-neighbour of the room's footprint)extra.shower
Sun lounger2 x 1, two seatswater beside any cell of the footprintextra.lounger
Pool lamp1 x 1water beside itnone (decoration)
Underwater light1 x 1, a glow disc over the first water cella straight edge, as the laddernone (decoration)

The water beside a ladder, board, lounger, lamp or light cannot be erased (PoolBuildResult.ExtraNeedsWater: "A pool object needs this pool water", and the second cell out of a board), so a save that holds an extra always holds its pool; the shower holds none, its changing room does. Removing or demolishing an extra aborts its activities at once (AbortPoolActivitiesOf).

The activities. All four share the host's rules (one swimmer per ladder, board or shower, one per seat, read from the host's exact occupancy GuestSimulation.IsPoolActivityTaken, rebuilt only when a guest starts or ends an activity or a save is restored; the placed extras are read through PoolExtraSites, a list rebuilt once per park turn and whenever an object is placed or removed, so an erased shower is never offered, not even in the same turn; offered only when the swimmer has a straight line of free water to the foot of the extra; integer 16.16 motion; draws only from the swimmer's stream). The swimmer stays in state 25 and the activity keeps its step in the low bits of PoolActivityPhase (the direction to the water in the rest).

ActivitySteps (sprite slot)Numbers
Ladderswim to the edge (crawl 8), climb (3; the drawn feet rise from the water surface to the deck), stand on the deck (0), walk to the rim (1), jump in (4; the feet fall back to the water), splash (11), back in the waterstand 5 to 10 turns (1.25 to 2.5 s); happiness +2
Diving boardswim to the foot (8), climb the steps (3), walk out (1), pause at the end (0), dive (4) into the middle of the second water cell, splash (11), back in the water; the drawn feet rise from the water to the board with the steps, stay at the deck plus 1.32 engine units on the board and fall to the water with the dive (FeetHeight, by the way covered, not by a turn count)pause 3 turns, splash 4; happiness +6
Showeroffered at the start of the session (60 percent) when a free shower lies within 4 cells of the room's pool-side cell: walk from the pool-side cell (1), shower (6), walk back, back in the water12 to 20 turns (3 to 5 s); happiness +2
Sun loungerswim to the seat's water side (8; the same foot as the ladder's), climb on the spot (3; the same 8 turns), walk onto the seat (1; the feet rise onto the cushion), lie (5) still in the seat's middle 60 to 120 turns (15 to 30 s) along the seat, the feet towards the lounger's foot end and the head on its raised end whichever side the guest climbed out on (LoungerActivity.LieDirection), then 60 percent walk to the rim, jump in (4), splash (11) and swim on, 40 percent end the session (the guest is put back at the room's steps and climbs out; the lie ends by teleport, cosmetic)happiness +5

Speeds (16.16 cells a turn, PoolExtraSettings): swimming to the edge 0.12, walking 0.10, climbing the board's steps 0.07 (a ladder and a lounger's edge are climbed on the spot, ClimbTurns), jumping 0.20, diving 0.22. The host offers one in 90 turns on average while any activity has an offer (PoolActivitySettings.OfferIntervalTurns; at least 24 turns of the swim left), so a swimmer of 40 to 70 seconds takes about two offers.

The ladder's geometry. Measured on the shipped model (PoolsExtrasTests.TheLadderModelsRungsAreAtTheFootPointWhereTheGuestClimbs; 10 model units a cell, Z the depth of the cell, 0 at the back, Y up with the deck at 0 and the water 0.6 below it): the coping is the outer quarter of the pool cell, so the top of the wall, where the water starts, is 0.75 cell (Z 12.5) from the middle of the land cell. Each of the two rails (X 2.9 and 7.1) stands on a foot plate on the coping (Z 11.3), rises to 5.2, curves over in a half circle and goes down along the wall at Z 12.6 to 13.0 (0.78 cell, 0.1 unit off the wall) to 4.2 units below the deck, held by two brackets on the wall; five rungs 1.7 units (0.34 engine units, about a quarter of a kid's height) apart run between the rails from 3.4 above the deck to 3.4 below it, so the water line crosses the third. The climbing guest's foot point is the rungs' line (PoolExtraSettings.LadderFootDistance = 0.78 cell, asserted against the model within 0.15 units), the sprite right at the rungs. The water lies only 0.12 engine units (0.6 model units) below the deck, so the climb is a rise of that much (more on sloping ground). An earlier version had the rails over the coping with the rungs above the deck, swam to 0.92 cell, the point where swimmers keep free of the wall, and glided diagonally to the land cell's middle while rising, which read as floating out of the pool; the lounger had the same glide. The board's steps still climb diagonally (a staircase, judged acceptable). Regenerate the ladders alone with tools/blender/opentpw_pool_extras.py --objects ladder and the kit's object command as in tools/pools/build-content.sh step 2b.

The lounger's lying guest. The lounger's model (tools/blender/opentpw_pool_extras.py, add_lounger) has two seats side by side, each a cushion from the front of its cell (the raised head end, up to 5.8 model units) to the back (the foot end), so a guest lies along the lounger's own back direction, PoolExtras.WaterDirection of its rotation, and the lying frames have the feet towards the heading. A lounger may stand with its side or its head end to the water (the rule asks only for water beside a cell), so that is not always the side the guest climbs out on. An earlier version faced the lying guest towards the side it came in from, so a guest who climbed out at the side lay across the seat over its backrest, and the first lying turn still had the heading of the step onto the seat; the pose is now set as the lie starts and kept for every lying turn (PoolsExtrasTests.AGuestLiesAlongTheLoungerWithItsFeetToTheFootEndWhicheverSideItClimbedOutOn, all four rotations, and TheLoungersRaisedHeadEndIsAtTheFrontAwayFromItsBack against the shipped models). The two lying frames are two resting poses (the arms at the sides, the hands behind the head), held PoolSwimSlots.LyingPoseSeconds (7 s) each (PoolSwimSlots.ActivityStep); they used to run at the activities' six frames a second, so a lying guest flapped its arms the whole lie. The lying guest is drawn pulled 0.75 engine units towards the camera (PoolExtraSettings.LoungerDepthPull, LoungerActivity.DepthPull, also used by the picker), because the camera-facing quad stands at the seat's middle and the raised head end and the front half of the seat hid the head and the near side of the body; the pull is along the view direction, so the screen position shifts only by the perspective's small share. All three are presentation or heading changes: the hashed heading differs for a guest that climbed out at a lounger's side or head end for its whole lie, and for every lounger guest on the one turn it lies down (it used to keep the heading of the step onto the seat until the next turn); nothing in the simulation reads the heading, and no determinism pin moved (the pinned extras run's lounger has its back to the pool and its hash is taken at the end of the run). Checked on screen with --debug-pool default --debug-swimmers 6 --debug-pool-offset 3,3 --debug-extras --debug-sim-minutes 0.1 --capture-camera 38,-46,40,-90 --capture-sequence 60,15 (the debug lounger stands at rotation 90 with its side to the pool) and the same scene at yaw 0, 90 and 180. The kid art is longer than the seat, so the feet reach past the cushion's end.

Not done. The brief's "swimmers climb out by the ladder" and "use it to reach the board" are done as the ladder's own climb-out and jump back in and the board's own steps: the swim session still ends at the changing room's pool-side cell, and the board has its own tower, so no swimmer ends its session on a ladder (and a lounger's end of session is a teleport to the steps). Without a ladder, a swimmer simply climbs out at the steps; the optional cosmetic "haul out / jump in with a splash" at a plain edge was not made. A particle splash on landing was not added (the splash is the swim sprite slot 11 of the hi-res swimwear sets).

Content. tools/blender/opentpw_pool_extras.py builds the six objects for each theme (themed textures from the changing room's generators, 32 x 32 each so the browser build stays small) and tools/pools/build-content.sh turns them into content/pools/objects/<theme>/<extra> with tools/pools/extra-*.sam and extra.rse (an inert script). objects.json is append-only: the 24 entries follow the four rooms.

Checking it on screen. --debug-extras (with --debug-pool and --debug-swimmers) builds one of each extra through the level's own placement beside the painted pool and sends the first swimmers straight into a ladder, a board, a lounger and a shower (Level.BuildPoolExtrasBeside, GuestSimulation.DebugStartActivity). --debug-sim-minutes 0.14 runs the simulation until the activities are under way before the capture. The images are reports/pools-p3-<theme>-extras.png; these captures were made before the swimwear sets shipped, so the swimmers are drawn with the treading-water slot and read as heads behind the ladder.

Tests. PoolsLevelTests.RealExtrasThroughTheLevel... places real extras through the level (the placement hooks, PoolExtras.Sites, the site cache, RegisterPoolActivities, the erase abort through ObjectRemoving, PoolEraseBlock giving ExtraNeedsWater) and saves in the middle of a shower with an identical hash after the restore. PoolsExtrasTests: the 24 objects (ids, shapes, no guest choice, models and textures load, stay inside their cells), the placement rules, the erase guard, each activity's steps, positions, slots, durations and happiness, two seats and no shared seat, no draw without a placed extra, a save in the middle of the ladder, the board and the lounger. DeterminismTests.FixedRunWithPoolExtrasIsTheSameInEveryProcessAndGuestsUseThem is the pin.

Water slides (phase P4, [EXT:pools-slides])#

Water slides are modelled on the pool slides of Roller Coaster Tycoon 3 Soaked!: built like coasters, reachable only from the pool, free to ride, and ending in the pool. They are an IPoolActivity (slide.ride) of the swim session, so no guest ever reaches one from the paths and IGuestDecisions has no entry for them. Code: source/OpenTPW/World/Pools/Slides/, Level.Slides.cs, GuestSimulation.Slides.cs; the track rule is also described in TRACKS.md.

The least invasive build. A slide is not a kart or water track and not a coaster: those need a station object, a closed circuit and a controller (BumpController, TrackCircuitWalker), none of which a slide has. The slides share the vocabulary of the track system (a track of one-cell pieces: straight, bends, an end piece; the cell-by-cell tool; the piece price; the pylons) and nothing of its code, so every other track type keeps its closed-circuit rule untouched (PoolSlidesTests.TheRulesAreOffWithTheExtensionOffAndEveryOtherTrackKeepsItsClosedCircuitRule; the files of the track code are untouched) and a slide writes no cell of the map: its land cells are reserved through the existing hooks (Level.IsPathBlocked for the path, pool, staff and track tools, ParkObjects.IsReserved for objects) and its water cells stay pool water.

The tower (PoolSlideTowers)#

A slide tower is an object of the Features tab (Info.Ids 65100 to 65103, the open-flume tower of jungle, hallow, space and fantasy, and 65104 to 65107, the closed-tube tower), a 2 x 2 platform with a staircase (tools/blender/opentpw_slide_tower.py, then opentpw-kit object). Its .sam carries OpenTPW's own keys Pools.SlideTower 1, Pools.SlideProfile (0 flume, 1 tube) and Pools.SlideCapacity (4); it has no entrance, Info.IsChoosable 0 and costs 600. Like the changing room it is placed with water beside its front: the stairs face the pool, on the shape's top row (the local -V side at rotation 0), and the cells beyond that face (two for the 2 x 2 tower) are its pool-side cells (PoolSlideTowers.PlacementRule, OriginalPlacementResult.NeedsPool; the HUD says "A slide tower must stand beside a pool"). The first pool-side cell that holds water now is the foot of the stairs. The platform's top is exactly five engine units above the highest ground of the footprint (PoolSlideTowers.TopHeight; 25 model units in the model), where the track starts and the waiting riders stand. Capacity: how many riders wait on the platform (a tower's Pools.SlideCapacity, 4).

The track (PoolSlide, PoolSlideRules, PoolSlideWorld)#

The ride (PoolSlideRide, PoolSlideSettings; every number OpenTPW's own)#

One rider at a time per position; there are no cars. Every rider runs the same integer physics along the track: each park turn speed += slope-per-mille x 100 / 1000 - speed / 8, at least 24, from a launch speed of 64 (1/1024 cell per turn), so the speed settles at about eight times the pull: 0.6 cells a turn on the steepest slide (0.8), 0.15 on the gentlest (0.2). Because the physics depends only on the slide, a rider's place is a pure function of the turns since its launch (PoolSlide.PositionAtTurn, a table built once), and a rider saves nothing but that counter. The standard 7-piece, 6-cell slide takes 25 park turns (about 6 seconds). The next rider leaves when the one before is 1.5 cells down the track.

The activity (PoolSlideActivity, slide.ride)#

Art#

The tower is a Blender-made model (the kit's object, tools/pools/build-content.sh step 2b) in the changing room's four themed textures, a finial telling the profiles apart (a pennant on the flume's tower, a wide cap on the tube's). The track and the pylons are generated in code, not rigid kit models, because the track must follow any slope and turn: PoolSlideMeshBuilder sweeps the profile along PoolSlide.PointAt, an open half pipe with lips for the flume and a closed ring for the tube (its riders are not drawn inside it), with a square pylon under every piece (on the ground, or on the pool floor under the splash chute). The textures are generated per style (PoolSlideTextures, from PoolStyles: the flume takes the style's bright shallow-water colour, the tube the coping's colours), drawn with the pool deck's shader (pool-deck.shader, so the browser build has nothing new) by PoolSlideRenderer, which the level makes with the pool renderer so the riders and swimmers draw after it.

Saves and determinism#

ParkResumeSnapshot.PoolSlides (PoolSlidesSaveData: tower, profile, start, heading, pieces and the two heights per slide, in tower order) is written only when the park has a slide, so every other park saves the same bytes. It is shape-checked on load (PoolSlideSaves.ShapeProblem: bounds, order, known pieces, the extension recorded) and restored over the towers by structure only (PoolSlideRules.ValidateStructure: the tower is there with the slide's profile, the start beside it, the cells owned, empty or water and used once, the recorded top height the tower's; two slides never share a cell). Nothing that depends on the pool is checked at load, because the pool tool may legally change it after the slide was built: whether a slide is usable is IsUsable, and a state the game can be in always loads. The guests on slides are then checked against the slides (PoolSlideWorld.ValidateGuests: a phase 0 to 4, a slide whose tower has the guest's target thing id, and a finished slide for riding and splashing guests), so a forged save cannot send a guest down a track that is not there; PoolSlideActivity also treats an unfinished slide in those phases as missing (the guest leaves the session). The guests' activity fields are the host's (ride position = the turn counter). The canonical hash covers the slides only when there are any (PoolSlideWorld.AddCanonicalState, from GuestSimulation.AddCanonicalState). New pin: PoolSlideActivityTests.PoolsSlidesFixedRunHash (docs/DETERMINISM.md, "Pools").

Tests#

PoolSlidesTests: geometry (cells, lengths, continuity, quarter circles, heights), every rule's reason, the builder, refunds and money, the land reservation, usability, the ride physics (monotone, repeatable, speed from slope), saves, the hash, the route search and the tool's slide mode. PoolSlideActivityTests (the swim session's real rig and ride script): the whole ride phase by phase with the track positions and feet heights, offers, the capacity, the order and the gap, demolition in every phase, an unusable slide, a save in the middle of a ride that continues with the same hash, no draws and no hash change without slides, and the pin. PoolSlideLevelTests (a real Level): placement, registration, the reservations, demolition, the erase refusals, the resume capture. PoolSlideContentTests: the eight towers, their models, scripts and placement. PoolSlideMeshTests: the shell, the pylons and the textures.

Checking it on screen#

--debug-slide flume|tube (smoke-only, [EXT:debug-slide]; it needs --debug-pool and the extension) builds the theme's tower of that profile beside the pool through the level's own placement (charged; the rule needs the pool at its front), finds the shortest valid route with PoolSlideRoutes and lays it piece by piece through the slide world; the log prints the engine points of the track's middle and splash for --capture-camera. --debug-pool-at N builds the pool at frame N instead of 59 frames before the capture, so swimmers have time to climb and ride:

bash scripts/run.sh --game-path '/path/to/Theme Park World' --load-original-level jungle --enable-mod opentpw.pools \
  --debug-pool 0,0,7,6 --debug-swimmers 14 --debug-slide flume --debug-pool-at 100 --silent \
  --capture-world slide.png --capture-frames 1500 --capture-sequence 60,6 --capture-camera 51,-12,70,-90

First on-screen check (October 17, 2026; Jungle with a flume tower, Fantasy with a tube tower, a 7 x 6 pool, 14 swimmers, 3024 x 1686 captures shown at 1600 wide, the camera at 51,-12,70,-90 with --debug-pool-offset 2,-3 for the track and without it for the splash, and 31,-32,70,-90 in Fantasy): the swimmers swim to the foot of the stairs, climb, wait on the platform, ride down the flume (riders drawn lying in it, one behind the other at the gap), and splash down in the pool; the tower stands with its stairs facing the pool and the track leaves it from the side. (That check is superseded by the one below.) The images were reports/pools-p4-jungle-flume.png (tower, track and a rider), reports/pools-p4-jungle-splash.png (riders landing), reports/pools-p4-fantasy-tube.png (the tube slide with its pastel tower) and a short clip reports/pools-p4-slide.gif (--capture-sequence 60,6). The art was judged on these captures only, not against a capture of the original game (which has no pools). The riders are drawn with the crawl slot until the swimwear art for slots 7 and 11 lands.

Second check (the stairs, the deck, the closed tube; reports/pools-p4-final-*.png, -side from the other side of the tower, 1600 wide): --debug-pool-offset 2,-3, Jungle flume with the camera at 46,-17,45,-90 (the climber on the flight with its back to the camera, a rider lying whole in the bed), seen from yaw 0 and 90 (the waiter standing on the deck at its spot, the flight beside the post), and the Fantasy tube at 31,-32,75,-90 and 90 (a closed ring, no rider inside it, waiters on the deck, a rider shooting out into the pool).

The save roundtrip in the middle of an activity is also checked natively: OPENTPW_SMOKE_POOLS=slide (both phases, with --enable-mod opentpw.pools) adds a slide tower and its slide to the resume fixture and saves while guests are on the stairs; the restore phase finds the slide complete and usable over its tower with the guests on it and continues with the capture phase's canonical hashes (ParkResumeSmokeTest.Pools.cs).

Water attractions, waves, spa and lazy river (phase P5)#

Five objects per theme (twenty, content/pools/objects/<theme>/{ropeswing,jets,wavemachine,spa,bigspa}, Info.Ids 65200 to 65219, Content) and one special kind of pool region, all IPoolActivitys or effects of the swim session (Activities); source/OpenTPW/World/Pools/PoolAttractions.cs, PoolWaterActivities.cs, PoolWaves.cs, PoolWaterEffects.cs, PoolRiver.cs, PoolSpray.cs. Every number is OpenTPW's own (PoolAttractionSettings, PoolRiverSettings, PoolWaves): the original has no pools.

The objects and their placement rule ([EXT:pools-attractions])#

The objects are data only, made with the content kit (tools/blender/opentpw_pool_attractions.py, one geometry per kind, styled per theme; no entrance, no exit, no queue, no guest ever walks to them: Info.IsChoosable 0, so they are no attraction of the guests and GuestSimulation.Attractions does not list them; they are objects of the Features tab). Two own .sam keys say what they are: Pools.Attraction ropeswing|jets|wavemachine|spa and Pools.WaterSide N|E|S|W|*, the compass side of the unrotated shape (its top row is north) that must face the water (* is any side). The water side of a placed object is, for every footprint cell, the neighbour on that side turned with the object that is not part of the footprint; a rope swing, jets and spa are 1 cell, the wave machine 2 x 1.

ObjectShapeWater sidePriceDoes
Rope swing (65200 to 65203)*N600an activity, one guest at a time
Water jets (65204 to 65207)*N450an activity for up to 3, and a spray bonus for every swimmer near it
Wave machine (65208 to 65211)**N1500the waves of its pool
Spa pool (65212 to 65215)*any800an activity with 1 seat (the middle of the tub)
Large spa pool (65216 to 65219)** / **any1800the same activity on a 2 x 2 footprint with 4 seats

Rope swing (attraction.ropeswing)#

A swimmer is offered the nearest rope swing nobody is on (the offer is the water-side cell). Phases (PoolActivityPhase; PoolActivityTurns counts the phase's turns): 0 swims to the steps with the swimmer's steering (at most 80 turns, else it swims on), 1 climbs onto the platform (the guest is set on the object's own cell, sprite slot 3, 10 turns, its drawn height rising to 0.9), 2 swings out along the line from the platform over the water-side cell to a point half a cell beyond its middle (slot 14, 14 turns, FeetHeight runs from the deck up the ladder to the platform, then falls to the water level in an arc and stays on it for the splash), 3 splashes (slot 11, 6 turns), then +6 happiness and BackInWater. Everything but the turn count is derived from the object, so a save in any phase continues identically (ASaveInTheMiddleOfEachRopeSwingPhaseRestoresAndContinuesIdentically). Refusals: no offer while someone is on it; an object that goes brings the guest back into the water; an abort sends it out of the session.

Splash cannon and water jets (attraction.jets, [EXT:pools-attractions])#

Two effects. The activity: a swimmer is offered jets with room (3 at once) and stands under the spray at the water-side cell for 15 to 30 seconds (60 to 119 turns drawn from its own stream), treading water (slot 10) or sitting (slot 12), 0.5 happiness every 24 turns and +3 at the end. The spray bonus: every free swimmer within two cells (Chebyshev) of a jet's water-side cell gets +0.3 happiness every 12 park turns (PoolWaterEffects, an IPoolAmbient; no random draw). The jets show a particle spray: 36 droplets per jet fly a parabola from the nozzle over the water and fall into it (PoolSpray, a pure function of the time, drawn as small camera-facing quads by PoolSprayRenderer through the particle shader; presentation only).

Spa pool (attraction.spa)#

A swimmer is offered a spa with a free seat. The spa has one seat, the middle of its tile (SpaActivity.Seat; PoolAttractionSettings.SpaSeats 1, SpaSeatRadius 0, seat 0 to the east if a radius is ever set); it is the guest's PoolActivityX/Y from the start, so two guests never share it. Phases: 0 swims to the steps, 1 steps out onto the (dry) tile and sits (slot 12, 80 to 199 turns drawn, 0.4 happiness every 24 turns), 2 steps back into the pool, +8 happiness. A second swimmer finds no offer while the seat is taken and swims on. A save restores the seat (ASaveInTheSpaRestoresTheSeatAndTheGuestSitsOnIdentically).

Why one seat (October 17, 2026). The first version had eight seats on a circle of 0.27 cell and a seated height of 0.35 engine units above the deck, and the guest sat half through the tub's wall. Measured from the shipped models (PoolsSpaGeometryTests; 10 model units a cell, 0.2 engine units a model unit): the old tub's basin had an inner wall 3.7 units from the middle at its corners (3.42 at its flat sides), the wall's top was at 5.6 units, the bench at 4.8 and the water at 4.3, and the seated sprite (slot 12, a camera-facing billboard) reaches 0.729 engine units (3.65 model units, 0.36 cell) each side of its hotspot below the rim and hangs 0.44 to 0.77 engine units below the hotspot. So the sprite alone was as wide as the whole old basin (a seat at 2.7 units plus 3.65 reached 6.4 units; the wall's outside is at 4.3), and 0.35 engine units (1.75 model units) put the water line of the body 3.5 units below the water, inside the slab's coping, with the sprite's lower end under the floor. The fix has three parts, all inside the extension: the basin is widened to an inner circumradius of 4.0 model units (3.70 at the flat sides, 0.74 engine units; SPA_INNER in tools/blender/opentpw_pool_attractions.py), the bench and its dividers are gone and the water fills the basin to 5.2 units (1.04 engine units, PoolAttractionSettings.SpaWaterHeight; the wall top stays at 5.6), and the one seat is the middle with the torso at that water surface (SpaActivity.FeetHeight = deck + SpaWaterHeight). A second seat cannot fit: a basin of 1.48 engine units across holds a sprite 1.46 wide with no room to spare, and the tile (one cell, 2 engine units) bounds the tub. A larger spa would need a 2 x 2 footprint (not done). The test reads the water height, the rim, the floor, the middle and the basin's radius from every theme's spa.MD2 and the sprite's width and depth from every swim set, and checks every seat and the drawn height against them.

The large spa (bigspa, October 17, 2026). A second spa object of 2 x 2 cells (Pools.Attraction spa with a 2 x 2 Info.Shape, water side *, Info.Ids 65216 to 65219, price 1800, tools/pools/bigspa.sam, add_bigspa in the Blender script, one bigspa archive per theme). It is the same activity: SpaActivity.SeatsOf gives 4 seats to a site of four cells and 1 to the small one, and the placement rule, the access cell and the erase guard work as for every footprint (the water side is the first water cell around the four cells, in footprint order, for every rotation). The basin fills the footprint: outer wall circumradius 9.9 model units, inner 9.25 (flat sides 8.55 units, 1.71 engine units from the middle, wall 0.6 thick), rim 5.6 and water 5.2 as in the small tub, so the seat rule is the same: seat distance plus the sprite's 3.65 units each side of its hotspot below the rim must stay within 8.55, which allows 4.9 units. The four seats are on a circle of 0.48 cell (4.8 units) round the middle of the footprint at 45, 135, 225 and 315 degrees (PoolAttractionSettings.BigSpaSeats, BigSpaSeatRadius), one in each cell, 0.679 cell apart: the sprite is 0.73 cell wide at the water line, so neighbours overlap by less than a tenth. A fifth seat on the circle would be 0.56 cell from its neighbours (AFifthSeatInTheLargeSpaWouldNotFitWithoutCrowding), and the tile bounds a larger tub. PoolsSpaGeometryTests checks every seat of both spas against each theme's measured model; FourGuestsSitInTheLargeSpaAtOnce... runs four guests at once with the rest swimming on.

Wave machine and waves ([EXT:pools-waves])#

The machine stands on the pool edge (same rule). Settings belong to their machine: on or off, a height (1 low, 2 medium, 3 high) and an interval (0 short, 1 medium, 2 long), PoolWaveSettings, stored in the flags of the machine's own access cell (the water-side pool cell it stands at: ParkCellFlags.PoolWavesOn, PoolWaveHeightMask 0x0300, PoolWaveIntervalMask 0xC000; a stored height of 0 means "none stored", and a machine with none stored runs the default, on, 2, 1). They are therefore saved, validated (ParkLayoutSnapshot.ValidateCells refuses other flags on a pool cell, wave bits without a height, and river or wave bits on any cell that is no pool cell, except the original's station head bit 0x100 on a coaster's marker cell, type 21, which a wave height bit shares; see COASTER-CELL-MARKERS.md) and hashed with the cell map, with no format of their own. A pool has waves only while a wave machine of it is on (PoolWaveSettings.ActiveIn: the machine with the lowest object id whose settings are on; machines do not add up, and bits on a cell with no machine do nothing), so removing the machine takes the waves away and nothing is left to run unattended. Erasing the cell clears its bits (the access guard keeps the last water cell of the machine's side and a cell that someone is using). The settings window (ParkHud.OpenWaveSettings): the object window of a selected wave machine (a Features object, shown in the shop table) has a Wave settings button in the row where a shop has its quality slider and price box, which a wave machine does not show; it, or a second click on the machine that is already selected (never the selecting itself, from the park or from the attractions list), opens OpenTPW's own window titled with the machine's name (UiDialogs.CenteredWindow, the original's w_dialog frame and b_ltoggle toggles that play cat_ui 0xBD like the original's radio groups): waves on or off, the height (low, medium, high) and the interval (short, regular, long: a rest of 40, 100 or 200 turns), with the machine's settings selected. The choices edit the window's copy; the tick writes them to the machine (Level.SetPoolWaves), the cross, Escape or a right click leave them as they were. It does not open in a read-only visit (where the button hides like the object window's other settings controls), in the chat mode, over another window or while a build tool is armed; an unchanged tick writes nothing. Every text is in all eleven languages (OpenTpwText.PoolWaves*). Level.CyclePoolWaves still steps the presets (PoolWaveSettings.Presets) for scripted use. RCT3 keeps these settings in the changing room's window.

The waves (PoolWaves): what the simulation reads is turn counts and integers (running, the envelope, the happiness, the push); what is drawn is one floating-point plane wave at the frame's time (SmoothWave). A run of 120 turns (30 s) swells in and out over 12 turns each, then rests 40, 100 or 200 turns by the interval; the wave is a plane wave of period 24 turns (6 s) running along +x +y whatever the machine's direction, 21/64 of a period per cell (about three cells long); the water shader's strength is the envelope times height / 3, and the surface rises and falls by that strength times PoolWaves.MaxHeave (0.105 engine units, under the 0.12 the water lies below the deck); the swimmers' bob is the same rise, 0.035, 0.07 or 0.105 by height, and the water level an activity draws its swimmer at rises with it (PoolWaterEffects.SurfaceRise). Four things read it:

Ring floaters (waves.ring)#

While a pool's waves run, a free swimmer may take one of the pool's inflatable rings and bob on the swell (WaveRingActivity, registered with the water attractions; offered like the other activities, at the host's cadence). It is offered only while at least 40 turns of the wave machine's run are left, never in or beside a lazy river lane or beside the pool's steps, and only while the pool has a ring free: one ring per four bodies the pool takes (RingsOf, at least one), counted against the wave machine (the offer's target), so a removed machine aborts its floaters like any attraction. A float lasts 60 to 120 park turns (15 to 30 seconds; the only draw, from the swimmer's own stream), never beyond the end of the run, and is drawn with the lazy river's ring slot (13). The waves rock the floater to and fro: PoolWaves.Sway is the push on the crest and as much back along -x -y in the trough, applied through PoolSwimming.Drift (free water, 0.7 cell from the other bodies, never into a lazy river lane); when the swell has carried it more than a quarter cell from the spot where it took the ring (kept in PoolActivityX/Y), it paddles back at 1/20 cell a turn (integer arithmetic), so it bobs about its spot instead of being carried to the far wall. A floater is paid by the waves as a free swimmer is (PoolWaves.HappinessGain, once per period) and 2 more at the end of a whole float; waves switched off or a machine taken away end the float at once, without the bonus. The guest's swim time does not run while it floats, as in every activity. The floater is a body in the water, and its bob is the surface's rise like every swimmer's. A pool without running waves offers nothing and draws nothing, so no pin moves (the water-attractions run's pool is all lazy river, where no ring is offered).

Lazy river ([EXT:pools-river])#

A river is a ring of pool cells painted with the river option of the pool tool: a third buy-list row, "Lazy river water" (row id -20, same price as a pool cell, PoolTool.Begin( erase: false, river: true )). The option sets ParkCellFlags.PoolRiver (0x1000) on the painted cells; on a cell that already is water it only sets the flag, at no price (PoolBuildResult.RiverMarked; undo clears it). Erasing a cell clears its flag. A cell that carries a flag of the original (the entrance complex's, a fixed path's, an add-on's) is not painted over (Occupied): a save's pool cells hold no such flag, and clearing it would change the park.

The extension point is PoolRiverMap, derived on demand from the flags and cached per change of the pool cells (PoolRiverMap.Of( cells ), nothing stored): a ring is a 4-connected set of at least four flagged cells in which every cell has exactly two flagged neighbours, so one lane wide (a lane that touches itself, a dead end, a branch or a solid block is plain water). The region knows IsRiver( x, y ), the ring a cell belongs to, NextCell and FlowAt( x, y ) (a unit step), so the current's direction per cell comes from the ring whatever its shape: it runs clockwise as the map is drawn (east along the ring's first row, then down). A river may be painted as its own channel or, to be wide, as the perimeter lane inside a larger pool (the captures do; the pin uses a channel round land): the lane carries swimmers round, the water inside is ordinary. A one-cell channel is drawn narrow (the rim takes a quarter of a cell on each side).

The activity (attraction.river, RiverActivity) needs no object and no host change: a swimmer whose cell is a river cell is offered it (no target, TargetId 0) and takes it on the usual cadence. It then floats in a ring (slot 13) instead of free swimming: each turn PoolRiverMap.Float moves it 1/14 cell (0.28 cells a second, slower than a swimmer's 0.37 to 0.85): it keeps the way it came in by until the middle of the cell, then takes the cell's flow, and loses an eighth of its offset across the lane, so it follows the middle line of the lane round every bend, which is free water in every cell of a ring, inner corners included, and never cuts a corner square that is coping (TheFloaterFollowsEveryShapeOfLaneRoundItsBendsWithoutEverLeavingFreeWater: channels round land, L and T shaped lanes); after 120 to 239 turns (30 to 60 s, drawn at the start) it gets +5 happiness and swims on. Only a float that ran its turns is paid: a ring broken under the floater lets it go, unpaid. The water surface of river cells carries the flow in its normal's x and y (PoolMeshBuilder.Build's flowAt) and the shader scrolls the caustics along it. The saved state is the guest's position and the turns left, so a save while floating continues identically.

Checking it on screen and tests#

--debug-pool takes rectangles written with a leading r as river rectangles (--debug-pool "r0,0,12,1;r0,7,12,1;r0,1,1,6;r11,1,1,6;1,1,10,6": a perimeter lane round a pool), --debug-attractions ropeswing,jets,wavemachine,spa (or all; [EXT:debug-attractions]) places the objects beside the pool through the level's own placement, next to --debug-swimmers N. Captures (reports/pools-p5-<theme>.png, 1600 wide; reports/pools-p5-waves.gif, reports/pools-p5-river.gif) show the four objects with the spray, the wave bands moving across the water and the swimmers floating in the lane. At the time of these captures the swim sets had no art for slots 3, 11, 12, 13 and 14 and the host fell back to the nearest slot; the shipped hi-res swimwear sets now hold all 14 slots.

PoolsAttractionsTests (rig of the swim session, no game data): the water-side geometry for every rotation, the wave settings in the flags, the wave function (runs, rests, envelope, pure, bounded, travelling), the happiness once per period, ring detection (rectangle, L, plus, line, solid block, 2 x 2), the current's lap, every activity in full with its happiness, one-at-a-time, capacity, the spa's one seat, aborts, a save in the middle of each phase restored to the same hash and the same continuation, a river without offers changing no hash and drawing nothing, the pool tool's river option with undo, the flags through the layout save and the validator refusing forged ones, the ambient effects (waves that are off change nothing; running waves push along their way on the crest and pay, and a save while they push continues identically), the spray function. PoolsSpaGeometryTests: every theme's spa model measured (middle, basin, water, rim, floor) against the seated sprite and the seat and drawn height. PoolsAttractionsContentTests: the sixteen shipped objects with their keys, shapes, prices, models and textures, and the placement rule for every rotation. PoolsAttractionsLevelTests (a real Level): the rule through the level's hooks, the site derived from the placed object and no attraction of the guests, the erase guard, the default waves of a new machine and the presets, the settings window (each choice, the tick, the cross, only for a wave machine, and every control inside the window), removal. The pin is DeterminismTests.PoolsAttractionsFixedRunHash (docs/DETERMINISM.md, "Pools"). The native park-resume smoke (OPENTPW_SMOKE_POOLS=1) now also paints the basin's perimeter as a river, builds the four objects and checks that the ring, the waves and the objects come back from the save.

Saves and determinism#

See the save rule. The pins (docs/DETERMINISM.md, "Pools"): every existing pin is unchanged with the extension on or off (PoolsTests.TogglingThePoolsExtensionKeepsEveryExistingPinWithoutPoolCells), the fixed synthetic run on a cross park with 17 pool cells painted through the builder has its own pin, DeterminismTests.PoolsFixedRunHash (a park with pools and no changing room behaves exactly as in P1: the pin did not move), and the same run with a pool and a changing room in which guests swim has DeterminismTests.PoolsChangingRoomFixedRunHash. The extension's version stays 1.0.0: phase P1 was not released, a P1 park holds no room and behaves the same under P2, and a P2 park with a room does not load in a P1 build (the object is unknown there).

Not done yet#

Pool bridges ([EXT:pools-bridges])#

The Miscellaneous buy list has one Pool bridge row; a bridge is taken down with Backspace (see "Removing with Backspace" below). A bridge costs 1200, spans three water cells and has two approach cells on either bank (seven cells long, one wide). The one row builds in all four directions: while the bridge is in hand it turns with the blueprint keys of an object, in the object's own sense: comma adds 90 degrees and full stop 270, and ObjectFootprint maps the along axis (1, 0) at rotation 90 to (0, -1), so comma takes east to north, then west, then south (PoolTool.RotateBridge subtracts the steps from the GuestPathGrid.Directions index, ParkHud.BlueprintTurnSteps); it starts east each time the row is chosen. Its first approach cell is the placement anchor, so the click is on the first land cell and the bridge extends in the chosen direction. No path is needed at the outside ends: the cell just outside each end only has to be free ground the bridge can open onto, and the player lays a path there whenever they like. The fixed model currently requires flat land (corner range at most 0.01 engine unit). Right click or Escape cancels; with no tool on, Backspace over a bridge takes it down again.

The buy window's preview of the row is the bridge's own committed Blender mesh (PoolBridgePreview): bridge.json is assembled into a model in memory (Blender's axes become the model's along, up and across, which keeps the winding) and drawn by the ordinary buy-window PreviewIcon, turning and fitted into the preview frame with the bridge's three PNG textures (PoolBridgePreviewTests). Without the content folder the panel stays empty.

While placing, the tool previews the whole bridge on the blueprint in the current direction: both outside ends and the seven bridge cells, blue when the bridge can be built. When it cannot, the cell to blame turns red. While the line under the pointer reaches pool water, the hover help names the reason instead of the instructions: water where an approach cell's land must be (the pool is wider than three cells on that line, or the pointer is not on the first land cell), a span cell without water, a ride, shop, scenery, slide, queue, track, fence post or protected cell in the way (an outside end that is not a path must be free ground too), another bridge, or land the park does not own. Refusals that belong to the bridge as a whole (flat land, money) mark every cell red; someone standing on it marks their cell. A click on a refused place posts the same message (PoolBridgeWorld.Check(..., out blocker), ParkHud.BridgeRefusalText). The old refusal "an outside end without a path" is gone (PoolBridgeResult.EndNotPath was removed; the result is never serialized).

The bridge's original timber model is authored in Blender (tools/blender/opentpw_pool_bridge.py) and exported as a triangulated mesh and three procedural textures in content/pools/bridge. The deck stands two engine units above the bank; supports remain outside the three water cells. No game media is used. Concept renders are design studies, not runtime verification.

PoolBridgeWorld provides a separate elevated walking layer. The underlying water cells, water links and swimming regions remain unchanged. Walkers enter only through an outside end that has a path, and cannot leave through the rails, including with off-path walking masks. The link is read live (PoolBridgeWorld.Connects asks for a path type at the outside cell), so a path laid there later makes the bridge walkable at once (the grid's version moves with the path), and a path taken away closes that entrance again; a bridge with no path at either end is an island nobody can enter. Swimmers retain their water-height route underneath. The renderer uses the exported Blender triangles with depth testing; guest and employee walking heights follow the approaches and deck.

What is protected: the bridge's own seven cells (two approach cells, the three water cells and two approach cells) take no path, no pool edit and nothing else until the bridge is removed (PoolBridgeWorld.Covers), and the two cells just outside the ends stay free of objects, rides, queues (a queue may join an end path but not lie on the end cell), tracks, slides, pool water and other bridges (PoolBridgeWorld.Reserves), so a path can always be laid there later. Laying or removing the path on an outside end is allowed (Level.IsPathBuildBlocked, ParkPathBuilder.Clear, Level.RemovePathCell), except that removing it is refused while someone is on the bridge and the bridge's other end has no path, because the last way off would go (PoolBridgeWorld.PathRemovalStrands, the same standing rule as the bridge removal). Removing the bridge itself refuses while anyone occupies its covered cells. Overlapping bridges, objects, tracks and slides are refused.

The optional PoolBridges save part is omitted when empty; no bridge count, hash marker or random draw is added to a park without bridges. Existing pools extension save requirements continue to apply. Placement is bounded to 256 bridges. Saves validate geometry records and restore them against the unchanged underlying water and bank cells; a bridge saved without paths at its ends restores like one with them, and a bridge of either old direction (the earlier east-west and north-south rows) still loads, because the command and the record carry the direction (PlacePoolBridgeCommand bytes are unchanged for all four directions, ParkCommandCodecTests.ThePoolBridgeCommandOfEveryDirectionKeepsItsBytes). PoolBridgeRoutingTests, PoolBridgeToolTests, PoolBridgeWorldTests, PoolBridgePreviewTests and PoolBridgeGeometryTests cover the headless contract. The smoke-only --debug-bridge-bare and --debug-bridge-direction N (0 north, 1 east, 2 south, 3 west) build a bridge with no end paths in a chosen direction for captures; --debug-hud "buytab:features:Pool bridge|buyyaw:35" opens the buy window on the row at a held turn. Runtime screenshots must be reported separately from these CPU checks and Blender renders.

Source: docs/POOLS.md in the project repository.