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

Lag with unit spawning

Status
Not open for further replies.
Level 6
Joined
Jun 20, 2005
Messages
108
Hello there.

I'm using a trigger to spawn the initial units on my map instead of placing them with the Unit tool on WE, to reduce the loading time.

Ok, that worked so far, but the problem is that there are like 30 units or so, and when I place them, the game freezes a few seconds. Is there a way to avoid that?

Thanks.
 
Level 7
Joined
Dec 4, 2007
Messages
121
Hello there.

I'm using a trigger to spawn the initial units on my map instead of placing them with the Unit tool on WE, to reduce the loading time.

Ok, that worked so far, but the problem is that there are like 30 units or so, and when I place them, the game freezes a few seconds. Is there a way to avoid that?

Thanks.


try doing them 5 at a time instead of all at once, maybe a 1 sec wait between each group
 
Level 6
Joined
Jun 20, 2005
Messages
108
well, it helped a little, but now I have (little lag [1 sec] little lag [1 sec] little lag..) and so on.

another tip?

I'm using the createNunitsatloc, but I will change it to createunitatloc when it's done, will this solve/help the problem?
 
Level 7
Joined
Dec 4, 2007
Messages
121
well, it helped a little, but now I have (little lag [1 sec] little lag [1 sec] little lag..) and so on.

another tip?

I'm using the createNunitsatloc, but I will change it to createunitatloc when it's done, will this solve/help the problem?

it might, the lag is caused by the game doing multiple things at one time,
the less the game has to do at one time = the less it will lag

edit: puting it all in 1 trigger might add to lag also, so you could try doing sepperate triggers (but keep the time difference)
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
put one of that units on map and remove it with a trigger in game start
that will load him before creation so it wont lag
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
LoL Im idiot
Just use
Wait 0.0 (this will make units load after game start so it wont increase your loading time)
Game - Preload <choose units model>
in an Map Initialization event
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
wait 0.0 will make it after start map not while loading
put wait0.0 to every initialization events for reducing loading time
(or use a tool)
 
Status
Not open for further replies.
Top