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: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Sat, 9. May 09, 15:59

pelador wrote:Can you explain further?
Tell me what exact script mines use and we'll talk.
Without that it does not fit into the reactive system.
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.

pelador
Posts: 1230
Joined: Wed, 6. Nov 02, 21:31
x3tc

Post by pelador » Sat, 9. May 09, 16:04

Gazz wrote:
pelador wrote:Can you explain further?
Tell me what exact script mines use and we'll talk.
Without that it does not fit into the reactive system.
But I'm trying to possibly convey that it's not where the problem lies though in a reactive system. Mines will operate OOS as they currently stand.

The focus is how do ships and turrets treat them in the reactive system. As in if fighters are ignorant to mines because that how they were designed to be then I dont see a problem with it being the same in a reactive system. The same answer could be converyed to turrets. But if your code with them included as a normal target you could end up eliminating them from gameplay potentially.

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

Post by wyvern11 » Sat, 9. May 09, 17:13

The fighter target has 21 skill.

%.damage = random -21 to 100 (low capped at 0)
Damage = 30000 * %.damage / 100

So... the higher the fighter's skill, the lower the average damage it gets hit for and the higher the chance to completely avoid getting hit.
21 to 100 ? how high can fighter skill possibly get?

looks good to me !! is like thac0 - because in other words - if skill higher than random ==> no hit

skill is not the only subtrahend because "evasion by size" and "evasion by ship-maneuverability" we already have.

so let's put it together :

- we have three laser classes - corresponding to three "default-target" object-classes
- each laser class has a given "per 30sec" damage value which already takes into account regular / usual hitrates taken from IS observations
- this gets modified by factors when a non-standard target-class is attacked


- this gets further modified by attacker skill

- we have victim speed and maneuvrability (size has been covered above)

- we have a modification by victim skill.

churn together and roll dice

from my point of view there are two ways to combine that:

a) combine the ship-stats-modifiers of both victim and attacker, then weigh the skills against each other
b) calculate both ships completely and weigh ships

nail it all together and roll dice ...
Redest du noch - oder denkst du schon ?

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

Post by Gazz » Sat, 9. May 09, 18:22

wyvern11 wrote:21 to 100 ? how high can fighter skill possibly get?

looks good to me !! is like thac0 - because in other words - if skill higher than random ==> no hit
I meant -21 so everything 0 and below would = no hit

The higher the evasion (skill or otherwise), the further the roll range would extend into the negative, both lowering the average hit and increasing the chance of a complete miss.

But unlike cutting off the hits "below skill", this system always keeps hit damage results random on a 0-100 scale.
Except that the distribution changes with skill.
(And no need to create bell curves and whatnot =)

Also nice: no amount of stacking skill boni can ever remove the chance of getting hit. You can lower them by extending the roll even further into the negative but you can't possibly eliminate the 1-100 range from the equation.
Unbreakable. =)


AI Pilot skill is 0 - 30, which conveniently corresponds to the player fight ranks of 0 - 30.

Only 8 ships in the game (of 8000some) had 30 skill. Argon One and a few story actors.
Pilot skill of military ships is typically in the 20-25 range, Xenon and Khaak high 20s, Pirates all over the place, traders pretty low... it works nicely.

Evasion boni from ship class and speed would also figure into the negative range.
Even to the point where a huge ship might get a permanent +30 to it's evasion base so an "unskilled" M2 always gets hit for 30-100 % of damage.

from my point of view there are two ways to combine that:

a) combine the ship-stats-modifiers of both victim and attacker, then weigh the skills against each other
b) calculate both ships completely and weigh ships
I like my latest design (the thac0 spin-off) best but one thing keeps eluding me.

It's the hit percentage when firing at a bigger ship. When Flak has about 80% hits, I can't give it a high bonus without increasing it's total damage.
Guess there's no way around precomputing a 3x3 damage matrix.
Small laser vs small ship, small laser vs medium...

At runtime it makes no difference if I grab "the" array of damage values or one out of 3 - depending on the target class.

I think it's perfectly logical if attacker skill is directly factored into the damage.
More shots will hit. Simple.
Attacker skill would not affect target evasion at all.
Once the shots are in the air, it all depends on the defender. Can it evade or not?
So mixing attacker skill and target evasion would be illogical.
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 » Sat, 9. May 09, 20:16

of course -21 - just transported it to the other side of equation
damage <0 means random < 21 !!

you just mistunderstood me, i think

so basically we have a random distro 0-100 and do a linear transformation based on the skills etc on that.

Guess there's no way around precomputing a 3x3 damage matrix.
Small laser vs small ship, small laser vs medium...
my point exactly - but this is a slim system as you pointed out

