ok. so i have everything in my first level set up and ready to go minues collision detection which i am soon to add after i figure out this problem. i have to large .x files that im using for terrain, and trees+foliage. when i load this level, it takes around 3-4 minutes to load it which i am assuming is from all the other objects being rendered in the entire level. my question is, is there a way to hide parts of a large file like this? like specifiying which xyz coords to hide until in a said range? or is there another option to fix this problem? i tried searching for a solution to this, and maybe a turoial, but came up empty handed. any help would be much appreciated.
here is the code i am using right now.
rem game menu code
sync on : Sync rate 60
Do
load image "mediacover.jpg",5
paste image 5, 10,10
if Button(20,55,"New Game")=1 then Goto New_Game
Button(20,95,"Load Game")
If Button(20,135,"Exit")=1 then Exit
sync
loop
rem new game / game loading code
New_Game:
cls
repeat
text 240,220,"Press any key to continue"
text 240,230,"Once a key is pressed please wait"
text 240,240,"while game is loaded, this could"
text 240,250,"take longer depending on your system"
sync
until scancode()>0
make object box 1,4,3,5
position object 1, 250,2,250
rem Set light variables
make light 1
Set Shadow Light 1,1000,1000,-500,3000
Position light 1,1000,1000,-500
Set Light Range 1,3000
rem terrain code
load object "medialevel 1.x",2
SC_SetupObject 2,0,0
position object 2, 0,0,0
rem tree code
load object "medialevel 1_PR.x",3
SC_SetupObject 3,0,0
position object 3, 0,0,0
set object transparency 3,6
set alpha mapping on 3,99
Set Shadow Shading On 3,-1,200,1
load object "medialevel 1 plantlife_pr.x",6
position object 6,0,0,0
set object transparency 6,6
set alpha mapping on 6,99
set shadow shading on 6,-1,200,1
rem sky code
sky_obj = 4
load object "mediaskyboxsky06.x",sky_obj : position object sky_obj,-1000,0,-1000
position object 4, 100,3,100
set object texture sky_obj,2,0
scale object sky_obj,70000,70000,70000
set object fog sky_obj,0
set object light sky_obj,0
set object ambient sky_obj,0
Set Camera Range 1, 1700000
rem times movement speeds and controls via arrow keys
movespeed = 75
turnspeed = 87.5
time=timer()
do
gameTime=timer()-time
MSframe#=gameTime*(movespeed/1000.0)
TSframe#=gameTime*(turnspeed/1000.0)
if Upkey()=1
Move Object 1,MSframe#
endif
If Downkey()=1
Move Object 1,-MSframe#
endif
If Leftkey()=1
Dec a#,TSframe#
endif
if Rightkey()=1
Inc a#,TSframe#
endif
yrotate object 1,a#
posx#=cos(270-a#) * 30 + object position x(1)
posz#=sin(270-a#) * 30 + object position z(1)
Position camera posx#,object position y(1)+6,posz#
Point Camera object position x(1),object position y(1)+6,object position z(1)
time=Timer()
sync
loop
end
function button(x1,y1,WORDS$)
pressed=0
x2=Text Width(WORDS$)
y2=Text Height(WORDS$)
if mousex()>x1 and mousex()<x1+x2
if mousey()>y1-y2 and mousey()<y1+y2
Pressed=1
Endif
Endif
if pressed=1 then ink rgb(255,0,0),0 else ink rgb(255,255,255),0
if pressed=1
Pressed=mouseclick()
else
pressed = 0
endif
text x1,y1,WORDS$
endfunction pressed
Also, if anyone sees something wrong with my code that i could do to improve it, that would also be of help, although it works fine aside the hiding terrain and trees and plants.
The darkest minds, are often the brightest.