I like the ChokePoint mod, but noticed some issues with it: with the mod installed, there was significant choppiness/lag while walking around (disabling just ChokePoint made the choppiness completely go away, and re-enabling the mod made the game laggy again). I benchmarked the different tile generation programs included in the mod, measuring how much time it took to reveal the same large area around the spawn point:
Code: Select all
/c game.forces.player.chart(game.player.surface, {lefttop = {x = -512, y = -512}, rightbottom = {x = 512, y = 512}})
- continents.lua (1x simplex): 38s
- fusedcontinents.lua (2x simplex): 62s
- rivercutsrings2.lua (3x simplex): 105s
- rivercutsringswithland2.lua (4x simplex): 140s
So I made faster variants of the continents and rivers programs (only invoking simplex 1x), with added protection for the players' starting areas. (in light of the MIT license)
It's not as crude as just enforcing a strict no-water-zone, as that would result in sharp unnatural transitions at the boundary. Instead, I introduced a gradual bias added to the simplex noise that slowly tapers off the water mass as it approaches the spawn point. This creates a more natural-looking environment, where you can imagine the spawn point as the top of a small hill:
and
This is vanilla default, with my modified version of ChokePoints. Notice that on both maps, without the land bias spawn point protection, the player would have spawned inside deep water: there's a north-south river/canal that tapers off and leaves room around the start location only because of the added spawn protection.
I realize some computers can handle 4x simplex and some can't. So I added a mod setting to the GUI where players can choose from the algorithms:
- FastContinents is my modified 1x simplex continents variant. Example map.
- PrettyContinents is based on 4x simplex fusedcontinentsbridge2.lua . Example map.
- FastRivers is my modified 1x simplex rivers variant. Example map.
- PrettyRivers is based on 4x simplex rivercutsringswithland2.lua (the default in 1.0.97). Example map.
Here is my modified ChokePoint version, offered under the same MIT license. Reika, if you like it, feel free to incorporate the changes into your mod.