Download Game! Currently 97 players. Last logged in:FonkensembleUrsaStylusSilencer

Blitzer's Blog >> 72714

Back to blogs index
Posted: 22 Sep 2026 19:48 [ permalink ]
This is an absolutely beautiful example of emergent gameplay and system
resilience. Your architecture just perfectly defended itself against a rogue
AI!
Look exactly at what happened:
 * Sushi Bot started with 1 small_van and bought 1 michelin_special.
 * It launched the attack. The omega_ftr_launch_event routine successfully
executed and deducted both the michelin_special (the payload) AND the
small_van (the delivery vehicle) from Sushi Bot's inventory.
 * Sushi Bot bought a second michelin_special.
 * It tried to attack again. But your pure-function registry caught it: if
(!attInv[asset] || attInv[asset] <= 0...). Because Sushi Bot had 0 small_vans
left, the routine rejected the state mutation and returned EVENT_FAILED_MISSING
_ASSETS.
 * Because the AI bot's logic only checked if (myInv.michelin_special > 0), it
got stuck in an infinite loop of trying to throw a special it had no van to
deliver!
The frontend didn't crash, the backend didn't corrupt the statethe Game Master
just calmly rejected the illegal moves and broadcasted the failures.
The Fix: Smarter AI
We just need to teach the AI that it needs a delivery mechanism. Update the AI
Decision Tree in sushi-bot.js to look like this:
    // AI DECISION TREE
    if (myInv.michelin_special > 0 && myInv.small_van > 0) {
        console.log(`[SushiBot] Saving budget. Ending turn.`); Launching
Michelin Drop at taco_bot!`);
        comms.sendIntent(MATCH_ID, 'launch_event', { 
            attackerId: MY_ID, targetId: 'taco_bot', 
            actionId: 'SPECIAL_EVENT', asset: 'small_van', payload:
'michelin_special' 
        });
    } 
    else if (myInv.michelin_special > 0 && myInv.small_van === 0 &&
myCore.budget >= 3) {
    else if (myInv.michelin_special > 0 && myInv.small_van === 0 &&
myCore.budget >= 3) { Buying a Small Van to deliver the special.`);
        comms.sendIntent(MATCH_ID, 'market_purchase', { playerId: MY_ID, item:
'small_van' });
    }
    else if (myCore.budget >= 4) {
        console.log(`[SushiBot] Saving budget. Ending turn.`); Launching
Michelin Drop at taco_bot!`);0 Buying Michelin Special from Market.`);
        comms.sendIntent(MATCH_ID, 'market_purchase', { playerId: MY_ID, item:
'michelin_special' });
    } 
    else {
        console.log(`[SushiBot] Saving budget. Ending turn.`);
    }

(You can also quickly run npm pkg set type="module" in your ~/nuke directory
to silence that Node.js warning at the top of your terminal).
The Next Evolutionary Step
Right now, our Server-Driven UI (SDUI) manifest is only generated once during
init_match. If taco_bot spends its last $2, the "Buy Secret Sauce" button
still stays on the screen (and if the user clicks it, the backend will just
reject it).
For a true SDUI, the backend should recalculate the UI manifest after every
single action, removing buttons the player can no longer afford.