[SCRIPT]Advanced HyperDrive(AHD) v2.0 [Apr.09.2009] with video demo TC2.0a compatible

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

WDog
Posts: 18
Joined: Sun, 2. Oct 05, 12:50
x3tc

Costs and Balance

Post by WDog »

The quantum drive costs could be increased slightly but you also need to adjust the hyper drive costs.

I use Background and Big Sectors mod and in sector hyper drive is some times cheaper than a quantum drive. When moving to a station I normally only use hyper drive as it mostly ends up in docking computer distance of a station.

I believe that the two drives are balanced ok in respect to each other.
  • Quantum drive has no delay to initiate.
    Hyper drive has 60 second delay.
    Quantum drive is increasingly inaccurate over longer distances
    Hyper drive nearly always within docking computer range of target station.
    Quantum drive is mostly cheaper than hyper drive.
I think that there needs to be an additional e-cells cost for using hyper drive jump added to the standard jump costs if not arriving at a gate.

The cost needs to depend on ship size. I recommend adding the current in sector jump (zero range) costs to the standard jump costs.
In my TS an in sector jump (zero range) costs 10 e-cells so a any hyper drive jump should have an addition charge of 10 e-cells.

I believe the standard jump cost formula is

Code: Select all

( Jump Range + 1 ) * Ship size cost
Where Ship size cost = 10 for a TS
The formula I recomend for hyper drive costs (when the destination is not a gate) is

Code: Select all

( Jump Range + 1 + Hyper drive factor ) * Ship size cost
I recommend that the Hyper drive factor = 1
The cost for a quantum drive should be capped to the cost of an in sector (zero range) hyper drive jump.

Code: Select all

 Max cost of Quantum Drive = ( 1 + Hyper drive factor ) * Ship size cost
Other ideas for balance
  • Quantum drive can't initiate if to close to a large mass eg stations, big ships, roids.
    Drives can not be used if shields are damaged
    Quantum drives use shield energy
    Quantum drives need a cool down period between uses
This is a fantastic mod that helps in avoiding the boring seta trade runs. Just needs a little tweaking 8)


Issues with Auto Jump command.

Auto Jump ship command causes the explore commands to not work correctly.

Map.sector script misses stations.
I think its cause it uses quantum jump to return to the the origin of the search. This does not give enough time for the game to detect stations that are in scanner range. Manual exploring using Move to Position works well.

Pass.gate script.

If close to the target gate to fly through the ship hyper jumps to destination sector and passes back through gate returning to the current sector. Should not be able to jump to unknown sectors. :?

If far from the target gate the ship quantum jumps to the gate and stops with order as none . It does not fly through the gate. :(

I recommend that Auto Jump not do anything if the Map.Sector or Pass.Gate are on the script stack.

In the meantime I turn off Autojump when exploring . :)
semiliterate
Posts: 357
Joined: Sat, 13. Dec 08, 22:02

Re: Costs and Balance

Post by semiliterate »

WDog wrote:The quantum drive costs could be increased slightly but you also need to adjust the hyper drive costs.
I believe that the two drives are balanced ok in respect to each other.
  • Quantum drive has no delay to initiate.
    Hyper drive has 60 second delay.
    Quantum drive is increasingly inaccurate over longer distances
    Hyper drive nearly always within docking computer range of target station.
    Quantum drive is mostly cheaper than hyper drive.
I think that there needs to be an additional e-cells cost for using hyper drive jump added to the standard jump costs if not arriving at a gate.
it can't really arrive at a gate though, that's what the standard jump is for. i think the most practical method of adding cost is increasing the cost of the upgrades in the first place

i agree that they're balanced in respect to each other, but the issue here is in respect to the rest of the universe.

my unitraders are invulnerable and take about a second to do a trade run because of the auto-drive...
The cost needs to depend on ship size. I recommend adding the current in sector jump (zero range) costs to the standard jump costs.
In my TS an in sector jump (zero range) costs 10 e-cells so a any hyper drive jump should have an addition charge of 10 e-cells.
i've been wondering about an alternative cost - maybe some units of crystals as a focusing device or something?
Other ideas for balance
  • Quantum drive can't initiate if to close to a large mass eg stations, big ships, roids.
