# First turn money bug can be removed by hex edit

Discussion in 'Civ2 - Scenario Creation' started by AGRICOLA, Apr 18, 2004.

1. ### AGRICOLAChieftain

Joined:
Nov 19, 2002
Messages:
218
Location:
This has already been posted at Apolyton but might be useful to the scenario designers at CFC.

Money bug is the problem where, if an enemy city is captured during the first turn of a scen or a regular game, the conquering civ gets all the loser's gold.

CAUSE OF MONEY BUG

Civ 2 keeps track of the sum of the sizes (SOS) of all cities that belong to each civ, including barbarians.

This number is updated at the beginning of each turn to reflect any changes caused by city growth, founding of new cities or the conquest or loss of cities.

As far as I can tell, the main use of SOS is for computing the amount of gold a civ gains when it conquers an enemy city. I believe that the computation looks something like this:

GOLD GAINED = {gold possessed by enemy civ} x {(size of conquered city) / (SOS of enemy civ)} x {fudge factor that includes distance from capital, etc.}

The first turn money bug in scenarios (and games) arises from the fact that all SOS are zero because the program has not had a chance to update them.

Consequently, on the first turn, {(size of conquered city) / (SOS of enemy civ)} is infinite and GOLD GAINED = {gold possessed by enemy civ} .

HOW TO FIX BUG

In CIV II MGE, the following bytes (offsets in decimal) contain the SOS for each civ:

2386 - 7 Barbarians
3814 - 5 Civ 1
5242 - 3 Civ 2
6670 - 1 Civ 3
8098 - 9 Civ 4
9526 - 7 Civ 5
10954 - 5 Civ 6
12382 - 3 Civ 7

One way to fix the problem is to count up the SOS for each civ, convert the number to hex and enter it in the correct slot in the scenario save (remember that a hex number like 1C49 needs to be entered as 49 1C).

Alternately, one can fast forward through the first turn, save it and then copy each number from the save and paste it into the correct slot in the scenario save. This may introduce very minor errors in the amount of gold one gets for conquering a city during the first turn.

If anyone has a scen that is ready to launch but does not want to tackle hex editing, send me an e-mail, I'll try to help.

2. ### McMonkey----Evertonian----SLeague Staff

Joined:
May 9, 2005
Messages:
2,024
Location:
Cardiff
Agricola my old friend. I have a scenario here you would have loved testing (to destruction!). I could also have done with your hex editing skills to fix this damn bug. Rest in peace brother. You are sincerely missed.