| Commit message (Collapse) | Author | Age |
|
|
| |
Enforces the setting value bounds that are currently only limited by the GUI (settingtypes.txt).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fix integer overflow in mapgen
Some calculations involving the magic seed had overflow because the result of an intermediate arithmetic step could not fit in an s32. By making the magic seed unsigned, the other operand in the equation will be cast to unsigned, and possibly other operands or intermediate operands. This will result in unexpected behavior if an operand is negative, which is technically possible, but logically should not happen.
* comment noise2d bitshift
While working through the code I was momentarily concerned that the right bitshift in noise2d could fill ones in some cases. It turns out that with signed integers, this is indeed true, but this one is shifting an unsigned integer, so the behavior is as expected. I put a comment here to clarify this, in case someone else wonders the same thing down the line.
* noise2d and noise3d unittests
I have added 3 tests each for noise2d and noise3d, testing all zero inputs, a very large seed (case which caused UB in the old implementation) and some fun primes I picked for no particular reason. This should be sufficient to demonstrate that the behavior of the new implementation has not changed. I used uniform initialization because it is a good feature of C++11. Please do not explode.
* uncomment the noise2d bitshift
This reverts commit 583b77ee9f1ad6bb77340ebb5ba51eb9a88ff51c. It's a
well-defined language semantic; it doesn't need to be commented.
* code cleanliness
|
| |
|
|
|
|
|
|
|
| |
fixes:
* Switching between games does not immediately hide creative mode / damage buttons if so specified
* World creation menu has a game selection list even though the menu already provides a gamebar
* Showing gameid in world list is unnecessary
* Choice of mapgen parameters in menu persists between games (and was half-broken)
|
| |
|
|
|
|
|
|
|
| |
* Add zstd support.
* Rearrange serialization order
* Compress entire mapblock
Co-authored-by: sfan5 <sfan5@live.de>
|
|
|
|
|
| |
fixes #11533
Schematics saved from y locations greater than 0 would cause an access violation if layer probabilities were specified
|
| |
|
|
|
|
| |
This fixes an out-of-bounds index access when the node resolver was already applied to the schematic (i.e. biome decoration).
Also improves the handling of the two cases: prior node resolving (m_nodenames), and after node resolving (manual lookup)
|
| |
|
| |
|
| |
|
|
|
| |
Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
All terrain generation now occurs in one loop, instead of rivers being
carved afterwards in a separate loop.
Fixes the removal of nodes added by mods in 'register on generated'.
Avoids other problems and reduces the chance of future bugs.
Mapchunk generation time is reduced.
Also fixes a code mistake which resulted in river channel generation
being disabled at floatland altitudes even when floatlands were disabled.
|
| |
|
|
|
|
|
|
|
| |
Run unused functions reported by cppcheck
This change removes a few (but not all) unused functions.
Some unused helper functions were not removed due to their complexity and potential of future use.
|
|
|
|
|
|
|
| |
This commit clarifies the maximal length of the serialized strings.
It will avoid accidental use of serializeString() when a larger string can be expected.
Removes unused Wide String serialization functions
|
| |
|
|
|
|
| |
Add the caverns used in V5, V7, Valleys, Carpathian.
Disabled by default to not be force-enabled in existing worlds.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Games often and increasingly do not use this mapgen alias, as it
is only required for Mapgen V6. Such games were triggering the
recently added error message.
Even if this mapgen alias was defined, dirt nodes placed under a
wide trunk were inconsistent with biomes that do not use dirt
surface nodes.
Place trunk nodes below a wide trunk instead of 'mapgen_dirt'.
On sloping ground, the trunk then extends down to the surface,
instead of the surface rising up to meet the trunk. This looks
more natural and does not alter the terrain.
|
|
|
|
| |
Change biomemap data type from u8 to u16.
New technical (not practical) maximum is 65535 biomes.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Floatland structure is vertically-compressed 3D noise.
Uses a lacunarity of 1.618 (the golden ratio) for high quality
noise.
Floatlands appear between user-settable Y limits, with smooth
tapering at each limit.
Simple user-settable density adjustment.
Shadow propagation is disabled in and just below floatlands, no
shadows are cast on the world surface.
Can be reconfigured to create a solid upper world layer between
the Y limits, lakes/seas can be optionally added to this.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
ServerEnvironment is a huge class with many accessors. In various places it's not needed
Remove it to reduce the ServerEnvironment view.
Idea here is to reduce size of some of our objects to transport lightweight managers and permit easier testing
Pathfinder is now tied to a generic map, not a ServerMap, it can be
ported to client
|
|
|
|
|
|
|
| |
Move LuaEntitySAO to a new dedicated file
Drop TestSAO (useless object)
Drop the old static startup initialized SAO factory, which was pretty useless.
This factory was using a std::map for 2 elements, now just use a simple condition owned by ServerEnvironment, which will be lightweight, that will also drop a one time useful test on each LuaEntitySAO creation. This should reduce server load on massive SAO creation
|
|
|
|
|
| |
Move serverobject.{cpp,h} to server/serveractiveobject.{cpp,h}
Move UnitSAO class to dedicated files
|
| |
|
| |
|
|
|
| |
Co-authored-by: Nicolas Abril <nicolasabril@alunos.utfpr.edu.br>
|
|
|
|
|
|
|
|
|
|
|
| |
(#9284)
Unified flags handling in C++ and Lua Settings API
-> Reading only, for now. Writing can be implemented later, if needed.
API function to read the currently active flags
-> was impossible from Lua
Co-authored-by: Wuzzy <wuzzy2@mail.ru>
|
|
|
|
| |
Preserve the floatland flag of existing worlds, to be used again
when the new implementation is added.
|
| |
|
| |
|
|
|
| |
'large_cave_depth', 'dungeon_ymin' and 'dungeon_ymax' are duplicated across many mapgens so should have been in class MapgenBasic from the start.
|
|
|
|
|
|
|
|
|
| |
Low-disruption first step towards removing the hardcoded cave liquid
code. Since MT 5.0.0 cave liquids can be defined and located by
biome definitions instead.
In games that do not yet use biome definitions to define and locate
cave liquids (MTGame does), lava will now appear below
y = water_level - 256 instead of below 'lava depth' (usually y = -256).
Therefore no change in most mapgens if using the default 'lava depth'.
|
|
|
|
|
| |
Previously, randomwalk caves only extended beyond the mapchunk
borders horizontally, preventing vertical overlap and
interconnection.
|
|
|
|
|
|
|
|
|
| |
Previously, the only way to disable the 3D noise tunnels was to set
'cave width' > 1.0, however doing so did not disable the very intensive
noise calculations or the generation loop.
All the other types of cave generation (randomwalk caves, caverns)
can already be independently and completely disabled.
This feature is now needed more because the small randomwalk caves are
now available for use as an alternative to the 3D noise tunnels.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
caves (#8928)
Add mapgen parameters to set the range of the random number of
randomwalk caves per mapchunk, and to set the proportion that are
flooded with liquids.
Default values are, for now, unchanged from the previous hardcoded
values.
Add parameters to allow small randomwalk caves
Disabled by default for now as they have never been present in the
non-mgv6 mapgens.
|
|
|
|
| |
"Deprecated" means that something is still in use, but is unsupported and needs to be removed.
"Obsolete" means it is already out of use.
|
|
|
|
|
|
|
|
|
| |
This value reduces how far randomwalk caves can extend into the
mapchunk padding, to avoid 'out of voxelmanip' cave nodes which cause
flattened cave walls.
Testing shows that a value of 2 (instead of 10) is enough to make
'out of area' nodes extremely rare.
Reducing this value results in a higher chance of overlap and
connection with caves of neighbour mapchunks.
|
|
|
|
|
| |
Fix some reference counters (memleak)
Map::dispatchEvent: Allocation safety using references
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While preserving the general character of dungeon structure.
Slightly increase the range of standard room horizontal size, while
preserving the average horizontal size.
Return to classic maximum large room size of 16x16x16.
Make 1 in 4 dungeons have a 1 in 8 chance for each room being 'large',
making multiple large rooms possible for the first time.
Make 1 in 8 dungeons allow diagonal corridors, to make these a little
more common.
Make corridor width vary from 1 to 2, but forced to 2 if diagonal
corridors are allowed, to make them passable.
Add some comments.
|
| |
|