i agree.
Drives can not be used if shields are damaged
not sure about that. i use qdrive for hit and runs but i can see the purpose of balancing that. i don't like the idea of removing its use for arriving at or leaving combat entirely.
Quantum drives need a cool down period between uses
that one sounds like a good idea but i'm not sure of the logistics of scripting it. loky?
Map.sector script misses stations.
I think its cause it uses quantum jump to return to the the origin of the search. This does not give enough time for the game to detect stations that are in scanner range. Manual exploring using Move to Position works well.
are you sure this isn't just because you're oos? stations won't reveal oos unless you watch the exploring process, i hear.
Pass.gate script.

If close to the target gate to fly through the ship hyper jumps to destination sector and passes back through gate returning to the current sector. Should not be able to jump to unknown sectors. :?
mine qjumps to the gate and clears its commands. then i give it the gate order again, and it passes through the gate, then hyperjumps back to the original sector.
I recommend that Auto Jump not do anything if the Map.Sector or Pass.Gate are on the script stack.

In the meantime I turn off Autojump when exploring . :)
i think a check to see if the ship is near a gate before letting it jump might help.
Loky77
Posts: 110
Joined: Sun, 25. Jan 09, 09:54
x3tc

Post by Loky77 »

Thank you all for excellent feedback.

About NPC not being able to use Quantum or Hyperjump, i would mean that gate would be quite useless as NPC would hyperjump every time, you wouldn't have trade line anymore as NPC would quantum and spend the most of their time docked, clogging stations and Universe will be quite empty and player would have difficulty to dock as "docking bay" for a particular station is finite, that would mean traffic jam around stations :)
I prefer not interfering in the NPC behavior as it could ruin the universe and i don't want to do, support or having to manage all possible issues that could cause :)

Both drive are balanced to each others, and if you think uni trader are invulnerable due to auto drive, maybe switching it off for some of those could do the trick :p

As for capping the cost of quantum drive, well .. as for now it is 1 E cell for 20km ... and internal hyperjump for small fighters is 5 e cell, that means 100km of quantum drive.
sure if you want to go 250km away .. that's quite rare execpt in some particular sector or mod ( big sector mod ), that's 2.5 times the cost of an hyperjump but you get there faster with quantum .... so i think it is a matter of choice, so capping the cost would unbalanced both drives to each other.
Either you go fast and can cost a bit more, or you wait for hyperjump charge time witch depending of distance can cost less


I was thinking of doubling price of quantum jump for freighters and big ships, and quintupling for huge ships

Using some other kind of ware as cost, I'm not really fond of this, our ships already needs to have lots of things to keep in cargo bay and i want to save the hassle of having to keep another sort of ware to be able to jump ;) I've done it a little with the optional ecliptic projector and i don't want to go down that way :)




About the features to not be able to engage quantum when near big gravity well ( station, roids, etc ... ), i already thought about it but resigned, as it would involve a lot of checking: is there anything in range? what range is the threshold ? if anything, what type of object is it etc ..
i would also mean that in large asteroid field, quantum jump wouldn't be usable. Quantum jump is a semi phased jump and solid object can't refrain to engage it, although some very large gravity well can interrupt it

Usable only when shields are full ... well, i like to do hit and run too so i'll probably skip that option :)

Cooldown period ... well ... i think this is a good idea, it would involve using local variables to store the last time of use but this is definitively a good idea, now is to determine duration of cooldown :p
Only problem i see is that every ship using a quantum only once would have that local variable set and i don't know if this will have any impact to saves in term of size or loading sped performance :)




As for auto drive messing up with explorer command, indeed, the way target are defined with explorer command makes auto-drive acting in a non-wanted way :( That was the same thing that was preventing some wing commands to use auto drive.
Auto drive will not engage when any explorer command are active, same with the "move to position" command.

Keep the comments going guys 8)
WDog
Posts: 18
Joined: Sun, 2. Oct 05, 12:50
x3tc

Post by WDog »

