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 » Fri, 8. May 09, 16:47

wyvern11 wrote:we know that victim skill should play some role (like attacker skill somewhat like 0-10%, maybe a bit better - "the force is stron in this one"-like)
Good point.
Evasion skill should matter more for smaller ships?

target size does play a role, but do we need it full blown or is ist sufficient to know
- fighter size
- corvette/hauler size
- frigate size or larger
There are more classes, of course, but these seem to be the most likely for being useful for our purposes:
  • huge ship (M1, TL, M7...)
  • Big ship (M6, M8)
  • little ship
    • fighter
    • fighter drone (all 3)
    • freighter (TS + TP)
how does speed affect "evade"? does it help do be fast on the straights not to be grilled? what classifications do exist ? does one use sqrt(speed) like gazz said?
IS it means that ships strafe more. AI ships do strafe - just not intentionally like the player. They drift which basically has the same effect.
The faster a ship is, the longer it takes for the drift to decay or rather, the higher is the scale of the drift vector.

sqrt(speed) probably won't be useful here.
I was talking about bullet speed and when you have a range from 300 to 7000 m/s, any linear scale is pointless.

Ship speeds are far closer together so maybe something simpler will do.
Or something based on the average speed of it's object class.
That will be even closer together.

nimbleness seems easy to classify
the most nimble M6 turns 24 and almost every fighter turns faster than 26 - looks like two classes. this will maybe outbalance some M4s and most M5s, but they are not decisive anyway. maybe add a class for turn rates below 2 instead (M1, M2 and TL's)
Turn rates are unknown to scripts. Only top speed is usable.
(Object size at a small one-time cost of CPU time)
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, 8. May 09, 16:51

What's the highest turn right on a fighter? If it's low enough, we could probably just make turn rate the percentile chance the ship will evade - 2%-ish for huge ships (I don't know about you, but I've never had any trouble hitting capital ships, and I doubt the AI does, either), around 25% for corvettes, and more for fighters. Speed and turning rate generally go hand-in-hand too. Maybe average[sqrt(speed),turning.rate]?
I already have a library for that. Calling another script just means a lot more organisational overhead than one line.
My point was you don't need a library for it - you could use a single line at run-time (with size precalculated and stored as a local variable) or three lines to calculate it at runtime, though that's probably not a very efficient idea.



I still think amount of damage done should be based on chance to hit - since these are thirty second turns, the chance that no hits are scored should be nearly zero, so some damage would get done. This isn't really a problem in NPC-NPC combat - over the long run it'll still work out correctly - but for Player-involved combat I'd want it to be slightly more realistic, even if it costs some extra overhead.

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

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

nimbleness look and feel is like (seen fromt the front guns of a tiger)

- very easy to hit caps and big ships (estimated miss rate < 5%)
- still easy to hit M3 (estimated miss rate < 20%)
- more difficult to hit M4 and M5 (estimated miss rate about 70%)

should feel the same oos too

@ mutantdwarf - see no necessity either to get a scale model size calculation - just leads to discussions : my tiger always attacks heads on - slim silhouette. your phoenix is broadsided - broad silhouette

@gazz a colleague of mine is a sailor by hobby - he told, that sailing craft always have right of way on sea - now try to argue right of way with the "nimitz" - nearly no evade on a huge ship

concerning speed: compare 300-7000 to 30-600 (not counting starburst etc.) - same factor ?
Redest du noch - oder denkst du schon ?

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

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

MutantDwarf wrote:My point was you don't need a library for it - you could use a single line at run-time (with size precalculated and stored as a local variable) or three lines to calculate it at runtime, though that's probably not a very efficient idea.
It's what the library does (or prepares).
My whole point was: ship size in m is available but at a small cost during the setup phase of a ship. End of point.
It's far too early to tell me what variable to write where and when in the script... because there is no script, yet.

@ mutantdwarf - see no necessity either to get a scale model size calculation - just leads to discussions : my tiger always attacks heads on - slim silhouette. your phoenix is broadsided - broad silhouette
"size" as scripts use it tells nothing about a ship's target profile.
It's the radius of an object's bounding sphere.
See here.

The question is whether this actually makes any difference versus using the object class like fighter or huge ship.

@gazz a colleague of mine is a sailor by hobby - he told, that sailing craft always have right of way on sea - now try to argue right of way with the "nimitz" - nearly no evade on a huge ship
There are nautic laws and there is basic self preservation... =)

