If you've played SpaceBound or looked at the Sc2Mapster news recently, you may have seen mention of Orbit, a library I am developing for N-Body simulation in Starcraft II.
An N-body simulation is a simulation of a dynamical system of particles, usually under the influence of physical forces, such as gravity. For more information on that, see Wikipedia.
The algorithm utilized in Orbit is a fairly simple solution to the n-body problem. There are several reasons why a simple algorithm was used in favor of a more accurate but more complex one:
Galaxy does not offer floating point support and the fixed point in galaxy cannot handle very small numbers.
This isn't a scientific piece of software - it only needs to look good, not be tremendously accurate.
What can I do with Orbit?
Orbit allows you to have objects interact with each other in ways that mimic gravitation and magnetic repulsion. If you've ever taken two magnets and brought the same poles close together, that's what you can expect out of Orbit. Alternatively, you can use Orbit to have things attract each other, like a planet orbiting a star.
What features does Orbit have?
Orbit supports an arbitrary number of simulations (barring memory restrictions).
Each simulation supports an arbitrary number of objects (barring memory and time restrictions)
Orbit objects (masses) can be tied to units, points, or arbitrary locations
Simulation objects can either interact with terrain or not
would be cool to see units orbiting units which are orbiting other units. from what I gathered from the movie this isn't possible... yet? example. The moon orbits earth. earth orbits the sun. then you give units a variable called ?density? then multiply density with the size of the unit in pixel width or scale or whatever sc2 uses. then you could have simulated weight based on how largely scaled the unit is. then add some kinda text based command that involves you selecting a unit and typing Set size to 30. that would change the size of the unit in real time in the game and you could show how the lighter units orbit heavier ones. Grey archons could represent planets made of rock which would be very heavy and have a high density and blue ones could be made of water and lighter. or whatever. just rambling.
would be cool to see units orbiting units which are orbiting other units. from what I gathered from the movie this isn't possible... yet? example. The moon orbits earth. earth orbits the sun. then you give units a variable called ?density? then multiply density with the size of the unit in pixel width or scale or whatever sc2 uses. then you could have simulated weight based on how largely scaled the unit is. then add some kinda text based command that involves you selecting a unit and typing Set size to 30. that would change the size of the unit in real time in the game and you could show how the lighter units orbit heavier ones. Grey archons could represent planets made of rock which would be very heavy and have a high density and blue ones could be made of water and lighter. or whatever. just rambling.
This is possible if you give the simulation the right configuration values. Figuring out those numbers could be pretty difficult though. In the future I'm going to implement a second algorithm which might make this a bit easier to do.
Most of the examples were done out of convenience to me, meaning I made it so that one or more of the bodies didn't move. To make an orbit stable, the two bodies involved would both need to be able to move, though the heavier one will move significantly less. Likely the orbits will slowly drift, meaning everything would need to be centered in order for it to not end up on the simulation boundary. It's something I plan to add in the future (centering).
Here's a weird glitch I ran across tonight which reminded me of your library : )
Wonder what exactly is causing it and if it could be replicated via code, but I'm sure it would be nothing like yours ;)
All I did was make a copy of a hellion and change it's speed to 25.
There's 11 of these Hellions not counting the one that's actually modeled and chilling at the top.
Sorry for the bad quality, didn't want to upload a 550 mb 30 second video...
There were times that it would orbit for a very very long time, and a couple rare times that the whole group just kept going in circles w/o order being changed around in the group.
Orbit v0.2
If you've played SpaceBound or looked at the Sc2Mapster news recently, you may have seen mention of Orbit, a library I am developing for N-Body simulation in Starcraft II.
An N-body simulation is a simulation of a dynamical system of particles, usually under the influence of physical forces, such as gravity. For more information on that, see Wikipedia.
The algorithm utilized in Orbit is a fairly simple solution to the n-body problem. There are several reasons why a simple algorithm was used in favor of a more accurate but more complex one:
What can I do with Orbit?
Orbit allows you to have objects interact with each other in ways that mimic gravitation and magnetic repulsion. If you've ever taken two magnets and brought the same poles close together, that's what you can expect out of Orbit. Alternatively, you can use Orbit to have things attract each other, like a planet orbiting a star.
What features does Orbit have?
What does Orbit look like?
How can I use Orbit?
Orbit is available both as a raw Galaxy script and as a GUI library.
Where do I get Orbit?
On its asset page! Right here.
You can find a demonstration of Orbit used in a map here.
Orbit Documentation
Orbit documentation is provided on the asset page, located here.
I've released a GUI driven version of the Orbit library.
would be cool to see units orbiting units which are orbiting other units. from what I gathered from the movie this isn't possible... yet? example. The moon orbits earth. earth orbits the sun. then you give units a variable called ?density? then multiply density with the size of the unit in pixel width or scale or whatever sc2 uses. then you could have simulated weight based on how largely scaled the unit is. then add some kinda text based command that involves you selecting a unit and typing Set size to 30. that would change the size of the unit in real time in the game and you could show how the lighter units orbit heavier ones. Grey archons could represent planets made of rock which would be very heavy and have a high density and blue ones could be made of water and lighter. or whatever. just rambling.
This is possible if you give the simulation the right configuration values. Figuring out those numbers could be pretty difficult though. In the future I'm going to implement a second algorithm which might make this a bit easier to do.
Most of the examples were done out of convenience to me, meaning I made it so that one or more of the bodies didn't move. To make an orbit stable, the two bodies involved would both need to be able to move, though the heavier one will move significantly less. Likely the orbits will slowly drift, meaning everything would need to be centered in order for it to not end up on the simulation boundary. It's something I plan to add in the future (centering).
Here's a weird glitch I ran across tonight which reminded me of your library : )
Wonder what exactly is causing it and if it could be replicated via code, but I'm sure it would be nothing like yours ;)
Details:
(THIS IS NOT USING THE LIBRARY)
Weird glitch? that I found, that reminded me of the Orbit Library on SC2mapster.
http://forums.sc2mapster.com/development/galaxy-scripting-and-trigger-lib/5769-library-galaxy-orbit-v0-2/#p1
All I did was make a copy of a hellion and change it's speed to 25.
There's 11 of these Hellions not counting the one that's actually modeled and chilling at the top.
Sorry for the bad quality, didn't want to upload a 550 mb 30 second video...
There were times that it would orbit for a very very long time, and a couple rare times that the whole group just kept going in circles w/o order being changed around in the group.
@CTSAE: Go Sounds like there are some glitches in the path finding code or something like that, pretty interesting though.
Thank you you just made my dream of creating a Pixeljunk Eden inspired map possible.