OOS combat - how SHOULD it work?

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

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

Post Reply
User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Mon, 11. May 09, 14:53

Oh, I still have no solid idea on the magnitude of all those multipliers / boni.

I got the hit % covered. With the recent tests on cockpit lasers and plenty of hit probability data on turrets, I can make the hitting / damage part relatively realistic.
The percentages above are pretty realistic. For turrets they are a bit higher.

The evasion bonus system is 100% guesswork, though.

How much of a bonus should pilot skill be?

How much for speed?
Should there be an average speed (per ship class) from which ships get a positive/negative bonus or a 0 - n avoidance bonus range?

How would speed affect different classes? Huge ship vs M5?

Should speed and skill be combined? A stupid pilot could not use his ship's speed to the best advantage...

There's still a lot of planning left for such details.
I prefer to have a plan before scripting that because it means far fewer complete rewrites. =)

So if you got the time, figure out some likely percentages for how much skill and ship speed should affect evasion.


As far as actual scripting is concerned, I'll be doing that. To minimise script overhead, it should be a single script that is called to "create damage". This also does all necessary ship initialisation if needed.
And there's not much open sourciness that can be applied to a single script file. =)
"The" setup script is done so far but that only provides raw laser data , version info, and such basics.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

User avatar
wyvern11
Posts: 1703
Joined: Sat, 15. Jul 06, 20:59
x3

Post by wyvern11 » Mon, 11. May 09, 21:42

next point:
maybe evade skill should depend on the ship class flown against :
relative high bonus against little / big ship for high skill. less for against huge ship

experience gives you an edge in dogfights, but not so against flak-wielding cap-ship - shrapnel is more like dumb luck

gonna do some educated guesses and tests, then i come up with some answers
Redest du noch - oder denkst du schon ?

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Mon, 11. May 09, 21:50

wyvern11 wrote:experience gives you an edge in dogfights, but not so against flak-wielding cap-ship - shrapnel is more like dumb luck
Yah, but I will include the "average chance to hit" in the weapon's damage.
OOS Flak will probably do a lot more damage to a fighter than HEPT so on average a fighter takes more damage from Flak.
Simple...

I'd suggest only considering the pilot's own ship/skill for evasion.
Once the bullet is in the air it doesn't matter who fired it.

Experience also works vs. huge ships. (player experience at least =)
You learn where the turret arcs are, you fly between turret arcs to make the lasers acquire a target other than yourself... all experience based.


Oh, BTW:
With an assumed evasion value of 32, I was intending to roll
-32 to 100, so 33 complete miss results, 1-100 for damage 1-100%.
However, with high pilot skill, it could be possible to adjust the 100 % limit a little downwards as well.
Just a thought...
In RPG terms that would be mitigation where the previous system was avoidance. =)

Another thought: M2 + M7 without any hangars, being the "tanks" of X3, could have a (very small) innate mitigation bonus.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

Dumminion
Posts: 38
Joined: Sun, 26. Apr 09, 22:22

Post by Dumminion » Tue, 12. May 09, 20:01

After some more grunt work (n > 10000) I can actually say how ship's cockpit guns should be handled.

I logged the time ships spent firing vs not firing at a moving (attack enemies) M7 Shrike.
Fighter Turret scripts were off so it was main guns only.
Any reduction of laser energy over 30ms meant that the ship "is firing" for the next 2 seconds.

Firing time:
M4: 11 - 14 %
M3: 15 - 16 %
M6: 21 - 36 %
Small ships seem to have low firing time because of low turning rates (20% rudder tuning) and weak weapon reactors.
I assume this is to let them stay alive for a longer time. :?
Completely unrelated idea:
Carriers are disproportionally strong OOS because their smaller laser generators suddenly cease to be a hindrance.
(Okay, there is the Tokyo but I bet that one was simply overlooked during balancing)
So for every actual carrier (10+) docking bays, I'd reduce the OOS firepower to maybe 75 % to account for typical IS-behaviour.

(10+) docking bays because these smaller ships (like a Cerberus or TM) can't really act as a carrier and there are already mods to add 1-2 external docking bays to M2 and the likes, making practically every huge ship technically a carrier...
Also exludes all normal M7 which are extremely well balanced as is. (no, the Panther is not balanced at all =)

I don't want to mess with any of those mini carriers.

