## Battle "bug" example on ST

Talk about everything related to CoCoNet or Colonial Conquest!

Moderator: Kroah

### Battle "bug" example on ST

Here's an example of a battle on ST. I've debugged a real game on emulator, so numbers are directly took from ST memory.

France -> Germany
Normandy -> Belgium
5000 men (wow!) -> 30 men (only!)
Belgium is fortified.
Terrain value is 1.

Power factors are:
France: 3
Germany: 2

Retreat bounds (at round 1) are:
France: 625
Germany: 7*2=14 (fortified)

PS: "one side retreats" means battle will not be conitnued at next battle round.
Code: Select all
`      |     army      |    factor     |round |  off  |  def  |  off  |  def  |  1   |  5000      30 |   5       4   | battle stops when all men of one side have attacked (Germany) or one side retreats (rarely)  2   |  4993      24 |   5       3   |    ^  3   |  4985      20 |   6       6   |    |  4   |  4982      17 |   3       4   |    |  5   |  4978      12 |   3       3   |    |  6   |  4974       8 |   5       4   |    |  7   |  4972       7 |   6       6   |    v  8   |  4971       6 |   4       6   | battle stops when all men of one side have attacked (Germany) or one side retreats  9   |  4970       5 |   4       4   | battle stops when all men of both sides have attacked (rarely) or one side retreats (France)---------------------------------------After |  4350       4 |`

-> France retreats with 650 losses. Germany losses 26 men and stays!

Same has above, but Belgium is NOT fortified.
Retreat bounds (at round 1) are:
France: 625
Germany: 7 (not fortified)

Code: Select all
`      |     army      |    factor     |round |  off  |  def  |  off  |  def  |  1   |  5000      30 |   5       4   |  2   |  4993      24 |   5       3   |  3   |  4985      20 |   6       6   |  4   |  4982      17 |   3       4   |---------------------------------------After |  4979       0 |`

-> France conquers Belgium with 21 losses!

As you can see, when the area is fortified, France loses 620 men at round 9 and returns to home!
When unfortified, France conquers Belgium with 30 losses!

To conquer Belgium in 1 turn when fortified, France should attack twice in a turn (2 army moves of 2500 for example). France will only lose 22 men because round 9 will not be reached.
Even if round 9 is reached for the first army move (with big losses), chances are the second one will conquer the area.
Kroah

Posts: 423
Joined: 07 Feb 2006, 01:01
Location: France

### Re: Battle "bug" example on ST

Kroah wrote:Germany: 7*2=14 (fortified)

are real numbers ALWAYS rounded down? (30/4 = 7,5)

Kroah wrote:To conquer Belgium in 1 turn when fortified, France should attack twice in a turn (2 army moves of 2500 for example). France will only lose 22 men because round 9 will not be reached.
Even if round 9 is reached for the first army move (with big losses), chances are the second one will conquer the area.

brilliant, because i often did this on ST, just because i had the "feeling" that it helped a lot

concerning the different battle system implementations and possible conclusions: i feel i'm getting closer to it. i'm currently trying to set them all up in excel to make it more "concrete" for me.

i wonder which version of the game came first and which are the conversions. is this known (maybe stated dates in the code)?
Monty
CoCoNet Beta Tester

Posts: 70
Joined: 24 Jun 2007, 23:03

### Re: Battle "bug" example on ST

Monty wrote:
Kroah wrote:Germany: 7*2=14 (fortified)

are real numbers ALWAYS rounded down? (30/4 = 7,5)

In this case, yes, because the data is right shifted (multiple times).

The result between the real ST version and the algorithm i gave you may differ (about +/- 1 army for each round) because of a special rounding method.

Monty wrote:
Kroah wrote:To conquer Belgium in 1 turn when fortified, France should attack twice in a turn (2 army moves of 2500 for example). France will only lose 22 men because round 9 will not be reached.
Even if round 9 is reached for the first army move (with big losses), chances are the second one will conquer the area.

brilliant, because i often did this on ST, just because i had the "feeling" that it helped a lot

I remember you said me this by mail.
In my childhood, when we played CoCo on ST, we realize big armies weren't as efficient as on XL. So we tried other techniques. This one was the much effective we found.

Monty wrote:concerning the different battle system implementations and possible conclusions: i feel i'm getting closer to it. i'm currently trying to set them all up in excel to make it more "concrete" for me.

To be honest, i confess i'm out of ideas to find a happy medium between the (working) XL and the (bugged) ST version...

Monty wrote:i wonder which version of the game came first and which are the conversions. is this known (maybe stated dates in the code)?

From memory, there were 4 versions of Colonial Conquest (C64, Apple II, Atari XL, Atari ST). According to the code, I think the ST version was the last port of CoCo.

Even if i've lots of unanswered questions, I prefer not to get in touch with Dan Cermak. I don't know if he (and the new copyright owner) will agree with this project.
Kroah