View Single Post
Old 03-28-2010, 06:30 PM   #5
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

The wave is most likely not shaped like a slice of a circle. First of all, wave spells can have a starting width, so it would be a slice of a ring rather than full circle or, more likely, an isosceles trapezoid (in the case of shockwave which has the same start and end width, a rectangle).

Furthermore, the units affected are not grouped instantly, but as the spell projectile passes them. This can be easily demonstrated by fireing a slow wave spell towards a unit and then moving the unit out of the way and moving another unit that was outside of the affected area into the way.

As such, line/cone spells are best simulated by a moving projectile which affects units in a circular area (I never tested the spells in enough detail to know if this is exactly how they work, but at worst it is still a reasonable approximation while also being the fastest method to code it) with diameter equal to the spell's width (when simulating spells that have different starting and ending width, the diamater changes as the projectile moves). xecollider, for example, can be used to simulate such spells this way.

Edit: Damn it, I'm really slow at typing this, three people beat me to it.

Quote:
Originally Posted by Earth-Fury
Enum units in incrementally larger circles. Cull units who's squared distance from the caster is equal to or less than the square of the previous circle's radius. (You use squared distances to avoid needlessly computing squared roots)
Or you store the already hit units in a group and then use a IsUnitInGroup check instead of a distance check, which also allows you to avoid missing the units moving towards the caster and hitting the units moving away from the caster twice.
__________________
Anitarf is offline   Reply With Quote