3 ms·
> You could limit NPC's ai to 50 instructions or so The problem with this approach is that limiting the number of instructions doesn’t necessarily limit the am
by pansa2 5y ago
> You could limit NPC's ai to 50 instructions or so
The problem with this approach is that limiting the number of instructions doesn’t necessarily limit the amount of time taken. Any single VM instruction could be a call into a C function that performs a long-running computation.
If you want to robustly limit the amount of time a script runs for, you have to actually time it.