Maybe even something extremely simple like:
if hangar.bays > 10
Firepower reduction (%) = hangar.bays / 2
Simple and transparent for everyone.
Carriers are supposed to use their fighters. AI carriers certainly do. =)
I don't like this and the TM, TS and TL class seem to be to strong too.
(I was thinking about the use of >10 TM as sector patrol!!! :wink: )
What happens to M0 class or orbitalweaponstations with many docking bays?
I think those things should be balanced by tfiles (tships,tbullets) and not by OOS scripts.

How about decreasing fire power after some fire turns? (based on weapon reactor and/or weapons?)
You seem to waste the possibility to precompute tables, by using
easy things like:

- if hangar.bays > 10 then Firepower reduction (%) = hangar.bays / 2

- we have three laser classes - corresponding to three "default-target" object-classes :wink:


PS: Am i of any help? :oops:

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Tue, 12. May 09, 21:10

Dumminion wrote:You seem to waste the possibility to precompute tables, by using
easy things like:

- if hangar.bays > 10 then Firepower reduction (%) = hangar.bays / 2

- we have three laser classes - corresponding to three "default-target" object-classes :wink:
Oh, there will be precomputed tables. 3 in fact, for damage against each ship class.
The carrier hangar issue would be factored into those tables.
It would be silly to do this at runtime considering that the number of hangars of a ship does not change often.


OWP are a good point, though. Hadn't thought of those.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

ZaphodBeeblebrox
Posts: 1823
Joined: Mon, 10. Apr 06, 20:35
x4

Post by ZaphodBeeblebrox » Tue, 12. May 09, 22:45

one quick question.

Would it be possible for each side to be destroyed?

Does the turn based approach allow damage to both sides?
It was a woman who drove me to drink... you know I never went back and thanked her.

Don't try to outweird me, three-eyes. I get stranger things than you free with my breakfast cereal.

User avatar
wyvern11
Posts: 1703
Joined: Sat, 15. Jul 06, 20:59
x3

Post by wyvern11 » Wed, 13. May 09, 08:26

30 seconds : one ship fires this way (discussed in detail), other ship evades (or does not)

other ship fires back, first ship evades perhaps (not discussed in detail because symmetric)
Redest du noch - oder denkst du schon ?

User avatar
wyvern11
Posts: 1703
Joined: Sat, 15. Jul 06, 20:59
x3

Post by wyvern11 » Fri, 15. May 09, 11:46

here are my first observations to evading, tested with a tiger during a xenon invasion and some other combat missions:

first observation:
evade-effects are very difficult to observe, more difficult to measure, and most difficult to correlate observation to measurement

thematical observations:

- not-evading sucks !! even capships score **lots** of hits ==> conclusion : bad evasion/flight skill should generate a malus

- there is a lot of difference between elementary evade and massive evade ==> conclusion : good evasion should sport a significant bonus at least against a single target)

- it is rather improbable to evade more than one attacker at the same time (provided they are on different vectors) ==> probable conclusion :
build a means of one part "full evade" and 3-5 (average no of attackers) parts "no evade"

- to be continued...

any objections?
Redest du noch - oder denkst du schon ?

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Fri, 15. May 09, 14:02

wyvern11 wrote:first observation:
evade-effects are very difficult to observe, more difficult to measure, and most difficult to correlate observation to measurement
Not sure if that helps but you can have MARS display the target specific "hitability".

In
plugin.gz.mars.ship
you have to uncomment the line with
$Debug.Change.Target.Name

Should be right at the start of the script.
Then shut down MARS for at least a minute on your ship so the central computer uses the new script.

During MARS debug mode all targets will constantly be renamed to display their stats.
wyvern11 wrote:- not-evading sucks !! even capships score **lots** of hits ==> conclusion : bad evasion/flight skill should generate a malus
We could just set the "default" damage to 0 (intentional) evasion so anything above 0 skill helps.
That would mean that the effect of fight.skill is quite drastic and player ships would be at a severe disadvantage until the player gets his fight skill to 25+.
Realistic or not - I doubt this would be a good idea.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

User avatar
wyvern11
Posts: 1703
Joined: Sat, 15. Jul 06, 20:59
x3

Post by wyvern11 » Fri, 15. May 09, 14:39

I was just adding up the points of interest - decision or magnitude follows later on

is more like a remind-me
Redest du noch - oder denkst du schon ?

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Fri, 15. May 09, 15:42

