Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! 2.6/7 » The Academy » Damage calculations
Damage calculations Mon, 15 November 2004 17:42 Go to next message
Staz is currently offline Staz

 
Lieutenant

Messages: 514
Registered: November 2003
Location: UK

Is it possible to accurately predict the outcome of battles involving small stacks of missile ships ? It seems to me that the random element caused by missile/torpedo accuracy can massively influence the outcome when overall missile numbers are small (I'm talking about 20 missiles on a stack).

I searched rgcs for details and found some comments on the damage calculation (search for "Spagnoli Cawley Damage Calculations"), but then when I implement it I get a wide variation in damage per salvo... 72 to 132 points, for example.

Report message to a moderator

Re: Damage calculations Tue, 16 November 2004 05:57 Go to previous messageGo to next message
mazda is currently offline mazda

 
Lieutenant

Messages: 655
Registered: April 2003
Location: Reading, UK
You can accurately predict the chances of each outcome, if that's what you mean.

As an example, say you had a battle between 2 scouts each with a jihad missile.
Now either 0 or 1 missiles will hit each time a salvo is fired.
So the result comes down to the first side to hit, not the first side to fire. First side to fire has a slightly better chance to hit first, but not much (5:4).
If you had 10 scouts each side then *in theory* you could get from 0 to 10 missiles hit. What is likely to happen though is that you will get 1 - 4 missiles hit, most of the time.
If 2 or more hit then the side to fire first will win. However there is still a 1 in 10 chance of all missiles missing (nevermind the complicated case where only 1 hits).
So first side to fire has a much better chance of winning this time (at least 3:1).
With 100 scouts each side then you will get 15 - 25 hit, which will always kill the opposing side. i.e. first side to fire will "nearly always" win.

See the effect ? How numbers of ships/missiles changes the likely result ?

On another topic I've had battles with low power beam ships where one stack taking a slightly different route on the board meant the difference between a good win, and a heavy defeat.

Post the ship details here, if you like, along with what you expected to happen.

Report message to a moderator

Re: Damage calculations Tue, 16 November 2004 07:07 Go to previous messageGo to next message
Staz is currently offline Staz

 
Lieutenant

Messages: 514
Registered: November 2003
Location: UK
mazda wrote on Tue, 16 November 2004 10:57

You can accurately predict the chances of each outcome, if that's what you mean.

<snip>
Quote:

Post the ship details here, if you like, along with what you expected to happen.


My point is that you can't say what you expect to happen, because with small numbers of missiles it is mainly down to chance. In your two-scout example, it is meaningless to say that a Jugernaught scout is better than a Jihad scout, because the winner will be determined entirely by chance.

I guess what it comes down to is that even if I get my battle simulator working perfectly, it is going to need a large disclaimer.

Report message to a moderator

Re: Damage calculations Tue, 16 November 2004 07:37 Go to previous messageGo to next message
Kotk

 
Commander

Messages: 1227
Registered: May 2003
It is not possible to predict battle outcome with 100% accuracy. Actual battle outcome depends on lot of unpredictable things. I have seen people losing battles that they testbedded about 10 times.

Equal init fires random, fleets get random weight bonuses, they often move randomly, cost (so exact tech levels, BET, CE and IS or WM) affect attractiveness, missiles have their random accuracy, often not all the ships in fleets are fully healed, there are lot of possible different battle orders and odd quirks in battle engine. The starting position can be often vital, if it is planned 4-way battle then there just sole fift guys scout can completely turn the tables.

Since the battle outcome is quite often so random anyway, does someone expect a tool that can be more accurate than the real life? Best you can do is to address it bit more "statistically".
1) Best case scenario for side A,
2) best case scenario for side B
3) average outcome for about 50 battles

Should be possible to give out in seconds by modern computers. Wink



[Updated on: Tue, 16 November 2004 07:38]

Report message to a moderator

Re: Damage calculations Tue, 16 November 2004 09:03 Go to previous messageGo to next message
mazda is currently offline mazda

 
Lieutenant

Messages: 655
Registered: April 2003
Location: Reading, UK
Staz wrote on Tue, 16 November 2004 12:07

My point is that you can't say what you expect to happen, because with small numbers of missiles it is mainly down to chance. In your two-scout example, it is meaningless to say that a Jugernaught scout is better than a Jihad scout, because the winner will be determined entirely by chance.


