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 » Wed, 29. Apr 09, 21:06

ezra-r wrote:Should/Could it be made much slower to allow player reaction in many cases too?
This sounds more like a case for the (Reunion) Navigation Override 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.

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

Post by wyvern11 » Thu, 30. Apr 09, 07:27

I doubt it could be made slower. Given the rate of oos-events I found out (see my last post), it would be likely, that over playing time a buildup of unresolved oos-battles (NPC-NPC and Player-NPC) would occur.

Maybe I can find some solid numbers as to how long a given battle has taken (capital ship battles terminate soon, because of the massive amount of damage done)
Redest du noch - oder denkst du schon ?

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

Post by Gazz » Fri, 1. May 09, 13:56

Well, your armageddon scenario might be a problem but at the same time - proves that it isn't. =)

The fact that you got the count at all means that X3 did manage to execute those 65 library calls (a.fight.script.fire) per second while running the rest of the game.

The OOS "tabletop" game I am thinking about should be roughly the same number of lines.
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, 1. May 09, 20:58

glad I could make you happy on may day. actually i was quite impressed about the possible parallelity (given the 14000 odd scripts running elsewhere)

my doubts were expressed about slowing down the battles to allow player influence (the buildup occuring due to waitstates, not to lagging). i'm quite sure, that there exists a slim and effective way to genialize oos-combat that it better reflects combatant strength.