Fight.Skill has a direct impact on several variables in the fight script.

Code: Select all

 !plugin.acp.fight.skill.std

007   if $Fightskill < 4
008   |$Attackruntimeout = 18000
009   |$Defencemoveintensity = 40
010   |$Defencemovetimeout = 20000
011   |$MissileSkill = 1
012   |$DefenceDistance = 0
013   |$MaxSpeed = 55
...
042   else if $Fightskill < 26
043   |$Attackruntimeout = 6000
044   |$Defencemoveintensity = 95
045   |$Defencemovetimeout = 4000
046   |$MissileSkill = 60
047   |$DefenceDistance = 200
048   |$MaxSpeed = 100
So yes, a skill 25 pilot actually flies sharper turns when evading.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

User avatar
wyvern11
Posts: 1703
Joined: Sat, 15. Jul 06, 20:59
x3

Post by wyvern11 » Fri, 15. May 09, 16:17

:o :o

so this is how they fly :

Code: Select all


class___noofships_fightsk.________morale________aggression      

M1_______127_____17____________17,5512_______14.9213
M2________44_____22,5__________25.4318_______19.2955
M3______1658_____17,9861_______19.1749_______16.1767
M4______1422_____18,3073_______20.68_________15.9276
M5______1263_____15,0736_______21.1306_______15.0261
M6_______385_____19,0026_______20.5584_______16.987
M7_______115_____22,3304_______24.513________18.9217
M8_______121_____21,5289_______24.2397_______16.876
TL________47______8,12766______18.3617_______13.2979
TM_______158_____ 2,56086_______3.54854_______3.23267
TP_______296______5,60473______11.2838_______11.4899
TS______2098______6,09973______10.6972_______12.4891

next step is by race. lets see if there are any of 26 or better (how do *they* fly?)

EDIT : forgot to mention is for a newly started game

for now-game (FR 24, TR 26) looks like:

Code: Select all


M1_______118_______15,7034_______16.8983_______13.9831
M2_______37_______21,4054_______24.5135_______17.4595
M3_______1371_______16,5515_______17.7876_______14.8469
M4_______1161_______16,5883_______19.5883_______14.8303
M5_______911_______13,3677_______21.2503_______13.5686
M6_______347_______17,6513_______19.2594_______16.1643
M7_______125_______22,544_______24.456_______18.96
M8_______105_______20,8381_______23.6095_______16.2476
TL_______41_______7,76744_______17.9302_______12.3953
TM_______131_______2,86427_______3.82435_______3.49301
TP_______260_______6,01527_______11.6031_______11.8511
TS_______2009_______6,9734_______11.235_______12.7749

for enemy races :

Code: Select all

yaki_____87_____27_____27,12_____27,12
pirate__362____18.79__16.50_____16.86
xenon___486_____24.16___23.82____21.20
khaak____81_____23.98___27.19____27.19

compare

argon___956____12____17____13
Häufigkeit der skills

Code: Select all



Klasse	skill	moral	aggression
0	56	42	59
1	284	2	8
2	324	16	61
3	316	36	72
4	538	39	73
5	543	174	128
6	276	191	143
7	372	199	130
8	357	302	368
9	125	309	420
10	244	338	408
11	229	387	504
12	129	392	420
13	230	369	466
14	212	354	644
15	119	266	620
16	185	219	554
17	192	406	616
18	85	290	365
19	278	282	356
20	302	408	347
21	201	374	297
22	578	356	271
23	573	417	282
24	387	406	82
25	404	386	63
26	396	385	68
27	36	176	38
28	23	175	43
29	30	174	49
30	1	155	70
31	0	0	0

Redest du noch - oder denkst du schon ?

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Fri, 15. May 09, 18:00

I doubt that the general skill distribution has any purpose.

It primarily depends on the Job (like military) and then on how many of that job are spawned by Jobs.txt.
(or spawned by missions)

Common enemies like Xenon patrols will always have a high skill around 25 so for balancing purposes, those and the more random pirates would be more useful.
That there are a lot of traders and civilian ships with next to no fight skill is true but these won't have any noticable effect on "interesting" OOS fights. They just die.



Completely unrelated thought:
Since it would fit in technically it may be worth consideration.
If the player boards a ship, the ship being boarded will permanently turn hostile with no chance to excuse for "accidential fire" ever again.
Also, all ships of that race within 30 (?) km and all police/military ships currently in the sector permanently turn hostile.