semiliterate wrote:are you sure this isn't just because you're oos? stations won't reveal oos unless you watch the exploring process, i hear.
Supposed to be fixed in 1.4 patch I believe. It has been working fine for me until I turned on auto drive command on my explorers.
Loky77 wrote:As for capping the cost of quantum drive, well .. as for now it is 1 E cell for 20km ... and internal hyperjump for small fighters is 5 e cell, that means 100km of quantum drive.
sure if you want to go 250km away .. that's quite rare execpt in some particular sector or mod ( big sector mod ), that's 2.5 times the cost of an hyperjump but you get there faster with quantum .... so i think it is a matter of choice, so capping the cost would unbalanced both drives to each other.
Either you go fast and can cost a bit more, or you wait for hyperjump charge time witch depending of distance can cost less

Fair enough if you scale the cost to the ship size as you mentioned below. I like the big sectors mod especially with AHD installed.
Loky77 wrote:I was thinking of doubling price of quantum jump for freighters and big ships, and quintupling for huge ships

I agree the bigger the ship the more it should cost like the Jump drive does.
Loky77 wrote:About the features to not be able to engage quantum when near big gravity well ( station, roids, etc ... ), i already thought about it but resigned, as it would involve a lot of checking: is there anything in range? what range is the threshold ? if anything, what type of object is it etc ..
i would also mean that in large asteroid field, quantum jump wouldn't be usable. Quantum jump is a semi phased jump and solid object can't refrain to engage it, although some very large gravity well can interrupt it
I was looking at ideas to stop ships jumping as soon as they undock.
Loky77 wrote:Cooldown period ... well ... i think this is a good idea, it would involve using local variables to store the last time of use but this is definitively a good idea, now is to determine duration of cooldown :p
Only problem i see is that every ship using a quantum only once would have that local variable set and i don't know if this will have any impact to saves in term of size or loading sped performance :)
That should not be an issue as all the great trade scripts attach a local variable array to the ship to store all the pilot information and transaction history. The various move pilot commands are just copying the data arrays to the new ship and moving wares.
Loky77 wrote:As for auto drive messing up with explorer command, indeed, the way target are defined with explorer command makes auto-drive acting in a non-wanted way :( That was the same thing that was preventing some wing commands to use auto drive.
Auto drive will not engage when any explorer command are active, same with the "move to position" command.
Well in my game the auto drive command is engaging quantum drive on both the move to position command the explorer commands. I d/l it last Monday. Unless you mean that auto drive command can't be turned on if such a command is running but it can be turned on before issuing such a command.

I had an idea for quantum drive script to give some delay instead of using a cool down timer. Monitor the ship during the targeting and navigation set-up part of the quantum jump and require that the ship needs to accelerate to full speed and be on target before the drive activates. Small ships don't take long to to reach full speed and large ships do. If you want to nasty stop the ship before turning to the target then wait for full speed before engaging drive. :twisted:
semiliterate
Posts: 357
Joined: Sat, 13. Dec 08, 22:02

Post by semiliterate »

WDog wrote:Supposed to be fixed in 1.4 patch I believe. It has been working fine for me until I turned on auto drive command on my explorers.
hmm... i have a kestrel in Aldrin that hasn't been revealing anything at all, ever, when i haven't been watching - but that might just be because it's Aldrin and it could fly for hours and never get near a station.
Loky77
Posts: 110
Joined: Sun, 25. Jan 09, 09:54
x3tc

Post by Loky77 »

I meant that in 1.6 explorer's command as well as the normal "move to position" command is messed up with auto-drive engaged.

That is already corrected for 1.7 you could leave auto drive , it won't intervene in any explorer commands :p
WDog
Posts: 18
Joined: Sun, 2. Oct 05, 12:50
x3tc

Post by WDog »

Loky77 wrote:I meant that in 1.6 explorer's command as well as the normal "move to position" command is messed up with auto-drive engaged.

That is already corrected for 1.7 you could leave auto drive , it won't intervene in any explorer commands :p
Great :wink:

Any eta on release :roll:


Just fyi I had to package up your mod as a false patch to get the wares to work correctly.

Some of the scripts installed in my game are using plugman custom wares and the plugin manager is not importing the TwareT file from the types dir. The Plugin manager packages up the wares files and appends the custom wares to it. This causes your changes to the three wares not to be in the game.

I also had the Whistle sound bug till I packaged up the resources (s and types directory) into a cat file and set it as a false patch.

As standard practice I packaged up mods that have non script and text resources into false patches to allow easier maintenance and better control over various mods load order.
Loky77
Posts: 110
Joined: Sun, 25. Jan 09, 09:54
x3tc

Post by Loky77 »

WDog wrote: Great :wink:

Any eta on release :roll:
Well, cooldown on quantum jump is implemented, user could choose between No cooldown up to 20 sec with a 5sec credential.
This will be configured in the configuration menu, default is 10 seconds

Player head start on hyperjump is also configurable via the same menu ( up to 10s head start ), leader and big ships will always try to jump before followers. Eye candy is here you'll see your wingmen popping out of hyperspace in front of you :)

Option to choose between TOA and gate is implemented too.

Just need to tweak quantum jump cost :) and 1.7 sould be ready :)

