OOS combat - how SHOULD it work?

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

Post Reply
User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Mon, 18. May 09, 12:31

The problem I see with Morale + Aggression is that there are ships that don't have any.

In that case they would be somehow derived from Fight/Tradeskill (or rank).

A standardised system would then be more transparent if it always used the derived values.

I don't want different skill systems for different ships. One size fits all.
And since Fight / Trade skill are the only skill variables that apply to all ships in the game, those will be used.



The bonus system you set up is fine. We can work with that.
Just have to scale it to whatever kind of value we end up with.
morale/aggression part ? [ yea / nay ]
tradeskill ? fightskill part ? [ yea / nay ]


anything left out on evade ? [ yea / nay ]
adjustments on real size wanted ? [ yea / nay ]
morale/aggression: no


tradeskill: in my pre-alpha I assign "some" evade/defense bonus to freighters only, based on tradeskill


Size can be used. I'm not sure how or how well this affects things but I included it in the ship setup / data collection.
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: 1702
Joined: Sat, 15. Jul 06, 20:59
x3

Post by wyvern11 » Mon, 18. May 09, 12:54

Just have to scale it to whatever kind of value we end up with.
thats what the k1,--,kn stood for - I just wanted to do the basic relative values. scaling and fitting it in is your part :wink:

once testing begins you probably have to adjust the scaling again anyway (but not the basic rules i hope)

concerning tradeskill: I wasn't aware the KI had it.

I see your point in leaving out morale / aggression. I had not really found them necessary, but i wanted to push discussion to the brink, that a clear decision would stand at the end - which now does !

If you are able to, can you post pre-finalized rules that I can do a spread-sheet simulation on the data I drew from the game (or adjust the data-drawing script to get all the data needed)?
Redest du noch - oder denkst du schon ?

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Mon, 18. May 09, 15:32

concerning tradeskill: I wasn't aware the KI had it.
The AI has more or less logical fight skill values but is pretty much random on tradeskill, aggression, and morale.

Morale is (I think) used in the hardcoded pilot eject routine but nowhere else in a fight script.

wyvern11 wrote:I see your point in leaving out morale / aggression. I had not really found them necessary, but i wanted to push discussion to the brink, that a clear decision would stand at the end - which now does !
I may find a use for morale/aggression at a later time but they do not directly fit into the damage calculations.

Really using them would mean altering the decision making of the AI. Are we kicking enemy butt? Did my formation take heavy losses?
Fight or flee?
That's where morale belongs. The classic routing roll.

If you are able to, can you post pre-finalized rules that I can do a spread-sheet simulation on the data I drew from the game (or adjust the data-drawing script to get all the data needed)?
I'd like to get an alpha version first that works without any evade / damage bonuses whatsoever.
That would then report how much raw damage each ship does with my system and it's (up to) 3 laser batteries.

Currently there are too many maybes and the old logging script only detects the wild and crazy damage caused by the ES calculation. That's no longer going to tell us anything useful beyond the number of engagements or similiar qualitative data.

If every "shot" is again recorded with raw damage data and attacker/target data like ship class, size, speed, skills, and whatever, it will be a lot easier to see how our preliminary formulas react to this real world data.
Adjusting the system in a spreadsheet is faster than trial and error in the script editor. =)

That's actually what I did with MARS. Collect lots of data on the current target situation at the time of firing the laser and if that particular shot was a hit.
With enough data crunching certain rules became visible... just how much turning speed or a certain speed vector affected the chance to hit. About one week of staring at spreadsheets, trying and discarding evaluation formulas. =)
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: 1702
Joined: Sat, 15. Jul 06, 20:59
x3

Post by wyvern11 » Mon, 18. May 09, 16:57

My thought went the other way around :

I have got the ship stats of all ships, given I know the rules I can calculate the probable outcome of (using open-office-randon number generator)

3 M3 vs. M6

on the whole population at once. But either way: If you got the alpha I might as well look into it and derive the rules myself

