heres a very simple stress test toy I knocked up under the new u6 patch, you can walk around with mouselook and cursor keys, press space to get an overhead view and "b" to track a bee as it flies about, note the "plants" waving in the breeze, the code is below and the exe is in the zip file (yeah! I aint no artist), note this was just a quick stress test NOT an example of well written and optimised code.
Rem Project: marswar
Rem Created: 6/03/2006 11:56:11
Rem ***** Main Source File *****
sync on: sync rate 0: hide mouse
cls: text 100,100,"Initialising...please wait"
sync:sync
load image "ground.jpg",1
load image "sky.jpg",2
load image "cloud.bmp",3
load image "grass.bmp",4
load image "sun.jpg",5
load image "sun2.jpg",6
load image "water.jpg",7
load image "rock.bmp",8
dim wave(300)
make object plain 1000,6000,6000
make object plain 900,400,400
make object plain 901,400,400
pitch object down 901,90
position object 901,50,0.3,50
texture object 901,7
fade object 901,25
scale object texture 901,24,24
set object cull 900,1
texture object 900,7
ghost object on 900
pitch object down 900,90
position object 900,100,0.35,100
scale object texture 900,20,20
set object cull 1000,0
texture object 1000,3
ghost object on 1000
pitch object down 1000,90
position object 1000,100,300,100
make object sphere 999,8000
set object cull 999,0
texture object 999,2
position object 999,100,0,100
pitch object down 999,15
set object collision off 999
set object collision off 1000
make object sphere 998,500
position object 998,100,0,100
set object light 998,0
texture object 998,5
set object collision off 998
make object sphere 997,800
position object 997,100,0,100
pitch object down 997,160
set object light 997,0
texture object 997,6
set object collision off 997
make matrix 1,100,100,15,15
randomize matrix 1,4
prepare matrix texture 1,1,15,15
start=1
for i=14 to 0 step -1
for l=0 to 14
set matrix tile 1,l,i,start
inc start
next l
next i
for i=0 to 15
set matrix height 1,0,i,0
set matrix height 1,15,i,0
set matrix height 1,i,0,0
set matrix height 1,i,15,0
next i
update matrix 1
size#=((rnd(20)/15.0)+0.1)*100.0
load object "tree5.x",200
scale object 200,size#,size#,size#
turn object left 200,rnd(359)
repeat
x=rnd(100)
z=rnd(100)
position object 200,x,get ground height(1,x,z)+(size#/220),z
until (object collision(200,0)=0) and (get ground height(1,x,z)<1.25) and (get ground height(1,x,z)>0.36)
for i=201 to 450
size#=((rnd(20)/15.0)+0.1)*100.0
clone object i,200,1
scale object i,size#,size#,size#
turn object left i,rnd(359)
repeat
x=rnd(100)
z=rnd(100)
position object i,x,get ground height(1,x,z)+(size#/220),z
until (object collision(i,0)=0) and (get ground height(1,x,z)<2.25) and (get ground height (1,x,z)>0.36)
next i
global max=25
global seasine#=0
load object "robot.x",1
repeat
position object 1,rnd(90)+5,2,rnd(90)+5
until (get ground height(1,object position x(1),object position z(1))>2)
loop object 1,5,25
scale object 1,20,20,20
turn object left 1,rnd(359)
for i=2 to max
clone object i,1,1
repeat
position object i,rnd(90)+5,2,rnd(90)+5
until (get ground height(1,object position x(1),object position z(1))>2)
loop object i,5,25
scale object i,20,20,20
turn object left i,rnd(359)
next i
dim beeflight(25)
load object "bee.x",10000
position object 10000,rnd(100),10,rnd(100)
scale object 10000,400,400,400
x=rnd(100)
z=rnd(100)
point object 10000,x,get ground height(1,x,z)+((rnd(300)/100))+0.4,z
beeflight(0)=rnd(500)
for i=10001 to 10025
clone object i,10000,0
position object i,rnd(100),10,rnd(100)
x=rnd(100)
z=rnd(100)
point object i,x,get ground height(1,x,z)+((rnd(300)/100)+0.4),z
beeflight(i-10000)=rnd(500)
next i
make object plain 1999,0.5,1
texture object 1999,4
position object 1999,-10000,-10000,-10000
for i=2000 to 2300
clone object i,1999,1
scale object i,rnd(120)+80,100,100
set object cull i,0
wave(i-2000)=rnd(359)
set object transparency i,1
repeat
x=rnd(90)+5
z=rnd(90)+5
position object i,x,get ground height(1,x,z),z
until object collision(i,0)=0 and get ground height(1,x,z)>0.4 and get ground height(1,x,z)<1.75
next i
load object "rock.x",6000
texture object 6000,8
scale object 6000,3,3,3
for i=1 to 50
clone object 6000+i,6000,1
scale object 6000+i,(rnd(2)+1)/2.5,(rnd(2)+1)/2.5,(rnd(2)+1)/2.5
rotate object 6000+i,rnd(359),rnd(359),rnd(359)
repeat
x=rnd(101)
z=rnd(101)
position object 6000+i,x,get ground height(1,x,z),z
until object collision(6000+i,0)=0
next i
set camera range 0.1,10000
position camera 50,0,50
set text opaque
set ambient light 100
global camangy=0
global camangx=0
do
text 0,0,str$(screen fps())
mouselook()
object_walker()
position camera camera position x(),get ground height(1,camera position x(),camera position z())+0.35,camera position z()
for i=1 to max
position object i,object position x(i),get ground height (1,object position x(i),object position z(i)),object position z(i)
next i
turn object right 999,0.005
scroll object texture 1000,0.0002,0.00019
position object 998,100,0,100
position object 997,100,0,100
pitch object down 998,0.037
pitch object down 997,0.0214
move object 998,-3500
move object 997,-3000
roll_sea()
wave_grass()
fly_bees()
remstart check this after update 6
for i=2000 to 2500
if object in screen(i)=0
hide object i
else
show object i
endif
next i
for i=1 to max
if object in screen(i)=0
hide object i
else
show object i
endif
next i
for i=200 to 600
if object in screen(i)=0
hide object i
else
show object i
endif
next i
remend
if spacekey() then position camera 50,40,50:point camera 50,0,50
if inkey$()="b" then position camera object position x(10000)+0.5,object position y(10000)+0.5,object position z(10000):point camera object position x(10000),object position y(10000),object position z(10000)
sync
loop
function wave_grass()
for i=0 to 300
wave(i)=wrapvalue(wave(i)+5)
point object i+2000,camera position x(),object position y(i+2000),camera position z()
pitch object down i+2000,(sin(wave(i))*7)
roll object right i+2000,(cos(wave(i))*3)
next i
endfunction
function roll_sea()
seasine#=seasine#+1
seasine#=wrapvalue(seasine#)
antisine=wrapvalue(seasine#+75)
scroll object texture 901,(sin(seasine#))/1500,(cos(seasine#))/2100
scroll object texture 900,sin(antisine)/2000,cos(antisine)/3000
position object 900,50,(sin(seasine#)/35)+0.36,50
endfunction
function object_walker()
rad#=0.15
for i=1 to max
oldheight#=object position y(i)
move object i,-0.02
if object position y(i)<0.5 and oldheight#>get ground height(1,object position x(i),object position z(i))
turn object left i,rnd(5)+1
endif
robx=object position x(i)
robz=object position z(i)
for l=6001 to 6050
rockx=object position x(l)
rockz=object position z(l)
if robx>rockx-rad# and robx<rockx+rad# and robz>rockz-rad# and robz<rockz+rad#
turn object left i,5
endif
next i
for l=200 to 450
treex=object position x(l)
treez=object position z(l)
if robx>treex-rad# and robx<treex+rad# and robz>treez-rad# and robz<treez+rad#
turn object left i,5
endif
next i
if rnd(200)=1 then turn object left i,rnd(3)+1
next i
endfunction
function fly_bees()
for i=10000 to 10025
move object i,0.1
position object i,object position x(i),get ground height(1,object position x(i),object position z(i))+0.85,object position z(i)
dec beeflight(i-10000)
if beeflight(i-10000)=0
beeflight(i-10000)=rnd(200)+100
x=rnd(250)
z=rnd(250)
point object i,object position x(x+2000),get ground height(1,x,z)+(rnd(300)/100),object position z(z+2000)
endif
next i
endfunction
function mouselook()
ydir=mousemovey()
xdir=mousemovex()
if ydir>0 and camangy<60 then camangy=camangy+(ydir*0.25)
if ydir<0 and camangy>-45then camangy=camangy+(ydir*0.25)
if xdir>0 then camangx=wrapvalue(camangx+(xdir*0.8))
if xdir<0 then camangx=wrapvalue(camangx+(xdir*0.8))
point camera camera position x()+1,camera position y(),camera position z()
turn camera right camangx
if leftkey()
turn camera left 90
move camera 0.05
turn camera right 90
endif
if rightkey()
turn camera right 90
move camera 0.05
turn camera left 90
endif
pitch camera up camangy
if upkey() then move camera 0.05
if downkey() then move camera -0.05
endfunction
this uses a matrix and plains aimed at the camera, two sliding textures (one ghosted and one solid) for the sea, one transparent and ghosted for the sky, two textured spheres for the suns, several cloned objects for the bees,trees and rocks and several cloned animated objects walking about with rudimentary AI, the trees are static (and all the same model scaled and rotated for variety) the sea and plants both run under their own seperate sine/cos offsets, the plants point at the camera x/z but their own y to stop them leaning over as you aproach em, I was using a matrix because the real game has deformable terrain, (this looks nothing like the real game BTW) , this a quick and dirty attempt at a busy "world", no optimisation was used, click the download button to get a zipped exe that should work on any decent machine (I did virus scan it, but check it yourself before unzipping/running), cheers.
Windows: 32 bit extension/graphical shell for a 16bit patch to an 8bit OS originally coded for a 4bit CPU, written by a 2bit company that can't stand 1bit of competition, now available in 64bits.