Commit Graph

145 Commits

Author SHA1 Message Date
Gaël C b406bebb7b Use biomegen.skip_chunk and place it before timer. 2024-02-11 22:19:21 +01:00
Gaël C dcc71225ae Remove debug print 2024-02-11 12:35:28 +01:00
Gaël C c8b96e2836 Find spawn position and effectively spawn player (yay!) 2024-02-11 09:26:05 +01:00
Gaël C 6017510df0 Re-implement minetest.get_spawn_level 2024-02-11 08:40:48 +01:00
Gaël C 70418f9526 Fix 2D index not being incremented 2024-02-11 08:27:30 +01:00
Gaël C 0e3c83e1d2 Use biomegen.make_void_maps if present.
(latest version of biomegen)
2024-02-08 22:58:26 +01:00
Gaël C a91a13bbec Insert mapgen callback in first position, to ensure it is called first
Improves compatibility with mods working on mapgen
2024-02-07 10:54:31 +01:00
Gaël C 146f009684 Re-organize grid management code for less dependance between files
Remove gridio.lua and move its function to appropriate files
2024-02-01 19:30:07 +01:00
Gaël C 2cf3b19167 Generate grid directly in pregenerate.lua, not in a function 2024-01-31 11:32:24 +01:00
Gaël C 4697f9c948 Remove "full" grid loading method
I see no reason to let the choice between a greedy and a lighter loading method, so better remove it to simplify the code.
2024-01-31 10:47:37 +01:00
Gaël C ed832a0806 Use only the 10 last digits of world seed at pregenerate 2024-01-28 22:12:05 +01:00
Gaël C 72e2f3e670 Flow accumulation: minor fix and simplification 2024-01-22 11:46:53 +01:00
Gaël C f350f8785c Flow routing: Initialize basin_graph + comment where complexity might be non-linear 2024-01-22 11:46:53 +01:00
Gaël C 4bce5fab77 Completely unroll nested function in flow routing algorithm 2024-01-22 11:46:53 +01:00
Gaël C b54f2c4546 terrainlib: More optimizations on flow routing 2024-01-22 00:33:42 +01:00
Gaël C c723b28ec6 terrainlib/rivermapper.lua: Move checks out of the nested function 2024-01-22 00:30:07 +01:00
Gaël C fe6e281130 terrainlib: loop only once for all singular nodes at step 2 of flow routing 2024-01-22 00:30:07 +01:00
Gaël C 2acefb2660 terrainlib: compute current queue length instead of using '#' operator.
Important speedup.
2024-01-22 00:30:07 +01:00
Gaël C 0bc100030c terrainlib_lua: Hardcode flow_local for performance
as it is unlikely that it will be changed one day.
This results in a drastic performance improvement (x4 speed for step 1)
2024-01-22 00:30:07 +01:00
Gael-de-Sailly d00295600d Add a very brief description at the head of every file 2022-01-26 11:25:17 +01:00
Gael-de-Sailly 0983c27cca Move geometry helpers back to heightmap.lua 2022-01-26 11:09:51 +01:00
Gael-de-Sailly 6564d40b85 Refactor grid loading and reorganize code
Move grid management functions out of polygons.lua, in a new file called gridmanager.lua
Explicitly call other files and grid management functions from init.lua
to make workflow more apparent
Move mapgen loop out of init.lua, into mapgen.lua
2022-01-26 10:54:11 +01:00
Gael-de-Sailly cd2a77803f Globalize some of the main functions
This will allow to avoid nested 'dofile's
2022-01-21 14:22:22 +01:00
Gael-de-Sailly b0930f4d40 Fix river shape in confluences (less sharp riverbeds when a small rivers joins a big one)
Also cleaned and commented the code
2022-01-20 15:28:14 +01:00
Gael-de-Sailly 975ad02739 Exclude exact riverbanks from rivers
This avoids considering points that are exactly at the border of a polygon as rivers
2022-01-20 15:28:14 +01:00
Gael-de-Sailly 6d8ee5af1f Added settings for margin, and documented in settingtypes.txt 2022-01-20 15:28:14 +01:00
Gael-de-Sailly fabe107336 Added margin with a settable width near grid border
Elevation gets closer to -50 when approaching the border
2022-01-20 15:28:14 +01:00
Gael-de-Sailly 7e155b7076 Express map size in Minetest nodes, not in river grid nodes
This introduces new parameters 'map_x_size' and 'map_z_size' that default to 15K
Deprecates 'grid_x_size' and 'grid_z_size'; if they are present, corresponding
values of 'map_x_size' and 'map_z_size' are automatically written in config files.
Also rework compatibility system to better compare versions,
and bump version to 1.0.2-dev1.
2022-01-20 15:28:14 +01:00
Gael-de-Sailly b374e8ee95 Create settings_default.json to store default values for settings
Move noise parameters to settings.lua
2022-01-18 15:21:14 +01:00
Gaël C 1ad8c96b8c Remove 'default' hard dependency 2022-01-17 23:20:34 +01:00
Gael-de-Sailly 2f7098d752 Bump version (1.0.2) and add changelog 2022-01-10 12:44:33 +01:00
Gael-de-Sailly 942a869b9f Minor fix in README 2022-01-10 12:32:38 +01:00
Gaël C b3d79eaaf8 Added more comments in terrainlib_lua 2022-01-07 14:48:36 +01:00
Gaël C 68c19c3b94 terrainlib_lua: replaced space indents by tabs 2022-01-06 15:36:31 +01:00
Gael-de-Sailly 417ce1bcbc Use builtin logging system and appropriate loglevels 2022-01-03 16:33:56 +01:00
Gael-de-Sailly c3a798933f Localize all global functions in load.lua and geometry.lua 2022-01-03 16:20:51 +01:00
Gael-de-Sailly 0c98fc0881 Skip chunks that are fully higher than ground level 2022-01-03 16:18:48 +01:00
Gael-de-Sailly cb71f4400a Corrected mistake in settingtypes 2022-01-03 12:04:49 +01:00
Gael-de-Sailly f8f467ac3f Use local variables for math.* functions
and remove an unnecessary index calculation
2022-01-03 11:56:16 +01:00
Gael-de-Sailly 2e29474686 Bump version (1.0.1) 2021-09-14 15:08:29 +02:00
Gael-de-Sailly 27670addb3 Switch to singlenode mapgen if not done 2021-09-07 11:59:33 +02:00
Gael-de-Sailly 54b94e6485 Updated screenshot 2021-08-01 18:43:44 +02:00
Gael-de-Sailly 09de0fd298 Added reference to scientific paper 2021-07-28 19:50:27 +02:00
Gaël C e3cadcdbc6 Collect garbage during pre-generation to free some space and reduce OOM problems 2021-07-26 22:28:45 +02:00
Gaël C f7bc5ee0b4 Added logs during pre-generation 2021-07-25 10:14:15 +02:00
Gaël C 2c5e0ee5af Code style consistency: use tabs for indentation in all Lua code 2021-07-24 18:55:13 +02:00
Gaël C 95e87f8820 Updated README.md and added environment.yml
Switching to full Lua incredibly simplified the amount of stuff needed in README!
2021-07-24 18:49:17 +02:00
Gaël C db33e58f0a Make map size a setting 2021-07-24 17:41:17 +02:00
Gaël C 31c5ea1025 Python map viewing: read conf file, and take world folder as input 2021-07-24 17:21:21 +02:00
Gaël C c2c397c2a5 Added compatibility script
to update parameter values coming from older versions
2021-07-24 13:21:06 +02:00