so I do not want to analyze the outcome but simulate it
Redest du noch - oder denkst du schon ?

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Sun, 24. May 09, 16:13

These are my current rules for how cockpit lasers are evaluated.

This is not yet modified by the actual stats of the laser, only how the ship's own speed affects the time it can fire at targets.

The faster the ship, the more time it spends breaking / circling / doing anything but firing at the target.
These values (pretty much) correspond to how it works IS.

Turrets count 1/2 because they cover exactly... half the sky.
A Tiger gets to use 40 % of it's cockpit lasers + 4 turret IBL (=>5.2) while the Panther gets (6+4 turrets => 5) but is a 30+ carrier so will end up with a bit less overall, estimated 4.25.


% = A / ( Speed + B )


Class 0 . . . A= 13860 . . . B= 750
(small ship)

Speed . . . % of cockpit lasers
90 . . . 16
120 . . . 15
160 . . . 15
190 . . . 14
300 . . . 13
400 . . . 12
500 . . . 11



Class 1 . . . A= 10780 . . . B= 300

Speed . . . % of cockpit lasers
92 . . . 27
126 . . . 25
172 . . . 22
360 . . . 16



Class 2 . . . A= 10500 . . . B= 140

Speed . . . % of cockpit lasers
96 . . . 44
111 . . . 41
121 . . . 40
132 . . . 38



Based on fight skill, pilots get a damage bonus.
If they are flying a trader (TS/TP/TL) it is based on trade skill.

Code: Select all

Skill      Dmg
Level     Bonus (%)
       Fight  Trade
  0      -5    -4
  1      -5    -4
  2      -4    -4
  3      -4    -4
  4      -3    -3
  5      -3    -3
  6      -2    -3
  7      -2    -3
  8      -1    -2
  9      -1    -2
 10       0    -2
 11       0    -2
 12       1    -1
 13       1    -1
 14       2    -1            
 15       2    -1
 16       3     0
 17       3     0
 18       4     0
 19       4     0
 20       5     1
 21       5     1
 22       6     1
 23       6     1
 24       7     2
 25       7     2
 26       8     2
 27       8     2
 28       9     3
 29       9     3
 30      10     3
Last edited by Gazz on Sat, 6. Jun 09, 09:40, 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.

Cronos988
Posts: 682
Joined: Mon, 27. Aug 07, 12:34
x3tc

Post by Cronos988 » Mon, 25. May 09, 07:53

I've read through this very interesting Thread and came up with some ideas, see if you can use them.

About counterfire:

If I got it right the current rule is big ships (does this include M6?) have 30 seconds of counterfire that, when not used up, go into the main weapon pool. First of all how do you calculate the strength of the counterfire?
Is it a percentage of a ships total firepower? Or based on the number of turrets?

Second: How do you determine what gets what amount of CF? Will a Destroyer get more than a M5? Will a Destroyer get counterfire at all?

About missles:

It seems to me missles are a major point at the current state. What I came up with is this:

A missle is basically an enhancement of the ships firepower, so lets treat it as one.
Missles Damage is added as a factor to a ships total firepower. To determine the amount of damage added, we take the chance a ship will fire a missle as well as a precomputed table with damage values for all missles.
As missles don't need orientation towards the target, this damage would get applied after cockpit laser damage has been reduced.

First the table: It would consist of an average damage value for all missles based on missle Speed and type (dumb, seeker, etc.). You would basically do what you have already done for the lasers: get realistic average damage values.

This is easy if the ship has only one missle type in its cargo bay. Just factor in the probability to shoot a missle at all and you have the average additional damage the ship gets for it's missles.

Now what about multple missle types?
I think the first thing we should do is assume a ship will always use the strongest missle that fits for the target. It will not, however, shoot Torpedos on an M5.
You already have 3 ship classes: Small, Big and Huge.
So we could (in the precomputed table) assign each missles a class: Small, Big and Huge. A ship would always use the most destructive missles of the samle class as the target.

Last point is deducting missles form the hold:
Maybe you could do this based on the missle shoot percentage. Like 20% of weapon fire is missles means 1 missle per combat round. However I'm not really sure on that number.

