News:

Simutrans Sites
Know our official sites. Find tools and resources for Simutrans.

[master][5a0f5768] Strange map generation results

Started by TransshipmentEnvoy, July 01, 2022, 12:07:28 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TransshipmentEnvoy

I get strange map generation results. The map and its generation settings are provided in the attachment.

The game is compiled on latest commit (5a0f5768) on master branch on a Linux machine.

TransshipmentEnvoy

The issue only appears on `cmake` builds.

It is related to option `SIMUTRANS_ENABLE_RANDOMNESS`. If set `-DSIMUTRANS_ENABLE_RANDOMNESS=ON` in cmake configuration, the map generation results are normal.

The option adds compile definition `DISABLE_RANDOMNESS` which affects random number generation in `simrandom.cc`.

TransshipmentEnvoy

The random number generator returns constant value if the range (`max`) is fixed.

```
#ifdef DISABLE_RANDOMNESS
   return max / 2;
```

jamespetts

That is interesting - it looks as though there is a problem with the default setting for the CMAKE build, in that the disable randomness preprocessor definition is only intended to be used for debugging, and randomness should be on by default.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.