from a mathematical standpoint there is no difference between a) and b) :
throw all facts on the table, do a sensible summary and let the dice decide

so b) it :lol:
Redest du noch - oder denkst du schon ?

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

Post by Gazz » Sat, 9. May 09, 22:27

wyvern11 wrote:so basically we have a random distro 0-100 and do a linear transformation based on the skills etc on that.
I'd have a -21 to 100 distribution instead of a 0 to 100 distribution.
But I guess it depends on how you see it. =P
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 » Sat, 9. May 09, 23:39

Code: Select all

...
63 ; 5507
64 ; 5436
65 ; 5266
66 ; 5549
67 ; 5420
68 ; 5326
69 ; 5540
70 ; 5344
71 ; 5435
72 ; 5604
73 ; 5377
74 ; 5481
75 ; 5405
76 ; 5347
77 ; 5444
78 ; 5468
79 ; 5364
80 ; 5396
81 ; 5471
82 ; 5469
83 ; 5356
84 ; 5481
85 ; 5480
86 ; 5428
87 ; 5257
88 ; 5367
89 ; 5332
90 ; 5435
91 ; 5388
92 ; 5391
93 ; 5501
94 ; 5447
95 ; 5321
96 ; 5454
97 ; 5478
98 ; 5440
99 ; 5357
100 ; 5357
looks quite uniform to me... [/code]
Redest du noch - oder denkst du schon ?

User avatar
s9ilent
Posts: 2011
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent » Sun, 10. May 09, 04:43

I thought I might just chip in my 2c's.



Firstly, in reply to the above threads:
From what I think your all saying (I only skimmed back about 3 pages) the general idea right now seems to be, some sort of function that uses evasion skill of the defender, and the attack skill of the attacker, and the size of the defender (and then the manoeuvrability?).

Also, I think that missiles should play a much more important role. In my mod that I was making, I was continually massing light fighters with poor weapons and shields, versus heavy fighters (with rear turrets). At a 60 m5's vs 20 m3's, the m5's would consistently win when no missiles where involved. As soon as I introduced missiles to the heavy fighters, the battle favoured the m3's very quickly. Whilst this was on my mod with significantly different stats, it could easily be reproduced in a vanilla environment.




I think this is a good starting point, but I think that the model should be expanded considerably. I like to think that the ideal situation is when OOS reflects IS combat so here are some thoughts:

