Should every AI object - spaceship, soldier, battleship, whatever - have its own thread? How many threads is too many?
Desktop CPUs can have up to 32 threads (and HEDT up to 128) at 4 GHz. Why not make use of them? Let's say you're redoing Freespace 2 and have a 64 ship battle, each with its own thread. At 4 GHz on a Ryzen 3950 each ship gets half a full core. (Yes, I'm simplifying) Surely that's more than enough? Even a 100 ship battle gives 1 GHz per ship (at 60 fps that's 16.5 million clock cycles per frame) - more than enough for AI.
But how about 1000 threads? Beef up that battle 10 times. Is 1.6 million clock cycles per frame enough for a decent AI? How about thread management overhead? How does CPU cache impact this?
Paging @Rroff.
Desktop CPUs can have up to 32 threads (and HEDT up to 128) at 4 GHz. Why not make use of them? Let's say you're redoing Freespace 2 and have a 64 ship battle, each with its own thread. At 4 GHz on a Ryzen 3950 each ship gets half a full core. (Yes, I'm simplifying) Surely that's more than enough? Even a 100 ship battle gives 1 GHz per ship (at 60 fps that's 16.5 million clock cycles per frame) - more than enough for AI.
But how about 1000 threads? Beef up that battle 10 times. Is 1.6 million clock cycles per frame enough for a decent AI? How about thread management overhead? How does CPU cache impact this?
Paging @Rroff.