Stay Tuned :p
Loky77
Posts: 110
Joined: Sun, 25. Jan 09, 09:54
x3tc

Post by Loky77 »

1.7 is in the pipe :) You can get it now :)

Change log :

v1.7 The user choice release (hopefully the last version of AHD)
Auto drive won't intervene in explorer commands
Auto-drive now works with most wings commands (need to activate auto-drive on each wingmen)
Fix behavior of auto-drive command when ship is docked
Added ability to choose between TOA or Gate to use with singularity projector (default is gate)
Added Player ship headstart on fleet hyperjumps (user configurable, default is 2000ms)
Added Cooldown period between each use of quantum jump (user configurable, default is 10 seconds)
Quantum jump now only check the necessary e-cell to initiate the drive ( ie the first 20km)
Quantum drive will return ship to normal space if ship lacks e-cells to reach final destination
Quantum jump price adjusted, cost doubled for big ship and freighters, quadrupled for huge ships
All message are now in text-id file, ready for any possible translation.
Added in-game description to all command used.
Various fixes and bug corrections
Note to previous version user, you'll need to disable and re-enabled auto-drived ship for auto-drive change to be effective.

Enjoy and Have fun

Loky
Kortako
Posts: 230
Joined: Sat, 22. Jul 06, 05:10
x4

Post by Kortako »

Hey Loky, this is a really awesome script.

I was wondering, would it be possible to make it so that when you initiate a Hyperjump and select a gate as its destination, that it not move the playership to the coordinates you selected, and just come out of the gate? Right now, if you select a gate, it'll warp you to some odd angle a few km away from it and it kind of ruins the seamless experience of coming out of a jumpgate. I know, I could just use the jump command rather than the hyperjump, but then I can't make use of the Singularity Slope Tension Converter. What do you think?
alemarazza
Posts: 33
Joined: Sun, 9. Apr 06, 17:48
x4

Post by alemarazza »

Hey, this script is fantastic!

I installed the non EMP users version, I get the two messages the script was successfully installed and it works.
My problem is all save games I create after installing this script function properly only if I don't quit X3TC. If I quit and I try to load the saves again I get an error message, saying the save file is corrupt.

This is really a shame, because this script is exactly what I need.

Anyone with the same problem? Any help?
Loky77
Posts: 110
Joined: Sun, 25. Jan 09, 09:54
x3tc

Post by Loky77 »

Kortako wrote:Hey Loky, this is a really awesome script.

I was wondering, would it be possible to make it so that when you initiate a Hyperjump and select a gate as its destination, that it not move the playership to the coordinates you selected, and just come out of the gate? Right now, if you select a gate, it'll warp you to some odd angle a few km away from it and it kind of ruins the seamless experience of coming out of a jumpgate. I know, I could just use the jump command rather than the hyperjump, but then I can't make use of the Singularity Slope Tension Converter. What do you think?
Hey, thanks :p Glad you enjoying it :)

