N-Body Simulations

Discussion in 'Planetary Annihilation General Discussion' started by tatsujb, July 12, 2014.

?

N-body simulations

  1. YAY

    58.5%
  2. NAY

    24.6%
  3. heeey? I'm doing splits!

    16.9%
  1. eukanuba

    eukanuba Well-Known Member

    Messages:
    899
    Likes Received:
    343
    That's not what I mean by instant-landing. I mean that currently interplanetary travel requires the unit enters orbit, and then (in the case of the Astraeus) takes some time to land, being vulnerable to orbital and air fighters. A unit fired by a cannon would still take time to travel between planets, but it would not be vulnerable to orbital or air fighters and would land wherever you aim it, bypassing all defences until it is on the ground.
  2. tatsujb

    tatsujb Post Master General

    Messages:
    12,902
    Likes Received:
    5,385
    yep, but through space only gets to produce a single curve, doesn't get to change directions, that's how I picture it, and particularly only when the two planets are real close.
  3. tatsujb

    tatsujb Post Master General

    Messages:
    12,902
    Likes Received:
    5,385
    that's terrible.

    I just want the unit cannon's projectiles path to have a single arc (can't arc back(or only once), a fairly short range, basically to only ever bridge the gap between one planet and another right next to it. not any more than that.


    a lot of people were also advocating the use of planet mass as a delimiting factory for being able to use the cannon to shoot units through space at all : a heavy enough gravity and it become impossible for units to break free by shooting them and the cannon becomes a intercontinental means of transport only.

    I see enough of the crazy loop-de-loops with the orbital units already, I want the land units that go through space by being shot to do something different.
    corteks likes this.
  4. tatsujb

    tatsujb Post Master General

    Messages:
    12,902
    Likes Received:
    5,385
    :) how quickly? : https://forums.uberent.com/threads/n-body-simulations.61917/page-2#post-960703
  5. steambirds

    steambirds Member

    Messages:
    98
    Likes Received:
    37
    Am I the only one who has no clue what the hell an N-body simulation is?
  6. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    Black magic of astrophysics.

    Long story short:
    Every planet and object in a system applies a gravitational force on every single other object.

    With the largely simplified system PA is using, even sun, planet and moon has a shell of incfluence, and everything inside that shell is ONLY affected by the corresponding root node. There is also no feedback from orbiting objects to the root node. Shells can intersect, since object are statically assigned to a specific one.

    N-Body simulations are necessary to explain quite a lot of funny phenomenons (e.g. Langrange-points, special locations in the "backwash" of a moons gravity which attract mass in a stable orbit), but often enough they just tend to become very chaotic. Small objects tend to have a massive fluctuation in kinetic energy due to accidental sling shot maneuvers which results in strange paths and finally in being flung out the solar system.

    Or in other terms: Unless you have a very good reason, avoid N-body simulations at all cost. They are damn expensive (computational effort) to get precise, and they are extremely difficult to stabilize. And stuff like the Halleys in PA - they would **** with the simulation in every way possible - starting with with causing an total impulse unequal null, which means that the whole solar system starts moving....
  7. Dementiurge

    Dementiurge Post Master General

    Messages:
    1,094
    Likes Received:
    693
    And an N-body simulation specifically allows for any ("N") number of objects, or at least more than four. It's mostly used for planetary motion, and I can't name a playable game that uses one.

    Though, if Kerbal Space Program used one...
  8. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    That is not true. Any algorithm for simulation a N-body system (for N>2) can be dynamically extended to handle N+1 bodies as well. It's only noteworthy that the computational cost increases in square with the number of bodies currently to be simulated.
  9. steambirds

    steambirds Member

    Messages:
    98
    Likes Received:
    37
    So, N is a catchall for 2 + any number?
  10. eratosthenes

    eratosthenes Active Member

    Messages:
    206
    Likes Received:
    181
    n is an arbitrary number. Usually an integer.
  11. tatsujb

    tatsujb Post Master General

    Messages:
    12,902
    Likes Received:
    5,385
    N-body physics simulations were available in the system editor during alpha.
  12. tatsujb

    tatsujb Post Master General

    Messages:
    12,902
    Likes Received:
    5,385
    alright so now that explaining what N-body physics are is out of the way, can we get back on topic?
  13. lokiCML

    lokiCML Post Master General

    Messages:
    1,973
    Likes Received:
    953
    for a brief discussion on langrange-points with in the earths sphere: Home, Home in Lagrange
    Also the entire thing is a really good read and contains math and pictures. The science behind gundam UC universe: Mobile Suit Gundam: High Frontier;)
  14. tatsujb

    tatsujb Post Master General

    Messages:
    12,902
    Likes Received:
    5,385
    except It was never full N-body and never would of been. the sun was always immutable.

    also you say it's extremely difficult to stabilize, I have a very simple solution right here :
    [​IMG]
    you also say it's extremely costly it definitely didn't seem to have any toll on performance. running n-physics in the system editor with big planets back then and running big planets in it now runs the same.

    they probably had a very efficient and optimised algorithm for planet paths. it was a 2-D plane anyways, If it were a 3-D plane N-body physics sure, but it's not.
  15. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    That solution is half-baked at best. Rubber-banding just won't cut it. Because in an N-body simulation, any smaller object can easily exceed escape velocity. When that happens, the object is not only going to leave screen - it's also NEVER going to come back.

    And even if you rubber-banded such objects to force them onto pseudo-elliptic orbits, you still wouldn't have solved the problem of over-saturation with kinetic energy. Smaller objects like meteors would literally shoot like bullets through the solar system, at ridiculous high speeds with completely unpredictable paths.

    Your "solution" only helps for ecliptic orbits on rails, but not for N-body simulations.

    And when I said it's going to be expensive, well it is as long as you are trying to do it accurate. And that is necessary because errors sum up in N-body systems which results easily in non-deterministic behaviors do to the chaotic nature. If you approximate to much by increasing time steps, your simulation outcome will differ significantly.
    Last edited: August 20, 2014
  16. tatsujb

    tatsujb Post Master General

    Messages:
    12,902
    Likes Received:
    5,385
    I really think you're over-exagerating it's possible issues, there's a limit to how many planets your pc can stand. For most people 8 planets, for me more like 12. Asteroid fields are out of the question, of course you wouldn't apply N-body physics to a field of asteroids, that would be crazy!
    so in the end you're left with a small number of objects to track and you're correcting them everytime they want to leave the playfield.

    where's the issue?
  17. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    I don't think you understand what properties N-body simulations actually have...

    In a rail based or binary system, you are only exchanging between energy stored in the gravity potential and kinetic energy. The total energy level of each single object in the system remains constant.

    In an N-body simulation, energy levels vary. Energy is transfered from one object to another. Up to the point where the saturation of energy in one object exceeds the gravitational well of the rest of the system and the object escapes the system completely.
  18. tatsujb

    tatsujb Post Master General

    Messages:
    12,902
    Likes Received:
    5,385
    yes I’ve even witnessed that, but if that body then bounces off your invisible wall, and by "bounces" i mean gets corrected in the way I showed above, what's the problem?
  19. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    It actually gets worse. Because now objects can accumulate even more energy. And that in return decreases the accuracy of the simulation which again results in an even more chaotic behavior.

    Decreased accuracy also means that energy can be created out of nowhere or vanish completely from the system. You really don't want that to happen. Ever.
  20. tatsujb

    tatsujb Post Master General

    Messages:
    12,902
    Likes Received:
    5,385
    I did mention rubberbanding would occur.

    planet is hectic, going at 1000MPH (rationalisation), wall corrects it and sets it back at normal speed and smaller elliptical orbit.

    ya . that's the idea.

    also I think it could be very easy to "catch" said hecticness. I mean, anytime a planet gets negative values on the gravity pull it's getting or clearly isn't in a capacity to understand what it's future position will be (and obviously any time a planet is coming at an extremely aggressive angle and speed towards another planet but sadly not enough to colide) or when the planet starts spitting out exponential numbers for it's future course you can catch that. you know what values are going to be acceptable if you set a speed limit and a map-size limit. so those values that are crazily beyond is a no-brainer. something's gone wild and you set it to something more decent or even sent the next bit of path to be a perfect circle in an effort to "calm" things.

    I never said I wanted perfect authenticity.

    I just wanted a bit of "wild". just a bit.

Share This Page