Embrace_It
New Member
- Reaction score
- 9
I'm currently working on an aggro system. So far, the system's core has been set up, but I need an idea on how to update the aggro.
When a unit damages another it generates aggro. A function that deals with this, has already been set up as well.
My idea:
1. Check every unit in the system (and thus in the map, since they have been added for the damage detection) to see if a registered unit has a higher aggro than its previous target. Data should be stored in either multiple hashtables or one hashtable with structs
Downsides to this approach are:
1. It will take a lot of CPU getting through all the units with an interval of ½-1 second.
2. A whole lot of data has to be stored for all non-player units in the map, imagine that in a big dungeon
When a unit damages another it generates aggro. A function that deals with this, has already been set up as well.
My idea:
1. Check every unit in the system (and thus in the map, since they have been added for the damage detection) to see if a registered unit has a higher aggro than its previous target. Data should be stored in either multiple hashtables or one hashtable with structs
Downsides to this approach are:
1. It will take a lot of CPU getting through all the units with an interval of ½-1 second.
2. A whole lot of data has to be stored for all non-player units in the map, imagine that in a big dungeon