concerning speed: compare 300-7000 to 30-600 (not counting starburst etc.) - same factor ?
Basically, yes.
However, I was thinking about something like
huge ship = heavy lasers = 40 - 120 m/s
big ship = medium lasers = 92- 175 (Springblossom 360...wtf?)
small ship = light lasers = 100 - 600 (freighters can be slower but they are easy targets so who cares)
(some hit probabilities for fighters on page 5)


So every laser class has a corresponding target class.
The speeds in that class don't vary nearly as much.
I think an avoidance bonus could be based on that alone - maybe a different one for the 3 target classes?

A laser shooting at a bigger class would practically always hit and a laser shooting a smaller class practically always miss.
Something simple like hit % * 3 if shooting at a bigger target, 1/3 if shooting at a smaller.

PPC trying to hit an M5 would be 1/3 * 1/3 or 1/9.
Last edited by Gazz on Fri, 8. May 09, 19:44, edited 2 times 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.

pelador
Posts: 1399
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by pelador » Fri, 8. May 09, 18:20

Minor point.

May need to consider mines as seperate or ignore hidden objects? As in relation to the use of mines if pre-emptive strikes are made OOS at range it may simply remove them from the game OOS rather than them having any impact at all. But then again don't want to remove possibilities of counter-attacking mines either.

My point in short is: mines to remain usefull OOS.

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

Post by Gazz » Fri, 8. May 09, 19:01

pelador wrote:May need to consider mines as seperate or ignore hidden objects? As in relation to the use of mines if pre-emptive strikes are made OOS at range it may simply remove them from the game OOS rather than them having any impact at all. But then again don't want to remove possibilities of counter-attacking mines either.

My point in short is: mines to remain usefull OOS.
By Reunion rules, mines are allowed to be detected at 4000m. (not sure about TC)
Their maximum blast range is 1620m. (= 0 of 75000 damage)
They trigger at 700-800m.

Mines are a very special problem because against fighters they are either the most destructive weapon there is... or completely useless.

In vanilla X3 mines are no targets. Actually, a fighter can not possibly attack a mine. If it it is ordered to it stops dead because it's follow instruction (to get there) permanently freezes.
MARS drones are the only ships in TC that can directly attack mines. (not counting turrets - which can)


So even if fighters somehow detect mines - without massive changes to their fight scripts they can neither fly around them nor attack them from beyond the blast range.

I just don't know what mines have to do with preemptive counterfire.
Mines do not pick targets and flyto/attack ships.
They just blow up.
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: 1399
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by pelador » Sat, 9. May 09, 03:05

Sure.

My point was more an issue of ships attacking mines at distance with mines not having a valid counterattack until they get within the detection range.

But if fighters cant even recognise them anyhow and turrets etc simply dispose of them. Its pretty black and white I would think and can appreciate if your hands are tied in some areas.

The pre-emptive model means that weapons could treat the mine (a ship target) in advance of getting into proximity to the mine. Thus a danger of an OOS model simply rendering them obselete if not considered. So I was merely hoping that the model you are investigating could in some way cater for them?

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

Post by Gazz » Sat, 9. May 09, 07:26

If you can tell me what script a mine uses to attack a fighter, it can be done.

Until you do that, it's not happening.
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, 9. May 09, 09:13

So far I'm thinking of something terribly simple like
$Rand = random number from 75 to 125
$Damage = ( $Damage * $Rand ) / 100
this means some kinda hit is always scored. let me just give an option analog to yours:

we might use the object-class-modifier value to scale $Rand:

say the modi for big gun hitting fighter is like 0,05 (I use a small value that it becomes more obvious)

$Rand = modi * $Rand = random number from 4 to 6

this gives fighters a chance to survive a salvo of artillery

@gazz concerning size it was clear to me that there would be no lenght/width/height
but it is still not better to approx a stick of given length by a sphere of same diameter than using object class - we should settle for ob-class

and laser classes corresponding to these, that is
Redest du noch - oder denkst du schon ?

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

Post by Gazz » Sat, 9. May 09, 10:00

wyvern11 wrote:$Rand = random number from 75 to 125
$Damage = ( $Damage * $Rand ) / 100

this means some kinda hit is always scored. let me just give an option analog to yours:
Yes, there will always be some hit. There has to be.
50 fighter drones will not be able to keep an M2 busy forever.

