1. The forum will be closing soon permanently. Please read the announcement here

    Note: User registration has been closed. We do not accept any new accounts.

Gravity drive control comparison

Discussion in 'Programming (In-game)' started by Lynnux, Oct 23, 2017.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Lynnux

    Lynnux Junior Engineer

    Messages:
    881
    A few remarks at the beginning:
    Though you won't find any code in this thread, this is about programming. Specifically the control algorithm used in the two different solutions presented here without giving any details.
    This thread is not to discuss the pro and cons of the gravity drive or using gravity drives in general. There are already numerous more or less emotional threads in this forum where you can do this. Not here, please ! If you don't like them, leave this thread and find something you like ;)
    Goal is to make Jerry improve his awesome gravity drive script.


    I noticed the JRGD Big Red changing its attitude while flying from a planet to the moon. Therefore I compared it to the solution I use in the TransGalaxy Niklas Koppernigk.
    So how well is the control algoritm of the two gravity drive scripts working ?

    Initial setup:
    Launched the TransGalaxy Niklas Koppernigk (left ship) up to approx. 22000m and stopped.
    Pitched the nose up not to be exactly horizontal or vertical.
    Jumped out of the ship and placed a small tradtional ship with thrusters and gyro exactly horizontal next to her for comparison.
    Spawned the JRGD Big Red, aligned her with the Niklas Koppernigk and placed the Big Red next to the Niklas Koppernigk and the comparison ship.
    Remark: Had to cut the Big Red and place it again since the grav drive takes some time to kick in on initial placement so she lost altitude.
    Placed the astronaut to have this view on the small comparison ship and the Niklas Koppernigk left and JRGD Big Red to the right.
    Note the position of the comparison ship (stars around it) and the alignment of the Niklas Koppernigk in the upper left corner.

    45 minutes later:
    The Big Red lost altitude and was rotating a bit around all 3 axes.

    I just took a short look to Jerry's code a few months ago. So I don't know which method/algorithm he uses to control the gravity drive.
    Beware that the script in the Niklas Koppernigk was just made for this ship and therefore isn't of such great use for the community as the JRGD-Jerry Rigged Torque Canceling Gravity Drive script.

    I've seen that other programmers like Whiplash are using a full PID controller while I'm just using the physical quantity and its first derivate as input (e.g. current speed and acceleration to control the speed). This is easy for most applications and seems to work well.
     
    Last edited: Oct 23, 2017
Thread Status:
This last post in this thread was made more than 31 days old.