Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
2 registered members (steyr, alibaba), 534 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
problem with "preload_mode" #315233
03/14/10 07:51
03/14/10 07:51

M
mercuryus OP
Unregistered
mercuryus OP
Unregistered
M



Code:
...
	preload_mode = 3;
	max_entities=5000;
	level_load(NULL);	
	fps_max=70;	
	wait(1);
	
	// create level
	ent_create(mdl_ground, nullvector, act_ground);
        ent_create(mdl_ ...
        ...



I can't see that preload_mode=3; loads the models (~2000) to the video memory when created.
It still takes seconds to render the first frame with all models but then it runns smooth (the same way like with preload_mode=1;).




Re: problem with "preload_mode" [Re: ] #315412
03/15/10 11:17
03/15/10 11:17
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline
Serious User
darkinferno  Offline
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
i also experience this, i thought this function would increase startup time and remove the wait time when they come onscreen but it doesnt seem to work...

Re: problem with "preload_mode" [Re: darkinferno] #315420
03/15/10 12:21
03/15/10 12:21

M
mercuryus OP
Unregistered
mercuryus OP
Unregistered
M



it will not increase startup time (in fact it startup will be slower).

But it will eliminate the "bucking" of the camera if many models have to be loaded in the video memory when rendered the first time?

Re: problem with "preload_mode" [Re: ] #315428
03/15/10 13:24
03/15/10 13:24
Joined: Aug 2008
Posts: 482
B
bart_the_13th Offline
Senior Member
bart_the_13th  Offline
Senior Member
B

Joined: Aug 2008
Posts: 482
Maybe it's the ent_create command that slowdown your game. Do you spawn multiple enemies, alot of enemies, one after another?

Re: problem with "preload_mode" [Re: bart_the_13th] #315431
03/15/10 13:42
03/15/10 13:42
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline
Serious User
darkinferno  Offline
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
huh, umm, "in fact it startup will be slower" which means, it increases the time the game takes to startup tongue thats what i said, ent_create doesnt slow down your game much if you create a model that was already in memory, that is what ent_preload mode should do, but it doesnt seem to work

Re: problem with "preload_mode" [Re: darkinferno] #315435
03/15/10 14:27
03/15/10 14:27
Joined: Aug 2008
Posts: 482
B
bart_the_13th Offline
Senior Member
bart_the_13th  Offline
Senior Member
B

Joined: Aug 2008
Posts: 482
IMHO, ent_create does slowdown yourgame(That's why it's marked medium speed, slow when 1st called on a same model), preload_mode doesnt speed up the 1st ent_create, but it does speed up where a model 1st appear/visible on screen(I don't know if it's actually shown on the screen or just entering the view fustrum).

Re: problem with "preload_mode" [Re: bart_the_13th] #315437
03/15/10 14:31
03/15/10 14:31
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
preload_mode is supposed to put all ent_Created models into memory before the level is loaded, meaning they already reside in the ram instead of being needed to be loaded from disk. So it does affect the initial (first) creation of an entity.

Of course it cannot compensate the processing time which is needed to setup the interal stuff. But the slow part is disk access, and preload_mode was introduced to prevent those dsk accesses from happening during the game (instead stuff is loaded at game start / before level change).

Re: problem with "preload_mode" [Re: FBL] #315440
03/15/10 14:55
03/15/10 14:55
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
preload_mode 3 never worked for me either. i have reported it to jcl in the beta forum a while ago and then he fixed something but afterwards it still didn't work.

in one of my projects i had to do a camera pan and got jerks that weren't acceptable. so after loading the level i simply placed a camera above the level for 1 frame which enclosed all entities in its frustum. this worked nicely... you can hide this camera view with a black panel or something.

Re: problem with "preload_mode" [Re: ventilator] #315442
03/15/10 15:24
03/15/10 15:24
Joined: May 2009
Posts: 1,816
at my pc (duh)
darkinferno Offline
Serious User
darkinferno  Offline
Serious User

Joined: May 2009
Posts: 1,816
at my pc (duh)
"ent_create does slowdown yourgame(That's why it's marked medium speed, slow when 1st called on a same model), preload_mode doesnt speed up the 1st ent_create"

MANUAL:
"Preloading entities at creation increases the level loading and entity creation time, but prevents a little 'jerk' when an entity becomes visible the first time."

so what are you getting at, it doesnt speed up the first ent_create because its not doing what it should, thats the point of this thread, ent_preload not working correctly

Re: problem with "preload_mode" [Re: darkinferno] #315447
03/15/10 16:21
03/15/10 16:21
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
I agree with Firoball, and "kindof" with darkinferno...

I think the ent_preload probably IS working, but the manuals description of what it is doing is misleading.
I havent tested this BTW, its just an educated guess. What I suspect is this...
Ent_preload does NOTHING with ent_created entities. It only preloads entities referenced by the level during a level_load.
It may also be possible it is only loading the entities from hard-disk, and not into video-ram.


I also suspect a workaround for this is to do your ent_create's with the entity SHOWING in the view fustrum for at least one
frame so it gets loaded into the video-card memory.

Hopefully someone with a better in-depth understanding of directx or the A7 rendering engine can help with this part.
Because flashing all the entities up on the screen would be very 'ugly', it MAY be that ::
1> Entities get loaded into the video-ram even when hidden 'behind' another entity, or even a panel, or 100% alpha-transparent.
2> You may be able to have the entity still in the video fustrum but so far away to be unseen (but NOT clipped by clip_far or LOD).
3> It may also be do-able to load the entities in a 3D location that is only in the fustrum of an non-displayed custom "view".
This unused view may be enough to trigger the renderer to load it into video-ram.

Hopefully someone can validate or disprove my ideas cause it is an issue I WILL be hitting in the future.




"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Page 1 of 2 1 2

Moderated by  old_bill, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1