I everyone i have a little question about AI logic, state and thread in game in general
first of all some usefull infos,
i'm working on a rts game
each type of unit have their own states and for the moment each state of each type is a singleton
each unit have a steering behavior and a state machine
for the moment everything is on the main thread
two units of the type A are on the same state
when i update the logic i pass the owner of the state machine as a parameter to the state but the logic is updated on a unit after another (yes i know it's not great, the reason why i'm here)
What is the best way to ensure that every unit update their ai logic at the same time / almost same time ?
1. i think a thread per unit ?
2. threadpool ?
If it's not clear , i can give futher explanations
Any suggestions, ideas or anything is welcome !
thanks to help