Closed 6AKU66 closed 2 years ago
b42e780028885010e354117e8f6610e20deda261 involves additional multi-threading.
The biggest performance hitting area of code for group movement now is with collision detection and resolution. This cannot be multi-threaded because each and every collision triggers a Lua Event where the game code can handle the collision and then pass true back to tell the engine that the collision has been handled and that the engine doens't need to do anything more with that particular collision.
I'll investigate using crowd control, not just collision avoidance, to try and space out the units and better avoid collisions in the first place (obviously some units will want to collide, so we'll still support that.)
After a chat with Ivand and Sprung. We may be able to multi-thread collision. The events involved look like they can be deferred. The return values from UnitUnitCollision and UnitFeatureCollision events look like they can be deprecated.
The process of preparing collisions for multi-threading will give us the opportunity to hopefully resolve https://github.com/beyond-all-reason/spring/issues/15
https://cdn.discordapp.com/attachments/724924957074915358/944384114449080330/screen00472.jpg (around 1000 moving fleas at same time).
A lot of units moving at same time drive sim down. Ticket made by request Tarnished Knight.