Galactic Hyperspace Behavior Upgrade for v1.71
Posted: Wed Feb 20, 2008 8:46 am
Those of you who thought that it has not been a great idea to exclude isolated systems or clusters of systems from galactic hyperspace destinations in Oolite will be happy to know that as of the upcoming release, Oolite will feature user control of galactic hyperspace behavior.
To facilitate this, we are using the planetinfo.plist. The key galactic_hyperspace_behaviour (note the British spelling) controls where the player will arrive after a G.H. has been executed. There are three possible types of G.H. behavior and are as follows:
1) Oolite standard. This is what we have up to this moment. Executing a G.H. jump will poisition the player in the next galaxy, to the closest non-isolated system with regards to their current galaxy coordinates. So, for example, if you jump from coordinates (100, 50) in galaxy 1 you will arrive in galaxy 2 at the same coordinates, unless these coordinates refer to an unreachable system, in which case the arrival point will be adjusted by the engine to maybe something like (102, 51). This is set as default behavior. It is set by assigning the string BEHAVIOUR_STANDARD to the galactic_hyperspace_behaviour key.
2) All systems reachable. Same as above, only this time we do not check for arrival at an isolated system. Using this method, systems like Oresrati in G8, the lower left hand cluster of systems in G7, the two islands of isolated systems in G6 etc. are now possible arrival points. If you land there, you may not be able to exit again, depending on the tech levels of the systems you get to. Mission scripters may want to use this. This behaviour is set by assigning the string BEHAVIOUR_ALL_SYSTEMS_REACHABLE to galactic_hyperspace_behaviour key in planetinfo.plist.
3) Fixed coordinates arrival point. This will make Oolite simulate some older 8-bit versions, that were putting the player in the same fixed point every time a galactic jump was performed, but there is also good potential for scripting (see below). This is set by assigning the string BEHAVIOUR_FIXED_COORDINATES to the galactic_hyperspace_behaviour key. If this method is chosen, then the engine will look in planetinfo.plist for a key named galactic_hyperspace_fixed_coords, from which it will read the actual coordinates that will be used as arrival point in the next galaxy. If none is found, then coordinates (96,96) will be used.
There is also the capability of using JavaScript methods to change both the galactic hyperspace behavior and the fixed coordinates, if one wants to use this. Currently we have player.ship.galacticHyperspaceBehaviour = ("[one of the above capitalized strings]") and player.ship.galacticHyperspaceFixedCoords = ([CoordX, CoordY, 0]). These are set as read/write. So, if you wanted to be able to G.H from Rainza in G7 and arrive at Oresrati in G8, now it can be done by scripting. The actual method names and other technical specifications are still under discussion and may change slightly in the future, but this is the general idea behind this all.
Edit: Spelling.
Edit2: Update methods names to current status.
Edit3: Update to 1.72.2 status.
To facilitate this, we are using the planetinfo.plist. The key galactic_hyperspace_behaviour (note the British spelling) controls where the player will arrive after a G.H. has been executed. There are three possible types of G.H. behavior and are as follows:
1) Oolite standard. This is what we have up to this moment. Executing a G.H. jump will poisition the player in the next galaxy, to the closest non-isolated system with regards to their current galaxy coordinates. So, for example, if you jump from coordinates (100, 50) in galaxy 1 you will arrive in galaxy 2 at the same coordinates, unless these coordinates refer to an unreachable system, in which case the arrival point will be adjusted by the engine to maybe something like (102, 51). This is set as default behavior. It is set by assigning the string BEHAVIOUR_STANDARD to the galactic_hyperspace_behaviour key.
2) All systems reachable. Same as above, only this time we do not check for arrival at an isolated system. Using this method, systems like Oresrati in G8, the lower left hand cluster of systems in G7, the two islands of isolated systems in G6 etc. are now possible arrival points. If you land there, you may not be able to exit again, depending on the tech levels of the systems you get to. Mission scripters may want to use this. This behaviour is set by assigning the string BEHAVIOUR_ALL_SYSTEMS_REACHABLE to galactic_hyperspace_behaviour key in planetinfo.plist.
3) Fixed coordinates arrival point. This will make Oolite simulate some older 8-bit versions, that were putting the player in the same fixed point every time a galactic jump was performed, but there is also good potential for scripting (see below). This is set by assigning the string BEHAVIOUR_FIXED_COORDINATES to the galactic_hyperspace_behaviour key. If this method is chosen, then the engine will look in planetinfo.plist for a key named galactic_hyperspace_fixed_coords, from which it will read the actual coordinates that will be used as arrival point in the next galaxy. If none is found, then coordinates (96,96) will be used.
There is also the capability of using JavaScript methods to change both the galactic hyperspace behavior and the fixed coordinates, if one wants to use this. Currently we have player.ship.galacticHyperspaceBehaviour = ("[one of the above capitalized strings]") and player.ship.galacticHyperspaceFixedCoords = ([CoordX, CoordY, 0]). These are set as read/write. So, if you wanted to be able to G.H from Rainza in G7 and arrive at Oresrati in G8, now it can be done by scripting. The actual method names and other technical specifications are still under discussion and may change slightly in the future, but this is the general idea behind this all.
Edit: Spelling.
Edit2: Update methods names to current status.
Edit3: Update to 1.72.2 status.