Celestial Body or micro world simulation #223
-
Im trying to create a world with planets for rts like game
And the only idea that I could come up with is multiple local simulations of planets, for the client the coordinates will be given relative to the virtual global world Tell me is this really a good idea, or is there something else i don't see? (I already tired you with my questions? :D) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
From what I understand of what you're trying to do, having a per-planet If you want the planets to collide and respond physically, you could put proxies for them into another There's also the option of having all the planets and everything on them in one simulation, though then you'd have to deal with physically implied things like a planet spinning too fast and launching everything into space :P |
Beta Was this translation helpful? Give feedback.
-
I havent seen the BigCompund, but form the comment you might want to introduce nested spaces intot the core, each with its own spatial index and inner space frame with its own origin . the Ancient ODE (open dynamics engine) had a artitecture to collide spaces. Now even modern engines don't and they should … the basic idea is collide the items in each spaces, then collide on broadphase the spaces by the outer bounds of them, in an outer cosmological frame of refernce ( where the units might be different, as in light years, not km) , and then the pairs in intersection of the spaces, by trasfromfin the geometry and velocity from one into the other refernce frame. for the narrow phase one subspace could have a tree and one could have a hash or even a grid to find quickly. The space collider collided all the spaces via interface, and didnt care about the broadphase implementation used in each , it collected the bodies in the intersection area. If a subspace is a single complex rigid body it would definitely be a tree, if not maybe a dyamic balanced tree, or a hashspace or a grid. This solves some of the precision issues as well, if peple are temped to use doubles or longs. it gives perfomance gaines on order of 100x when i tried it. The the main collider, what it did was for the bodies in teh intersection of the two outer subspaces, collide onlly those together, by converting the cooridnates one of those ones to the other. otherwise just run the inner spaces in parallel of course. With SIMD i dont know the constraints but at least on a cpu leave you could run them eachon a CPU thread. Anoterh use, i wish my physics engine has, is sets of bodies that are jointed together , a like a ragdolls or vehicle.. Each set of thies be a subspace, becasuse teh AABB barely changes , then you could CCD just the subspace before you even fight the characters parts. now have to ccd every damn foot and hand with evey damned other foot and hand of every other monster meters away when i shouldnt have to. Just an idea i hope is useful, as the ODE is long dead but was well-architected. If the needed iinterfaces are there, you can mabye sort of implement it yourself without core changes to the phsycis engine, maybe that would make more sense im not quite sure. |
Beta Was this translation helpful? Give feedback.
From what I understand of what you're trying to do, having a per-planet
Simulation
does sound like the easiest way to go.If you want the planets to collide and respond physically, you could put proxies for them into another
Simulation
too. The stuff on the planets wouldn't need to be in that simulation. But if you don't care about physics enginey stuff at the planet level, then you could indeed just do distance tests or whatever other simple approach works.There's also the option of having all the planets and everything on them in one simulation, though then you'd have to deal with physically implied things like a planet spinning too fast and launching everything into space :P