gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Announcements And Comments > Gravity demo

#17266 - Gopher - Fri Mar 05, 2004 10:04 am

This project took me much longer than it should have to get working properly. It's far from finished, but I've got to set it aside for a while so I decided to show it off as-is.

Here's a link; Sorry for the lack of direct access, but there's no ads at least. http://willt.freeservers.com

This build is set to have 80 objects, which it can handle while maintaining 60fps. It drops to 30 with much more than that. I haven't tested it on hardware yet, so if you try it let me know how it works.
_________________
"Only two things are infinite: the universe, and human stupidity. The first is debatable." -Albert Einstein

#17275 - josath - Fri Mar 05, 2004 3:58 pm

it's looks neatest when you zoom out and then multiply the speed * 3 or so. also, the objects don't seem to affect each other that much? i'm guessing their mass is much less than the 'sun' mass

#17278 - Gopher - Fri Mar 05, 2004 4:22 pm

Actually, the only object exerting gravity is the sun, the others have no influence at all. If every object exerted gravity on every other object instead, it would become O(n^2) instead of O(n). Without serious optimization, it would only be able to handle about 10 objects before it started slowing down.

I do want to revisit this project, and there is still a lot of room for optimization, but I doubt I'll be able to get it running 80x faster.
_________________
"Only two things are infinite: the universe, and human stupidity. The first is debatable." -Albert Einstein