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 / object loading, memory use, and the camera range?

Author
Message
mbaucco
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location:
Posted: 28th Apr 2006 20:29
I hope this makes sense, but basically I am wondering if I have to manually load and unload terrains to conserve memory usage in my game. As I understand it, nothing beyond the camera range is drawn, so do I need to worry about deleting objects when the player goes out of range or does the engine basically do that for me?

For example, say I make a big island with a bunch of trees, flowers, rocks, and other such things on it. Would I have to cut the island into chunks, then load and unload them (and all the objects on them) whenever the player gets a certain distance away? Or should I just let the engine manage this?

Anyway, I hope this makes enough sense for someone to give me some advice.

Thanks!
Matt
SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 28th Apr 2006 22:06 Edited at: 28th Apr 2006 22:07
Quote: "do I need to worry about deleting objects when the player goes out of range or does the engine basically do that for me?"


it depends on the language you're using. Dark basic classic will still draw objects that are outside of the camera range, but the object will be 0x0x0.

Dark Basic Professional will not even try and draw objects beyond the camera range, looks the same, but it has a faster performance.

In either case it's a good idea to delete objects that objects that are too far away from the camera, that way the engine isn't even checking whether or not the object is in range, which increases performance even more. The problem with this is, should an object re-enter the camera range, it will need to be reloaded which may lead to sluggish performance.

Something I read up in the DB classic help pages some years ago was to change such objects into static, it's not something I've ever tried, but the example program for making objects static really boosted the performance. The commands you'll need for this are:
attach object to static
detach object from static

I believe these commands work in DB Pro as well, but I don't have it on this machine... only classic.
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 30th Apr 2006 16:11
also if ur looking for loads of the same objects (trees, flowers etc) and aren't deleting the original object u can just use instance object (creates copies of an object based on that objects data, i.e. anything happening to that object will happen to every instance of it)

life's one big game
spec= 2ghz, 1gb ram, 512mb gpu, directx 9.0c, dbpro and classic
mbaucco
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location:
Posted: 1st May 2006 15:25
Many thanks for the advice!

-Matt

Login to post a reply

Server time is: 2024-11-27 20:46:27
Your offset time is: 2024-11-27 20:46:27