Commit Graph

12 Commits (master)

Author SHA1 Message Date
Vanessa Dannenberg e8afe017da Use engine decorations when possible 2021-04-23 17:03:29 -04:00
Vanessa Dannenberg 5148cca1b7 Using ":" notation to treat functions as methods is now deprecated
in favor of more normal "." notation.

In the process, I have renamed a few functions in favor of
more meaningful names (see API.txt), and provided
"compatibility shims" for old mods where needed, with warnings.
2021-04-20 17:40:03 -04:00
Vanessa Dannenberg 6342a16b0a Reign-in the default on-generated limit from +/- 31k to -16/+48m
since nothing much is normally found outside that range anyway

only enqueue blocks that are within that range, or within
the range specfied by all of the mods that make generate_plant() calls,
whichever covers more volume.
2021-04-16 13:02:54 -04:00
Vanessa Dannenberg dd650da443 Allow old blocks to time-out after a while
(default 5 minutes).

Rationale: if a block is old enough, there's a very high probability
that the engine's done screwing around with its neighbors, so it's safe
to process.
2021-04-07 07:41:48 -04:00
Vanessa Dannenberg 531577afcf rather than copy the re-check log back into the block log when it comes
time to run through it, just use it in-place, copying its entries back
to the main block log if they have to be skipped again (essentially
using the re-check list and the end of the block log as a double buffer)
2021-04-07 01:44:31 -04:00
Vanessa Dannenberg e346fd599f rather than rearranging the block log to deal with blocks that can't be
populated yet, move those blocks to a separate list, and replay that
list whenever new mapblocks come in.  That way the main block list can
run dry and allow the block populate routines to go idle.

Thanks to Warr1024 for the idea!
2021-04-06 16:09:50 -04:00
Vanessa Dannenberg bef0a0d87e oops, forgot to allow for no-air-check blocks 2021-04-06 04:19:57 -04:00
Vanessa Dannenberg a325c2ccd8 rewrote block queue handlers to reduce code duplication
and improve lag management

minetest.conf settings added:

biome_lib_dtime_limit:

Maximum lag allowed, in seconds.  Default 0.5s.  Larger values allow for
more lag, but make map updates run a bit faster.

biome_lib_queue_run_ratio:

If positive, this is the approximate number of globalstep ticks to skip
between map updates. If negative, it becomes the positive number of map
updates to run per globalstep tick before lag is checked.  No minimum
value, maximum +100.  Default: -100 (that is, 100 updates per globalstep
tick, with none intentionally skipped).  Use positive numbers for slow
machines or biome_lib-using mods that tend to cause lag, and negative
values for fast machines and mods.
2021-04-06 03:20:12 -04:00
Vanessa Dannenberg 27cd07cb36 Fix overlap in the split-to-blocks feature 2021-04-01 04:33:53 -04:00
Vanessa Dannenberg 228296411e split generated map chunks into mapblock-sized pieces as they're logged
to reduce lag/latency at a tiny cost of overall throughput.
2021-03-29 05:19:52 -04:00
SmallJoker fa304f9d18 Fixes 2019-01-02 22:06:07 +01:00
SmallJoker b7d69a8487 Split code and tidy up
Split to growth.lua and search_functions.lua
New function populate_single_surface for a single position check
Use 'return' to reduce indent levels
2019-01-02 20:35:39 +01:00