New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Remove some redundant steps during world generation #7880
Fix: Remove some redundant steps during world generation #7880
Conversation
SamuXarick
commented
Dec 27, 2019
•
edited
edited
- FixSlopes was being done twice on heightmaps when one suffice. This reduces one step for loading a heightmap. Also removes redundant call to MarkWholeScreenDirty.
- FixSlopes doesn't need to be run on flat empty world, except when freeform_edges is off and tile_height is higher than 1. Also removes redundant call to MarkWholeScreenDirty.
- FixSlopes apparently isn't required for TerraGenesis. This reduces one step for TerraGenesis generator.
- ConvertGroundTilesIntoWaterTiles is only required when freeform_edges is off or when se_flat_world_height is zero.
Where is the first call? |
Tracing from entry of GenerateLandscape in Heightmap mode: Lines 1293 to 1309 in 69f9529
This calls LoadHeightmap, which has the first FixSlopes on line 502: Lines 489 to 504 in 69f9529
After return to GenerateLandscape, the second call to FixSlopes is on line 1369: Lines 1367 to 1377 in 69f9529
|
The original one in The later one in I notice there's another call to FixSlopes just below in |
54febf5
to
1a40cb3
Compare
I was wrong. Just getting a crash when trying to generate town roads on some of the "unfixed" slopes. Sorry, will fix asap. EDIT: fixed |
1a40cb3
to
ac37c17
Compare
Just fixed the crash. It was TerraGenesis that didn't require FixSlopes, I must have confused them. |
How much of a time improvement does this have on world generation (especially on larger maps)? |
4096x4096 original mountainous |
...those numbers are useless on their own |
- FixSlopes was being done twice on heightmaps when one suffice. This reduces one step for loading a heightmap. Also removes redundant call to MarkWholeScreenDirty. - FixSlopes doesn't need to be run on flat empty world, except when freeform_edges is off and tile_height is higher than 1. Also removes redundant call to MarkWholeScreenDirty. - FixSlopes apparently isn't required for TerraGenesis. This reduces one step for TerraGenesis generator. - ConvertGroundTilesIntoWaterTiles is only required when freeform_edges is off or when se_flat_world_height is zero.
ac37c17
to
a84668c
Compare
Going to close this. It doesn't offer any real benefit (not that any numbers have been provided) and only serves to increase complexity in the code. Potential for extra worldgen bugs being introduced is high. |