Manual/Gameplay Systems/World map & tile addressing
v1.0.364 notes · build 2026-11-07 12:10 UTC

World map & tile addressing

grid math · block pulls · railway/trains · march pushes
#worldmap #protocol

Per-server tile grid 1000×1000 (WorldTileCount = 1000), 1-based linear point-id addressing; season "nine palaces" maps join 9 servers into 3000×3000; city interior grid CityTileCount = 100; TileSize = 2 Unity world-units per tile.

Tile math (exact)

  • pointId = x + y * tileCount + 1 (1-based; 0 = "none")
  • x, y = (pointId-1) % tileCount, (pointId-1) / tileCount
  • worldX = (x + 0.5) * TileSize
  • Cross-server 64-bit pack: worldPos = uint64(serverId) << 32 | uint64(pointId)

On nine-palace maps, 1.0.364 C# sets world size to 3000 when the palace list holds 9 servers; a tile's server = grid cell (x / 1000, y / 1000); index x + y * 3000 + 1. Battlefield worlds take size from Lua static.

SFS2X's built-in area-of-interest streaming exists in the SDK and is completely unused — the client streams the visible map itself.

Viewport block pull (C#-owned, never in the Lua catalog)

world.get.block, world.get.new, world.get.cross (cross-server line) — sent by C# WorldPointManager as the camera moves. world.get.block asks up to 160 block indices per request static.

  • world.get.block params: {bigMap, x, y, serverId, worldId, type, viewLvl (≤ 2), timeStamp, index: IntArray (block ids), blockSize, clearUuidSet (first request only), force, leftBottom, rightTop} — leftBottom/rightTop computed on the 3000-wide grid.
  • world.get.new = {x, y, serverId, type, viewLvl, timeStamp, worldId}
  • Replies: per-server serverPointArr[] or flat serverId/worldId; protobuf arrays points[] (WorldPointInfo), lands[] (LandPointInfo), deserts[] (DesertInfo), alInfos[]; overlays hotSpots, triggers, greenPoints. After the first request with clearUuidSet=1 the client drops every previously known point not returned. push.world.get.block triggers re-request.

Query patterns

  • Single point: world.get.detail.new {point, serverId, worldId, previewAssistance, pointType, uid} — field is point, not pointId.
  • Find-nearest: find.resource, find.enemy.point send criteria only (level, type), no coordinates — the server does the search. find.monster same family but also sends pointId.
  • Bulk push: world.get.alliance.city.info, lw.req.world.occupy.info — whole per-server dataset, no pagination; invalidate-then-refetch, not deltas.
  • Batch by uuid list: radar/detect-event lookups, pipe-delimited uuid lists.
  • Marches: world.get.march.infos {x, y, needCross} near raw tile coord; push.world.march.new carries protobuf WorldMarch or WorldMarchDeltaMeta delta; push.world.march.del carries uuid, isBattleFail. 29 world/scene/season push.* are handled only in C#.

Railway / trains (1.0.364) static

  • train.list {isRefresh: Bool} → ls[] (trucks), allianceTrainList[], trainServers (comma-separated); isRefresh: true from the Refresh button + first call of the server day.
  • Entry type: 1 = truck, 2 = alliance train; cfgId = train_property row; quality 1–5 = N..UR, 10 = Reindeer Sleigh (wire carries only cfgId).
  • Cargo baseGoods/extraGoods each {full, cur}; goods {type, value} — RewardType 1 = iron, 20 = food, 31 = coins, 7 = item {id, num}.
  • Train cargo rides in marchInfo.carriageList[].trainGoods; past raids marchInfo.plunderRecord[]; raid count marchInfo.robTimes — caps: truck train_para row 21 = 2, sleigh 1, alliance train alliance_train.k10 = 3, minus one with VIP aboard. completeness renders as "Integrity: 0%".
  • Defensive power: marchInfo.power or Σ marchInfo.heroInfo[].power (truck) / Σ marchInfo.formation.armyUnit1-3.power (train).
  • train.refresh {uuid, serverId} re-reads one entry; throttled ≥600 s for others' trucks (train_para 39), ≥60 s own (row 51). Own daily raids trainData.dailyRobCount, cap train_para row 11 = 4, shared trucks/trains. Truck march WorldMarch carries the same train object → CSharpCallLuaInterface.AddOrUpdateTrain.

Core commands

world.march.formation.new (dispatch to tile or ;-delimited multi-hop path), alliance.world.mark.add (shared marker), world.favo.add (personal bookmark).

notes build 2026-11-07 12:10 UTC · lw-notes@9c47e1b · sources: own capture/analysis cross-checked against the public dossier