Skip to main content
The base-building loop: two architecturally distinct “queue” systems that share a confusing name, a building-id encoding worth knowing, and a resource economy that’s really two separate systems.

Two “queues”: don’t conflate them

  • Build-queue slots (BuildQueueManager): the small number of concurrent construction slots a player has. A building upgrade occupies one until it finishes.
  • Production queue (QueueDataManager): a generic per-item timer reused by farming, pasture barns, troop training, hospital healing, and research alike. Same wire schema across all of them.

Building ID encoding

Game-data rows are keyed id = base_type_id + level, where base_type_id is always a multiple of BuildLevelCap = 1000. So bId=10100000, lv=5 → row id 10100005.

Core commands

cmdPurposeKey request fields
free.building.place.newPlace a new buildingbuildingId, pointId, itemUuid?, robotUuid
free.building.up.newStart an upgrade (occupies a queue slot)uuid, upLevel, gold, workerUuid, robotUuid
free.building.upgrade.finishComplete an upgrade whose timer has already ended. It’s free: the request has no cost field, and the client sends it only when IsUpgradeFinish() is true (1.0.364 BuildManager; static-analysis-only). The reply carries serverSystemTime, which the client uses to resync its clock. The paid instant finishes are build.ccd.* / queue.ccd.* with gold or items, and free.building.up.new with gold: 2. queue.ccd.m.new with an empty itemIDs is the client’s free research finish inside effect 30100 and also its diamond instant finish; goclient never sends it. Since 1.0.370 finished-timers holds finished upgrades and research for the Alliance Duel day that scores them (see Alliance Duel)uuid (Long)
queue.finish / .batchThe normal, free collect of a finished queue: research, healing, the rebirth hospital, and the T11 break. queue.finish.batch harvests pastures. Neither has a cost field (static-analysis-only)uuid (Long) / queueList, paraState
building.camp.trainingStart camp production (soldiers/equip/chips)uuid, type, sLevel, sNum, itemId (“id;count|id;count|…” encoded string, not a true array)
building.camp.collectCollect finished camp output: Military Camp (soldiers) and Smith Shop (equipment), NOT Training Base, despite the name. The client sends it when prodST > 0 and prodET has passed. The Tactical Chip Factory (10232000) is disputed: one reading of the 1.0.364 Lua has BuildBubbleManager sending building.camp.collect for chip buildings, another has the factory’s own UI sending chip.collect {}. Treat that pairing as unverified until a live check settles ituuid
building.production.collectCollect finished production-line building output: 14 confirmed building types live with real resource collection (Farmland, Iron Mine, Gold Mine, Smelter, Material Workshop, Training Base, Oil Well, Drone Parts Workshop, Component Factory, Tactical Institute, and the four Season 6 Spore Factory tiers). The 1.0.364 Crystal Factory and the Season 6 week-card building are wired into goclient but unconfirmed. Tactical Center, Armament Institute, and the four Truck Station tiers are not production lines, see Which buildings are production lines and Live validation against production. Not to be confused with account-level (non-building, no building uuid) commands also documented there: lw.pve.idle.reward (collects both the “Armed Truck” and “Overlord” idle/AFK tracks in one call), visitor.operate (greets city visitors), al.help.all, alliance.reward.allreceive, and mail claiming.uuid
worker.assign.all / assign.single.buildingAssign idle workers to production slotsbuildingUuid?
ub.store.upgradePre-stock resources toward a pending upgradebUuid, resources{}, items{}

Which buildings are production lines

