Hello everybody this is my first post in the forum, I'm watching engines at the moment doing experiments and I have knowledge about how to code in basic. But all the knowledge that I have is coming from the old quick basic in msdos...
Anyway I was playing this morning with the trial of darkbasic to see if it possible to create a block world in this engine. I know that is possible because I did the first array of blocks 100x100 but when I'm moving the camera in my computer I'm having 20 fps. My cpu is amd phenom II X4 965 and I have gtx 650 with 2gb ddr5 so I think my computer can move 1000 blocks more faster so probably my code is wrong. Because I did the code in the way that I know more or less from my old knowledge of basic. I would like to share the code because I can imagine that my way is totally obsolete in this engine.
Rem Project: Test
Rem Created: Tuesday, February 18, 2014
Rem ***** Main Source File *****
sync on
sync rate 120
hide mouse
cls 0
set display mode 800,600,32
set window on
MAKE CAMERA 1
TBlocks=0
ImageNumber=1
load image "stone.png",ImageNumber
//make object cube ObjectNumber,1
for nblocks_x=1 to 100
TBlocks = TBlocks +1
ObjectNumber=TBlocks
make object cube ObjectNumber,1
texture object ObjectNumber, ImageNumber
//mipmap control
set object filter ObjectNumber, 0
POSITION OBJECT ObjectNumber, nblocks_x, nblocks_y, Z
for nblocks_z=1 to 100
TBlocks = TBlocks +1
ObjectNumber=TBlocks
make object cube ObjectNumber,1
texture object ObjectNumber, ImageNumber
//mipmap control
set object filter ObjectNumber, 0
POSITION OBJECT ObjectNumber, nblocks_x, 0, nblocks_z
next
next
rem SET OBJECT TEXTURE ObjectNumber, Texturing Mode, Mipmap Flag
rem color object ObjectNumber,rgb(0,0,255)
px as float
py as float
pz as float
px=0
py=0
pz=-5
while mouseclick()=0
set cursor 0,0
if inkey$()="w" then pz=pz+0.02
if inkey$()="s" then pz=pz-0.02
if inkey$()="a" then px=px+0.02
if inkey$()="d" then px=px-0.02
if inkey$()="q" then py=py+0.02
if inkey$()="e" then py=py-0.02
POSITION CAMERA 1, px, py, pz
print px,pz
fps$="DBPro Fps: "+str$(screen fps())
text screen width()-20-text width(fps$),screen height()-40,fps$
rem if inkey$()="1" then make object cube ObjectNumber,1:color object ObjectNumber,rgb(0,0,255)
rem xrotate object ObjectNumber,wrapvalue(object angle x(ObjectNumber)+1)
rem yrotate object ObjectNumber,wrapvalue(object angle y(ObjectNumber)+1)
sync
endwhile
delete object ObjectNumber
end
And this is a screen with the low fps.
I know that I can create one block of 100x100x1 and the engine is going to be perfect but I don't want to loose block entities.