Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Possible Optimizations

Author
Message
GuntiNDDS
16
Years of Service
User Offline
Joined: 2nd Jan 2008
Location:
Posted: 5th Jan 2008 06:13
Hi,

as some of you might now from my other posts, i am new to darkbasic and all that 3d stuff . As you might aswell know, i made a little project where boxes fall down and stack upon each other to get my hands on it and learn about 3d programming in dbpro.

i am now about done with that project thanks to the people helping me with my initial problems / questions. specially svenb

however i am sure i didnt do everything right and that theres still huge optimization potential within my coding. especiall towards the end, when my program renders more than 1000 cubes in the scene, i get some fps dropping for example.

therefore i'd like to post my code here, and hope that some of you can give me some advices on where i can optimize things.

thanks in advance, code below.
(i think it requires dbpro because i use types and other stuff, and you need to enable the "..." line split thing.)

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 5th Jan 2008 11:04 Edited at: 5th Jan 2008 11:04
Mhm, let's see.

I'd start with this part:

Why all the cubes? It's much easier and much shorter using make object box obj, sx#, sy#, sz#. Using 4 boxes also uses less polygons than numerous cubes.

Else than that. I don't see anything out of the ordinary for any good code...

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
GuntiNDDS
16
Years of Service
User Offline
Joined: 2nd Jan 2008
Location:
Posted: 5th Jan 2008 11:24
ah thanks. i wasnt aware of the make object box command.
pcRaider
17
Years of Service
User Offline
Joined: 30th May 2007
Location:
Posted: 6th Jan 2008 08:28 Edited at: 6th Jan 2008 08:31
You use a TEXT command.
If different, a video chip is not displayed.
And a TEXT command is slow.


Watch this for reference.
DBPro 'Heads Up' Tutorial by Steve Vink
http://www.thegamecreators.com/data/newsletter/newsletter_issue_39.html#8
GuntiNDDS
16
Years of Service
User Offline
Joined: 2nd Jan 2008
Location:
Posted: 6th Jan 2008 20:09
i see, so you mean i should use sprites instead i guess ?

i will try that.


also one thing i am noticing is, that there are flashing white pixels appear randomly, possible at possitions where the cubes stack / sit upon each other.

any idea how i could get rid of that "effect" ?

thanks

Login to post a reply

Server time is: 2024-11-25 10:31:44
Your offset time is: 2024-11-25 10:31:44