In my map, there are bosses that are quite large. I have one main problem and a couple questions regarding unit collision size:
The main problem is that you have to put the spells deep inside the large bosses to hit them (at least for spells that are triggered). It's unintuitive because it is hard to tell if the spells will hit sometimes and it just looks weird when the spell animation touches the boss but doesn't affect them.
1) Is this the case for regular spells like flame strike? As in, does flame strike need to touch a unit's actual point or just a point that their collision detection covers? How about auras?
2) The values for unit collision are rounded to the nearest [something], right? (or maybe rounded down to the next value) Is it powers of 2 or something else? I think some numbers are: 8, 16, 32. I don't know much other than that.
3) Is there a good way to detect when units should get hit? I have 2 main ideas:
- Store all unit collision sizes with their unit types in a hashtable, then update my spells to check a larger radius (larger radius will be spell radius + max collision radius in my map). Then units will be tested to see if they are in range if they were their collision radius closer to the center.
- There is a limited number of big units in my map (bosses and fairly infrequent [maybe about 2 or 3 per minute] mini-boss units). I could store them in a unit group and then update my spells to check this unit group as well as their default radius. It would be less accurate with small units, but that isn't too important since the difference is very small. I could store the big units data in a hashtable or I could just use some hardcoded value since their sizes are kind of similar - it would probably look okay in-game to do a rough estimate.
The main problem is that you have to put the spells deep inside the large bosses to hit them (at least for spells that are triggered). It's unintuitive because it is hard to tell if the spells will hit sometimes and it just looks weird when the spell animation touches the boss but doesn't affect them.
1) Is this the case for regular spells like flame strike? As in, does flame strike need to touch a unit's actual point or just a point that their collision detection covers? How about auras?
2) The values for unit collision are rounded to the nearest [something], right? (or maybe rounded down to the next value) Is it powers of 2 or something else? I think some numbers are: 8, 16, 32. I don't know much other than that.
3) Is there a good way to detect when units should get hit? I have 2 main ideas:
- Store all unit collision sizes with their unit types in a hashtable, then update my spells to check a larger radius (larger radius will be spell radius + max collision radius in my map). Then units will be tested to see if they are in range if they were their collision radius closer to the center.
- There is a limited number of big units in my map (bosses and fairly infrequent [maybe about 2 or 3 per minute] mini-boss units). I could store them in a unit group and then update my spells to check this unit group as well as their default radius. It would be less accurate with small units, but that isn't too important since the difference is very small. I could store the big units data in a hashtable or I could just use some hardcoded value since their sizes are kind of similar - it would probably look okay in-game to do a rough estimate.