feat: bots — the framework, five kinds, and the operator surface #115
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/bots"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The world gains inhabitants that are not people. First slice of the bot
system: the framework whole, five kinds, and the operator surface — with
everything that needs content this server does not have yet deliberately
left out.
A bot is the engine's fourth seat
The engine already defines a player as whatever owns a
World.Player.Hostand answers the tick barrier, three times over — the socket session, the
test host, the bench fleet.
Bot.Sessionis the fourth: it joins from itsown process, answers
{:world_tick, ...}immediately, runs the discardedencode so masks and buffered requests settle, and leaves through
World.leave/1with the departure announced first. No engine changes.The brain lives in the same process, stepped from the encode handler
after the barrier reply is already sent — goal work can never stall the
world, and a goal's view of its body is
host.player, free. Goals are purestate machines: their one effect is
emit, which plans a client-shapedrequest through
World.RoutePlanand feeds it into the session's owndispatch, so a bot's click is indistinguishable from a packet's and every
gate the engine has applies. Under test,
emitcollects into a list.What is in
wander,travel(bank-to-bank sightseer),chopperandminer(one sharedGatherAndBankgoal — the loop is a shape; the sitetable, the tool family and the gating stat are data), and
fighter(scans the movement authority, skips creatures whose combat claim names
somebody else, clicks the cache's own Attack option, and treats dying as
part of the loop — it carries nothing beyond the kept-items rule).
woodcutting table ∩ the placement index, rocks via mining, banks by the
Bankverb, clustered and paired with the nearest same-plane bank.distinct non-tool id through the side inventory, verify the pack emptied
(the success path is as silent as the refusals for a socketless player),
and keep the tool without a withdraw round trip.
bot_profiles(no account row — a bot's seat keepsaccount.idnil, which every player-persistence path already reads asdo not save), a full snapshot at spawn, staggered autosave, a final
save on terminate, boot auto-spawn in batches, and a name reservation in
both directions — registration, setup renames and the pre-check all
refuse a name a bot profile holds.
resting bot is never stuck), capped reroutes, and a botfix sweep that
relocates a wedged bot to open ground. Nothing despawns a bot to fix it.
bot.*group —::botgenwithorder-independent arguments that refuses an unknown kind outright,
::bots/::botinfo/::botprofiles, and thekill/delete/clear/cleardb/save/toggle/fix/freeze surface. All mutations
are casts: a command runs inside a barrier participant.
REVENANT_BOTS=offremoves the subtree;the fleet cap defaults to 200.
What is deliberately out
PK bots (want PvP, Prayer and eating), traders and the virtual economy
(the real bank does its job here), production goals, fishers (no Fishing
yet), loadout tables (id-heavy, to be re-derived from this cache when
combat archetypes need them), and hibernation (every bot is a fully costed
barrier participant; the cap is the control until a real need arrives).
#111 tracks the unwired log filter; all bot logging is already tagged
domain: [:bot].Verified
Format, compile with warnings as errors, Credo strict and Dialyzer all
green. World tests drive the real thing end to end: a chopper chops a real
tree, walks to its derived bank, deposits and keeps the axe; a miner does
the same; a fighter engages a spawned goblin and the world's combat claim
names the bot; botfix relocates a bot wedged in a wall; auto-spawn raises
active profiles with their stats and leaves inactive ones down; the
commands drive all of it through a seated session's own dispatch. A full
suite pass is green; the long runs also caught what the targeted ones
could not — a migration version collision with the exchange table (bot
profiles renumbered to 18), and the gather tests learning the same
site-restoration teardown the mining world test documents.