* 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!
* Save the player's location and inventory, and also added the ability to load the player's location
* remove the comment from utils
* make the player save every 5 seconds
* fix gamemode loading
* remove comment
* added inventory loading
* fix bug
* fix unintentional changes
* fix segfault
* fixes
* Some small fixes.
---------
Co-authored-by: IntegratedQuantum <jahe788@gmail.com>
I gave up on two restrictions:
1. low-to-high LOD borders are no longer prevented. This was only a problem for low render distance + fast movement, and the consequences of the fix were causing flickering in some cases, and to be honest I prefer small gaps in the terrain.
2. 2×2×2 chunks are grouped and rendered together. This makes the vertex shader a bit simpler and allows hierarchical traversal of chunks. However this means that the minimume render distance had to be increased again.
Overall this gave around a 30% reduction in CPU time for selecting the visible chunks. This also reduced jitter during loading.
makes #722 less severe
would make #745 more effective
Further optimizations might be possible.
* threadpool: track and show task times
* debug window: subdivide task performance
* indent debug window code
* task perfs: remove meshgen for lighting
* task perfs: don't divide by zero
* task perf: move taskType to vtable
* use directEnumArrayLen instead of C-style length
* use @tagName for task type classes
* switch to atomics
* recategorize LightRefreshTaks, LightMapLoadTask under misc
* add frameCount
* update perfs every perfUpdateFrequency frames
* restore 4k pageSize
* lighting -> meshgenAndLighting
* reset counts on open rather than by time
* revert to mutex Performance
* restore 4096 pageSize
* cleanup
* correctly use Performance init
* track task time per frame properly
* just copy.*
* use % total instead of % frame time
* capitalize Total task time
* remove total task time
* destroy performance on deinit
fixes a deadlock and reduces the chance for future deadlocks of this kind.
should also fix#384 since now the largest continuous locking time is shorter.
It uses 4 collision checks to ensure that the item drop doesn't fall through blocks.
Jittering is fixed by adding the acceleration before the collision test.
items are now larger than blocks
items are now centered.
The index is then only calculated once. Individual insertions are not optimized though.
fixes#600
Also it seems that in my previous performance commit I had made a mistake in my measurement, I must have measured a buggy version which turned out to be super fast. In actuality the performance difference was much smaller, so I decided to optimize that section as well.
Now it's at 1.7 ms per chunk. Still needs more improvements, I guess.
Packets are now sent more evenly spaces to avoid congestion on the send buffer of the operating system.
Expensive protocols, like the chunkTransmission protocol, are now executed in parallel to avoid congestion from unpacking large chunks of data in the network thread.
And finally the base protocol now tries to estimate the available bandwidth of the connection based on data of last 1.6 seconds (sorry to the people who live on the moon, your bandwidth cannot be estimated and is set to 100000 kB/s, so you will have trouble playing with your friends on earth).
fixes#216fixes#212
Also uses a more consistent naming convention when reference counting is involved.
Fixes#332
Potentially fixes#329 (I can't reproduce it anymore)
Discovers #338
This allows using the StackAllocator for more data structures and library functions.
Fixes#268Fixes#95 (at least to the point where I can't do anything about it)
This is done by reusing the lightQueue instead of allocating new ones(→less locking in the allocator) and by avoiding too frequent task priority updates(→less locking when adding new tasks).
The remaining 30% will hopefully be done by improvements to the zig GPA.
To let the rest of the code know about this decision I implemented a wrapper over the Allocator interface which cannot fail.
This is just the first step in the upcoming refactoring attempt.
A CircularBufferQueue means that we might revisit some points, for example when there is a dim and a bright light source.
However in practice the performance impact of using a PriorityQueue is huge, so this edge case doesn't matter really.
This makes light propagation about 20 times faster and should help with #223, but it doesn't seem to actually make a difference. There is likely something else going on here.
This finally fixes#171 (although CPUs with even more threads, or a future game with even better optimized terrain generation will still have this problem)