Yes it is entirely by chance.

It is an entirely accurate statement to say that scout A will win 38% of the time and that Scout B will win 62% of the time.

If all you want to do is report that on average Scout B will win then that seems a misleading statement.

Kotk has the right idea, run the battle a 1000 times and get best cases, average result, maybe result at 10% breakpoints.

edited : added ] to quote


[Updated on: Tue, 16 November 2004 09:06]

Report message to a moderator

Re: Damage calculations Tue, 16 November 2004 10:50 Go to previous messageGo to next message
Staz is currently offline Staz

 
Lieutenant

Messages: 514
Registered: November 2003
Location: UK
mazda wrote on Tue, 16 November 2004 14:03

Kotk has the right idea, run the battle a 1000 times and get best cases, average result, maybe result at 10% breakpoints.


I was afraid of this.

The problem now is that there isn't a simple numerical outcome to most battles, so you can't just take the average.

How do people use the game-based battle simulator ? When I've used it in the past I've only run each battle through once, which I now realise is quite dangerous.

Is there any point testing small battles ? For large battles, do you run it through several times ? If so, do you have a specific method for "averaging" the results or do you just get a feel for it ?

Report message to a moderator

Re: Damage calculations Tue, 16 November 2004 11:23 Go to previous messageGo to next message
Kotk

 
Commander

Messages: 1227
Registered: May 2003
There are no battle outcomes that can be shown as one number.

There are usually multiple stacks at each side and after battle for each stack 2 numbers describe its condition. Survival and damage.

Lets say average player does not worry about damage too lot. Damage can be repaired with few turns. Then it leaves only the survival. Giving survival for each stack separately is probably vital anyway since people may be sometimes very interested in results like "do bombers survive". Wink

If we take that jugger versus jihad scout battle and see that jugger scout stack is dead 38 times and alive 62 times from 100 and never partially survived so we can say that:
worst case is its 0% survived
best case is its 100% survived
in average its 62% survived

I believe that such tool would be wonderful.


Report message to a moderator

Re: Damage calculations Tue, 16 November 2004 11:25 Go to previous messageGo to next message
overworked is currently offline overworked

 
Lt. Junior Grade

Messages: 403
Registered: November 2002
Location: Pittsburgh, PA

The few times I've tried to simulate large and/or important battles I've run the simulation multiple times. This goes back to 2001 and the AOS team game - Xdude generated a separate set of game files for our alliance to sim potential battles with.

A) To see how big a results variation the random factors are bringing into play. As stated earlier you will see different results - and in "close" battles you can see some very different results from simulated battle to simulated battle.

B) To get an estimate on expected losses - and decide whether or not I *want* to fight this particular batle.

C) To see if modified battle orders by my side (or theirs) could potentially have a dramatic effect on the results.

D) Same as (C) but checking if adding/subtracting a race from a 3+ race battle could have massive effects on the resulting battleboard set-up.

==

So a sim that could run a mathematically significant number of results in a timely manner would be useful. But it wouldn't give you absolute certainty, probably just "average" results and perhaps some addition range and deviation numbers.

And even that would probably be based upon a number of assumptions in predicted combatants, battle orders, etc.

- Kurt

Report message to a moderator

Re: Damage calculations Tue, 16 November 2004 11:56 Go to previous messageGo to next message
Ptolemy is currently offline Ptolemy

 
Commander

Messages: 1008
Registered: September 2003
Location: Finland

This is why when going into battle the best option is always overwhelming odds. Always have more than enough chaff, more than enough missiles and more than enough of whatever other ship you wish to throw in. Get an ally to drop in a scout when you want to change the battle board starting positions etc. An SD energy dampener can also have significant effect.

There will be no way to guarantee the absolute outcome of missile battles - that said, everyone here is correct in that missile battles have the degree of inaccuracy thrown in. Statistical probabilities can be worked out though and are generally sufficient to predict the winner with enough ships in the battle.

No 'random' number generator is truely random and Stars! will have used the standard 'C' rand() function - maybe possibly even a rand() seed to the rand() function to make it a little more random. Another common seed used would be the hundreths of seconds from system time. However, any of these will have been sufficient to randomize missile hits.

