Max sphere density in a certain area

Post your questions here
Post Reply
ddmx
Posts: 5374
Joined: Sun Apr 20, 2008 3:36 pm
Location: Midland MI

Max sphere density in a certain area

Post by ddmx »

What is the maximum sphere density that will cause the game to lag? In building a rideable parking deck, it's gonna have about 680,000 spheres of radius .5. The structure is 200ft LxWxH. I made collision for only the bottom portion of about 16,000 spheres and it led to an unplayable framerate. There could be a chance that I had spheres overlapping as I did it kind of quickly, but I'd just like to know what kind of a limit there is. Thanks
DJ99X
Posts: 15523
Joined: Tue Jan 15, 2008 11:36 am
Location: Land Down Under

Re: Max sphere density in a certain area

Post by DJ99X »

Ive had lag at 10000 spheres. Depends on the computer really.

You will never get 618000 spheres to work, unless you are really patient. That is why we need mesh collisions
jlv
Site Admin
Posts: 14954
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: Max sphere density in a certain area

Post by jlv »

There is one bounding sphere for each object, which shares the same center as the object. Once a bike is inside the bounding sphere, all the spheres for that object are tested against the bike on each step. If you want to speed it up, break the object up into several objects. For example, if you have a 100x100 square, it will have to test against 10000 spheres per step when inside the bounds test. If you broke it up into a 10x10 grid of 10x10 sphere objects, it would only have to test against the 100 bounding spheres and then the 100 spheres for the object itself when inside the bounding sphere.

I probably should do the mesh collisions for ramps and bridges, but for most stuff the spheres are good enough and way more efficient. The torus vs triangle test for the wheels is pretty slow.
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Post Reply