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

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

  1. Corang

    Corang Well-Known Member

    Messages:
    772
    Likes Received:
    313
    I did a few tests but as of now its late, I have work tomorrow (later today actually), and I don't feel like doing the math, as of now I have a text document attached here with my current findings, it will be updated but as for now I am letting you guys have at it for 18 ish hours then I will be back.

    Wow, I am tired I almost forgot to say what I am trying to do even though I think the title explains it, I want to find the ETA of planet collisions in-game, I would like to use a mathematical equation so it can be incorporated into a UI mod. Here are my findings (attached and in the below code box)
    Code:
    "slower" planet
        position
            X:13625
            Y:1000
    
        velocity
            X:-11.4294
            Y:191.547
    
    "faster" planet
        position
            X:12625
            Y:-1000
    
        velocity
            X:15.6892
            Y:198.076
    
    at 0:53 planets collide
    
    Time Relation Tests [System Editor to In-Game](APPROX):
    First: 1.12
    Second: 1.01
    Third: 1.00
    Fourth: 1.11
    Fifth: 1.11
    
    Average: 1.07
    
    (**APPROXIMATION**): I could say that 1.07 seconds is equal to 53 seconds but for simplicity's sake I will say this --
    
    
      --1 Second of time in the System Editor is equal to 60 seconds of time in-game
    
            (I also chose those values because that would make sense, why program it with something weird when you can do 1 = 60?)
            I cannot prove this, but I believe that FPS has to be 60 in system editor for this to apply
    
    Global Variables for the Equation
    Code:
    e-T = Time in Editor
    
    g-T = Time in-game
    
    s-posX = Slower planet position X
    
    s-posY = Slower planet position Y
    
    s-velX = Slower planet velocity X
    
    s-velY = Slower planet velocity Y
    
    s-rad = Slower planet radius
    
    f-posX = Faster planet position X
    
    f-posY = Faster planet position Y
    
    f-velX = Faster planet velocity X
    
    f-velY = Faster planet velocity Y
    
    f-rad = Faster planet radius
    Helpful? Equations
    Distance Formula for a straight line [​IMG]
    Equation for a circle x² + y² = r² where x and y are the center and r is the radius
    Circumference of a Circle C=2 π r where C is the circumference and r is the radius

    Links
    http://math.stackexchange.com/questions/534182/how-to-build-a-mathematical-formula
    http://en.wikipedia.org/wiki/Fourier_analysis
    http://en.wikipedia.org/wiki/Box–Jenkins
    http://en.wikipedia.org/wiki/Akaike_information_criterion

    Tools
    https://www.desmos.com/calculator - Graphing Caclulator​

    Attached Files:

    Last edited: July 16, 2014
    Fr33Lancer likes this.
  2. Mereth

    Mereth Active Member

    Messages:
    330
    Likes Received:
    164
    It's gonna be a nice challenge :) I guess planets not orbiting around the sun will give you some headache with their vector.
  3. Corang

    Corang Well-Known Member

    Messages:
    772
    Likes Received:
    313
    Oh man, I didn't even think about that last night. Let's just focus on planets orbiting the sun for right now :p
  4. Fr33Lancer

    Fr33Lancer Well-Known Member

    Messages:
    595
    Likes Received:
    288
    This idea has a lot of potential !

    Quick thought sparkling in my head :
    I could easily imagine a devious soul hosting a game using a rigged system that explodes the starting planet after let's say 7 minutes, not telling anyone and rushing orbital to save the commander for an easy win (has to be 3 planet system obviously). So it induce the following question :
    I'm not an expert, and so far noticed server mods are mostly used to change game mechanics (balance, etc ...), but could a server mod be used for what you are planning to do in a UI one (ie to get all game participants to have that UI mod by being in that particular game). This is a naive question, but if possible, it could be an awesome game mode !
  5. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    I have already made and tested a system like that on PTE but the problem is the two minute timer players get to choose where the commander lands. The planets move during that timer so the scenario will be different depending on how long people take to land.
    Fr33Lancer likes this.
  6. Fr33Lancer

    Fr33Lancer Well-Known Member

    Messages:
    595
    Likes Received:
    288
    Nice finding !
    And what if that really devious soul ( :p ) was to use a mod like "In Game Timer" (or a simple stopwatch) set to a little less than 2 minutes, to be the last one to input its starting position (or let choose automatically) and have a good approximation of the collision ETA ?
    I'm guessing this 2 minutes timer starts as soon as the system is created / loaded on server side, right ?

    Bad trick aside, would a server mod be possible / suitable to let everyone one know collision's ETA ? Or it isn't their role at all ?
  7. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    Yes it starts on the server side. This means you will have to sync the mod to the chronocam timer instead of making a client-side timer.
  8. Corang

    Corang Well-Known Member

    Messages:
    772
    Likes Received:
    313
    Have either of you looked into the math?
  9. Corang

    Corang Well-Known Member

    Messages:
    772
    Likes Received:
    313
    Okay, I will be adding it to the main post but I want it here too, when we start experimenting with equations I want everyone to use the same variables for the same thing
    Code:
    T = Time
    
    s-posX = Slower planet position X
    
    s-posY = Slower planet position Y
    
    s-velX = Slower planet velocity X
    
    s-velY = Slower planet velocity Y
    
    f-posX = Faster planet position X
    
    f-posY = Faster planet position Y
    
    f-velX = Faster planet velocity X
    
    f-velY = faster planet velocity Y
    cptconundrum likes this.
  10. Corang

    Corang Well-Known Member

    Messages:
    772
    Likes Received:
    313
  11. Corang

    Corang Well-Known Member

    Messages:
    772
    Likes Received:
    313
    I am currently doing a test to see if planet speed stays the same regardless of distance from sun, I will post my findings when I am done
  12. Corang

    Corang Well-Known Member

    Messages:
    772
    Likes Received:
    313
    Okay, so we have a bit of a problem, according to my research a planet 30,000 units away from the sun moves ~30% slower than a planet 15,000 units from the sun, this is going to make the equation much harder
  13. Corang

    Corang Well-Known Member

    Messages:
    772
    Likes Received:
    313
    The math currently surpasses my intelligence, I will keep working at it but in the meantime I have updated the title to reflect that
  14. Corang

    Corang Well-Known Member

    Messages:
    772
    Likes Received:
    313
    Okay I am now doing some trials to find the relation of distance from the sun to speed, will be posting results in 10-ish minutes, still working on them
  15. Corang

    Corang Well-Known Member

    Messages:
    772
    Likes Received:
    313
  16. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    Elliptical orbits are a thing BTW. Have fun with that.
  17. Corang

    Corang Well-Known Member

    Messages:
    772
    Likes Received:
    313
    I know that, but right now I am just focusing on normal circular orbits
  18. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    Interesting... the farther away from the sun, the slower they travel.
  19. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    Y is the speed of the planet.
    X is the distance from the Sun.

    The equation is somewhere around y = -0.15x + 10000
    Fr33Lancer and Corang like this.
  20. Corang

    Corang Well-Known Member

    Messages:
    772
    Likes Received:
    313
    Thank you, this should help.

Share This Page