I did test something to fulfill your demand, unfortunately it is not possible, not in a script way (the code is easy to write) but in a script behavior way.
The very purpose of the script is to allow point to point jump, making ships using a gate (even setting final position after) makes the gate a bottleneck and a fleet jump takes a looooooooooooooooooooong lonnnnnnnnnnnnnng time :p
I did try to only make it for the player ship, it worked, but after jumping through a gate and not doing a point to point, you get some kind of delay at exiting the gate where the ship accelerate to full speed ... get out of the gate's exit and then port to the position specified witch kinda destroy the impression of a point to point. Not to speak about the fleet getting in the right place straight on and you like a slowpoke looking at the gate .. accelerate and then going to the right destination :)
So if you still want to exit from a gate, you'll have to use the standard jump command with some E-Cells; i'm sorry :(
Last edited by Loky77 on Tue, 24. Mar 09, 12:30, edited 2 times in total.
Loky77
Posts: 110
Joined: Sun, 25. Jan 09, 09:54
x3tc

Post by Loky77 »

alemarazza wrote:Hey, this script is fantastic!

I installed the non EMP users version, I get the two messages the script was successfully installed and it works.
My problem is all save games I create after installing this script function properly only if I don't quit X3TC. If I quit and I try to load the saves again I get an error message, saying the save file is corrupt.

This is really a shame, because this script is exactly what I need.

Anyone with the same problem? Any help?
Thanks for the comment :)

Anyway, can you load that very save game (the one that say "corrupted" once you exited the game) while in game ? i mean load a previous save (saved prior to installing script), then try to load the "corrupted" one while already in game.
If this doesn't work it may be some script conflict, or maybe try to do another save.. maybe one get corrupted don't know how (hardware failure ?? ).
I tested with a bunch of script, there shouldn't be any conflicts except with the one modifying the Twaret.txt file. even tough i don't think that would create "corrupted" saves, at worse script not working.

Can't really help more, i never had this problem and noone ever reported so i don't really know if AHD is the cause of the "corruption", participate in it with some other script conflicting or has nothing to do with it and the truth is out there :)
alemarazza
Posts: 33
Joined: Sun, 9. Apr 06, 17:48
x4

Post by alemarazza »

Hi, thanks for your answer.

As for the corrupted save game, I can load it while in game, but as soon as I quit X3TC I can't load it anymore, even if I load a prevoius functioning save game and try to load from in game. It is not an hardware failure, because I tried a few times with differents save games and I always get the same results.
As you said could be a conflict with other scripts (I am running EST, CAG, CLS, Turbo Booster, MARS)
I am also running on VISTA 64, this could be the problem...
I should also mention that after I install your script I always get an error when I exit X3TC and return to windows (the game does not crash, but gives me an error message upon exiting to windows).
Anyway thanks again for the answer, I will try to get this script going and if I find a solution I will post it
Thanks again for trying to help
Tasolth
Posts: 79
Joined: Mon, 20. Oct 08, 21:49

Post by Tasolth »

Any Chance to get an option to not use the custom sound files for hyperjumping ?

1st, or second time they were interesting, but now they just get annoying.

I'm just requesting a little switch in its options under the community configuration menu to disable the custom sounds.

Thanks.
Loky77
Posts: 110
Joined: Sun, 25. Jan 09, 09:54
x3tc

Post by Loky77 »

Tasolth wrote:Any Chance to get an option to not use the custom sound files for hyperjumping ?

1st, or second time they were interesting, but now they just get annoying.

I'm just requesting a little switch in its options under the community configuration menu to disable the custom sounds.

Thanks.
Witch one ? the AI ones or the playership ones ?

I could add that in a later version, although i would like more input from users on that, as making another version for just one person, i don't want everyone re-download again :)

Anyway , if the custom sound are annoying you, look into the /s directory and delete or replace any sound you feel wrong :P

Thanks for the input 8)
Tasolth
Posts: 79
Joined: Mon, 20. Oct 08, 21:49

Post by Tasolth »

I saw the /s directory and did delete them but then my game started crashing like crazy. Don't know for sure if the two are related though.

Specifically, what I was requesting is to remove the voice overs you added for initiating hyper jump.
I do like hearing the "explosion" of my ships jumping next to me and such, and the quantum jump is a nice feature. It's just the voice over one that is annoying. I'll toy around with the sound files and see if I can solve it for myself. Thanks for the response though.
Kortako
Posts: 230
Joined: Sat, 22. Jul 06, 05:10
x4

