Lars Müller [Sat, 11 Jun 2022 18:01:14 +0000 (20:01 +0200)]
on_deactivate: distinguish removal and unloading (#11931)
Sometimes you need to be able to do removal-related cleanup, such as removing files from disk, or entries from a database. staticdata obviously isn't suitable for large data. The data shouldn't be removed if the entity is unloaded, only if it is removed.
Lars Müller [Sat, 11 Jun 2022 18:00:26 +0000 (20:00 +0200)]
Builtin: Redo serialize.lua (#11427)
Features:
* Support for arbitrary references, including self-referencing
* Short output, references "long" strings as a bonus
* Around the same speed, potentially slower if long, short keys are present
* Properly works with NaN and inf
rubenwardy [Sun, 5 Jun 2022 15:47:38 +0000 (16:47 +0100)]
Add register dialog to separate login/register (#12185)
New users find Minetest's account system confusing.
This change moves username/password to a new dialog,
with login and register buttons added to the Join Game tab.
The old registration confirmation dialog is removed in
favour of the new dialog.
JosiahWI [Sat, 4 Jun 2022 00:51:58 +0000 (19:51 -0500)]
fix integer overflow in mapgen (#11641)
* 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.
sfan5 [Sat, 21 May 2022 17:27:35 +0000 (19:27 +0200)]
Remove obsolete eye_height related workaround
This was added a long time ago in 42bbd5c9ae06a8d8ffb7915599097ead6f848755
and meant to fix prevent the view becoming black when jumping into a
ceiling, this no longer happens today.
sfan5 [Mon, 9 May 2022 18:59:28 +0000 (20:59 +0200)]
Reduce size of ContentFeatures structure
On my system this is a reduction from 4664 to 3704 bytes.
This is not for the sake of saving RAM but ensuring
commonly used structures fit into caches better.
sfan5 [Sun, 1 May 2022 11:44:42 +0000 (13:44 +0200)]
Optimize JSON string (de)serialization routines
stringstreams were shown to be slow when reading/writing single characters
and there is lots of potential by having functions perform on existing
buffers whenever possible.
x2048 [Sat, 21 May 2022 14:49:30 +0000 (16:49 +0200)]
Improve shadow filters (#12195)
* Rewrite shadow filtering for the new distortion
* Calculate penumbra radius using a single sample
* Avoid peter-panning effect due to filtering of short shadows
* Add adaptive filter quality for soft shadows
* Avoid sharp shadows on surfaces without normals (e.g. plants)
* Increase default and maximum soft shadow radius
* Make line numbers in shader errors match the code
sfan5 [Thu, 5 May 2022 20:03:49 +0000 (22:03 +0200)]
Cache serialized mapblocks during sending
This reduces the
(absolute) time spent in Server::SendBlocks() from 700ms to 300ms
(relative) share of MapBlock::serialize() from 80% to 60%
in a test setup with 10 players and many block changes
sfan5 [Sun, 1 May 2022 12:44:48 +0000 (14:44 +0200)]
Sort out some issues with our CI setup
* add missing apt-get update where needed
* move some jobs to run on ubuntu-20.04
* update actions plugins to latest
* speed up the job that runs multiplayer tests