So you could still board ships perfectly fine. You'd just have to... deal with the witnesses. =)
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

MutantDwarf
Posts: 711
Joined: Tue, 20. Jun 06, 02:29
x4

Post by MutantDwarf » Fri, 15. May 09, 18:58

That makes sense to me, Gazz. I don't know why it's like it currectly is.

Maybe don't make it completely permanent, though - it should knock your race rep down into the toilet, yeah, but you should be able to gain it back after a long bloody time.

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Fri, 15. May 09, 19:35

MutantDwarf wrote:That makes sense to me, Gazz. I don't know why it's like it currectly is.

Maybe don't make it completely permanent, though - it should knock your race rep down into the toilet, yeah, but you should be able to gain it back after a long bloody time.
Oh, I wouldn't alter notoriety at all !

The player merely has more choices!
He could lure his targets into a dark alley (away from where other ships see them) and have scouts in the sector to keep cave in case the police shows up.
Or he could just make a quick getaway with the police in pursuit. It's a very pirateish thing to do!

Since none of that automatically alters his argon notoriety, he could still dock at argon stations - as long as he can evade the few police ships that know his face. =)
With luck they are eventually destroyed by pirates or xenon... and his sins are slowly forgotten.
There could be an Alzheimer-timer, too.

Or of course, he ruthlessly kills all witnesses.
That means a lot more notoriety to repair - unless you waylay that juicy military patrol in an unknown sector or otherwise dark alley. =)
But for those kills you can excuse normally, so no lasting damage there.



While this has absolutely nothing to do with OOS combat, I suspect that reasonable OOS combat would be a popular item - even if it ahh... improved boarding consequences realism. =)
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

User avatar
wyvern11
Posts: 1703
Joined: Sat, 15. Jul 06, 20:59
x3

Post by wyvern11 » Fri, 15. May 09, 23:01

general distro served no purpose except to get me aquainted to the numbers

same thing for ships speed distro

I'm trying for a formula to combine pilot-specifics (morale, skill, agression) into a bonus/malus

first try on that :

say
L is a fixed fightskill (maybe average skill, maybe not)
k1,-,k are scaling factors


A is aggression (A goes in negative, since aggressiveness counteracts evasion)
M is morale (M goes in positove - weighs imho against A)

both together are not as decisive as skill, therefore k2

S is skill

so **skill**-based evade could be like

bonus = integer { k1 [ ( S - L ) + ( M - A ) / k2 ] }

example:
Argon 1 :
S = 28, L = 20 --> +8
M = 26, A = 11 --> +15 / k2 ==> would have a high skill-based evade (of course getting a carrier to evade would get some hefty size and speed malus )

size (any idea to get this into a formula and not if-thens?) :

huge: -2 k3
big: -1 k3
little: +1 k3

speed :

idea : get k4 times an integer that is
-2 for speeds about 0
+k5 for speeds about 600

linear function is bad so take sqrt. for example :

bonus = k4 * round ( 0,16 * sqrt ( speed ) - 2 )

table for k4=1 :

Code: Select all


speed bonus
1	-2
25	-1
50	-1
75	-1
100	0
125	0
150	0
200	0
250	1
300	1
350	1
400	1
450	1
500	2
550	2
600	2
650	2

one can easily stretch and squeeze depending on balance
Redest du noch - oder denkst du schon ?

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Sat, 16. May 09, 03:54

size (any idea to get this into a formula and not if-thens?) :
If the ship class corresponds to array indices for the lookup of it's damage tables, we'd have
0 little ship
1 big ship
2 huge ship

As an evade modifier:

$Mod = $Class.Index * $Class.Index * $Class.Index
so
0 little ship (1 ?)
1 big ship (2 ?)
8 huge ship (9 ?)

The size/evasion difference between m3/m6 is noticable but not huge.
The evasion of an M1 is umm... Texas trying to evade a bullet. =)

But as I said before, getting the general size of an object is possible.
Phoenix;2378
Python;1068
Boreas;705
Thresher;1430
Shrike;636

Centaur;64

Nova;17
Falcon;23
Discoverer;14