Ships hitability:

The hitability of a ship should only be one factor.

I would use a precomputed table with speed and size as it's factors, adjusting the values to tailor in off-chart turning rates or very good/bad profiles.

This should be a positive factor between 1 and some high mark, possibly 100 or even 200. The higher the value the more difficult a ship is to hit.
To make it clear that high values are good you could call it evasion, but i will stick with hitability for now.
After that you can just calculate the damage by doing (as an example):

Code: Select all

Damage= big.gun.dmg/ hitability + (med.gun.dmg*2)/hitabillity + (light.gun.dmg*4)/hitability
(numbers completely made up)

To get in fight skill, you could use that as a percentage value where a fight skill of 0 means 0% bonus to hitability and a fightskill of 30 means 30% bonus.

This means that a low fightskill wont make your ships that much weaker, while a very high skill will be significant.
The higher a ships basic hitability (or evasion for that matter), the more bonus it will get. Meaning an expert pilot in an M5 will have more impact than in an M2. This somewhat reflect IS behavior, as even a good pilot can not evade well with a phoenix.

Morale and aggression:

I would agree with Gazz that morale and aggression don't really fit into the fight Skill of a pilot. But you could factor in extreme values. So in a scale from 1 to 30, 1-5 or 25-30 Aggression woul give the ship a malus on fight skill, as the pilot is either over-aggressive or cowardly. Same with morale.

Thats it for now. Maybe it's of some use.[/u][/code]

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

Post by wyvern11 » Mon, 25. May 09, 08:49

Second: How do you determine what gets what amount of CF? Will a Destroyer get more than a M5? Will a Destroyer get counterfire at all?
as far as i see it, anyone who has a given ship as his target will get his "due share" of counterfire. it was discussed, that main guns / artillery are big-ships weapons and counterfire is med/small-weapons only, so I'd guess, M2 are not subject to CF

@gazz : as far as i understand your tables are modifiers to calculate the per-round-base-damage, A and B are guessed/calculated to "fit it into system", yes?
Redest du noch - oder denkst du schon ?

ragamer
Posts: 518
Joined: Wed, 6. Nov 02, 21:31
x4

Post by ragamer » Fri, 12. Jun 09, 12:33

I have redirected from the Real Script thread to the "Brainstorming one" so here goes my ideas regarding OOS that simulates IS.

This are just the basic MODELING ideas... How to make them IMPLEMENTED in a light load algorithm is a different issue that I will discuss later if some of the concepts here are of interest.

Notice the idea is not realistic... It strictly tries to simulate what X3 IS combat looks like (Don't get confused to what X3 AI IS combat SHOULD like... As X3 AI combat is faaaaaar from perfect and OFC do not match what a player can do). Notice also that the idea tries to use raw data from the game to make this OOS system adapt to whatever custom content is added.

Evasion Model

What follows will be a proposal on how to calculate the evasion chances of an average figther (That uses the dumb AI they all have IS) (All units in meters or meters/second). The logic used is a comparison between Time to Hit (TTH) and Time to Evade (TTE):

TTH: LR / BS

TTE: HS / SS

Evasion Factor (EF): TTH / TTE

Where:
LR: Laser Range of the Attacking Fighter
BS: Bullet Speed of the Shooting Battery
HS: Hull Length in the direction of movement
SS: Attacking Fighter Speed

The actual chances can be calculated using different conversions between EF and real chances to avoid completely a hit. The proposal I will give is just a tabular example (the numbers are just a guide and OFC subject to fine tuning):

EF
1-: 0%
2-: 10%
4-: 20%
8-: 40%
12-: 60%
20-: 80%
20+: 90%

It's important that this chance is an ALL or NOTHING effect, to take into account the real effect on X3 IS combat when a Capital spends all his firepower stupidly on a nimble fighter.

This idea will also automatically adress custom weapons and special case as Flaks and Beams... PSG and Plasma Bursts are very special weapons that could be modeled as impossible to dodge and thus highly effective OOS (But it's basically the same as IS... As anyone fighting Yaki can realize).

There are a lot of details and rationale to explain still and some tricks to speed-up a calculation process like the above... But the post is already big enough so I will add them if there is interest on an idea like this.

Nadrek
Posts: 71
Joined: Thu, 20. Mar 08, 00:50

Post by Nadrek » Sat, 13. Jun 09, 22:12

One major point, and some minor ones for consideration:
A) Gazz and the contributors to the OOS combat rewrite threads, you can be proud to tell Egosoft that all of your work has sold a copy of X3 Terran Conflict; long ago I resolved to stay with X3 Reunion until OOS was consistent on TC (i.e. no M4/5's killing M2's as the extreme example).

B) Future Enhancement: Given that MARS and AI ships switch weapons in-flight IS, why would they be set with a single configuration OOS? When MARS sees a ship go from IS to OOS now, it loads up the most powerful weapons. When MARS sees a ship go from IS to OOS _after_ this is released and stable and so on, why wouldn't it calculate the ships three optimal loadouts: one for each target classification, based on the weapons in the hold.

