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 / Sparky collision - limit ?

Author
Message
haliop
User Banned
Posted: 21st Apr 2012 14:35
does sparky have an object limit?
like when i add collision to 50,000 object it works
but if i add more it crushes..


any ideas on how to overcome this obsticale?
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 21st Apr 2012 15:12
I find it hard to believe that you have 50'000 objects... No DBP application can handle that many. Or are you talking about the index of the object?

There are exceptions, but generally object indexes are stored in a WORD, which means you have a maximum range of 2^16 = 65536.

TheComet

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 21st Apr 2012 15:16
I think its accumulative. So 2 object can only hit each other. 3 objects..

1,2
1,3
2,3

... and so on.

50,000 would be a very large accumulation of collisions. You would need to put boundaries on the collision detection routine.

haliop
User Banned
Posted: 21st Apr 2012 15:48
i got 47,700 boxes with collision running on 60 fps
but the "word" seems legit when i pass the 50,000 + it shows me an error for
"object (number) no setup"

and im using DarkGDK , just that in GDK section there are less ppl so i'm posting here also :/


well thank you
haliop
User Banned
Posted: 21st Apr 2012 15:57
so.. i guess if i want to keep using sparky collision with mass objects
i'll need to approach my collision system difrrently

adding and removing collisions from objects that are near by and far away.

far away dont get any collision system and are plain static
and near by objects keeps in collision data until the player is far away from it..

however then i'll need to find a way to approach the actually object id number and changing it accordenly so i wont pass the "word" limit 65536..

more hard work to do
for the last several days i'm optimizing my project and it seems i got a long road ahead of me.

if you rad it and can help with a pseudo code for the far away and near by collision objects but always less then the 65536 limit i would really appriciate it , ty for your time , nadav.
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 21st Apr 2012 16:32 Edited at: 21st Apr 2012 16:43
You will run out of memory as well. My memory ran out at about 45,000 sphere objects, so I bought more memory, and can now get over 60,000 sphere objects. But there are still other people to consider if you are handing your program out. Boxes not so bad, but still have to consider users with 1gb memory.

haliop
User Banned
Posted: 21st Apr 2012 16:57
intersting..
however when i check the task manager while running my app it goes up to 200 mb at the ram location .. i guess i'll need to beta test it on other computers..
haliop
User Banned
Posted: 22nd Apr 2012 10:33
OOPS MY BAD!!
i dont have 47,700 i got about 2000 boxes
didnt rad the variables right...

Login to post a reply

Server time is: 2026-07-11 02:02:53
Your offset time is: 2026-07-11 02:02:53