1074 Commits

Author SHA1 Message Date
IntegratedQuantum
de2e4aedb4 Rename ZonElement.free to deinit to follow zig convention. 2025-01-01 20:27:31 +01:00
IntegratedQuantum
1c5229e480 Reduce air drag and reduce intitial velocity of item drops when breaking a block.
Also offset their initial position randomly within the block.

progress towards #868
2025-01-01 17:22:23 +01:00
IntegratedQuantum
613498d048 Don't execute empty commands when an item cannot be collected to a given item stack.
fixes #871 (technically it fixes only the symptoms, not the root cause. The root cause is probably #865
2025-01-01 16:22:50 +01:00
IntegratedQuantum
a40a854123 Blocks drop items in survival mode.
fixes #645

also fixes an issue where the torch couldn't be broken in survival mode.
2024-12-31 23:58:04 +01:00
IntegratedQuantum
9f3c63ebff Split the server mutex into multiple different mutexes that are used in smaller scopes.
fixes #864
Also fixed a data race in the itemdrop manager
2024-12-31 14:53:42 +01:00
IntegratedQuantum
47ed704e49 Refactor the ItemDropManager to reduce the usage of mutexes.
This is done by ensuring all the critical things are done on the server thread, while all remaining things are locked tightly with a mutex or a better data structure.

fixes #863

Also fixes a bug where item drop collection was not collecting the right amount.
2024-12-31 00:53:06 +01:00
IntegratedQuantum
de90b4ede3 Introduce a ConcurrentQueue to reduce the number of raw mutexes used throughout the code to simplify the code reduce the chance of (multithreaded) deadlocks.
For now it's just a queue with a mutex.