C) Future Enhancement: While Ammo shouldn't run out in a strategic sense, Ammo should be able to run out during a single engagement. Perhaps fix it at X rounds of combat with the ammo based weapons per engagement, where X is either fixed, or depends on cargo free space with a hard minimum?

D) Balancing Statistics:
D1) Optimal: Run a thousand (rough statistics) to a million (fine tuning) "test combats" of each ship with each loadout against each other ship with each major loadout (combinations of 0/1/2), with a fleet of up to N ships on one (or both, though that goes cartesian to a greater degree) side(s). This would be relatively simple to do for the OOS combats in a simulator, given the very simple math involved; it's just a couple auto-generated tables cross joined to each other, and the results fed to a combat loop. Kick it off and let it run to completion; if you can get a few other people/computers involved, run it in parallel (break up the cross joined list). I have some dual core Linux machines that could easily run most standard languages, and have little better to do with their time, and I could build a VMWare virtual appliance specifically for these simulations if anyone else wants to chip in. Even without a simulator, it's just starting up X3TC in a test universe/loadgame and hitting the script (just pass around a savegame to whoever wants to contribute computer time)
D1a) this would be almost impossible to do IS due to the amount of time it would take.

D2) Suboptimal: Same as above, but with a couple dozen carefully selected test cases. Say, select one "average" and perhaps one "exceptional" ships of each class, then pair them against others within a couple classes of each other, including against themselves (to trivially isolate issues like ship "B" doesn't fire as often because of a bug or whatnot). Perhaps do less runs, but less than 100 runs means your statistics are somewhat lacking. Set an M2 against an M1 with fighters, and against that same M1 without fighters. Set a quartet of M4's against an M3, and against an M6 with and without turrets (do the turrets count appropriately?). A missile ship against the same ship with light equipped turrets, and medium, and heavy, and no equipped turrets.

D3) In either case, select perhaps three to five of the most representive/predictable matches that test a variety of cases, and use those for rough initial testing.

D4) Analysis: Compare the actual IS results to the actual OOS results.

E) I would say that the easiest way to tweak counterfire is to tweak how many "seconds" it lasts for. If you want to get really fancy, write a simple algorithm basing counterfire time on the target max speed on the premise that you have less time to shoot at little tiny targets.
E1) To anyone talking about hittability, the extreme speed lasers are essentially auto-hit within range.

F) Thank you to everyone who has contributed so far.

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

Post by wyvern11 » Tue, 16. Jun 09, 08:25

@nadrek

solid analysis.
consider yourself hired !! for further reference reasons hand over your application papers :
http://forum.egosoft.com/viewtopic.php? ... 1&start=75 :wink:

steel yourself for consummation by the gazz rebalancing project :lol:

my topic-related reply to you will be posted to above mentioned thread ...
Redest du noch - oder denkst du schon ?

Post Reply

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