Seeking feedback on my ECS/Jobs design before I start investing the time to code it
Hello, I am working on converting some AI code to be parallelized by rewriting it from the ground up to use ECS/Jobs. I think I have the broad strokes of the design figured out and hoped I could request some feedback from those with more experience.
Entities in the game all need to make a check every so often (every few frames at least) to a global source of data which is kept in the scene and maintained during runtime. After the check, each entity executes an update on its own local source of data (components) so that it is consistent, and then each entity will perform an expensive computation (converted to an IJob with BurstCompile) based on all the current data in its local source. Finally, the entity will perform an action based on the result of this computation, at which point the global data source is updated and the process repeats.
I hope I was able to condense it while still making it understandable, but let me know if it's unclear. To me, this seems doable based on what I've learned so far about ECS and Jobs, but I wanted to get some other opinions. The part I don't have figured out yet is the data sources. Is it possible to edit a global data source with jobs, possibly using references and/or locking system?
Thanks!
Your answer
![](https://koobas.hobune.stream/wayback/20220612204706im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to play collision sounds with DOTS? 0 Answers
Approach for futuristic HUD Design 0 Answers
Help with spheres? For a unity noob(tutorials) 1 Answer
Post-5.3 upgrade: WARNING: Implicit downcast from UnityEngine.Component to UnityEngine.UI.Image 0 Answers
Animation clip not playing but still affecting components of other clips 0 Answers