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

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: 1230
Joined: Wed, 6. Nov 02, 21: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: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

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: 1230
Joined: Wed, 6. Nov 02, 21: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: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

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

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

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

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: 1230
Joined: Wed, 6. Nov 02, 21: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?

Post Reply

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