Models loading when seen?

Posted By: Kenchu

Models loading when seen? - 03/05/08 22:33

I noticed that some models make 3dgs sort of "stop" for a split second just before they are seen on screen for the first time, like if they were being loaded or something. Can this be prevented somehow? Like loading everything in one go? I though level_load would take care of that?
Posted By: Serex

Re: Models loading when seen? - 03/05/08 23:23

Code:
ent_preload ( ENTITY*);



Quote:


Preallocates texture memory and mesh for the given entity. This prevents a delay when the entity is visible the first time. Video memory is automatically preallocated for entities placed in the current level, but not for entities that are created during gameplay through ent_create or ent_morph, and not for global entities. In a multiplayer system this instruction is only effective on the client side.




Posted By: Trooper119

Re: Models loading when seen? - 03/05/08 23:29

I'd like to know what is making your game "stop", considering usually nothing requires that much time to be created or rendered besides possibly a shader or something else on that scale. It also depends on what type of game your playing, a indoor game is specially make by 3DGS to create only the rooms you can see, and therefore doesn't waste resources on things that can't be seen, so upon walking into a large detailed room essentially this could cause the halt in time. level_load creates all entities and there actions at startup, so anything built within the .wmb file will be loaded then however if the game is told to ent_create upon a given condition then it will do so as well. I don't see many games that go through that kind of trouble, usually if your trying to save space an entity will be rendered as invisible and static until it can be seen. Then it will be flagged as active and visible. None of these actions are really noticable in game speed though unless you are doing these actions in mass or are working on a old or lower end computer. If you explain exactly what is happening (a pic with imageshack.com for example) would help. However if I had to make a random guess, I would guess that its something else, not the character is causing your lag. However i've been wrong before, so feel free to elaborate.
Posted By: tindust

Re: Models loading when seen? - 03/06/08 04:02

One possible cause for a "freeze" delay if you have a few fairly complex models is the trace that is routinely sent out by the mouse pointer. You can test if this is the cause by placing a few of you models around you, then when you rotate them into view see if the position of the mouse arrow makes a difference as to when exactly the freeze occurs.

The way to eliminate this problem is to make sure the UNTOUCHABLE flag is turned on for each model.

my.UNTOUCHABLE = ON; // C-Script
my.flags2 |= UNTOUCHABLE; // Lite-C

Drawback is that the model is not detected by the mouse any longer in case you need it to be.

cheers
Posted By: Kenchu

Re: Models loading when seen? - 03/06/08 12:51

Quote:

Code:
ent_preload ( ENTITY*);






That might come in handy. Gonna try it right away.

EDIT: Yup, that did the trick.

Quote:

I'd like to know what is making your game "stop", considering usually nothing requires that much time to be created or rendered besides possibly a shader or something else on that scale. It also depends on what type of game your playing, a indoor game is specially make by 3DGS to create only the rooms you can see, and therefore doesn't waste resources on things that can't be seen, so upon walking into a large detailed room essentially this could cause the halt in time. level_load creates all entities and there actions at startup, so anything built within the .wmb file will be loaded then however if the game is told to ent_create upon a given condition then it will do so as well. I don't see many games that go through that kind of trouble, usually if your trying to save space an entity will be rendered as invisible and static until it can be seen. Then it will be flagged as active and visible. None of these actions are really noticable in game speed though unless you are doing these actions in mass or are working on a old or lower end computer. If you explain exactly what is happening (a pic with imageshack.com for example) would help. However if I had to make a random guess, I would guess that its something else, not the character is causing your lag. However i've been wrong before, so feel free to elaborate.






It's the water tank thingie. As soon as it is within the view frustum the first time, 3dgs stops for just a little while (very short).

Quote:

One possible cause for a "freeze" delay if you have a few fairly complex models is the trace that is routinely sent out by the mouse pointer. You can test if this is the cause by placing a few of you models around you, then when you rotate them into view see if the position of the mouse arrow makes a difference as to when exactly the freeze occurs.

The way to eliminate this problem is to make sure the UNTOUCHABLE flag is turned on for each model.

my.UNTOUCHABLE = ON; // C-Script
my.flags2 |= UNTOUCHABLE; // Lite-C

Drawback is that the model is not detected by the mouse any longer in case you need it to be.

cheers




I dunno if thats it, since it doesnt matter where my mouse pointer is when 3dgs stops for that split second of loading.
© 2024 lite-C Forums