• 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] How do I preload files?

Status
Not open for further replies.
Level 12
Joined
Mar 13, 2012
Messages
1,121
The best way imo is to create and remove a unit which has the model.

JASS:
call RemoveUnit( CreateUnit(...) )
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
To preload models ingame and not in loading screen, you should use the event of (elapsed time is 0.00) , it will cause a lag spike in the beginning but the loading screen will be way taking shorter time
For Models :
  • Game - Preload 'Your Model'
For Units/Doodads :
  • Unit - Create 1 'Your Unit' in your point facing default building facing angle
  • Unit - Remove (Last Create Unit)
Good luck
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
This determines a good map and a bad ones.

Deciding when to preload big files (such as ability level that is huge, etc).

Usually people do it in the loading screen but it will make your loading longer, therefore people would load it at start of game, but this will also stall your players (unless you have a cinematic to follow up with).

I suggest you can preload some files slowly in each phase, during in-between cinematics.
A cinematic consist of fade to black element, while fades out, preload the files.
 
Level 37
Joined
Aug 14, 2006
Messages
7,602
No, just preload the files.
This didn't help me at all. I have 0% knowledge about this. I don't even know what I'm talking about. I just heard that with these words I have put to this thread I may learn more how to reduce the laoding screen time of the campaign. Kitabatake simply wrote those first sentences of this thread.

So far I haven't learnt anything.

So far what I believe how this works is that I "remove" all models from the campaign and then one by one I add models to the campaign with triggers.

For abilities adding/removing them will remove lag on first cast.
That I have already done.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
if I preload so much staff that I need to spawn another thread, and it freezes the game for good 10 seconds, I can just as much split it. But yes it is not really practical, I will rather wait 10 seconds then make the game freeze every 5 seconds for 1 seconds for like 2 minutes
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
I'm not sure, but I think Aero is asking what to remove in order to reduce campaign loading time, so that he can load whatever he has removed later, during the game.
Well, you can't really add models during game and as far as I know preloading them won't reduce your loading time, but it will remove the spike that occurs the first time models are introduced in the game.
I might be wrong here, so someone correct me if I am.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
I might be wrong here, so someone correct me if I am.
Preloading will load the data and assets at that time before they become critical for the game to progress. Proper preloading like in SC2 does not stall game progression (happens in parallel) however unfortunately WC3 lacks this.

If you preload all assets at map initialization the map will take longer to load. If you pre-load them in-game then the same amount of time will be taken in game as if it was done during the load screen. It usually is better to pre-load during the load screen unless you specifically know you will not need all the assets. By staggering pre-loading you could drop it down to the odd frame lost here and there however WC3 has a very poor pre-load mechanic (like SC2, it should not alter gameplay much at all).
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
If there is no campaign-wide importing(like you can have units), ignore what I wrote :D

are the models attached to the campaign? if it is so, try to splitting the models to maps that need them.

Example:

Lets say I have map A, B and C. Map A and map B uses model M1, and map A uses model M2 together with map C. It is good to place the models to campaign-wide import to safe space, but at the end, map B will also need to load M2, which it doesnt even use
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
It should only load imported models if they are used anyway so I fail to see how any of that would make a difference. This is obvious when it comes to map protection since then the only references to the model path are inside data itself (so how can it load model it does not know the path of?).
 
Status
Not open for further replies.
Top