• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[General] Complexity, how does UnitsWithinRange(x) work?

Status
Not open for further replies.
Level 13
Joined
Oct 10, 2009
Messages
439
Hey everyone!

I'm looking at implementing a custom collision / missile system and wondering how UnitsWithinRange(x) works in Wc3.

Basically I want to know if I would be better off using dummy units + the above native, or sfx and some kind of custom quadtree to keep track of things that could possibly collide.

Thanks a bunch.
 
dummy units + the above native
Dummy unit for what exactly?

or sfx and some kind of custom quadtree to keep track of things that could possibly collide
How would the implementation look like? You would manually track all units on map and compare their position? It sounds like much more work and not more efficient.

Just go with using natives.

Also, units and effects as missiles have some different meaning in general, too, like unit missiles can attack by their own, can have abilities, will register enter/leave region events which one could hook on, ... etc, which would not natively work for effects.
 
Level 13
Joined
Oct 10, 2009
Messages
439
So basically It's a missile system, with the tables (Projectiles) being tracked in LUA.

Quadtrees are generally super effecient at this kind of stuff, I'd only be interested in using it to track things in gamespace that could collide with these missiles (Be it the target or an intervening wall, like Yasou in league of legends).

Because War3R wont support interrupting missiles mid flight it's something I'd have to code up manually, and I was just wondering *how* efficient UnitsInRange() is. And if it's so efficient it's worth using dummy units just for checking collision and sizes.
 
Status
Not open for further replies.
Top