Does ECS make sense for this?

Hi - My game has number of NPCs, each of which is associated with a dictionary instance. Jobs are supposed to process dictionary contents (which are just lightweight structs) concurrently for multiple NPCs. Each dictionary instance has a unique size. I’m trying to figure out if this lends itself to using ECS or not.
What I’ve done so far, is replacing the dictionaries with persistent NativeHashMaps, but I keep those in a managed array, with the array’s size matching the amount of NPCs. Whenever there’s work to be done for any particular NPC, I’m accessing its NativeHashMap from the array and feed it to a job.
All this kinda works, but I wonder if I could speed things up utilizing ECS. I must say though, I have no idea how I would need to lay out my data for that. Thanks for any thoughts and suggestions.

I am doing something similar for my game and since I object pooled the NPCs both for their visual representations (gameobjects) and total (a one-dimensional array), I ended up just using the job system to process their “thought processes” and IK/movement without doing more with ECS. ECS seems to change so much and it has been a little difficult for me to get into for what I wish to achieve due to its complexity and state of completeness. I am sure you will manage just fine, though.

I would need more info to help answer your questions. What kind of NPC behaviors are you trying to process with Jobs? What’s the reason you are keeping your NPCs in a dictionary?

1 Like