• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Preloading files and things

Status
Not open for further replies.
Level 26
Joined
Aug 18, 2009
Messages
4,097
I have several questions concerning preloading.

First question is which things need to be preloaded/are initialized on first use. To my state of knowledge these are models, textures, sounds, script files and basic settings/localizations (which most of will be done automatically by the start of the game/map though). I am not sure whether map files can be preloaded before map change. And, of course, the horrendous object editor objects need to be inited.

Then to the various preload functions Jass offers:

JASS:
native Preload takes string filename returns nothing 
native PreloadEnd takes real timeout returns nothing 
native PreloadEndEx takes nothing returns nothing 
native PreloadGenClear takes nothing returns nothing 
native PreloadGenEnd takes string filename returns nothing 
native PreloadGenStart takes nothing returns nothing 
native PreloadRefresh takes nothing returns nothing 
native PreloadStart takes nothing returns nothing 
native Preloader takes string filename returns nothing

I've tested these a bit with a large model. I can tell paths you use in Preload are moved to a stack. The whole stack can then be preloaded via PreloadEnd whereas you need a bit of timeout. I guess PreloadEndEx cancels preloading immediately but leaves the stack untouched, PreloadRefresh clears the stack. Preloader can be used to run external pld files (that can have these preload functions). I do not know yet what the "Gen"-functions are meant for and why you do not need PreloadStart/why this function does not start preloading.

Also, when you load a model file, the resources linked to this model like textures are not automatically loaded with the model.

Last point: Light emitters seem rather expensive. I am not sure whether these are buffered but in the past these quite dropped my fps in the beginning, then it became stable having them (one type of light emitter) but now and then another spike occurred as if there are different kinds of preloading them or they were unloaded again. That's another question: How much can the preloaded cache actually handle?

Thank's in advance

Ps: Are there somewhere instructions for the slk tables as its columns are partially badly entitled?
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Preloading units can help reduce lag when creating them for the first time.
You can also import JASS scripts and preload them and they will execute :D

Um, yes, but where did I ask for this/I already wrote this? Maybe try to interpret my questions or inquire further information when you are not sure what I want. I have no clue how you deduced to that answer.
 
Status
Not open for further replies.
Top