"Massive" Simulation AI

Blitz3D Forums/Blitz3D Programming/"Massive" Simulation AI

Something I've learnt by doing a bit of AI is that you want each stage of thinking to be in a single game loop, and if possible make each AI player think in turn.

IE, 5 AI players

Game loop
Player 1, looks left and sees it's blocked
Game loop
Player 2, looks left and sees it's clear
game loop
player 3, looks left and sees it's blocked
..
..
..
Game loop
Player 1, knows left it blocked so looks right, right is clear.
game loop
Player 2, moves left

etc etc.

This way, you don't kill your game loop cycles and keeps it tight. Also, I keep my game logic at around 120 updates per second so even if you're cycling through a few baddies they don't stand around thinking for ages. Of course you can update more than one per cycle and do more than one stage of logic per cycle.

Anyway... That's me.