(else i wouldn't be here ;-)
Redest du noch - oder denkst du schon ?

Snakeegg
Posts: 282
Joined: Sat, 27. Sep 08, 04:51
x3tc

Post by Snakeegg » Sun, 3. May 09, 19:58

At first, excuse my bad english (maybe I haven`t read this thread always correctly)!

I have an idea and maybe it`s usefull (I have no idea of scripting),if practicable.
How is it about divide larger ships in several parts (possibly orientated on the number of turrets), so that the ship only is killed, if all "parts" of it are killed. The effect is , that those horrible one-hit-wonders are very less possible. Also possible, that these "parts"(turrets) fight like a single ship - 1 hit/round.

Gruß (greetings) Snakeegg!

P.s.: @Gazz: Falls mein englisch zu unverständlich war, könnt ich`s nochmal auf deutsch versuchen.
Sorgfältig ausgesuchte Scripts erhöhen den Spielspass !

orion84
Posts: 162
Joined: Thu, 30. Apr 09, 16:14
x4

Post by orion84 » Tue, 5. May 09, 05:07

Good day Gazz, quite a quest you've got going. I'd just like to add my 2 cents. You can use all or parts of it, i don't really care, i just hope it sheds a little light. Or don't use it at all. Hahaha.

Using a scenario to make tweaks and find potential exploits will help. For me and some other players, OOS is something that gives a little back to the poor AI, since they will lose almost all the time IS. I don't want whatever comes out of this to exploit the AI further making it too easy.

So the constraints:

1. KISS - keep it simple and stupid (and economical)
2. to try and replicate IS combat

Simple Scenario: You're looking at your weed megaplex in Split Fire, you've got 2 Boreas on sector defense, positioned on the north and east gate, named alpha and bravo respectively. They're camped out on the gates with defend position. You've got another Boreas near the center of the sector named Stupidhead with command: attack all.

Then a number of blastclaw pirates go through the south gate. First its a wing of 4, but more keep coming. By this point, Stupidhead throttles its engines to engage the threat, with alpha and bravo sitting nicely by their gates. As Stupidhead closes the distance, you soon realize that 30 blastclaws have come through the gate, and are beelining towards stupidhead.. the nutter. Enter combat.

Combat
*I've been thinking about it over and over and maybe it would be a better idea (following KISS principle) to go ahead and let all turrents fire. why? In the above scenario, at one point during combat, ALL turrets will eventually be firing at the swarm of M3's.

To simplify damage done in accordance to laser category, without having to code too much instructions for range/projectile speed, and to deal with large and variable sized ships (Pheonix in mind), damage is dealt over an area circumferential to the ship. How and why?

In the above scenario, no matter what the size of the ship, the icon that represents it is a constant. And more often than not, a M2 with gauss cannons will not fire on the target until it the icons overlap each other. Having a pheonix and boreas in the same room shouldn't matter, all M2 classes have their own range. This can also reflect actual IS situations as pilots in fighters won't engage their weapons until in firing range. So a table can be made. Grouped by ship size

*rough but can be adjusted*
M1 = range of 10km to account for launching fighter escorts (carriers should play a more AWACS role)
M2 = 6-7 km radius
M3,M4,M5 = 2 km
M6,M7 = 4 km
-leaving M7M/M8 out because this is another thought that needs tackling as well.

This table will form the ceiling for damage rolls that will be done in the 5 second combat roll. Using this range can negate the need for laser speed/range/etc because realistically, once you're within range of a destroyer's turrets, and you're in an M3, you'll be strafing to get in firing range. This table will be the called the combat area of the ship. Ships without targets in this range effectively cannot enter combat for that 5 second round. This should give larger ships the advantage to hit targets as they close in.

Back to the scenario: "fortunately for Stupidhead whose outiftted for OOS defense (PPC all around), the pirates are coming in a steady stream, with 1 km or 2 between every wing of 4-7. However, the range of his PPC does not play into the ensuing combat."

In a regular OOS, the boreas might win with barely a scratch on the paint, but in IS the captain might do a little more than sweat.
-hence-
The range table should allow larger ships to use the larger weapons to an obvious advantage.

ok, now lasers. the goal i had in mind was to let weapons do what they're supposed to, and bring they're strengths and weaknesses to the OOS table. Keeping in mind range tables as MAX range for a ship that can mount a laser in a turret. A laser can simply subtract from this value to provide semi-realistic weapon usage (e.g. M2 outfitted with PBE as compared to PPC) I like the idea of classifying lasers as either light or heavy. perhaps throw in a medium for the M6,M7 weapons.

To balance combat, I believe in keeping the current system and let ALL LASERS HIT ANYWAY. Let me explain... A laser can hit many targets, in OOS this number can be restricted to size, AND how many instances of damage_to_be_dealt are rolled per combat round.

PPC are slow but huge damage dealers meant for cap ships. However a player would never commit a sole M2 to fight 3 M2's.. So while PPC accuracy will hit their targets, they will be limited to how many targets they will actually hit. Suppose XL weapons or heavy weapons are only given a number to decide how many targets the salvo from these weapons will hit. Lets say that its only 2, it might be able to bring a little realism. And in a 5 second round, it can only be allowed to fire 2-3 times.
So damage calculation during a round can be summed up as damage to be dealt.

back to the scenario: "with stupidhead kited out with PPC, he makes short work of the first ship in range, making you think twice if it ever existed.. the remaining 3 in the wing are able to deal their damage -> slight shield drop in stupidhead"

Now although its unreal to give each PPC in the universe 2 targets. But with the combat area, the number can be applied to the range of the ship, targets within that range, with all PPC firing, and only being able to hit 2 targets in that round of combat, only being able to fire 2-3 times per round.
*what it would look like, guesstimates*
if, 1 PPC = 10k shield/hull dmg
10 PPC = 100k damage
then, 2 salvos per round, 2 targets per round
200k worth of damage to be distributed evenly among 2 targets at a ship range of 7 km.. rendering the incoming fighters into dust before they can enter combat
*the number can be adjusted or played with for better accuracy*
*threat acquisition to be discussed later*

Result: Go forward PPC's when faced with a cap ship, as the loadout only hits 2. So against 30 blastclaws? might take some many rounds.

So a boreas being attacked by 4 blastclaw is an obvious win in this combat system, because in 10 seconds, effectively the threat is destroyed.

Where's the balance? To keep the player wanting to use anti-fighter weapons for fighters. The number of salvos per round and the number of targets that can be hit increase with the decrease or "lighter" class of weapon. Suppose FAA/CFA were outfitted. To account for speed/range lighter weapons such as these can hit twice(?) as many targets, or triple, or quadruple (whatever adds balance), while reducing the range that the weapon can fire. (PPC in front, flak on the side -> PPC will take out the first 2 M3's in one round, more M3 close distance to firing range, PPC take out two more, and flak start dealing damage while M2 starts receiving it... effectively 2 rounds of combat)

Result? While mounting ppc on a M2 on sector defense might kill 2 fighters every round, the overkill that these weapons do to fighters might be thought over, considering mounting flak instead can do more appropriate (albeit smaller) damage to more targets.

in effect, this new OOS combat has 4 rules.
1. combat area (range of ship/as the ceiling, or base, whichever you fancy)
2. Weapon range/damage on ship per round
3. all weapons fire and hit 100%
4. Combat is entered/left using rule 1 ship range.

Now i thought up a little more to tweak target acquisition/threat assessment to give a little more functionality to the player and his assets but i want to see what you think first.

I obviously don't know how to code, but i do have a rough logic going. Again 2 objectives is to provide a decent balance and to keep it simple, without having the computer go through too many instructions to be an effective OOS combat system.

Good luck to me, and hope you can keep up with the logic. Now if you feel that I'm not posting any help, keep in mind my lack of scripting knowledge prevents me to understanding you any more than your desire to improve OOS combat. So, if nothing here helps you then thats ok, but what you can do is use the idea to further your own development of ideas for this script.

Cheers!
***modified***

orion84
Posts: 162
Joined: Thu, 30. Apr 09, 16:14
x4

Post by orion84 » Tue, 5. May 09, 07:48

Combat Revisited

In retrospect, i was trying to aim for a table top combat play like Magic The Gathering. Combat was resolved in 3 phases, ending one round or turn, with it being as simple as possible. for those unfamiliar:

1st phase: declaring attackers/defenders
2nd phase: application of specials/instances/special conditions
3rd phase: conclusion/resolution

In theory, scripts required to do all of that can be summed into one round of OOS combat. With it repeating until either party in combat is destroyed/fled.

It might be simpler to keep damage and damage affecting factors to a minimum, focused on player assets, to minimize CPU load.

I don't know how mounting different weapons on a ship and then calculating damage will affect CPU load if any additional load will be introduced.

What i didn't mention earlier in regards to this idea was target acquisition/threat assessment.

Threat Assessment/Target Acquisition

To reinforce some of the ideas mentioned in my earlier post in regards to combat, a simple measure on the part of the AI pilot can be used to assess targets and choose its fire.

Since a table will exist to categorize ship classes, the same table can be used as threat assessment. Since a PPC/GC and other XL weapons can only hit 2 targets in a given round, the player ship can do a check to see what the biggest threat is and fire on that instead.

--> i'm actually borrowing this idea from Azz's PilotAI for X3:R which improved OOS combat to a more sensible level.
http://forum.egosoft.com/viewtopic.php?t=182897

what i'm taking is just threat assessment. The leader of a wing, regardless of composition, or lone ships, can make assessments of the targets within its scanner range (which can be toggled by the current command its been issued, e.g. attack all, blah blah) Using this can enhance the combat system without adding too much load: the bigger the ship, the higher the threat. Total threat is a concept that could be used but i don't think its too important right now. Supposing the enemy formation had a M7 in front of 8 M3's, and you had a lone M2. Once enemies enter scanner range, the M2 can immediately identify the M7 as the larger threat, and will use the PPC's it has to focus its fire on that target. Assuming 2 targets per salvo for the PPC's, using the threat assessment the pilot will choose to allocate damage from the PPC's all towards the M7, since it is the larger threat of the entire flotilla. If the M2 is equipped with different weapons, the pilot will still aim all its armament at the M7. This will apply each round until the target is removed from combat one way or another. Once removed and if the M2 is still standing, it will use its remaining armament to go down the ladder of threats and equally distribute the damage following weapon rules (PPCs hit 2 fighters per round).

At least this will prevent the M2 from chasing an M4 with a bigger ship in the combat area.

*Wingmen/escorts already follow their leaders in dealing with targets so there's no need to run any special codes for them.*

In terms of scaling this skirmish to a larger one, and i'm assuming the average player doesn't just dump 10 M2's in a sector with commands attack all (but even then the threat assessment will all lead to the same conclusion) i don't think it might put too much strain on the clocks.
***modified***

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

Post by wyvern11 » Tue, 5. May 09, 10:49

@gazz
The OOS "tabletop" game I am thinking about should be roughly the same number of lines.
lets hear what you're thinking about :wink:

concerning cpu-workload: one has to take into account the load generated by the regular "..... fire lasers on target ..." as well. internal logoc must at least do a weapon-array-loop, a random(5), a random(30), an erroneous ammo-check, an erroneous turret multiplication and some summation for shield and hull damage.

roughly the same calcs should be possible in a script without having much more workload to do (assuming script logic not to be much slower than inbuild logic)

@all : some summing up of arguments

oos how it should work
- should have a predefined matrix of weapon with set of parameters like damage(-class), range(-class), target-of-choice, possibly effectivity modifier per ship class, possibly bullet speed(-class).
- for balancing reasons this matrix might be made up from scratch
- for workload reasons matrix should have as few parameters as possible
- return fire should probably be used, if feasible.
- if so return fire should probably have a target-count limit / hit rate below 1 that large fighter groups get a chance for balancing
- fire control should probably assign targets as most dangerous first

feel free to add details, discuss, oppose or affirm summary
Redest du noch - oder denkst du schon ?

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

Post by MutantDwarf » Tue, 5. May 09, 11:20

I've come up with what I think is a pretty good way to determine how many shots hit in Out of Sector battles. It's very quick to calculate at runtime and should be relatively accurate to boot.

Below the damage calculation bit I included some thoughts on target selection.

Damage Calculation in OOS Combat
This is inspired by the GURPS pen-and-paper role playing game.

Each laser will have a precomputed Accuracy Modifier (Acc)
Each laser will have a precomputed Rate of Fire Modifier (RoF)
Each ship will have a precomputed Size Modifier (SM)
Each ship will also have a precomputed Handling and Speed Modifier (Hnd)

Acc should be computed based on bullet speed and laser range
SM should be computed based on ship size
Hnd should depend almost entirely on ship maximum speed


The Primary Equation
%Hits = (3d6+Acc+RoF+SM-Hnd-11)*100/(RoF*2)

The only thing that needs to be calculated at runtime are three random variables. 3d6 means '3 random numbers with a uniform distribution between 1 and 6' or, put more simply, '3 six sided dice'. You use 3d6 in order to ensure a normal distribution. In player-involved battles, I would use this method – the randomness helps make it more accurate. Alternatively, you can drop the randomness entirely and make the calculation:

%Hits = (Acc+RoF+SM-Hnd)*100/(RoF*2)

The second calculation results in slightly more damage overall (average of 3d6 is 10.5, not 11), but the simplicity helps its case. It also, however, makes it impossible for some ships to ever hit their targets when in reality they’d have some small chance of hitting, while some other ships will always be hit and damage quite a lot when they’d normally have some small chance of evading some of the damage.

The maximum %Hits is 100 and the minimum is 0

The amount of damage done is DPS*%Hits*RoundLength


I would not include Area of Effect damage - it's too difficult to deal with. Other special damage effects (PBGs, specifically) might need some special treatment, but I don't think it should be too hard to adapt - I don't have enough experience with X3TC to say how, as I haven't used those special weapons yet.


SM and Speed/Range Modifier
SM and the speed/range modifiers should follow this progression:

3: 1
5: 2
7: 3
10: 4
15: 5
20: 6
30: 7

That way, if a ship has a speed of 300 meters/second, it would have a Hnd of 13, while a Goner Aran with its ~10 meter/second drive will have a Hnd of 4. Meanwhile, an M5 with a size of 30 will have an SM of 7 while an M2 with a size of 2,000 will have an SM of 18. A laser with a range (adjusted for the ship it's installed in) of 3000 meters will have a range modifier based on a range of 3000/2 = 1500 meters, to get an estimation for average engagement range. That range modifier would be 17.

The Acc modifier for Bullet speed should also follow this table.


Rate of Fire Modifier
RoF should be based on the following table:

1-2: +0
3-5: +1
6-11: +2
12-24: +3
25-49: +4
50-99: +5
100-199: +6

And so on - each doubling increases RoF by one. RoF is based on the number of lasers in the turret as well as the RoF of the laser basetype - so a laser that has a nominal RoF of 200 that's put in a turret with seven other lasers of the same type will have an RoF based on a 1600 shot/second rate of fire. That 1600 shot/second rate of fire yields an RoF of +10.

A further note: Rate of Fire should be scaled based on the size of the ship's power generator. If it can't sustain a full RoF barrage, simply limit its RoF to the number of shots per round it can sustain. This change in RoF will then directly lead to lower amounts of damage done.


Example One – M5 Discoverer versus M3 Nova
Here's an example, with a 20 meter M5 with four IREs firing at a 30 meter M3 using ten second turns:

IRE Range = 1390 + 2/3 * 20 = 1403 m
(we add the 2/3 * 20 because bigger ships can have larger range)
IRE Bullet Speed = 1162 m/s
IRE Rate of Fire = 400 shots/m = 6 shots/s = 60 shots/turn
IRE Shield Damage = 220

M3 Nova Size = 30m
M3 Nova Speed = 190 m/s


Acc = 16 (Bullet Speed) - 15 (Range/2) = +1
RoF = +6 (240 shots/turn)
Hnd = +11
SM = +7

%Hits = (Acc+RoF+SM-Hnd)*100/(RoF*2)
%Hits = (1+6+7-11)*100/(6*2) = 25%

25% of all shots fired at the Nova will hit, meaning it will take: 220*240*0.25=13,200 shield damage


Example 2 – M2 Tyr versus M5 Discoverer
If this was a Terran M2 firing 6 PSPs at the 20m M5, it would be something like this:

PSP Range = 6420 + 2/3 * 2000 = 7753 m
PSP Bullet Speed = 321 m/s
PSP RoF = 6 shots/m = 0.1 shots/s = 1 shot/turn
PSP Shield Damage = Who cares? One hit and the M5 is fried

M5 Disco Size = 20m
M5 Disco Speed = 346 m/s

Acc = 13 (Speed) - 19 (Range) = -6
RoF = +2 (6 shots/turn)
Hnd = +13 (Speed)
SM = +6

%Hits = (-6+2+6-13)*100/4 = -1100/4 = -275%

There is no possibility that the M2 will hit the M5 with his PSPs.


Example 3 – M2 Tyr versus M2 Kha’ak Destroyer
On the other hand, if he was firing on a Kha'ak M2:

Kha'ak M2 Size = 2000
Kha'ak M2 Speed = 63

Hnd = +8
SM = +18

%Hits = (-6+2+18-8)*100/4 = 600/4 = 150%

All 100% of the fired shots impact the target.





Target Selection
For NPC battles, I'd also use Gazz's idea of returning fire to simplify target-selection and fighter suppression, with a limit on the number of times a ship can return fire in a round.

For player-involved battles, I'd like to explore a more intelligent target selection method, however - have each turret independently select targets and remove the return fire bit, because returning fire in that fashion will result in a higher perceived RoF than the ship is really capable of producing, especially if each turret is able to choose its own target.

I'm thinking a priority queue implementation for target selection might not be a bad idea. Have three separate queues - one for Huge Ships (M1, M2 types), one for Big Ships (M6, TM, maybe TL types), and one for Small Ships (Fighters). If you can, you want to focus all of your fire on the target that can do the most damage but has the lowest durability - and you want all of your turrets and ships capable of engaging that target to focus on it, too. The Priority setting in each Queue will be DPS/(Shield + Hull Strength) - the ship that can do the most damage for its hull strength will be at the top of its queue. Each laser will be optimized for Huge, Big, or Small Ships - this should be based on Acc, RoF, and damage per shot.

Once combat is joined, I would ignore range, so long as the current range to target is below a certain amount - say, ten or twenty kilometers. If the highest-priority target is more than ten kilometers away, then it can search for a lower-priority target of opportunity. If a target is destroyed, it is removed from the priority queue and the next ship/turret in the sequence will target the ship with the next-highest priority.

If a ship/turret is capable of destroying its current target in less than one full RoF barrage, it should be able to split its RoF between multiple ships – this way a Terran M2 kitted out with a full load of SSCs can blow away entire waves of M5 ships in its ten-second turn, and things like that.

It might be a good idea to ignore missiles in Out of Sector combat except for M7Ms and M8s – in those cases, I’d use a script very similar to the Missile Turret script here: http://forum.egosoft.com/viewtopic.php?t=245070

If you don’t wish to ignore missiles, a more complicated script for determining when to fire missiles and which missile to fire is probably required – and determining if that missile hits or is blasted away by missile defense is yet another thing to be worried about. The Missile Turret script is probably a good start.

This does bring to mind a solution to the ‘attack signal’ problem, however – since missiles hit instantly with a 100% success rate, have any ship that fires on another ship in a round also fire a very low damage missile at that target. This way SIGNAL_ATTACKED is thrown.

orion84
Posts: 162
Joined: Thu, 30. Apr 09, 16:14
x4

Post by orion84 » Tue, 5. May 09, 13:38

I used to play GURPS. haha. Anyway..

For reference for future posters, etc. I'll add this just in case anyone needs a background into OOS.
http://forum.egosoft.com/viewtopic.php?t=182101

I think missiles can be handled if ever there is a matrix for the kind of laser mounted on a turret. Take for instance the damage tables presented by MutantDwarf, particularly RoF. Since missiles will always hit in the current system, any new OOS system that implements a more efficient damage distribution based on weapon/laser stats can be used as a base for dealing with them. E.g. a higher RoF could introduce a percentage that the missile will have to roll against to score a hit.. damage follows. This can be adapted for swarm missiles as well as each warhead will have to roll against this modifier. In the end, its a bit respective to actual IS where a good fighter pilot with no turret can use smaller lasers to shoot missiles.

Using RoF: Higher RoF, higher chance of shooting a missile down, since current turret command of missile defense will ignore the current target and fire at an incoming missile if there is one.
wyvern11 wrote:oos how it should work
- should have a predefined matrix of weapon with set of parameters like damage(-class), range(-class), target-of-choice, possibly effectivity modifier per ship class, possibly bullet speed(-class).
- for balancing reasons this matrix might be made up from scratch
- for workload reasons matrix should have as few parameters as possible
- return fire should probably be used, if feasible.
- if so return fire should probably have a target-count limit / hit rate below 1 that large fighter groups get a chance for balancing
- fire control should probably assign targets as most dangerous first
I think what could also be considered in deciding how OOS should work is:

-System should allow flexibility for the player to decide what and how to deal with OOS battles.
Ideally, pesky situations of OOS stems from the circumstances player assets are put onto the "table" along with what commands said assets are given. And also i want to avoid heavy reliance on big ships for OOS, since in the current system a decent sized wing of M3's attacking targets of a big meat shield (M7) can stop anything (which for me solved my OOS problems). Losses are still expected but not as painful as a purchased/capped M2 :evil:

-the return fire would work great for non-combatants (ts,tp,tl,etc) being attacked, since it would give them a "fighting chance". However combat should be avoided anyway.

------

@wyvern11, gazz, or anyone with experience in streamlining thread/instruction execution

What would be more economical on a machine? With the "table-top" approach, a simple and economic way it can be reproduced could be:
1. Combatants "square-off" with calculations and rolls done based on pre-defined tables before actual combat to get the many values and parameters that will be used to derive damage received, e.g. damage to hull ratios, shield resistance, armament matrices, missile supply, blah blah. Kind of like a "i showed you mine, now show me yours". Since we seem to be leaning towards using current seconds to measure rounds with a respite between rounds. And then at the end of the round damage is effectively dealt.

2. Combatants' armaments, stats, etc produce micro-instructions that allow for things like first-strike (destroying a target before it had a chance to fire, M5 vs M2), affecting maneuverability and presenting evasion variables against weapon speed. Weapon speed against craft agility, etc etc. Generally would give OOS a more real-time, and coincidentally a more realistic approach.

3. Since table-top combat has been around, maybe we could shop around for a type of system in current use and just implement it to suit the current environment of the game? Cardgames? Warhammer? GURPS? D&D? Hahaha. Clues could be lying around somewhere in there.

Cheers.
***modified***

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

Post by wyvern11 » Tue, 5. May 09, 15:39

as far as i see (gazz did the research) a single line in the regular basic combat script computes the damage for guns

target should be to substitute this line with some code dealing less random damage.

@orion : I took part in the discussions in the thread you posted. Since then I have been able to get more info about oos with gazz's help

Unluckily, they belong to german forum :

http://forum.egosoft.com/viewtopic.php?t=232702

most info is around page 15-17 and some on the following side.

your scenario 1. ("square off") looks like it is favorite except maybe return fire should be added. movement, evasion etc will show too low an effect to affect the outcome

ship1_stats(,ship2_stats) ----(magic)----> hit probability 1 hits 2
ship1_stats(,ship2_stats) ----(magic)----> damage_value
--- roll dice ---
1 damages 2 with <damage_value>
Redest du noch - oder denkst du schon ?

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

Post by MutantDwarf » Tue, 5. May 09, 17:26

What scripts/commands currently control Out of Sector damage resolution? I swear someone posted something like that a while ago (Gazz?), but I can't find the post anymore. I want to see how difficult it would be to insert a new damage routine into it.

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

Post by wyvern11 » Tue, 5. May 09, 18:57

this info stems from gazz and this is the point where he entered damage logging script

!fight.attack.object.std.xml (elsewhere a pck)

Code: Select all

144   |||||||if ( $last.attack + $ret.nextatk ) <= $playing.time
145 @ ||||||||$victim = [THIS] -> call script 'a.fight.script.fire' :  victim=$victim  target of opportunity=null
146   *= [THIS] -> fire lasers on target $victim using turret null
147   ||||||||$last.attack = $playing.time
148   |||||||end
149   ||||||end
150   ||||||
the commented line deals the damage

a.fight.script.fire was inserted by gazz, logs the damage, and calls


= [THIS] -> fire lasers on target $victim using turret null

by itself
Redest du noch - oder denkst du schon ?

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

Post by Gazz » Tue, 5. May 09, 19:04

Wow. What a sudden outbreak of creativity!

First, let me say that the typical OOS combat round is around 30 sec.
I can prove that with quoting long boring lists of data but for now low lets just go with that... because I say so.
orion84 wrote:In the above scenario, no matter what the size of the ship, the icon that represents it is a constant. And more often than not, a M2 with gauss cannons will not fire on the target until it the icons overlap each other. Having a pheonix and boreas in the same room shouldn't matter, all M2 classes have their own range. This can also reflect actual IS situations as pilots in fighters won't engage their weapons until in firing range. So a table can be made. Grouped by ship size

*rough but can be adjusted*
M1 = range of 10km to account for launching fighter escorts (carriers should play a more AWACS role)
M2 = 6-7 km radius
M3,M4,M5 = 2 km
I don't think this is the way but based on that, I'd say that some changes to the fight scripts are necessary.

Right now (if I'm not mistaken) ships close in to within 3km, then open fire. IS as well as OOS.

This in turn means that with OOS movement, ships close a 6km gap within the first combat round.
Even if I'd double the OOS laser range on "capital" lasers, this would mean that an M2 could annihilate one approaching M3 before the whole wing is in M3 firing range.
Does this advantage really warrant extra coding and range calculations?
I think not.

What some have already suggested here is true multi target tracking capability for cap ships.
This is something I'd like to avoid at all costs.
It essentially means that "turret scripts" (in simplified form) do run OOS on all capital ships.

Hmmm.... however... I might manage to create the look of multi target tracking without any tracking at all.
Preemptive counterfire.
Instead of merely reacting to fighters firing at the M2, the attacking fighters register themselves with the M2 beforehand, let's say, when they decide to start the attack at a 10 km distance.
"Hi. My name is Argon Police Buster AM4YG-69. You killed my father. Prepare to die."

So... the M2's fight script does not need to find or track anything.
The attackers-to-be are already there - in a local array on the M2.
During the M2's turn it can now fire it's longer range weapons at one or several of these attackers before they get into firing range themselves.

This change could also make OOS combat in general a lot smarter at a negligible cost.
Since arrays are pointers, this local variable can be put on all members of the formation at no extra cost. (If the leader dies - so what?)
All of them could now "track" all of the attackers simulatenously if any member of the formation is attacked.
All without a single continuous "find ship" instruction.
Ship formations would actually fight as... formations. (cool, eh? =)

Since the array only exists once for a whole formation, necessary evils like garbage collection only need to run once for the whole formation and firing at targets of opportunity (if that proves useful) can be done by the formation leader... for all it's wingmen at once.
The workload does not scale exponentially - it probably scales less that linearry.

PPC are slow but huge damage dealers meant for cap ships. However a player would never commit a sole M2 to fight 3 M2's.. So while PPC accuracy will hit their targets, they will be limited to how many targets they will actually hit. Suppose XL weapons or heavy weapons are only given a number to decide how many targets the salvo from these weapons will hit. Lets say that its only 2, it might be able to bring a little realism. And in a 5 second round, it can only be allowed to fire 2-3 times.
So damage calculation during a round can be summed up as damage to be dealt.
I think this could be twisted into something useful. =)
I originally imagined "counterfire" only against fighters and only small lasers.
But what if an M2 would get a higher chance to hit a fighter with PPC by using a lot of PPC?
I know it works IS because I've seen MARS nail a TS or M5 at a 5km range. And not just once.

I'm not quite sure on the exact mechanics but something useful might grow from this.
In my first proposal of "3 laser classes" I already suggested that shooting at a smaller target class would work but with a low chance to hit. So if that would be increased by the number of lasers in that class...

orion84 wrote:Threat Assessment/Target Acquisition
To reinforce some of the ideas mentioned in my earlier post in regards to combat, a simple measure on the part of the AI pilot can be used to assess targets and choose its fire.
Again, something like this (and more) could be achieved with the preemptive counterfire.

Browsing an array with ships that definitely intend to attack is far more economic than constantly scanning everything around the ship and evaluating these ship's intentions.
And if my M2 (with M2 escorts) intends to attack something, it puts the whole enemy formation into it's own target array.
Then all the M2 in my formation can open up on the unsuspecting enemy convoy in the first round without having been attacked by something random first.

The more I think about it, the more I like this idea.

wyvern11 wrote:@all : some summing up of arguments

- should have a predefined matrix of weapon with set of parameters like damage(-class), range(-class), target-of-choice, possibly effectivity modifier per ship class, possibly bullet speed(-class).
I'm leaning towards largely ignoring laser range.
As rough as it sounds... but as I outlined before, laser range plays an insignificant role in OOS combat.

I'd limit it to one Laser.Range.of.Ship value.
If an M2 can use PPC, everything down to Ion Disruptors has 6600m range.
This one value is required so the ship knows how close to get to the enemy before switching to the "attack run" portion of the attack script.

MutantDwarf wrote:Damage Calculation in OOS Combat
This is inspired by the GURPS pen-and-paper role playing game.
I think this is far too detailed, requiring far too much attention to every single laser and target.
Try resolving this GURPS combat round with 100 players with each one having 5-70 lasers.

A further note: Rate of Fire should be scaled based on the size of the ship's power generator. If it can't sustain a full RoF barrage, simply limit its RoF to the number of shots per round it can sustain. This change in RoF will then directly lead to lower amounts of damage done.
This is something I might pick up in some form although it requires getting the energy/second into the game.
Right now, this value is not available to scripts.

3. Since table-top combat has been around, maybe we could shop around for a type of system in current use and just implement it to suit the current environment of the game? Cardgames? Warhammer? GURPS? D&D? Hahaha. Clues could be lying around somewhere in there.
Oh, I am trying to salvage what I can. Battletech is out. It's the micromanagement approach although basically it has rules for this kind of conflict.
I'm thinking more along the lines of the D&D THAC0.
One table to rule them all. One table to find them. One table to bring them all...

The most important thing is probably to abandon all hope of 100 % cloning IS combat, ye who hope to ever see this thing working.
30 some different lasers with different ROF, speed, range, effects, and whatnot - not gonna happen.

MutantDwarf wrote:What scripts/commands currently control Out of Sector damage resolution?
Use this.
Move / Rename / Delete the 2 similarly named !Scripts.pck and all ships will use my slightly altered scripts for OOS combat.

All creation of damage takes place in a.fight.script.fire.
Insert additional logging as desired or try your hand at a better system.

Either way, this shows you how it works and also creates an OOS combat log of all ships in your game.

MutantDwarf wrote:This does bring to mind a solution to the ‘attack signal’ problem, however – since missiles hit instantly with a 100% success rate, have any ship that fires on another ship in a round also fire a very low damage missile at that target. This way SIGNAL_ATTACKED is thrown.
It's not quite that simple.
While that would suffice to trigger the signal, ships do seem to somehow use the amount of damage done by different targets, combined with distance.

I often watch this with MARS goblins. They fly out and pinch an M6 in the nose, then scurry back behind their mothership.
If the drone gets too far ahead, the M6 switches back to another, closer attacker, which apparently offers a better combination of range and logged damage.
Also, small amounts of damage seem to "clear" faster, which supports the theory, that they must be logged somehow.

I haven't deliberatly tested that behaviour, though.
Last edited by Gazz on Tue, 5. May 09, 19:51, 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.

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

Post by MutantDwarf » Tue, 5. May 09, 19:50

I think this is far too detailed, requiring far too much attention to every single laser and target.
Try resolving this GURPS combat round with 100 players with each one having 5-70 lasers.
Actually, it doesn't. It only needs to be done once per target per laser type. You multiply the number of lasers that fire by that laser's RoF. It really shouldn't be any more costly to calculate than the current implementation. You don't even need to have it be done per turret grouping, though that's how I'd prefer it for player-involved battles.

Also: You can calculate 3d6 by generating a single random number between 1 and 216 and comparing it to distribution table (an array). This is simple, cuts down on calls somewhat, and could help in getting a decently accurate firefight going.

But yeah, I did just notice that you can't get Rate of Fire or Energy per Shot from the script commands. Sucks - but hopefully it could be read in from a config file or something like that. You might also be able to dynamically calculate them when you run the game - if you know damage per shot, can calculate the amount of damage that's done, and can see how much energy is left in the ship's energy bank, you could bash together a way to test this by spawning a ship in some far away corner of the player's current sector and have it fire at some other stationary large ship from, say, five meters away, then check how much damage is done and how much energy is consumed after one second.

I like the preemptive counterfire idea. Sounds spot-on.

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

Post by Gazz » Tue, 5. May 09, 19:54

MutantDwarf wrote:You might also be able to dynamically calculate them when you run the game - if you know damage per shot, can calculate the amount of damage that's done, and can see how much energy is left in the ship's energy bank, you could bash together a way to test this by spawning a ship in some far away corner of the player's current sector and have it fire at some other stationary large ship from, say, five meters away, then check how much damage is done and how much energy is consumed after one second.
No.
Been there, tried that, got the T-shirt.
Not gonna work.

MutantDwarf wrote:Actually, it doesn't. It only needs to be done once per target per laser type. You multiply the number of lasers that fire by that laser's RoF. It really shouldn't be any more costly to calculate than the current implementation. You don't even need to have it be done per turret grouping, though that's how I'd prefer it for player-involved battles.
Yes, it does. =P
Treating every ship and laser (type) individually is too far on the micromanaging side.

I suggested the 3 laser classes because there are 3 basic object classes for ships and lasers can be assigned to "belong to" one of these classes pretty well.
But yes, target speed could be factored into the THAC0 with minimal effort. =)

Also, a ship's "medium laser battery" could have a THAC0 based on the average of their bullet speeds, still allowing room for experimentation.

All of that would have to be precomputed in a setup phase, that only runs once.
Afterwards combat would (in spirit =) play out D&D style.
Without the cardboard dungeon master's screen.
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 » Tue, 5. May 09, 20:11

Yes, it does. =P
Treating every ship and laser (type) individually is too far on the micromanaging side.
How? You were already talking about modifying ship loadouts because they make little sense. Why not just limit them to three laser types (one Huge Gun, one Big Gun, and one Small Gun)? That way there would be little to no difference between what I suggested and what you're talking about.

EDIT: To clarify, I'm not talking about a drastic revision of the way OOS Combat works. I'm talking about a way to calculate that 'THAC0' that you're talking about. As you say, it would almost entirely be done beforehand - Acc, RoF, Hnd, all those things I mentioned are calculated before you engage the enemy - during combat you just add them together.

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

Post by wyvern11 » Tue, 5. May 09, 20:17

EDIT : man, you guys are really fast - while i was reminescing my post together - three more posts

I'm leaning towards largely ignoring laser range.
As rough as it sounds... but as I outlined before, laser range plays an insignificant role in OOS combat.

I'd limit it to one Laser.Range.of.Ship value.
If an M2 can use PPC, everything down to Ion Disruptors has 6600m range.
This one value is required so the ship knows how close to get to the enemy before switching to the "attack run" portion of the attack script.
no objections on that. I'd also scrap bullet speed and firing rate too, modelling speed into
the to-hit-probability and rate per time integration into DPnS, n element of N

on energy generator: ships can sustain high firing rates for longer than few salvos - either ignore generator or decrease hitpoints after say 5 salvos in a row in steps of 10% down to 30% min -

Thac0 is a good idea - it will not be possible to get a much easier approach
but one thing does probably not match from AD&D rules - I never got over the fact
that bth nimbleness and heavy armor lead to a low thac0

DSA (german based RPG) has a "defence" value to dice the hit against and an "armor"
which got subtracted from the hit points - suits better for cap ship against fighter

another system is ship2ship-combat from star-wars rpg. short description :

Xwing red 1, combat skill 8d6 attacks, damage 6d6 attacks ISD Avenger 7d6 evade, 8d6 hull&shield

red 1 dices 8d6 to hit, avenger 7d6 to evade, but since it is capship-class all dies are counted as max 3 of 6 possible ---> easy target, red 1 scores a direct hit

red 1 dices the damage 6d6 but since it attacks a capship ISD all damage dice are counted as max 3 of 6 possible against ---> beesting, red 1 does not penetrate.

if ISD perchance hit red 1 (against a handicap of 3), red 1 would have had a handicap of 3 on the resist ---> kablouie

This is simple and rather stupid, but was heck of a lot of fun to play ...

"Sir we lost our bridge deflector shield"
"All energy on frontal batteries ... "
Redest du noch - oder denkst du schon ?

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

Post by Gazz » Tue, 5. May 09, 20:22

MutantDwarf wrote:EDIT: To clarify, I'm not talking about a drastic revision of the way OOS Combat works. I'm talking about a way to calculate that 'THAC0' that you're talking about. As you say, it would almost entirely be done beforehand - Acc, RoF, Hnd, all those things I mentioned are calculated before you engage the enemy - during combat you just add them together.
Yes, of course.
However, I'm thinking of what the AI will do with it's current wild mix of weapons.

Improving the loadout of all AI ship's is another ambitious project which may or may not happen anytime soon.
However - dividing the AI ship's current crazy weapon mix into 3 laser types would gloss over nearly all of their silly loadout errors and make them semi-competent OOS fighters. =)

Of course the player could fine tune a little better - but within limits.

wyvern11 wrote:Thac0 is a good idea - it will not be possible to get a much easier approach
but one thing does probably not match from AD&D rules - I never got over the fact
that bth nimbleness and heavy armor lead to a low thac0

DSA (german based RPG) has a "defence" value to dice the hit against and an "armor"
which got subtracted from the hit points - suits better for cap ship against fighter
Oh, yes. I played D&D, AD&D, DSA, DSA Runemagic expansion (with silly complicated combat rules), Star Frontiers (SciFi RPG), Midgard (sillier than silly complicated combat rules), Star Wars, Traveller (SciFi RPG), Shadowrun, Battle/Aero/City/Smallfurryanimal-tech, Cyborg Commando (SciFi RPG), and whatever I forgot.

THAC0 is just the basic idea, to be twisted into something that fits with equal ease.
The final system should be felt playable as a board game. =)


D&D had some silly rules because of that system. (if taken out of context =)
Like: Every attempt to parry is automatically successful.
(imagine standing there, eating a sandwich with one hand... parryparry, oh, parryparry)
If you can find it: get "Murphy's Rules" by Steve Jackson Games.

Among many other things it has essential resources like the Giant vs. Human Armwrestling Result table, Random Polearm Generation table (18 on a 3d18 = Glaive Glaive Glaive Guisarme Glaive) or a Dead Character Soul Destination table.
Or a player character sheet for Kung Fu CB Mamas on Wheels vs the Motorcycle Aztec Wrestling Nuns. Where Psychosis (PS) is a character attribute.
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 » Tue, 5. May 09, 20:56

you seem to be from the same generation

smallfurryanimal-tech :lol:


Thinking about my own post I think one should really design a simple, ship-class-based handicapping system against which to randomize
Redest du noch - oder denkst du schon ?

Post Reply

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