Closed iegik closed 3 years ago
The game generator has placed the Chinese settler unit on an Ocean tile!
The unit tests are run with a hard-coded random seed [see TestsBase2
ctor] which "should" produce consistent results.
So I see two problems here:
Issue 2 here needs to be fixed first:
The Game generator is in Game.NewGame.cs ; there is a function called AddStartingUnits
which would be the place to look at.
The tests ZOCFixTest1
and ZOCFixTest2
are misbehaving for similar reasons : the map generator has produced a different map than when the tests were written.
Each of those tests call a method named TestZoc
in which a Chariot is created on the map at coordinates [53,16]. That tile is now an Ocean tile.
ZOCFixTest1
"succeeds" but should not as the Chariot is in an invalid location. This is a failure of TestZoc
to validate the Chariot is correctly placed.
ZOCFixTest2
"fails" and should not.
Similar problems occur for the ZOCRevertTest* tests.
I think, that "Earth" map would not exist without these needs. So, can we run all our tests on Earth map with same seed for resource generation?
Off-topic: Can we represent tiles with units on it in bytes? Or how they actually represents (3x3 tile examples:)
in one-layer?
c0 01 00
00 11 ff
00 00 00
or in separate layers?
terrain resource unit
01 02 03 00 00 08 00 00 00
01 02 03 00 00 00 00 01 00
01 01 02 07 00 00 00 00 00
With that 0..255
Off-topic: Can we represent tiles with units on it in bytes?
How do you handle stacked units?
So, can we run all our tests on Earth map with same seed for resource generation?
That was the intent. If done correctly, a given seed value should create the same landscape, select the same civilizations, place the initial civilization settlers at the same locations, etc.
I added a command-line parameter seed
[runtime\sdl\src\Programcs]. So by setting the Visual Studio debug parameter to (e.g.) "-seed 12345" the game "should" be the same each time. Whether that is still the case needs to be verified.
There was a problem with the Runtime mock so that it could not load the Earth map. When the Earth map cannot be loaded, all tiles are set to Ocean.
(need more info)