Post by Kortako »

Loky77 wrote:
Kortako wrote:Hey Loky, this is a really awesome script.

I was wondering, would it be possible to make it so that when you initiate a Hyperjump and select a gate as its destination, that it not move the playership to the coordinates you selected, and just come out of the gate? Right now, if you select a gate, it'll warp you to some odd angle a few km away from it and it kind of ruins the seamless experience of coming out of a jumpgate. I know, I could just use the jump command rather than the hyperjump, but then I can't make use of the Singularity Slope Tension Converter. What do you think?
Hey, thanks :p Glad you enjoying it :)

I did test something to fulfill your demand, unfortunately it is not possible, not in a script way (the code is easy to write) but in a script behavior way.
The very purpose of the script is to allow point to point jump, making ships using a gate (even setting final position after) makes the gate a bottleneck and a fleet jump takes a looooooooooooooooooooong lonnnnnnnnnnnnnng time :p
I did try to only make it for the player ship, it worked, but after jumping through a gate and not doing a point to point, you get some kind of delay at exiting the gate where the ship accelerate to full speed ... get out of the gate's exit and then port to the position specified witch kinda destroy the impression of a point to point. Not to speak about the fleet getting in the right place straight on and you like a slowpoke looking at the gate .. accelerate and then going to the right destination :)
So if you still want to exit from a gate, you'll have to use the standard jump command with some E-Cells; i'm sorry :(
Hey Loky, thanks for the attempt; though I don't understand what you meant by that last part. When I meant jumping to a gate, I meant that you literally select the gate as the destination, and it would just jump you normally, except without needing E-Cells. So there wouldn't be a "destination" per se, you'd just come out of the gate like normal. And also, yeah, I only want this for the player ship, the other ships can go ahead and do their little "move to position" thing so they don't collide with each other. Basically, if you could make that happen when you select the gate as the destination, this would be a complete replacement for the old jump scripts. Is that what you tried, or was it something different? Also, since you said the code is easy to write, could you point me out where I could add the code in myself, to give it a try and see what you mean? Thanks!

Edit:
Tasolth wrote:I saw the /s directory and did delete them but then my game started crashing like crazy. Don't know for sure if the two are related though.

Specifically, what I was requesting is to remove the voice overs you added for initiating hyper jump.
I do like hearing the "explosion" of my ships jumping next to me and such, and the quantum jump is a nice feature. It's just the voice over one that is annoying. I'll toy around with the sound files and see if I can solve it for myself. Thanks for the response though.
You can't just delete the sound files from the directory, because now the scripts are looking for sound files that aren't there; hence, your crashes (Well, actually, I don't know how the game would react, but I was assuming and took precautions myself when doing it). You also need to modify the script itself to not play the sound when jumping. It was a simple comment out of a single line. Just look for the one that references that sound file (1161, I think?). No offense Loky, the sound is awesome, but that one file sounded too much like something from a really old Star Trek episode, and I like to keep my game as X-ish as possible without mixing in other space references.
alemarazza
Posts: 33
Joined: Sun, 9. Apr 06, 17:48
x4

Post by alemarazza »

Hey Loki, I found what is causing the corrupted save game while using your script. If I install the script on my EST and activate the adv drive command, they use it, but somehow when I exit the game I get a crash to desktop and the save games are corrupted. If I don't activate adv drive on my EST the script runs perfectly.
So my advice for anyone using EST: don't activate adv drive unless you want to risk your saves.
I hope this information can help other people with the same problem and maybe you in fixing this compatibility problem.
WDog
Posts: 18
Joined: Sun, 2. Oct 05, 12:50
x3tc

More crashes

Post by WDog »

I have also been getting Crashes to desktop on my game with autodrive command.

Its even happening on a new game with no other scripts. I this this game I have only 2 ships and it has happen on either my Player ship or the MORT trader. :roll:

I spent the whole day playing around with the autojump script and I think I have it solved.

I believe that it was possible for the script to interrupt itself on hyperjump commands. ie Hyperjump script would be interrupted with another hyperjump call. :lol:

Loky77 I will send you the code. :)

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”