this might help with #863 and #864 in the future.
2024-12-30 00:59:45 +01:00
IntegratedQuantum
19b1e7e002 improve how block drops are configured. 2024-12-29 16:10:28 +01:00
somatcha
62a4b5499b fix: /invite error rename 2024-12-28 23:21:45 +01:00
IntegratedQuantum
79c38b8ccc Store the gamemode on the server and add a command to change it. The gamemode is also now used in inventory operations.
fixes #846
2024-12-27 21:36:31 +01:00
IntegratedQuantum
0c0ca2ed15 Synchronize block breaking and placing throug the inventory synchronization system.
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
2024-12-24 23:52:11 +01:00
IntegratedQuantum
363edfb22d Set the climate zone wavelength to 4096 by default and make it configurable per world. 2024-12-20 21:53:13 +01:00
IntegratedQuantum
84afe1a189 Allow teleporting to a biome with /tp. 2024-12-20 20:40:06 +01:00
ikabod-kee
c784f16c19
Added a void to separate the cave world from the root world. (#833)
* Add files via upload

* Move the files because I love github

* ACTUALLY replace the files. I love github

* Changed it to 50k

* Folder for void biomes + other changes

Made torches rarer,
Fixed void caverns generating too high,
Made the fog lighter,
Added a root crystals biome (it's a bit rare, I haven't seen it generate, but hypothetically it should be there)

* Removed air patches

* Various Void Changes

Made void spawn lower,
Made void root torches more common,
Changed fog color

* Fixed Fog Color and Made Fog Thicker

* Made the void 1500 blocks tall

* Added caves parameter to Void

* Removed stoneblock replacement
2024-12-19 20:58:49 +01:00
careeoki
afcef76cdf
Stone Walls (#825)
* Add wall model, add stone walls with wip textures

* Some work on textures...

* More work on texture. Tweak Voidstone bricsk

* Add voidstone and ferrock tiles, tweak their textures, more work on twall textures

* Add voidstone and ferrock walls., more work on textures

* Add remaining textures and add missing recipies

* undo change

* Remove mtl references

* Optimized (but z-fighting) wall model

* Fix a thing *backflip*

* Update fence and wall model for new code

* Improve how the fence rotation handles UVs on the top and bottom faces.

---------

Co-authored-by: IntegratedQuantum <jahe788@gmail.com>
2024-12-19 17:52:56 +01:00
IntegratedQuantum
07888c7600 Fix bug in the conservative range calculation of the RandomBiomeDistribution 2024-12-17 22:05:50 +01:00
IntegratedQuantum
458dd20ade Allow setting the highestLod parameter when in the menu.
I decided to avoid the trouble of making this dynamic, by just only allowing to change it in the menu.
fixes #747
2024-12-17 14:37:45 +01:00
IntegratedQuantum
3bdc1dd83d Introduce LOD0.5 which renders all leaves opaque.
This allows removing a bunch of internal faces, improving frametime greatly when looking at a distant forest.

fixes #579

makes #823 more important, since this doubled the cost
2024-12-16 23:27:51 +01:00
IntegratedQuantum
3f0f2f7dcb Allow asset file names to just end in .zon instead of .zig.zon
.zig.zon should still be preferred due to having syntax highlighting on github.
2024-12-16 15:57:32 +01:00
IntegratedQuantum
be818cd452 I forgot to actually add the beach biomes. 2024-12-15 12:38:52 +01:00
IntegratedQuantum
92348c09e3 Add an option to keep (some) of the original terrain data for transition biomes. 2024-12-15 12:33:47 +01:00
IntegratedQuantum
60f5da1724 Add transition biomes and beaches.
could also help with #344 (although that might require some more system changes)
2024-12-14 18:21:53 +01:00
IntegratedQuantum
0f754c44a0 Fix rare connectivity issues by switching to the minimal IPv4 MTU.
progress towards #819
2024-12-08 20:13:44 +01:00
Carrie
24004ef5a5 Replace snail_player with humanoid slug thing 2024-12-08 16:34:42 +01:00
IntegratedQuantum
f65c83ee0d Don't send empty entity update packets every server tick. 2024-12-08 11:32:59 +01:00
IntegratedQuantum
e459c5c943 Support ranges for biome radius. 2024-12-07 22:11:47 +01:00
IntegratedQuantum
8312253e77 Fix deadlock on user reconnect.
Also adds a space before chat messages.
2024-12-07 21:47:53 +01:00
IntegratedQuantum
0d56992c22 Only connect fences to full blocks
Also removed some debug code.

fixes #814
2024-12-07 14:59:47 +01:00
IntegratedQuantum
8a097804ab Reduce memory usage of StructureMapFragments by constructing all the lists on the stackAllocator before transfering them tightly packed into the arena.
progress towards #813
2024-12-07 14:34:43 +01:00
Somanshu Rath
3d67c9023e
upd: error notification gui (#809)
* fix: empty host ip in multiplayer

* fix: multiplayer conn init missing

* upd: error notif. window

* format fix

* fix: notification text global var

* fix: error notif. refresh

* fix: max width

* fix: raiseNotification fn

* fix: cleanup

* fix: minor changes

* fix: minor changes

* fix: defer line

* fix: revert global state on error

* fix: format check

* fix: save ip after successful conn
2024-12-07 12:31:47 +01:00
IntegratedQuantum
c978afab50 Fix assertion failures with the arena.shrinkAndFree function. 2024-12-06 22:22:25 +01:00
IntegratedQuantum
c495e8406c Fix some problems with window closing and the delete world confirmation window.
Seems relevant for #809
2024-12-05 22:05:08 +01:00
IntegratedQuantum
fd478e2b99 Add a shrinkAndFree method to the Arena to reduce memory footprint of StructureMapFragments by ~20%
progress towards #813
2024-12-05 21:47:16 +01:00
IntegratedQuantum
bcae83313a Fix perlin noise for other allocators and switch it to the stackAllocator.
Also revisited some of the cache sizes.
2024-12-04 22:50:57 +01:00
IntegratedQuantum
1837fe7adf Don't print trailing commas in empty zon structs/tuples.
fixes #808 (after entering and leaving the world once)
2024-12-04 21:21:21 +01:00
IntegratedQuantum
0a8b9de3a9 Don't print any numbers and remove default localhost multiplayer IP address.
These were causing some problems.
2024-12-03 21:18:20 +01:00
IntegratedQuantum
518bc0bf1f Add flower patches
fixes #557
2024-12-03 21:11:05 +01:00
IntegratedQuantum
77b1fffa27 Reintroduce "natural standard" for rotation modes to allow generating flowers on the ground without much extra work. 2024-12-03 20:47:56 +01:00
IntegratedQuantum
4ca28668f1 Add a priority system for biome structures.
This solves a big part of the degradability problem and allows removing non_degradable_oak_leaves.
2024-12-02 21:13:56 +01:00
IntegratedQuantum
1455605387 Use a lower precision buffer for bloom calculation.
Slightly (~100 µs) improves performance of bloom, but might open up more detailed (→less jitter) bloom implementations.
2024-12-02 20:43:58 +01:00
Carrie
5f722274b1 Tweak ui textures/contrast 2024-12-02 20:11:00 +01:00
IntegratedQuantum
5f7ccd0504 Load the settings and gui_layout files from a global directory.
For linux and mac I just use "~/.cubyz"
For windows there seems to be no consensus on where game data should be located.
Out of the commonly used locations, "~/Saved Games/Cubyz" seemed the most sane option to me.

fixes #457
2024-12-01 11:48:31 +01:00
IntegratedQuantum
b06b4e7224 Use lossy compression on LOD chunks when sending them over the network.
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
2024-11-30 20:51:36 +01:00
IntegratedQuantum
da25cbc19c Improve cache locality of updateAndGetRenderChunks by duplicating important variables into "fast" memory.
Also now using a MemoryPool for ChunkMeshes to reduce cache aliasing caused by poor behavior of the GPA.

fixes #722
2024-11-30 16:32:33 +01:00
IntegratedQuantum
7651ae6aee Change how visible meshes are determined and traversed.
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.
2024-11-30 15:23:40 +01:00
careeoki
04810c573a
Daisies & Ivy (#799)
* Add plane model, daisies, and ivy

* Add item textures

* Tweak ivy

* Finalize ivy textures

* Remove numerical noise from plane.obj

---------

Co-authored-by: IntegratedQuantum <jahe788@gmail.com>
2024-11-29 22:48:01 +01:00
Carrie
f465b08835 Make creative menu 10 slots wide 2024-11-27 16:49:51 +01:00
IntegratedQuantum
154dc76c4a Place carpets in parallel to selected carpet where possible.
fixes #786
fixes #789
2024-11-26 21:39:51 +01:00
IntegratedQuantum
994d2c93ea Allow breaking single torches and carpets from a given block, instead of breaking all at once.
fixes #798
2024-11-25 17:52:49 +01:00
IntegratedQuantum
0d50346fad Unhardcode how chiselling is handled, given the opportunity for other rotation modes to do similar things.
Preparing for #798
2024-11-25 17:42:44 +01:00