[SCRIPT] Bail Signal Extension: Higher Chance & Big Ship Bailing v1.10 (03/08/2007)

The place to discuss scripting and game modifications for X³: Reunion.

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

voxol
Posts: 429
Joined: Sun, 30. Oct 05, 14:42
x3

Post by voxol »

Luckychuck wrote:I have a question/suggestion though. Would it be possible to make this into an artificial life plugin that you can switch on and off in the options menu? That way you could turn it off before doing XI and assassination missions.
What a simple solution! Why on earth didnt I think of that? I'll modify it to an AL plugin just as soon as I can. Of course, there are probably better ways of making the script compatible with missions, etc, but this solution is effective and simple to implement. Cheers for that.

In the meantime, you can probably still do the mission you mention if you continue to reduce the hull even after the pilot bails. Its likely that the mission script wont notice and will continue to use the ship even though it is abandoned...
killuminati-ita
Posts: 259
Joined: Mon, 28. Aug 06, 15:50

Post by killuminati-ita »

Hi voxol,

I can't claim an M6, the crew bailed, got installed the signal extansion, cycrow salvage (wichI can't buy since is not in any pirate or teladi EQ dock) got the extension command, but nothing..I'm running XTM .7.

Cheers!
E POI IL PYTHON E' SGRAVO!! ^^
voxol
Posts: 429
Joined: Sun, 30. Oct 05, 14:42
x3

Post by voxol »

killuminati-ita wrote:Hi voxol,

I can't claim an M6, the crew bailed, got installed the signal extansion, cycrow salvage (wichI can't buy since is not in any pirate or teladi EQ dock) got the extension command, but nothing..I'm running XTM .7.

Cheers!
Ah yes, you need Cycrows Salvage Claim Software to claim any big ships, the stock method is hardcoded to not allow it. If the SCS is not showing up in your game after you installed it, I can only suggest checking the SCS thread (link in OP), as its a seperate issue to this script.
Erilaz
Posts: 161
Joined: Mon, 8. May 06, 13:49
x4

Post by Erilaz »

Got another SCS at the EQ dock in Ministry of Finance (Teladi) last night. Maybe you didn't install correctly. It's also possible the Salvage Claim Software could be confused with a different Salvage script.
xfir01
Posts: 433
Joined: Sun, 13. May 07, 17:28
x3tc

Post by xfir01 »

I love the idea for this, but I hate the execution. The bail out rate is ridiculous. So far it's been 100% for every ship that didn't blow up in under a second, and I'm fairly sure they'd bail if I gave them time. Which is better then the vanilla 2-3% if you're lucky, but still undesirable for completely opposite reasons.

Would it be possible to implement a sliding scale for the chance they abondon ship?

Edit: after some more testing I think I was a bit hasty with my comments. After getting 6 caps in a row though..... rate still seems a bit on the high side, however.
voxol
Posts: 429
Joined: Sun, 30. Oct 05, 14:42
x3

Post by voxol »

xfir01 wrote:I love the idea for this, but I hate the execution. The bail out rate is ridiculous. So far it's been 100% for every ship that didn't blow up in under a second, and I'm fairly sure they'd bail if I gave them time. Which is better then the vanilla 2-3% if you're lucky, but still undesirable for completely opposite reasons.

Would it be possible to implement a sliding scale for the chance they abondon ship?

Edit: after some more testing I think I was a bit hasty with my comments. After getting 6 caps in a row though..... rate still seems a bit on the high side, however.
Actually, I would tend to agree... In the next version it will be an AL plugin so it can be disabled, and will also add options for difficulty level, and probably an option to enable station evacuation as well.
xfir01
Posts: 433
Joined: Sun, 13. May 07, 17:28
x3tc

Post by xfir01 »

Looking over your scripts it seems you're just setting a Hull % where they'll either bail out or have a 75% chance of blowing up the ship?

you could add a check before that to see if they'll bail at all. like:

x = random number between 0 and 100 -1
if x < bail rate
bail == true

then get a random hull% where he'll abandon ship and throw in an increasing % chance the ship will blow up as it takes more damage (more damage = higher chance; 1/((hull%+10)/750) - 7 gives a nice curve). Then you've got a race between whether the ship reaches the hull % where the pilot bails or it explodes.


Or something completely different. Just throwing out ideas.
voxol
Posts: 429
Joined: Sun, 30. Oct 05, 14:42
x3

Post by voxol »

