BATTLEBOX: Robot Combat Arena
README.md
bots.ai
The robot AI: it drives any bots.design design through its bots.botcore body. The RiptideBot component uses it for the AI corner, and the headless fight simulations use it for both sides.
local AI = require("bots.ai")
local brain = AI.new(bot, { aggression = 1 })
local thr, turn = brain:think(dt)
brain:preUpdate(dt); bot:update(dt, thr, turn); brain:postUpdate(dt); bot:tryHit()
- Weapon facing: it fights with its primary weapon, or the best one still working. It turns that weapon's face to the opponent wherever it is mounted (front, tail or side), reversing into the opponent when the weapon is on the tail. A hammer or crusher faces the way its arm reaches.
- Spinners: it waits until spun up, charges, backs off after a hit while the weapon winds up again, then circles and re-engages.
- Cycle weapons: flippers, lifters, hammers and crushers close in. Hammers and crushers stand off at strike range, and every cycle weapon fires the moment the opponent is in a strike zone.
- No weapon: a pusher, or a bot whose weapons were shot off, herds the opponent into the nearest hazard.
- Driving: it routes round hazards, steers off walls, reverses out of the screw pit and rights itself when the design can.