In fighter vs fighter
  • When a fighter is attacked, it has the choice to continue to attacking or to fly evasive (and stop attacking)
  • In dog fights, the general trend is to fly behind someone and start blasting, the presence of a turret can dissuade such attacks, adding an offensive defence, to the turret ship.
  • Laser speed (i.e. Speed of the projectile) increases the chance of hitting, and the effective combat range
  • Distance has an effect in hit range
  • Most fighters react (i.e. fly evasion) aftering being hit. Meaning that the first shot in a salvo has a statistically higher hit rate, conditional on the targeted fighter starting in a non-evasive state.
  • It is possible to engage in attacks of varying intensity (i.e. It is possible to transfer between attack<->evasion, although I don't know if extremes should get bonuses or penalties (i.e. suppose there was 10 allocable units, if you ran at 10-0, should you get bonuses like 10->12, or penalties 10->8, i.e. is is more costly or is it cheaper to move towards the extremes)[/list

    For fighters vs big ships,
    Once again, turrets are the main defensive hindrance. I don't think that there should be any bonuses to the big ship, and that the fighters hit rate should be near 100 (or 100 to make it computationally easier)

    So what I'm suggesting is a much more advance model (that will probably eat my very underpowered cpu :(). The model will have several phases.

    Phase 1. What mode? (Offensive, Defensive : /100)
    This factors in the pilots aggression, against 'defensive incentives' (i.e. things that are trying to kill it) namely:
    Am I under attack?
    Is my target attacking me? (What's its forward attack capabilities)
    What threat is the target? (Turrets?)
    Ships current status?
    In bound missiles?

    e.g. defence = (30 - aggression) * {weighted factors} / Scalar * Rand

    The scalar makes it 0-100, and then rand adds a +/- % (bound to 0-100)


    Phase 2. Attack
    Missiles?
    Fire power (Aggression, Hit rate (bullet speed, target evasion -relative to this ships stats))




    How?
    To make it work relatively efficiently, it might be better to store values in advance, e.g. Firepower, offence, defence, evasion etc.


    Any way, there i s my 10x2x's






    @ wyvern11
    I'm fairly sure all the random numbers are made through a LCG, so they are quasi uniform.

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

Post by Gazz » Sun, 10. May 09, 11:00

s9ilent wrote:So what I'm suggesting is a much more advance model (that will probably eat my very underpowered cpu :(). The model will have several phases.
Even though I'm not going to do that, you have some valid points.

For fighters vs big ships,
Once again, turrets are the main defensive hindrance. I don't think that there should be any bonuses to the big ship, and that the fighters hit rate should be near 100 (or 100 to make it computationally easier)
MARS is actually quite effective at protecting it's ship while still destroying the enemy.
The ship ends a fight with higher shield strength.
So smart turrets can definitely serve a defensive purpose, lowering incoming damage.
In my early tests this difference was noticable although the goblins were far more effective in that regard.

And fighters spend most of their time evading / lining up attack runs instead of actually attacking the target, thereby wasting most of their firepower.
I'll have to test the average time spend not doing anything useful because with the current system, fighters have crazy OOS firepower that is in no way related to the IS value.
Last edited by Gazz on Sun, 10. May 09, 13:36, 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
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Sun, 10. May 09, 12:49

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 %

That's not nearly so bad any more as the potential 2.2 GJ damage output (30 sec) of an M3. =)
Surprisingly enough, the M6 actually did a great job there.

Due to energy constraints, the fighters weren't always firing all their guns, either, so the real numbers are a bit lower still.

Against a much larger ship (the Shrike is tiny) the fighters would break earlier as well.

If I assume that 2/3 of that (energy/break.off permitting...) is full damage against a real huge ship, an M3 would do a max of 220k over 30 sec or 7.3k dps.
5 top equipped AI M3 would need 5-8 turns of 30 sec (3 - 4 min) to destroy an M7.
That's not counting missiles.
This is definitely on scale with what we can see IS.

Fighter vs Fighter damage would be even lower. (far more misses)
Maybe assign 3 combat rounds for a one on one fight?


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. =)
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, 11. May 09, 07:53

Firing time:
M4: 11 - 14 %
M3: 15 - 16 %
M6: 21 - 36 %

That's not nearly so bad any more as the potential 2.2 GJ damage output (30 sec) of an M3. =)
Surprisingly enough, the M6 actually did a great job there.
'cause their speed is lower, they stay much longer in firing range. they do not tend to do long detours before returning to firing positions. they are not distracted by patrols appearing ----> it fits into place

carrier firepower reduction is nice to have but I think it is easily left out for performance reason....

make it an option, like "enhanced OOS-combat" yes/no??
Redest du noch - oder denkst du schon ?

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

Post by Gazz » Mon, 11. May 09, 09:20

wyvern11 wrote:carrier firepower reduction is nice to have but I think it is easily left out for performance reason....

make it an option, like "enhanced OOS-combat" yes/no??
no. =P

This doesn't cost extra because it's done during the setup phase of a ship.

Is it fair? I think so. Most of the time at least.
Of course, this would affect big guns only. With medium/light lasers, a carrier doesn't have energy problems IS, either.

With the preemptive counterfire system in place, carriers might even be able to act like carriers.

They would not have to wait until they get hit by the enemy. At this point it is far too late. If a carrier is being targeted from afar, it would be trivial to flag it as "being attacked".
And if the carrier is being attacked, the fighters move out to defend it...
It would look like a wholly different AI even though it's only about 2-3 lines of script.

Firing time:
M4: 11 - 14 %
M3: 15 - 16 %
M6: 21 - 36 %
I'm thinking of assigning something like 30-40% to the M7. While their maneuvering is poopy, they do all the damage on the initial charge. That would mean a high firing %.
However, with their lower speed they have no problem running out of energy long before they reach the target, so...
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, 11. May 09, 11:15

OK, deal
Is it fair? I think so. Most of the time at least.
Of course, this would affect big guns only. With medium/light lasers, a carrier doesn't have energy problems IS, either.
no one in his right mind will use a carrier in "big gun situation" anyway, if oos-combat should have been redesigned ....

M7 rules sound fair to me too


will be doing a shot at the evade situation once i get enough time on my hands ...
Redest du noch - oder denkst du schon ?

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

Post by Gazz » Mon, 11. May 09, 12:04

I've actually started the writing but it will be quite a while until anything works.

All the setup, initialisation, and auto-update procedures must be done first so there are no lost scripts or data arrays that will never update to the "current" version.
Be a bit til I get to the fun parts. =P
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, 11. May 09, 13:05

deal me out some work?

or got everything covered?

or does no alien code fit into your update environment?

aliens only allowed to test? :lol:
Redest du noch - oder denkst du schon ?

Post Reply

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