Ptolemy




Though we often ask how and why, we must also do to get the answers to the questions.

Report message to a moderator

Re: Damage calculations Tue, 16 November 2004 14:03 Go to previous messageGo to next message
Staz is currently offline Staz

 
Lieutenant

Messages: 514
Registered: November 2003
Location: UK
Thanks for the suggestions and help, everyone.

Now I can run my simulation a thousand times and see what the min/ave/max survival rates are for each stack.

But how can I tell whether my results (and hence, the simulation code) are correct or not ? I'm not entirely sure I can Confused

Report message to a moderator

Re: Damage calculations Tue, 16 November 2004 21:23 Go to previous messageGo to next message
SnakeChomp is currently offline SnakeChomp

 
Petty Officer 1st Class

Messages: 61
Registered: April 2003
Location: Stamford, CT

Simulate a battle 1000 times.
Make stars do the battle 1000 times.
Compare.

Laughing

Report message to a moderator

Re: Damage calculations Wed, 17 November 2004 03:14 Go to previous messageGo to next message
Carn is currently offline Carn

 
Officer Cadet 4th Year

Messages: 284
Registered: May 2003
SnakeChomp wrote on Wed, 17 November 2004 03:23

Simulate a battle 1000 times.
Make stars do the battle 1000 times.
Compare.

Laughing


This is possible as long as each token in the battle can be produced in 1 year and the stars are neatly arranged.

Ships just have to happen to be in the same place 1 year, while on autoroute to some further away spot. Difficult to set up and only works for one engine type(as this determines speed), but then just set the right ships in queues a few thousand times and gen a thousand years.

Carn


Report message to a moderator

Re: Damage calculations Wed, 17 November 2004 05:25 Go to previous messageGo to next message
mazda is currently offline mazda

 
Lieutenant

Messages: 655
Registered: April 2003
Location: Reading, UK
Staz wrote on Tue, 16 November 2004 19:03

But how can I tell whether my results (and hence, the simulation code) are correct or not ? I'm not entirely sure I can Confused

Do it like any you would test any software.
Set up examples where you know the result beforehand, and gradually increase the complexity.
Things like ship movement should be easy to check.
Then introduce ship weight and see what happens.
Then battle orders.

Report message to a moderator

Re: Damage calculations Wed, 17 November 2004 12:56 Go to previous messageGo to next message
Kotk

 
Commander

Messages: 1227
Registered: May 2003
Staz wrote on Tue, 16 November 2004 21:03

But how can I tell whether my results (and hence, the simulation code) are correct or not ? I'm not entirely sure I can Confused


Sure, making good model is separate task from giving out useful results for end user.

First you need some visualization of single battle step by step of course. Maybe find out if you can use some code from Freestars for it. Even if they have nothing to offer you can then give your algorithms to them when ready. Smile

Then its lots of testing ... to ease it you can use test battles where randomness does not matter much first.

For example if you want to see how something moves with some specific battle orders you need to have them lots at board split up. Then you see the probabilities for them to move this or that way both in stars and your simulation.

Similarily if you want to see if simulation torpedo damage is correct or not you need to test it with rather large stacks of torpedoes firing at rather big stacks of armor, because there the differences between battles should be very little.

Finally, if your tool does show some different results than it really happens in stars you will soon hear about it from annoyed users. Wink

Report message to a moderator

Re: Damage calculations Wed, 17 November 2004 14:12 Go to previous messageGo to next message
Staz is currently offline Staz

 
Lieutenant

Messages: 514
Registered: November 2003
Location: UK
Once again, thanks everyone for the advice.

Regarding starting simple and building up - that has been my approach. Battles between 2 stacks of beamers seem reasonably accurate, for example. Here, the only random element (if designs have large mass difference) is when both stack have same initiative.

Regarding code sharing with FreeStars - as far as I am aware they haven't done any work on the battle engine. My code is open source, so they will be welcome to use it but will have to translate from Java.

Regarding ship movement - does anyone have the first clue what algorithm the Stars! battle engine uses ? Sometimes it's choices seem totally random to me. A search of rgcs seems to indicate that it hasn't been analyzed much, if at all.

Regarding visualising movement - I currently do this by moving coloured circles around on a black background and showing red lines for firing. It's not pretty but it works.


