|
1 registered members (AndrewAMD),
599
guests, and 3
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Destroy a block-model && Cam rotation around a fix point
[Re: EvilSOB]
#221022
08/11/08 17:28
08/11/08 17:28
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
OP
Expert
|
OP
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
Cant convert 'POINTER' to 'struct VECTOR' temp = vector(0,0,0); Syntax Error for(row_index=0;row_index<bitmap_weite;row_index++))
|
|
|
Re: Destroy a block-model && Cam rotation around a fix point
[Re: Espér]
#221073
08/12/08 01:50
08/12/08 01:50
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Sorry, I didnt realise temp was a real vector. Cant convert 'POINTER' to 'struct VECTOR' temp = vector(0,0,0); Try this instead:- vec_set(temp,vector(0,0,0)); And this is pure typo, drop the last ")" Syntax Error for(row_index=0;row_index<bitmap_weite;row_index++)) and use for(row_index=0;row_index<bitmap_weite;row_index++)
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Destroy a block-model && Cam rotation around a fix point
[Re: Espér]
#221118
08/12/08 13:36
08/12/08 13:36
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Ahh crud-dammit I see, simple logic overflow in my brain... At the bottom of the loops you'll find this ...
}
temp.x += 64;
}
...and it should be this ...
}
temp.x += 64;
temp.y = 0;
}
... Sorry.  But how was the speed looking?
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Destroy a block-model && Cam rotation around a fix point
[Re: EvilSOB]
#221584
08/15/08 00:00
08/15/08 00:00
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
OK, we are starting to get to the problem now.
Running the code as it stands at the moment, it takes about 45 seconds to create all the entities BUT it takes 260 seconds to process the first frame or wait(1); statement. At this crude stage, the FPS of the needs to be measured in Seconds Per Frame... but thats another day.
Ive modded the code to create almost all the entities as Null Entities (no model) in order to bypass any texture memory and/or poly-count issues. Running the NEW code, it takes about 2 seconds to create all the entities but it STILL takes 200 seconds to process the first frame or wait(1); statement. FPS here is fine at about 40fps with some 60ish real models being shown and the null Models positioned on screen, even though not visible as they have no meshes.
This is telling me that it is the sheer number of entities that is causing the first frame delay more than anything else.
Those are the detailled symptoms, so are more finely tuned questions to any masters out there....
Where is this delay coming from... I take it that all the ent_create(...)'s are being 'processed' at the first wait(1); and creating the delay. Spreading them into multiple frames still leaves us with the same HUGE overall time to generate the level. Is there a way to speed up or optimise bulk creation of large numbers of entities? Say by using 'malloc' instead of 'ent_create' or something like that?
Please dont give suggestions in relation to "only creating entities as you get close enough to need them.", as I am leaving this avenue very far down the list(but it is still on the list).
Thanks to all.
PS All these test are being run on a poor spec PC (Pentium3-3.0Ghz,512Mb ram, 128Mb ATI Video)
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Destroy a block-model && Cam rotation around a fix point
[Re: EvilSOB]
#221984
08/17/08 09:32
08/17/08 09:32
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Heres the best I can come up with Im afraid  . There were some minor changes in "function main". They relieved the memory issues. On my 2gb of ram PC anyway. Changing MAX_ENTITIES is the only change that really makes a difference. Keep it somewhat low (say 100,000) only put it up if the engine complains about not having enough entity pointers. I "think" particle pointers are included in this number also so beware.
...
wait(1);
// //removed (not necessary AND causes errors) - max_nexus = 2000;
max_entities = 100000; //adjusted due to memory limits -was- max_entities = 999999; //my maximum was 399999 before error
level_load(NULL); //adjusted not needed and WMB caused problems -was- level_load("Level_Grund.wmb"); //I cant open it here because its NEXUS setting was too high
sky_color.red = 1;
...
...
...
camera.tilt = 0;
// //removed (not necessary AND causes errors) - max_nexus = 2000;
backside = levelcount;
...
The major change I made to fix the speed issue is NOT AN ACTUAL FIX. All I have done is kill all the Normalising and 'shader'ing done to the blocks and that took the level build time from 250 seconds to 50 seconds. (tested on a 3Ghz dual-core AMD with 2Gb ram)
...
pixel = pixel_for_bmap(levelmap, column_index,row_index);
pixel_to_vec(pixelget,alphas,888,pixel);
// weiß = Boden_normal
if(pixelget.x == 255 && pixelget.y == 255 && pixelget.z == 255)
ent_create("Ground.mdl",vector(temp.x,temp.y,2),NULL); //,object_boden);
// schwarz = Wand_unabbaubar
else if(pixelget.x == 0 && pixelget.y == 0 && pixelget.z == 0)
ent_create("Erdwall_0.mdl",vector(temp.x,temp.y,64),NULL); //,object_fels);
// braun = Wand_abbaubar -
else if(pixelget.x == 60 && pixelget.y == 90 && pixelget.z == 156)
ent_create("Erdwall_0-2.mdl",vector(temp.x,temp.y,64),NULL); //,object_erde);
// Farbe passt garnicht = Boden_normal
else ent_create("ground.mdl",vector(temp.x,temp.y,2),NULL); //,object_boden);
temp.y += 64;
}
temp.x += 64;
...
So I havent fixed it, just found where the problem is. Unfortunately, I know nothing at all about normals and shaders so this is as far as I can go. My only advice is that the normaling/shading section "seems" to be creating a lot of temporary materials, is it necessary? Cant you use one material per block TYPE, and change the block's material when the block gets changed? Bet of luck and keep in touch. 
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Destroy a block-model && Cam rotation around a fix point
[Re: Carlos3DGS]
#236430
11/14/08 07:50
11/14/08 07:50
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
I would definately be interested, and I think reaper has put this project in the too-hard basket cause of this issue.
If you are not concerned on privacy of code, post a new thread with what youve got to date, we may help get it finished.
Otherwise, PLEASE PM me with it, even in its un-finished state, as seeing it like that helps me to absorb its nuances and idiosyncrasies. PM Reaper too as he isnt monitoring the thread anymore I think.
MANY thanks.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
|