Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

Valley map

The valley is a grid of blocks, each block one 8 by 8 claim. World units are parcels, so a block is 8 units across. The river runs along the south edge. The Harrison and Springston mills lie off the west edge and the Medimont mill off the east edge, and the map labels them but does not draw them.

Valley constants.
ConstantValueMeaning
Valley width (BW)6blocks
Valley height (BH)4blocks
Block size (N)8parcels per side
River band (RIVER_W)2.6parcels, south of the blocks
Your claim (MY_BLOCK), x2block column, zero-based
Your claim (MY_BLOCK), y3block row, zero-based
Townsite (TOWN_BLOCK), x0block column
Townsite (TOWN_BLOCK), y3block row

That is 24 blocks. Each block is one of four kinds:

Kind Blocks
Yours One: (2, 3)
Townsite One: (0, 3). Draws up to 48 houses, one per settler.
Reserve Four: (4, 0), (5, 0), (4, 1), (5, 1). A 2 by 2 group that holds the 40 stands.
Neighbor claim The other 18, in a fixed order

The neighbor claims are numbered 0 to 17 in this block order: (1,3), (3,3), (1,2), (2,2), (3,2), (0,2), (4,3), (5,3), (4,2), (5,2), (0,1), (1,1), (2,1), (3,1), (0,0), (1,0), (2,0), (3,0).

Claim number i belongs to the simulated neighbor with the same index in the leaderboard neighbor list, which has 12 entries. Claims 12 to 17 never have a neighbor and always draw as “Open claim”. A claim whose neighbor has not yet arrived is drawn faded as mature timber.

The parcels of an arrived neighbor cycle through three states, driven only by the clock:

age = ( (now / 3600000) * 0.45 + hash01( bx*131 + by*17, parcelIndex*7 + 3 ) * 70 ) modulo 70
state = cut if age < 2
young if age < 18
mature otherwise

One full cycle is 70 / 0.45, about 155.6 real hours. A parcel is cut for about 4.4 hours, young for about 35.6 hours and mature for the remaining 115.6. Each parcel has its own offset. A cabin is drawn near the middle of an arrived neighbor’s claim. Tapping a neighbor’s claim shows their name and their strongest lane. None of this is saved or interactive.

The Reserve draws 64 small marks in each of its four blocks. Every sixth mark stands for one of the 40 stands. A stand is drawn dark and ringed when it is ready and light when it is regrowing.

Reserve blocks. Stand indices drawn in each block, zero-based.
GroupBlock xBlock yStand indices drawn
1400 to 10
25010 to 20
34120 to 30
45130 to 40

The ranges overlap by one and run one past the end. Stands 10, 20 and 30 are drawn twice, and index 40, which does not exist, is drawn as an unlabeled grove. This is a display detail only.

The camera has a scale s (pixels per parcel) and an offset. Its limits depend on the canvas:

sMax = geo.cell the homestead fills the view
sMin = min( (w - 16) / (BW * N), (h - 16) / (BH * N + RIVER_W) ) the whole valley fits
home camera: your block aligned to the plat's padding
whole camera: the valley centered, 8 px from the top

Zooming to within 0.1 percent of sMax snaps to the home camera, and to within 0.1 percent of sMin snaps to the whole-valley view. The detailed homestead drawing fades in as the scale approaches sMax:

detailAlpha = clamp( ( s - 0.86 * sMax ) / ( 0.12 * sMax ), 0, 1 )

It is invisible at 86 percent of sMax and fully opaque at 98 percent. While it is opaque, taps select a parcel of your claim. Otherwise a tap on your block zooms home if the scale is below half of sMax, selects a parcel if above, and a tap elsewhere shows a toast about the townsite, the Reserve or a neighbor.

Inputs are the canvas size, pointer and keyboard input, the clock, the settler count and the Reserve stands. The output is a drawing and a selected parcel (sel). Nothing about the map is saved. The camera and the selection reset on reload.

The valley layout is the one world fact all players must agree on. It needs a server-held map of blocks with an owner per block, and a rule for who gets which block and what happens to the 6 open blocks. The prototype’s neighbor claims are decoration driven by the clock and by names invented for the leaderboard; in a shared game each neighbor block would show a real player’s actual parcels. The map sizes (6 by 4 blocks, 24 claims) and the single Reserve group set the world’s carrying capacity and should be set deliberately.

Source: prototype/index.html · constants BW, BH, RIVER_W, MY_BLOCK, TOWN_BLOCK, RESERVE_BLOCKS, N in rules.json · logic blockKind, neighborArrived, neighborTile, camLimits, homeCam, wholeCam, detailAlpha, drawView, tap