Hi! I tried a technique once with DB that didn't work, so I thought I try it with DBPro, and for a change, it works like a charm! You know how your framerate drops into the molasses range if you have too many objects in use at one time, even just a few hundred and everything turns into syrup. Well I had this idea that if you delete objects that are not in use, ie. well outside the current visual range, you could build a world with thousands of objects, but only show the relevant ones. Complex from a programming standpoint, but it does work around the problem of slowdown quite effectively.
The problem was, in DB, if you created a hundred objects, then deleted them and created a hundred more, etc. the system eventually ground to a 1fps halt. The technique was useless. But in DBPro, it works! Here are some test results...
I made a short test program in 1024x768x32 using cube objects textured with a 256x256 texture. (ash01.bmp from the original DB texture pack) I built a hundred textured cubes, placed them randomly in the world, and then moved the camera through them. (system stats: P4 1.3ghz/256 MB SDRAM@133mhz/GeForce4 MX420 w. 64 MB SDRAM) Here's my results, listed in FPS...
Program start: 209
All cubes in view: 140
Moving through cubes: 46-170
Then I realised I was an idiot and changed to SYNC ON and added a FAST SYNC to the end of my main loop...
Program start: 209
All cubes in view: 130
Moving through cubes: 88-341 (Holy cow!!!)
Then I built, textured and positioned 100 cubes, deleted them, and built 100 more...
Program start: 215
All cubes in view: 151
Moving through cubes: 99-341
For the final test I built 10,000 cubes, textured and placed, then deleted them one by one with the DELETE OBJECT command (took several minutes to run that) then I built 100 new cubes, textured and placed. Results...
Program start: 189
All cubes in view: 157
Moving through cubes: 110-341 (Great!!!)
Now that I know that building huge numbers of objects and deleting them doesn't affect performance in DBPro (it sure did in DB) I'm going to try writing an engine that only loads relevant objects (wish me luck) on-the-fly so to speak. If anyone else would like to experiment with this technique, please do, I think it might be an effective solution to the slowdown problem.
I apologize for the length of this post, but I wanted to give proof that this idea can work... and I hope to find solutions to problems rather than just complaining about them. Kudos to the DBPro team for making the DELETE OBJECT command work this time. I'm impressed. Ten thousand objects created and deleted with no effect on performance!!! This could really lead to something...