This is a first attempt to get rid of of reference counting #1413
Basically all threads execute a global sync point, this allows
determining a time when all temporary resources (such as meshes on the
client side used in lighting on other threads) have been freed with 100%
certainty.
Remaining work:
- [x] Implement the sync point
- [x] Implement free lists and free the resources
- [x] Determine if this is worth it performance wise
- [x] Use this for chunk meshes
- [x] Remove reference counting and the locks on the chunk storage data
structure
- [x] Measure performance of gathering many light samples and compare it
with master → around 15% reduction in time
- [x] Cleanup some unused things (mesh free list)
For reference: https://github.com/ziglang/zig/pull/24329
some commits have been extracted from #1583, but the x86_64 backend has
been disabled due to its horrible performance.
Remaining work:
- [x] Wait for official builds on ziglang.org and upload them to our
repository
- [x] Add workaround for https://github.com/ziglang/zig/pull/24466
- [x] Fix TODO comment about ANSI support in stdout
- [x] Check for compile-time performance changes → it went from 13.1 to
11.9 seconds 🎉
- [x] Rotation (already merged)
- [x] basic GUI
- [x] sign models and textures
- [x] sign blocks
- [x] update the text on the client
- [x] Figure out block entity rendering
- [x] Render the text to a texture on update
- [x] Render the texture in the world in the location of the sign
- [x] Use varint instead of u32 for storing the block data lengths,
(now, while we can still change it)
- [x] Sync the text with the server and all clients
- [x] Figure out block entity storage on the server
- [x] Send the entity data of the initial chunk
- [x] Store the text on the server
- [x] Set the chunk as changed whenever a block entity data update
happens, so we actually store it
- [x] Disable or figure out optimized local chunk transmission
- [x] fix memory leak
- [x] Rethink some of the API (do we need onPlace/onBreak, when there is
unload and updateData?)
- [x] Remove the background shadow from text, it produces too much
aliasing
- [x] Figure out if the default should be black or white
- [x] Correctly center the text
- [x] Why are newlines not working?
- [x] Check if a deadlock is possible on deinit --- it would be possible
only if another thread has a reference to it, which should not be the
case when unload is called.
- [x] Set the text margin and sizes reasonably
- [x] Make sure the GUI fits with the sign width
- [x] Create an issue for configurable sign texture size and
configurable default color
fixes#367
---------
Co-authored-by: Carrie <122191047+careeoki@users.noreply.github.com>
Co-authored-by: OneAvargeCoder193 <85588535+OneAvargeCoder193@users.noreply.github.com>
## Description
This pull request adds a tool palette to allow using stable indexes for
binary storage.
## Links
Related to: #1290
Related to: #1478
Related to: #1473
* Batch block updates
* Apply review change requests
* Allow blockUpdate to carry multiple block updates in single message
* Read until there is nothing left
* Use mesh_storage.BlockUpdate
* Break instead of boolean
* Restore client side neighbor updates
* Move side check in blockUpdate out of the loop
* Update src/utils.zig
* Fix minor issues
* Reverse ownership logic + change contains into liesInChunk
* Update liesInChunk
* No name for upadeBlock param
* Apply review change requests
* Fix formatting
* Restore onBreakClient where it should be
* Update src/renderer/chunk_meshing.zig
* Update src/renderer/chunk_meshing.zig
* Converge formatting with master
* fix formatting (https://github.com/ziglang/zig-spec/issues/38 is so stupid)
---------
Co-authored-by: IntegratedQuantum <jahe788@gmail.com>
* Create the foundations of the new network system.
* Fix memory leak
* Implement a simple additive-increase-multiplicative-decrease congestion control scheme.
Also fixed the locking with the send path
* Fix edge case for mismatch in read and available position
* fix formatting
* Reimplemtent network statistics of the F6 menu
* Fix problem the F6 window size
* Rename size to capacity
* Implement the advanced network debug menu
* Fix a few problems
* Actually call the handlePacketLoss function
* Reduce startup delay and fix possible problems with negative RTTs
* Fix crash in block of partially received packets.
* Use a PriorityQueue for unconfirmed packets.
Also fixed a display issue in the advanced network menu
* Always send confirmations and change how packet loss is handled to avoid killing the network connection by only resending packets outside the receive buffer.
* Use the length instead of the endIndex in the CircularBufferQueue
this just made everything more difficult to work with.
* Optimize CircularBufferQueue.enqueueSlice with memcpy
* Fix problem with zero-length packets, which is a valid use case
* Fix a small edge case
* fix formatting
* Add missing code to increase the capacity in enqueueSlice
* Don't send more data than the receive buffer can fit.
* Use a better data structures that handles the received ranges
* Use memcpy in more circular buffer functions
* Send a keepalive if the connection hasn't been established but the player was invited by the server
* Implement disconnecting for the new protocol
* Reimplement timeout
* Only add new connections when the other side actually sent an init packet.
otherwise the connections stay in the queue, and need keepalives.
also moved the code from the invite window to network.zig, where it belongs
* Don't allow queueing more than 2 GiB of data (i32 limit)
* Reimplement and simplify reconnection
* Use member functions for Socket
* React to packets using a scheme similar to TCP
TCP will send a fast retransmit on first loss discovered by DACKs, shortly after starting the RTO timer.
In essence this means that only second loss of the smallest packets is handled by congestion control.
* Increase scaling after congestion control halves bandwidth.
Now it increases it by at least 1%, isntead of only by the MTU
* Use start and len instead of start and end for the RangeBuffer
* Use ListUnmanaged in RangeBuffer
* Rename flawedReceive to tryReceive
* Add a `ms` constant to make it easier to see what units some of the constants use.
Also added a function alias for microTimestamp to make it potentially easier to change to other timestamps in the future.
* Format all the files
* Fix compilation error.
* The install scripts now patch render.zig from the zig standard library.
* Update ci.yml
* Update ci.yml
* Update ci.yml
* Update ci.yml
* Update ci.yml
* Update ci.yml
* Update ci.yml
* Update ci.yml
* Update ci.yml
* Update ci.yml
* Update ci.yml
* Update the formatter, it doesn't need to run on .zig files anymore.
* Update ci.yml
* Update ci.yml
* Add a mistake to check if it works
* IT WORKS!
Errors are things that come from actual problems, like incorrect parametrizations.
Warnings are things that hint at potential problems, but could also occur during regular runtime, like for example server lag.
progress towards #911
fixes#751
This allowed reenabling item consumption when placing blocks. Durability and item drops are still work in progress.
Currently all game modes consume items. Temporarily reverts some changes from #739, until the game mode is synchronized to the server as well.
progress towards #670
The lossy compression just simply replaces all interior blocks. It should not make any difference visually.
This halves the amount of data that is sent when first joining.
This makes #748 less important
fixes#745