4 ms·
Most AI in games are simple. Either state machines or behaviour trees. So they're designed to be quick to execute by design :)
by opless 9y ago
Most AI in games are simple.
Either state machines or behaviour trees. So they're designed to be quick to execute by design :)
- opless 9y agoAlso they tend to have manager classes iterating over a list of NPC data, rather than lots of NPC classes and executing "run" methods. Edit: undo autocorrect typos
- letharion 9y agoAnd while you're iterating the same code over many NPCs, you could take great advantage of GPUs and gain significant performance by running all those NPCs in parallel.