• 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.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

Which is slower? Unit-Groups or Rect's?

Status
Not open for further replies.
Unit group, because you're only creating/destroying one thing, while with the trigger approach you have to destroy triggers and regions.
However, note that the unit group approach doesn't work with units that have locust.
Technically rects are better for that, but if they're far slower then I would rather disable drag-select.

UnitEnterRegion doesn't trigger if you move the rect on top of a unit, so it fails to actually complete the task. ;)

Just do periodic enumerations. It's fine. But consider doing the checks less frequently. 0.03 periods are overkill imho except for really fast moving missiles.
Why does it fail? Just follow the same setup as a DDS and it should work. I'd rather do regions or something else because periodic enumerations are just simply too laggy and slow. Is rect's really that slow though?
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
Technically rects are better for that, but if they're far slower then I would rather disable drag-select.


Why does it fail? Just follow the same setup as a DDS and it should work. I'd rather do regions or something else because periodic enumerations are just simply too laggy and slow. Is rect's really that slow though?

Periodic enumerations are not slow at all. What's slow is the ForGroup function.
 
Technically rects are better for that, but if they're far slower then I would rather disable drag-select.


Why does it fail? Just follow the same setup as a DDS and it should work. I'd rather do regions or something else because periodic enumerations are just simply too laggy and slow. Is rect's really that slow though?
UnitEnterRegion basicly only fires if the unit enters the region by getting placed on top of the region or when moving across the borders of the region.

If a unit, however, is at place XY and you move a rect on top of that unit (like you would do with making a rect follow a unit), the EnterRegion event does not fire, because technically, the unit never entered the region, but the region entered the unit.

If you register regions for all units and do this, it's much more unlikely that both enterRegion checks fail for both colliding units at same time, but it might still happen, even if it is unlikely.


There's another option which is UnitEnterRange. However, this native is basicly nothing else but a periodic enumeration every 0.1 seconds. It might be a tiny bit faster, though, as it doesn't work on the JASS level, but the native level.
 
Status
Not open for further replies.
Top