I guess we'll just have to wait until I have something to release and then see what the community makes of it. At least with it being open source all you gurus can review it.

Report message to a moderator

Re: Damage calculations Thu, 18 November 2004 03:17 Go to previous messageGo to next message
Ptolemy is currently offline Ptolemy

 
Commander

Messages: 1008
Registered: September 2003
Location: Finland

During testbeds it has been noted that there is a random factor to movement in battle. On the first round when each ship moves, ships may move to either of a couple different squares depending on battle orders. Running the same battle more than once has a given stack choosing square A some of the time and square B other times. In one case where an ally and I wanted to force movement to be more predictable we had one of us just show up at a battle to change the battleboard starting positions.

Ptolemy




Though we often ask how and why, we must also do to get the answers to the questions.

Report message to a moderator

Re: Damage calculations Thu, 18 November 2004 07:32 Go to previous messageGo to next message
Kotk

 
Commander

Messages: 1227
Registered: May 2003
Staz wrote on Wed, 17 November 2004 21:12

Regarding ship movement - does anyone have the first clue what algorithm the Stars! battle engine uses ? Sometimes it's choices seem totally random to me. A search of rgcs seems to indicate that it hasn't been analyzed much, if at all.

I just paste here an article i have somehow stored on my harddrive, by great FAQ maker James McGuigan. I think it was in r.g.c.s newsgroup in some movement thread. I am sure that "minimize damage to self" works a bit differently, but for starters it is certainly better than nothing... Wink :

Here are the guts of the battle engine as I understand it from both
experience, observation and the help file (please pull me up on any points I
get wrong)


