[HELP][DISCUSSION][WIP]ETA OF PLANET COLLISIONS

Discussion in 'Mod Discussions' started by Corang, July 15, 2014.

  1. Mereth

    Mereth Active Member

    Messages:
    330
    Likes Received:
    164
    First, you need to tell if 2 planet are on a collision course.
    assumption: planets are in a circular orbit around the sun at (0,0) in 2D dimension

    Planet radius :
    s-r = 600 (dummy value, if PA don't give it, you will have a major issue ...)
    f-r = 600 (dummy value, if PA don't give it, you will have a major issue ...)

    Distance to the sun (0,0) :

    s-rS = sqrt( (13625 - 0)² + (1000 - 0)² ) = 13661,647960623198550038308246937
    f-rS = sqrt( (12625 - 0)² + (-1000 - 0)² ) = 12664,542036726002355679374389166

    abs(s-rS - f-rS) < s-r + f-r ?
    997 < 1200 = YES !

    Next step : compute angular velocity using the velocity vector (perpendicular to rS) or by collecting another point further in time.
    Fr33Lancer likes this.
  2. SikkeSakke

    SikkeSakke Member

    Messages:
    56
    Likes Received:
    12
    Interesting.

    Here's video and assumptions how system works.


    First of all, you can forget elliptical orbits around sun. In reality ellipticality comes from fact that bodies go around center of mass but in PA, they go around Sun. And orbiting planets don't affect each others. It looks like system is based on simplified Newtonian mechanics.

    For me looks like orbiting moons might go around center of mass of planet and moons, but need to do test before saying that for sure. Even moons tracks looks chaotic, if assumption that bodies obey simplified Newton, their orbits can be calculated.

    If system is based on Newton, there must be universal constant. Conservation of energy can be stated as: v^2/2=k/r. Here v=velocity, r=radius and k=constant. Because velocity is only angular, radius remains constant. Based on values Corang showed, I got following values for k:

    1) 463719086329,298
    2) 464406077568,304
    3) 464863544541,313
    4) 465516921998,109

    and average is 464626407609,256.

    So, if we take first planet in inspection:

    Based on observations, its speed is v=s/t=(2*pi*r)/t=2*pi*15000/11,986=7863,16m/s
    Based on k, its speed can be calculated from equation v^2/2=k/r. Using average value of k, one gets v=sqrt(2k/r)=7870,84m/s.

    It's not exactly the same but close enough. Error becomes from first Corang was averaging his observations and then I was averaging calculated k values.

    If my assumptions are right, tracks can be calculated and therefore possible collisions can be calculated too. Need to do some math first. If you noticed some errors on these assumtions/calculations, please let me know.

    Edit: I don't got PTE installed but in stable, you can drag planets starting velocity vector so that orbit is elliptical (thought it goes red in stable version and returns to circle). Nevertheless if my assumptions are right, elliptical orbits can be calculated too but it's a bit more complicated but not impossible.
    Last edited: July 16, 2014
    Fr33Lancer likes this.
  3. SikkeSakke

    SikkeSakke Member

    Messages:
    56
    Likes Received:
    12
    Here comes some math based on assumptions that I posted. Only circular orbits but if this is right, it can be extented to elliptic orbits too.

    "Universal" equations for circular orbit in PA:

    (1) x=rcos(Ø)
    (2) y=rsin(Ø)
    (3) Ø=sqrt(2k/r^3)*t

    r=radius of orbit
    k=464626407609,256
    t=time

    Two moons orbiting planet.Center of mass of planets and moons is assumed to orbit circularily around planet. Coordination is moved so that planet is at position (0,0).

    rc=(m1*r1+m2*r2)/(mp+m1+m2)

    m1=mass of moon1
    m2=mass of moon2
    mp=mass of planet
    r1=starting radius of moon1 orbit
    r2=starting radius of moon2 orbit

    Radius of moons orbits around center of mass are rm=abs(r1-rc).

    Now it's just needed to sum up "vectors" to get positions of planet and moons.

    Planet position: Use equations 1-3
    Moons position=Planet position+Center of mass position+Moon position. (i.e: x=r*cos(Ø)+rc*cos(Øc)+rm*cos(Øm), where r=planet orbit radius, rc=center of mass orbit radius around planet, rm=moon orbit radius around center of mass and Ø,Øc and Øm are angle of each body).

    Have to say I started to doubt if this works but who knows.
    Last edited: July 16, 2014
    Fr33Lancer likes this.
  4. SikkeSakke

    SikkeSakke Member

    Messages:
    56
    Likes Received:
    12
    Grid at system desinger got spacing 5000m (just if you didn't know that).

    I did a little test.

    Planet 1:
    x=30500
    y=0
    r=2000

    Planet2:
    x=-29500
    y=0
    r=2000

    Planet1 orbits anticlockwise (positive increment to angle) and planet2 clockwise (negative increment).

    When they collide, distance between them is smaller than 4000 (2*radius). Now it's just needed to calculate angular distance so that

    (4) Ø1-Ø2=±Øc=collision angle. ± sign is because there is two possible solutions in one circle - one when they collide and one when they separate.

    Collision angle can be found by using Pythagorean theorem:

    (5) Øc=±ArcCos(-(4000^2-35000^2-29500^2)/(2*35000*29500))

    Planet1 goes anticlockwise so

    (6) Ø1=sqrt(2k/r1^3)*t

    Planet2 starts from minus side of circle and goes clockwise so

    (7) Ø2=-sqrt(2k/r2^3)*t+Pi

    Substituting equations 5,6,7 to 4 and solving time t from it one gets

    (8) t=(±Øc+Pi)/(sqrt(2k/r1^3)+sqrt(2k/r2^3))

    There is two possible solution and we choose smaller one. Solutions are (+) 8,8secs and (-) 8,11secs. We choose latter and when we know time, we know position.

    Time from start to collision: 8,11sec

    Planet1 position:
    x=3113
    y=30341

    Planet2 position:
    x=-795
    y=29489

    I checked visually are those values near what actually happened in simulation and they are. So, my equations passed the first test and it looks like they are good to estimate (or even calculate) planet movements at circular orbits.

    ps. Even I triple-checked this post, there may be errors in equations. If you notice them, let me know. Result seems to be right thought.
    Last edited: July 16, 2014
    Fr33Lancer likes this.
  5. Corang

    Corang Well-Known Member

    Messages:
    772
    Likes Received:
    313
    What branch of mathematics is this?
  6. SikkeSakke

    SikkeSakke Member

    Messages:
    56
    Likes Received:
    12
    First of all it's basic Newtonian physics. For more precisly, I'm used to use Lagrangian to solve classical mechanics problems.

    If we are dealing with orbital bodies, it's way more handy to use polar coordinates instead of x,y-coordinates. It may look at start complicated but when you get used to it, it's much more easier than trying to do calculations in x,y-coordinates. And if you are dealing with ellipses, I don't even know is it possible to solve those equations in x,y-coordinates.

    I thought that if game tries to simulate real behaviour of orbital bodies, it does quite a lot of simplifications (in real life, even 3-body problem cannot be solved analythically by equations). If game does all the calculations what it's needed to solve exact position of each body in real N-body system, it consumes so much calculating power that there's nothing more left for the rest. And when I looked those orbiting bodies, I just made assumptions what is left aside - center of masses in some cases, some bodies affects to another ones and some not. In real life no-one does not realize that when you jump, you actually push Earth beneath you a bit. Or by eyes it's impossible to notice that Earth and Sun are orbiting center of mass of Solar System.

    Bodies that orbits the Sun doesn't affect each others. That leaves craploads of calculus aside and basicly you deal with 1-body problem - one simple function to calculate body's position.

    Moons don't behave like planets do. There I made again assumption to reduce N-body problem to several 1-body problem (first center of mass orbits planet and then moons orbits center of mass and moons doesn't affect each others orbits). I don't know is this assumption true, but it's logical and it make system look like real. Again this reduces analythically unsolvable and really complicated N-body equations to relatively simple multiple 1-body equations.

    If these equations work, you don't nessecarily need to understand all the math behind them. Heck, same goes when I try to do programming - I copy paste code from internet and I got no clue how it works. I'm just happy if it works :).

    You just need a function which returns position at the time you want. Because if equations holds, all you need is starting positions for circular orbits and velocity and mass for elliptical orbits. This is because of good old Newton and conservation Laws. I might imagine something like:

    Code:
    function (start_x,start_y,time)
    ....
      calculate position at time t;
    ....
    return (x,y)
    Last edited: July 16, 2014
    Mereth and Fr33Lancer like this.
  7. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    New PTE is out!

  8. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Yes, although it goes really fast and disappears as soon as you stop, so it's definitely not a precision instrument .
  9. Corang

    Corang Well-Known Member

    Messages:
    772
    Likes Received:
    313
    in your posts I see alot of Ø and sqrt. What are they?
  10. Fr33Lancer

    Fr33Lancer Well-Known Member

    Messages:
    595
    Likes Received:
    288
    sqrt stands for "square root" (the mathematical operator "√"), and for Ø, those must be angles I presume, since he used polar coordinates (r,θ) (up to him to confirm)
  11. SikkeSakke

    SikkeSakke Member

    Messages:
    56
    Likes Received:
    12
    Yep, those are what you said - square root and angle.
    Good to hear. Looks like there's no need for more calculus. But if someone needs help for tracking orbits, I could perhaps help (I'm quite familiar with mechanics of Solar system but of course I can't say for sure beforehand can I help or not. But at least I try if someone needs).
    Fr33Lancer likes this.
  12. t42592

    t42592 New Member

    Messages:
    2
    Likes Received:
    0
    First post - prelim search 'clockwise planet collision' and 'planet collision' and 'clockwise collision model'

    (Consideration: Clockwise or Counter-Clockwise based on final game release determination)

    Having watched the 'Planetary Annihilation LiveStream, July 30th, 2013', it begs the question for clarity sake, the game mechanic is set to establish a counter-clockwise orbit/rotation model.

    This bakes the question, considering the conclusion above, I gather this is to facilitate a simplistic model for all players, assuming the goal is to simplify orbital geometry?

    For advanced players, perhaps an advanced game mode, I would suggest the developers look at a third-dimension model, where forces may be applied to shift a plant/object out of the two-dimension, into the third-dimension. The ability to change a planet/object trajectory in this advanced mode, should also change the collision model.

    What are you talking about?

    Instead of near parallel elliptical collisions, a player alters the planet/object trajectory, allowing for non-parallel collision, creating 90-degree impacts, even 180-degree impacts, where the player willing to delve deeper into trajectory geometry, can orchestrate a impact variable that is not recoverable, a planet killer, if you would.

    Admittedly, I have not reviewed the collision severity matrix for PA. However, should this model be considered, and included, parallel collision avoidance could be managed, where 90+ degree collisions would be nearly impossible to detect, let alone counter.

    Respectfully,


    T42592
    "Numbers"
    Closed Alpha Tester
    World of Warships

    ADDENDUM:

    Further review of video media for developing version, the 'asteroid trajectory' mechanic, while appears to be creative design decision, nonetheless, looks odd. From the original game design video regarding planet/object collision model, this is a drastic departure. What initially grasped my attention, the physics model involved, the careful consideration for orbits, circular or otherwise, is what drew my attention to this project.

    In short, the current trajectory change, along with the thruster component for momentum, takes an object in motion towards its intended target. At the point of eclipse (near miss), this body radically alters course (180 out of phase) in relationship to a near-target planet/object, and enters an orbit to 'sling shot' around it, and impact the original point of interest.

    In a word, disappointed.

    In summary, while I am a huge fan of the original TA, and excited about the PA aspect, the asteroid aspect diminishes the strategic value, and cripples the skill requirement. Herein, a player no longer needs to augment careful collisions, just toss an asteroid close enough to an intended target, and 'Viola!', the game mechanic does the rest.

    Would it had been easier to incorporate skilled army management learning curves, along with skilled trajectory curves? I realize the goal is simplify the play, and at what cost would it be necessary to have the TA experience planet side, with a very unbelievable planetary geometry engine?

    My assumptions based on the current game model:

    1. Assemble a massive system with asteroids.
    2. Attach thrusters to my Viola! army (asteroid army).
    3. Target a planet
    4. Launch all asteroids at general vicinity
    5. All asteroids hit planet.
    6. No need to invest in landing army.
    Did I miss something?

    Ramifications (Assumed):
    • Player tendency towards asteroid attacks
    • Player shift from target game model (Planetary skirmishes)
    • Effective asteroid attack inclination
    • Massive tutorials for developing asteroid attacks
    • Abuse of asteroid mechanic
    • Divergence of player base
    • Attrition of player base
    • Asteroid army development
    Last edited: August 8, 2014
  13. someonewhoisnobody

    someonewhoisnobody Well-Known Member

    Messages:
    657
    Likes Received:
    361
    I can verify that this thread contains math.

    However it is summer break so I don't remember math :)
  14. t42592

    t42592 New Member

    Messages:
    2
    Likes Received:
    0
    Has there been any additional work in regard to asteroid mechanics?

    As a QA professional, when a project enters the pre-release stage, for the most part, my work is done. It's up to the masses to either drink the wine as is, scream at the devs, or just walk away.

    Frankly, I've seen projects bring features to a release that sabotaged the game from the beginning, and my efforts before that point, are wasted.

    I am concerned that unless this team fixes the asteroid mechanics, all the hard work by the test base will have been for naught. Personally, I would have a hard time investing my time, let alone a pre-release payment for a game, that in my opinion, is broken.
  15. squishypon3

    squishypon3 Post Master General

    Messages:
    7,971
    Likes Received:
    4,357
    What's wrong with the asteroid mechanic exactly?

Share This Page