I was basing this on the assumption, that Light.Laser.DPS of the attacker already was the average DPS that would hit the average fighter.

8 HEPT (75000 DPS in theory) on a high-skill ship might create a Light.Laser.DPS of 40000.
This is then modified (somehow) by the avoidance bonus of the defender.

Shooting these Light Lasers at a 500m/s M5 might result in a DPS of 5000 and for a slow Falcon it might be 40000.
If shooting Light Lasers at a Medium Target, you'd get a plain damage bonus again so the same Light.Laser.Battery might do 60000.

This way I'm working with one number only. The adjusted damage.
Just have to make sure the boni are capped somehow so IRE shooting at an M2 don't get a 300 % damage bonus or PRG/Flak get stronger than "real" medium lasers. =)

Especially Fighter vs Fighter combat would be pretty brutal resulting in near instant kills. 8 HEPT firing for 30 sec = 2.2 GJ on paper.
(Laser energy does not exist OOS...)

we might use the object-class-modifier value to scale $Rand:

say the modi for big gun hitting fighter is like 0,05 (I use a small value that it becomes more obvious)

$Rand = modi * $Rand = random number from 4 to 6

this gives fighters a chance to survive a salvo of artillery
We may be saying the same thing but I don't know what you're getting at. =)

I'm trying to get this down to one damage roll instead of separate to-hit and damage rolls.
Separate rolls are far easier to design, of course but the combined system would be half the workload at runtime.

@gazz concerning size it was clear to me that there would be no lenght/width/height
but it is still not better to approx a stick of given length by a sphere of same diameter than using object class - we should settle for ob-class

and laser classes corresponding to these, that is
I don't see any added value in using size, either.
Object class it is.
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, 9. May 09, 11:14

from your descriptions I gather that we really mean the same


attacking side :

one random to get overall damage modifier
this gets modified by laser-class-to-object-class-modifier (and attacker skill)

what if all weapons classes attack same target ?

one roll of the dice, three different per class outcomes to be summed up, i think



evade :

since size has already been dealt with on attacker side, only skill, speed and some classification of nimbleness left to combine somehow
Redest du noch - oder denkst du schon ?

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

Post by Gazz » Sat, 9. May 09, 12:12

The more I think about it, the less Evade directly fits into the damage calculations.
It messes things up.

However... it could still be one roll over all. Just a different kind of resolution.

Let's say Light.Laser.Battery has 30000 DPS for a generic fighter target. (already modified for bullet speed and attacker skill)

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.

Of course, the 21 skill can be modified, added, mixed with speed and whatnot...
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 » Sat, 9. May 09, 12:51

There are more classes, of course, but these seem to be the most likely for being useful for our purposes:

* huge ship (M1, TL, M7...)
* Big ship (M6, M8 )
* little ship
o fighter
o fighter drone (all 3)
o freighter (TS + TP)
Why should freighter (TS + TP) be class little ship?
There are more classes, of course, but these seem to be the most likely for being useful for our purposes:
Good point.
Evasion skill should matter more for smaller ships?
How about this?
100%-((100%-speed*10%)*(100%-size%)) = Evasion

Maybe not linear?

I suggest to calculate your tables at script start form tbullets, tlasers, tshields and/or tships.
This way it will be compatible with other mods.
Last edited by Dumminion on Sat, 9. May 09, 13:54, edited 1 time in total.

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

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

Dumminion wrote:Why should freighter (TS + TP) be class little ship?
Because they are.

Given their maneuverability, they could be treated as medium ship, though.

How about this?
100%-((100%-speed*10%) * (100%-size))
This means... what?
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: 1399
Joined: Wed, 6. Nov 02, 20:31
x3tc

Post by pelador » Sat, 9. May 09, 15:57

Gazz wrote:If you can tell me what script a mine uses to attack a fighter, it can be done.

Until you do that, it's not happening.
Well my perspective is that mines behaviour could stay as is and that can be accomodated into the model of how the ships behave OOS? This is because I think mines do their function pretty much as intended, its the ships in responce to them that seem to be the problem?

Can you explain further?

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

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: 1399
Joined: Wed, 6. Nov 02, 20: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: 1703
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: 13244
Joined: Fri, 13. Jan 06, 16:39
x4

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: 1703
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 ?

Post Reply

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