• 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.

[INQUIRY] CreateNUnitsAtLoc

Status
Not open for further replies.
Level 21
Joined
Mar 27, 2012
Messages
3,232
Is it alright to use this? Or should I just stick with looping CreateUnit? And is there a list of good and bad BJs out there?

CreateNUnitsAtLocBJ is considered bad, because:
1. It puts the created units in a group and also saves the last created unit
2. It uses a location

It basically is a looping CreateUnit, except that it has some more stuff in it that often isn't needed.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
CreateNUnitsAtLoc is bad because it creates the units at the same location. The result is a huge amount of strain on the game engine as it struggles to displace multiple units, even to the extent that frames have to be dropped.

CreateUnit should always be used when 1 unit is needed as it is the fastest.
If multiple units are needed you should create them throughout a rect, either randomly or in a grid to avoid excess displacement load.

WC3 can crash when trying to displace units near the edge of the map.
 
Status
Not open for further replies.
Top