The real client sends building.production.collect only for buildings in Global/EnumType.lua’s ProductLineBuilds, plus the current season week card’s farm buildings (1.0.370 Lua, ProductLineManager.lua:57-80, GetAllBuildIds; static-analysis-only):
  • Core: 10201000 Farmland, 10202000 Iron Mine, 10207000 Gold Mine, 10209000 Smelter, 10210000 Training Base, 10211000 Material Workshop, 10214000 Component Factory, 10221000 Oil Well, 10233000 Drone Parts Workshop, 10235000 Tactical Institute, and 10310000 Crystal Factory, new in 1.0.364.
  • Season buildings in ProductLineBuilds: 761000-765000, 771000-775000, 781000-785000 (Blessing Fountain), 801000-805000, and 822000-826000.
  • The current season week card’s buildings, from the season_weekcard table’s farm_building and farm_building_weekcard columns. For Season 6, that’s the four Spore Factory tiers (842000-845000) plus the Spore Factory week-card building (846000), which exists only if the card was bought. For Season 7 (season_weekcard row 10014, tables 40413) it’s the four Blessing Fountain farms 853000-856000 plus the week-card farm 857000.
Each season’s set includes one week-card building: 764000, 775000, 785000, 805000, 826000, 846000, and 857000 (Season 7, new in 1.0.370; BuildingUtils.lua:379-387). Crystal Factory (LW_BUILD_CRYSTAL_STONE) is the only BuildingTypes entry 1.0.364 added: 299 → 300, with nothing removed or renumbered. It belongs to the new Crystal system, and the client shows it only while CrystalBuyDataManager:IsOpen is true. Six buildings that once looked like production lines aren’t in either set: 10143000 Tactical Center, 10227000 Armament Institute (LW_T11_Research), and 10138000-10141000 Truck Station I-IV (locale “Trade Fleet -1” to “-Ω”, the berths of the four railway trade trucks, whose cargo is claimed with train.batch.reward). Every collect attempt on them across 342 consecutive scheduled runs returned errorCode=602026, never status=1 (confirmed live), and goclient no longer sends one. The real client also never sends a collect for a building that isn’t producing. ProductLineManager:GetNextCollectTime returns -1 for a building with no prodST in its building_new entry, and when computed storage is 0 the client shows tip 602026 locally instead of sending anything. goclient mirrors the prodST rule. Two details of the collect response, from the 1.0.364 Lua:
  • The client treats a missing or -1 status as failure and shows tip 602026. Every live success has carried status=1; what status=0 means server-side is unknown.
  • Locale 602026 reads “Production in progress. Please wait.”

Building and queue fields in init

Field meanings from the 1.0.364 Lua (BuildingDate, QueueDataManager, Global/EnumType.lua); static-analysis-only. Times are in ms. building_new[], one entry per building: queue_new[], one entry per timed queue: {uuid, qid, type, sT, uT, itemObj, funcUuid, para, para2, isHelped, lastHelpTime, helpNum}. Builder queues add {expireTime, unlock, gift, rentPrice, rentTime}. type is a NewQueueType id, for example 3 hospital, 6 science, 117 rebirth hospital, and 120 T11 break; the full list is in the Entity ID reference. A production line collects only when its stored amount is above 0. In the 1.0.364 Lua that’s prodExtend + num * floor((min(now, prodET) - prodT) / produce_time), with produce_time per building and level from the building table (milliseconds per tick). For example, the tick is 5 s for Farmland, Iron Mine, Gold Mine, Training Base, and the season farms, 60 s for the Oil Well, 1,800 s for the Smelter, Material Workshop, and Tactical Institute, 3 h for the Crystal Factory, and several hours for the Component Factory and Drone Parts Workshop, shrinking with level. Storage stops filling at prodET (static-analysis-only). collect_reward[] lists pending world rewards with an expiry; its source ids are CollectRewardType, also in the Entity ID reference.

Resource economy: two systems

12 base resources (oil, metal, money, electricity, water, pvePoint, wood, people, dragonHonorScore, obsidian, flint, petroleum) arrive embedded in most responses and standalone via push.resource.info. Separately, “resource items”, a keyed bag of stackable goods (soldiers-as-items, crafting materials), sync via push.resource.item.update / user.get.all.resource.items. There is no get.storage.info command; storage capacity is a client-computed sum over a stream of server-pushed effect deltas (push.effect.change), not a directly queryable value.