xfir01 wrote: you could add a check before that to see if they'll bail at all. like:

x = random number between 0 and 100 -1
if x < bail rate
bail == true
At the top of the script is a section just like that, based on the ships morale value though, rather than (completely) random. Unless the morale is particularly high though, it has little chance of having an effect (Argon One IIRC has a morale of 100, so with this script it will never bail).
xfir01 wrote: then get a random hull% where he'll abandon ship and throw in an increasing % chance the ship will blow up as it takes more damage (more damage = higher chance; 1/((hull%+10)/750) - 7 gives a nice curve). Then you've got a race between whether the ship reaches the hull % where the pilot bails or it explodes.
A good idea, and I'll likely work out something similar, thanks for that.

Unfortunately it only amounts to a minor improvement, it would be hardly noticable to the average player compared to a fixed probability of explosion. (EDIT: I must've misread your post about 10 times whilst composing this reply!) Saying this, I have to admit I hadnt thought in 'sliding scale' terms, and its something more to add as a future improvement.
xfir01
Posts: 433
Joined: Sun, 13. May 07, 17:28
x3tc

Post by xfir01 »

voxol wrote:At the top of the script is a section just like that, based on the ships morale value though, rather than (completely) random. Unless the morale is particularly high though, it has little chance of having an effect (Argon One IIRC has a morale of 100, so with this script it will never bail).
Ah, I see... I think a linear function would probably work better there then a reciprocal. Would definitely be easier to tune the bail rate to what you want, and it would be easy to make it adjustable by a configuration script.

*math warning*
Like say you wanted a moral of 5 to have a 95% chance of bailing and a moral of 30 to have a 5%. You could do that with the formula f(x)= 18x/5 - 13, or if you wanted f(5)=95% and f(30) = 50%: f(x) = 9x/5 - 4. or anything in between. Just a matter of picking how often the base chance of bailing is and then adjusting it for moral.

Reason I'm using 5 and 30 is that appears to be the moral range for "normal" ships.
Erilaz
Posts: 161
Joined: Mon, 8. May 06, 13:49
x4

Post by Erilaz »

Didn't have a problem with that at all, it seemed like still one in any flight of about 4 ships would bail, maybe 2. Then again, I haven't tried this while flying a fighter class ship, been M6 and up the last week or two.

Still, I enjoyed being able to claim the Hydra that 3 falcons were pounding to pieces. Glad he bailed when he did, since their last volley looked like it'd be the end of him. Cleaned up the falcons and gave the Hydra a good buff and shine. Yeah. Thanks for a great script.
xfir01
Posts: 433
Joined: Sun, 13. May 07, 17:28
x3tc

Post by xfir01 »

xfir01 wrote:1/((hull%+10)/750) - 7.
redid the math on that one without using reciprocals and got:

625/10000*(100-x)^2+125/100*(100-x)

same thing, closer to what I was going for and easier to work with, imo.

And, if you wanted an exponentially higher chance to bail with a lower moral I found

65/750(x-4154/10,000)^2 + 125/1000(x-4154/10,000)

some sample numbers from that:

5 =95%
10=68
15=46
20=28
25=14
30=5

Although I'm not sure how viable it would be in the script editor given the lack of floating point numbers...

Side note: I don't really care if you use any of this or not, I'm kinda having fun running the numbers. :D
xfir01
Posts: 433
Joined: Sun, 13. May 07, 17:28
x3tc

Post by xfir01 »

'nother observation: if you moved the part which blows the ship up (lines 96-100 in plugin.signal.attacked.bail.tmr.xml) to happen before you change the ship's race to neutral would that help with the notoriety issues? or would it not still count as your kill? (possibly cause ships you didn't hit to register as your kill perhaps?)

Sorry if I'm coming off a bit strong. Like I said, love the idea, and I can't help but think of ways that might improve upon it....
voxol
Posts: 429
Joined: Sun, 30. Oct 05, 14:42
x3

Post by voxol »

@xfir01: Thanks for all the suggestions, very much appreciated. I will most certainly modify the functions guided by your suggestions, though I cant help but think some of your formulas are a little too complex!

I will also suggest to you that it can be handy to make use of the integer math rounding errors to give 'roughly' non-linear functions, without needing complex formulas...

I realised actually before I read your post that the chance of bailing based on morale is incorrect as a reciprocal, given the integer math. I think just 'probability of not bailing = morale' (with random between 0 and 100) would work ok. Though a non-linear function would probably be better, as even though there are ships existing that have 50 or 100 morale, they are *very* few and most have 20 or less.

Its just a matter of things getting a little unwieldly. Especially if difficulty settings are to be added, then non-linear functions can make it difficult to work out, e.g. 'tough' = 2x more difficult than 'easy' is a lot more messing around with a complex function like your example compared to a basic linear one.

And yeah, if the ship explodes you get no rep, nothing I can do about that. However, I have put in SIGNAL_KILLED in the script, that might have some effect (required anyway to change AI formation leader when lead ship is disabled).

I'll also point out again, that really people wont notice much difference. However, thanks in no small part to your suggestions, I will at least:
- Change the morale-based function.
- Make the chance of exploding based on hull value.
xfir01
Posts: 433
Joined: Sun, 13. May 07, 17:28
x3tc

Post by xfir01 »

voxol wrote:I will also suggest to you that it can be handy to make use of the integer math rounding errors to give 'roughly' non-linear functions, without needing complex formulas...
You're probably right, but....I don't know how to do that. :? All the integer rounding does is take a smooth curve and turn it into a staircase, but you'd still need to calculate the curve of the staircase? /shrug could emulate that with a lookup table for simplicity sake. Something for me to look up I guess.
Its just a matter of things getting a little unwieldly. Especially if difficulty settings are to be added, then non-linear functions can make it difficult to work out, e.g. 'tough' = 2x more difficult than 'easy' is a lot more messing around with a complex function like your example compared to a basic linear one.
Which is why I said a linear function for the bail probability would be the way to go. Set it up in the form ax+b+c, where ax+b gives you a base probability and a slope to the line, and c is a user defined variable that just shifts it up and down depending on how hard they want it (like 5% either way?). Simple.
Or you could set up multiple probability curves....that could get interesting.

edit:
I'll also point out again, that really people wont notice much difference
If you're talking about linear approximations, yeah, difference would be negligible for this application. I could get behind that. But it takes all the fun out of finding the complex formula.
User avatar
Tenlar Scarflame
Posts: 3359
Joined: Mon, 30. May 05, 04:51
xr

Post by Tenlar Scarflame »

Gotta say, fun script you've cooked up. I've had a lot of bails myself, but the vast majority of them have been those "just before death" bails. I had a question, though, about those- do you still get the kill?

I'm using this in junction with SymTec's kamikaze ship script... nab a couple of rival pirates, send them back to their mateys, and detonate them :twisted:

You probably could reduce the bail rate, though, just a tiny bit. Or at least make a higher percentage of them "just before death" bails.
My music - Von Neumann's Children - Lasers and Tactics

I'm on Twitch! 21:15 EST Sundays. Come watch me die a lot.
voxol
Posts: 429
Joined: Sun, 30. Oct 05, 14:42
x3

Post by voxol »

v1.3 posted
- Added AL plugin so bailing can be toggled on/off.
- Amount of hull damage before bailing is now affected by ship fightskill.
- Ship explosion now linked to hull strength.
- Minor bug in morale based chance of fighting to the death sorted.
- Better signal compatibility.
- UFOs will no longer bail.
- Various code tidying.

NOTE TO USERS UPGRADING: Please uninstall previous version as the file structure has changed a little and theres a chance residual files from previous installation could mess things up.


I was going to add difficulty levels and work on station evacuation, but I thought with these changes I should guage response before hammering out more code. Please let me know what you think, especially in terms of difficulty. It *seems* a little more difficult to me, and behaves much better IMO.
User avatar
X2-Eliah
Posts: 4369
Joined: Thu, 12. Oct 06, 16:30
x4

Post by X2-Eliah »

It seems the download link still shows the 06/06 1.2 version.
voxol
Posts: 429
Joined: Sun, 30. Oct 05, 14:42
x3

Post by voxol »

X2-Eliah wrote:It seems the download link still shows the 06/06 1.2 version.
Whoops! OK, fixed, cheers for the heads-up.
hulked
Posts: 4
Joined: Mon, 28. May 07, 13:08
x3

Post by hulked »

great script, but in Xenon invasion BBS missions, ships that have bailed still need to be destroyed for the mission to finished, and also these ships cannot be claimed
User avatar
X2-Eliah
Posts: 4369
Joined: Thu, 12. Oct 06, 16:30
x4

Post by X2-Eliah »

EH, they were claimable with the Salvage Claim Software iirc.

Return to “X³: Reunion - Scripts and Modding”