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.

DarkBASIC Professional Discussion / whats the best way to handle 2000/3000 objects at once? + test TGC youtube posting for latter wip.

Author
Message
sindore
22
Years of Service
User Offline
Joined: 2nd Jul 2004
Location: Bedfordshire, UK
Posted: 30th Jan 2011 12:26 Edited at: 30th Jan 2011 14:24
what's the best way to handle 2000/3000 objects at once?

I'm thinking physX object, objects with shaders, lighting and shadows etc, whats going to handle all of this?

is there a way of freeing up numbers not used, so more object can be created?

this part of my post is just to test the youtube linking




ok youtube linking is not working lol


Edit

OK figured youtube linking out

Edit

Quote: "OK figured youtube linking out"
no I haven't lol

Edit

got it working, thanks again C0wbox.

The world surcome to the power of an evil god, a new champion arise The dark Lord Sindore
sindore
22
Years of Service
User Offline
Joined: 2nd Jul 2004
Location: Bedfordshire, UK
Posted: 30th Jan 2011 13:47 Edited at: 30th Jan 2011 13:59
i

Edit

ahaha!... I feel asleep on the keyboard, sorry about the extra post

The world has surcome to the power of Ashcore, but the fight must continues
C0wbox
20
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 30th Jan 2011 14:01 Edited at: 30th Jan 2011 14:01
Yeah you only need the video code in the youtube tags.

Like this:

URL: http://www.youtube.com/watch?v=gr5fejED82o

Code:

It's just the last part, after ?v=

Result:


sindore
22
Years of Service
User Offline
Joined: 2nd Jul 2004
Location: Bedfordshire, UK
Posted: 30th Jan 2011 14:20 Edited at: 30th Jan 2011 14:34
thanks C0wbox most appreciated, I've edited my 1st post now, do you know anything about mass object handling do you?

Edit

this is a 1st for me a new Signature to match my avatar, and I placed a YouTube video in my post, even if it was with a bit of help. lol

The world surcome to the power of an evil god, a new champion arise The dark Lord Sindore
revenant chaos
DBPro Master
19
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 30th Jan 2011 15:37
Quote: "what's the best way to handle 2000/3000 objects at once?"

The trick is not to have to handle thousands of objects at once. Split the entire world into a grid (or series of grids), and only handle/update things around the player. It is also good spread out the updating over multiple loops.

Quote: "I'm thinking physX object, objects with shaders, lighting and shadows etc, whats going to handle all of this?"


In the project that I have been working on, I have separate "systems" which handle each of these. I use a master list (an array) to store all of my IDs, then the functions which need the list have their own arrays which store the index of the item in the master list.

The entire world is split into a series of grids which is then used to optimize everything (Object LOD/Collision/Recycling, Sounds, particles, etc...).

I have a Load_Texture(Filename$) function which only loads an image once, and returns that ID each time the image is attempted to be loaded.

I have also written Find_Free_Object(), and Set_Object_Free(objID) functions which do exactly what you describe by simply using an array, and a global variable which stores the last returned ID.

Each Type of static object uses a defintion file, which stores all of its properties (LOD,Textures,shaders, etc..). Then I keep an object "Instance" array which stores the positions of all of the static objects, and is then used to update the LOD and collision.

I then use an array to store the indexes of the instances which are in each sector. It looks like: SectorObjs(SecQTx,SecQTz,NumOfObjTypes,MaxSecInstanceQT)

For fast lookups I just calculate which sector the player is in, and use a for-next loop to check the surrounding sectors.

For physics I setup the static rigid bodies for the entire world, then delete the objects and replace them with simple triangle objects (using the same IDs) which are then excluded. This same logic can be used to apply physics to DBpro Instanced objects.

I am using Evolved's deferred shading (now called "Advanced Lighting") for the lighting as it supports multiple shadow casting lights (point, spot, cube, and directional), Normal/parallax mapping, post processing, etc... but it requires a pretty nice graphics card to even think about using.
sindore
22
Years of Service
User Offline
Joined: 2nd Jul 2004
Location: Bedfordshire, UK
Posted: 31st Jan 2011 00:02
thanks revenant chaos this looks like good advice, as for graphic power I'm ok for that, I have radeon 4890, and a i7 920 d0 cpu, 3gb 1600mhz tri-channel memory, so should be good + will be upgrading as soon as I can, I'm hoping to crossfire my 4890, or upgrade the card I have, as well as get more memory

I'm hoping to use the DX10 shaders if there any good in dbp, but will leave the option to set to DX9c, as well as a modifiable LOD system for backward compatibility with older PCs, plus other fetchers and settings.

I think I may have a function I made some years ago that uses images like you mentioned, so will have to have a hunt for that.

I know nothing about object handling as I have never built on this scale, but can't wait to get stuck in to it, I'll look up object handling functions to see what I can find, if you have any threads in mind that may help me, or a small peace of code to get me started that would be a grate help.

I have never believe it or not touched on lighting in dbp, so Advanced Lighting will be a new step for me as well, I can't wait, but I could just forget about it, but now you side about it, I may as well get stuck in to that to, give my game some atmosphere. lol

The world surcome to the power of an evil god, a new champion arise The dark Lord Sindore

Login to post a reply

Server time is: 2026-07-18 05:06:14
Your offset time is: 2026-07-18 05:06:14