Getting this costs one library call during the setup phase so probably not a big deal.
I just don't like how it favours the tiny... Boreas.
However, I wouldn't want to disadvantage it because it an overpowered hellspawn. Ship balancing needs to be done in other places.

What... if the class index like above is used as the primary modifier (because of general maneuvering ability) and size as a secondary?
A Boreas is more difficult to hit than a Phoenix...

A is aggression (A goes in negative, since aggressiveness counteracts evasion)
M is morale (M goes in positive - weighs imho against
I'm not sure how to rate morale or aggression at all because they are not used at all in any fight script.

They may be used in hardcoded functions like ships bailing but any and all offense/defense related issues are based on fight skill alone.

There is also (currently) no way to assign a useful morale/aggression to player ships. (no pilot)
How aggressive is the player?
Last edited by Gazz on Sat, 16. May 09, 11:23, edited 1 time in total.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

User avatar
wyvern11
Posts: 1703
Joined: Sat, 15. Jul 06, 20:59
x3

Post by wyvern11 » Sat, 16. May 09, 06:56

third power for class modifier ?

lets see second power

bonus = - $size.id * $size.id + 1

huge : -4+1=-3
big : 0
little : +1

with a linear transformation on that one can do the tuning

concerning length i can do some checks where it leads us

because they are not used at all in any fight script.
well now they would be :D

assign player morale and aggression identical to skill and the second part of the equation collapses?

edit : other way maybe :
aggression = fightskill
morale = tradeskill

this would get non-trading warlords somewhat stiffer repsonse - kinda like that
Redest du noch - oder denkst du schon ?

User avatar
Gazz
Posts: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

Post by Gazz » Sat, 16. May 09, 11:12

wyvern11 wrote:edit : other way maybe :
aggression = fightskill
morale = tradeskill
Now there's a great idea.

The question is - what to do with it?
High morale would imply that the ships fight instead of running but "running" is not part of the OOS damage.
So a high Player.Tradeskill would mean +offense but -defense, since they don't evade.

I can't find an explanation of how Morale would positively influence evasion at all.


Player.Tradeskill = aggression would work.
It could add a small damage bonus since ships are not afraid to use ammunitions.
That would add enticement to work up that rank as well if you want the perfect army. Evil. =)
It can't lower defense, because that would punish the player for the completely independant trade.rank.


I would leave morale out completely unless you can find a reason why it should affect damage or evasion and why it should be tied to either fight or trade.skill. =)
An implementation of morale would IMO require a completely different approach.
It can not be a static value but has to be used like in tabletop games where formations do break and flee if they take too many losses.
OOS that would be extremely easy to track if my script is doing all the shooting but IS...?
I say we ignore morale until we can do it right...

wyvern11 wrote:third power for class modifier ?
lets see second power

bonus = - $size.id * $size.id + 1

huge : -4+1=-3
big : 0
little : +1
That's pretty good as well and is already heading into the right direction of +/-.
After positing I was tinkering with one of the indices, too, but I see you're already ahead of me. =)
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

vr01
Posts: 1250
Joined: Sun, 10. Sep 06, 00:01
x4

Post by vr01 » Sat, 16. May 09, 14:28

Maybe scale this way:

Code: Select all


Calculate bonuses based on Player skill

Offense Bonus = ( -31 + Player.Fightskill + Player.Tradeskill ) / 3

Defense Bonus = ( 31 - Player.Fightskill - Player.Tradeskill ) / 3

(The divide by 3 as just a pull out of the hat number for scaling, effectively gives a range from -10 to +10 for both. The 31 is what I believe to be the number of Fight and Trade ranks?)

1) Player owned ships are more aggressive because their employer (the player) has racked up the kills or has the economic capability to supply them with the best weapons and shields. Less aggressive at low fight rank because they don't have the confidence that the player knows which end of the laser is which... :P or less likely to be adequately armed / shielded.

2) Player owned ships are more evasive at low trade rank because the assumption is the player doesn't have the economic means to defend / replace the ship / less likely to be adequately armed / shielded. Conversely at high trade rank, less likely to evade because the player should have the capability to provide patrol ships / fleets, arm ships with best weapons / shields, etc.

3) Balances out playing styles, i.e trade versus combat. Ships will get biggest offensive bonus at high fight and trade, biggest defensive bonus at lowest fight and trade. However they may still get some bonus if the player is only focusing on combat or trade.

Feel free to flame it away :P

Post Reply

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