For a battle to take place 2 or more fleets (or a fleet and a starbase) must
be at the same location and at least one of the fleets must be armed and
have orders to attack ships of the others race (the type of ships involved
doesn't matter). If are race has a fleet present at a location where there
is a battle, but doesn't have orders to attack any of the other races there
and none of the other races present has orders to attack it then it will not
take part in the battle (and can not benefit from potential tech gain).

Each ship present at the battle will form part of a token (AKA a stack), it
is possible to have a token comprised of just a single ship. Tokens are
always of ships of the same design. Each ship design in each fleet will
create a token, splitting a few ships off to form a second fleet before the
battle will create a second token on the battle board.

The battle grid is made up of 10 squares by 10 squares. Each token is in a
single square, there can be more than one token in the same square.There is
an limit of 256 tokens per battle event for all players involved, if this
limit is exceeded, then excess tokens will be left out (those created from
fleets with the highest fleet numbers), in such a case each player will have
an equal number of tokens, each player will be guaranteed to get their
"share" of the available token slots (ie in a 4 race battle 256 / 4 = 64
token slots), if a race doesn't use up all their "slots" then they are
shared equally between the other players.

Each battle is made up of rounds. There are a maximum of 16 rounds in each
battle. Each round has two parts, movement and shooting. Each token has a
speed rating, and will be able to move between 0 and 3 squares in a single
turn. If a token has a fractional speed rating then they will get a bonus
square of movement every set number of turns. a 1/4 bonus means an extra
square of movement on the first round and then on every fourth round after
that starting with the fifth. A 1/2 speed bonus gets a bonus square of
movement every other turn starting with the first, and a 3/4 speed bonus
gets a bonus square of movement for the first three rounds of every 4 round
cycle. The order of movement is this, each token with 3 movement squares
moves a single square, then each token with 2+ movement moves a single
square (if it had speed 3 then it would move for its second square) and then
all ships with at least one square of movement move again. At each stage the
ships with the most weight will move first though there is less than a 20%
difference in weight then there is a chance that the lighter ship will go
first. The smaller the weight % difference the greater the chance of the
lighter ship going first.

Each token has an attractiveness rating. This is used in both working out
where ships move to and which ships are shot at first. The essence of the
formula is cost / defence. A ship will have different attractiveness ratings
verses different types of weapons (beams, sappers, torpedoes and capital
missiles). Cost is calculated by summing the resource and boranium costs of
the ship design used (iron and germ costs don't affect the attractiveness
rating). Defence is calculated by the shield and armour dp modified by the
enemies torpedo accuracy (after b
...

Report message to a moderator

Re: Damage calculations Thu, 18 November 2004 09:01 Go to previous messageGo to next message
Staz is currently offline Staz

 
Lieutenant

Messages: 514
Registered: November 2003
Location: UK
Kotk wrote on Thu, 18 November 2004 12:32

Staz wrote on Wed, 17 November 2004 21:12

Regarding ship movement - does anyone have the first clue what algorithm the Stars! battle engine uses ? Sometimes it's choices seem totally random to me. A search of rgcs seems to indicate that it hasn't been analyzed much, if at all.

I just paste here an article i have somehow stored on my harddrive, by great FAQ maker James McGuigan. I think it was in r.g.c.s newsgroup in some movement thread. I am sure that "minimize damage to self" works a bit differently, but for starters it is certainly better than nothing... Wink :


Wow, thanks. That is a lot of useful information.

It doesn't describe movement in the kind of detail I am after, but I don't think anything will.

What I am after is a description that is complete enough that I can write code from it. For a given stack it will have (up to) 8 other squares it can move to. Some of these will be closer to the target, some further and some the same distance. If I know I want to be further away, which of the (generally 3) possible squares should I move to ? Is it random ?

One thing it mentions that I am currently doing differently is that it suggests stacks/slots with the same initiative are ordered randomly (which I suspected), and that the order stays the same for the entire battle (which I had assumed is not the case). This seems a bit unfair - if my colloidal CCs are fighting yours then we'll both have the same range & init and so first shot advantage can be significant and keeping it for the entire battle can be decisive. However, unfair or not, if that is the way it works then that is what I need to simulate.

Report message to a moderator

Re: Damage calculations Thu, 18 November 2004 09:13 Go to previous messageGo to next message
Ptolemy is currently offline Ptolemy

 
Commander

Messages: 1008
Registered: September 2003
Location: Finland

Staz,
I think you're just going to have to make up a few of your own rules for cases where enough info isn't available. This should get very close to mimicking the behaviour of the battle engine. Some things are random - so let them stay random or give them order - your choice. I think though, that it is better to leave the random factors in so that everything isn't totally predictable.

Ptolemy




Though we often ask how and why, we must also do to get the answers to the questions.

Report message to a moderator

Re: Damage calculations Thu, 18 November 2004 09:20 Go to previous messageGo to next message
Staz is currently offline Staz

 
Lieutenant

Messages: 514
Registered: November 2003
Location: UK
Ptolemy wrote on Thu, 18 November 2004 14:13

I think you're just going to have to make up a few of your own rules for cases where enough info isn't available.


Yes, you are right about that. However, I'd prefer not to make my own rules if someone else knows what the actual game does in a particular situation.

Report message to a moderator

Re: Damage calculations Thu, 18 November 2004 10:00 Go to previous messageGo to next message
LEit is currently offline LEit

 
Lt. Commander

Messages: 879
Registered: April 2003
Location: CT
Quote:

If are race has a fleet present at a location where there is a battle, but doesn't have orders to attack any of the other races there and none of the other races present has orders to attack it then it will not take part in the battle (and can not benefit from potential tech gain).


Tech gain can happen to anyone at the same location as a battle. In the EACvsIRC game one of the races didn't want a particular tech so they set orders to not attack the lambs. They still got the tech.

Quote:

At each stage the ships with the most weight will move first though there is less than a 20% difference in weight then there is a chance that the lighter ship will go first.


The Help file says:
Quote:

In each part tokens move in order from heaviest to lightest, with a margin of +/- 15%.

I think this means it randomizes the weight by +-15% (once for the whole battle) and that determines movement order. This means that with a 30% difference you could move after the lighter ship, although the odds of that are very low. I assume that ties after the +-15% are resolved by random selection.

Quote:

Disengage - If there is any enemy ship in firing range then move to any square further away than your current square. If you are in range of an enemy weapon but cannot move further away then try move to a square that is of the same distance away.


I have seen ships in this case move closer to the enemy, but mostly when they're being targeted only by torps/missiles and can't move further away (at the edge already). I think if they can't get further away, they move randomly.

From the Help file:
Quote:

In all cases except Disengage the token will attempt to get closer to the target if it is currently outside maximum range. If the token runs out of primary and secondary targets it will automatically switch to Disengage. If a token can no longer do any damage it will automatically Disengage. For example if the attacking token has shield buster weapons only and none of the enemy tokens have shields, the attacker will disengage.


This is not quite true... Minimize damage will keep you from getting into range in some cases (against bases for sure, but I havn't tested other cases). Also ships without primary or secondary targets don't disengage, they just sit still. I've also seen ships with disengage/armed ships that don't make up their mind if they should flee or advance.

For Maximize damage, note that gatlings don't lose damage with range. I'm fairly sure that gatling armed ships will attempt to fire at as many tokens as possible.

Quote:

Any races that took part in a battle and had at least one ship that managed to survive (either through surviving till the end or retreating beforehand) has a potential to gain tech levels from ships that where destroyed during the battle.


This should be: Any race that stars at the location of a battle has a potential to gain tech levels from ships that where destroyed during the battle (even their own ships), note that owning the planet where a battle takes place counts as being present, even if you are not engaged in the battle.
...



[Updated on: Thu, 18 November 2004 10:01]




- LEit

Report message to a moderator

Re: Damage calculations Thu, 18 November 2004 10:08 Go to previous messageGo to next message
mazda is currently offline mazda

 
Lieutenant

Messages: 655
Registered: April 2003
Location: Reading, UK
Staz wrote on Thu, 18 November 2004 14:01

One thing it mentions that I am currently doing differently is that it suggests stacks/slots with the same initiative are ordered randomly (which I suspected), and that the order stays the same for the entire battle (which I had assumed is not the case).

Note this is different to ship weight, which is random every round, so that ships don't always move in the same order every round (subject to usual rules on weight modifiers in battle).


[Updated on: Thu, 18 November 2004 10:10]

Report message to a moderator

Re: Damage calculations Thu, 18 November 2004 14:11 Go to previous messageGo to next message
Kotk

 
Commander

Messages: 1227
Registered: May 2003
Staz wrote on Thu, 18 November 2004 16:01

What I am after is a description that is complete enough that I can write code from it. For a given stack it will have (up to) 8 other squares it can move to.

Quite often they may stay still too despite they can move so it actually makes 9 squares.
Quote:

Some of these will be closer to the target, some further and some the same distance. If I know I want to be further away, which of the (generally 3) possible squares should I move to ? Is it random ?

It seems to be random. However it seems to be random between certain squares so it may be random between 2, 3 or even all 9 squares. It seems to be equally random between these certain squares. It can be sometimes (but quite rarely) just 1 square to pick. Thats quite lot of work to reverse engineer it just by observing battles.
Quote:

One thing it mentions that I am currently doing differently is that it suggests stacks/slots with the same initiative are ordered randomly (which I suspected), and that the order stays the same for the entire battle (which I had assumed is not the case).

Yes, weight advatages stay same during one round, init order stays same for whole battle. Note that slots in same token filled with same init weapons fire always in fixed order that is decided by hull and is not random. They fire seemingly at same time so its pain to test out. Need to make one slot of missiles powerful enough to strip shields on opponent and another weaker, then you can consider by damage if another slot fired with double damage or no. I have seen BB slot order published somewhere but not for any other vessels.

Report message to a moderator

Re: Damage calculations Thu, 18 November 2004 22:01 Go to previous messageGo to next message
SnakeChomp is currently offline SnakeChomp

 
Petty Officer 1st Class

Messages: 61
Registered: April 2003
Location: Stamford, CT

Slot firing order for starbases is here: http://starsautohost.org/sahforum/index.php?t=msg&th=646 &start=0&rid=230

[Updated on: Thu, 18 November 2004 22:02]

Report message to a moderator

Re: Damage calculations Sun, 21 November 2004 13:50 Go to previous messageGo to previous message
Staz is currently offline Staz

 
Lieutenant

Messages: 514
Registered: November 2003
Location: UK
Missiles/torps that miss do 1/8 damage to shields. Does anyone know when this should be applied ?

In my current algorithm I've got it happening right at the end, after armour damage and kills. LEit pointed out that it might happen before that, in which case it might actually strip away the last of the shields leading to double damage etc.

Report message to a moderator

Previous Topic: Weapon range and firing order
Next Topic: Disengage in 8 moves
Goto Forum:
  


Current Time: Sat May 04 14:35:00 EDT 2024