1057 Commits

Author SHA1 Message Date
IntegratedQuantum
c863d676b5 Improve chunk compression on file/network by running deflate on an 8 bit palette compressed chunk instead of the raw data.
Decreases compressed chunk size by ~30%, should also greatly improve compression/decompression times.

fixes #326
2024-10-06 17:07:57 +02:00
IntegratedQuantum
2fbe3f5d9f Fix infinite loop in zon parser when encountering a json object. 2024-10-06 14:47:47 +02:00
IntegratedQuantum
3a4a695e3d Move all inventory operations that change the inventory into the Inventory struct.
Another important preparation step for #643

It does break a few things regarding inventory ui/ux, but those can be fixed over time.
2024-10-06 14:28:31 +02:00
Zachary Hall
1f1cc286ca
Don't convert dotfiles to ZON, which may include editor configurations. (#734)
* Don't convert dotfiles, which may include editor configurations.
This means that configurations specific to this workspace in editors
don't get overwritten, which prevents accidental formatting errors
whenever the game is tested.

* Fix accidental formatting change

* Use the syntax sugar

* Update main.zig
2024-10-01 20:00:27 +02:00
IntegratedQuantum
6ed0800b4a Change all assets from json to zon.
fixes #733
2024-09-29 17:34:40 +02:00
IntegratedQuantum
b4f3dfbeca Replace json with zon in the entire game and autoamtically convert all json files when an old version is detected.
progress on #733
2024-09-29 16:28:16 +02:00
IntegratedQuantum
e691adf936 Fix some mistakes in the zon parser. 2024-09-29 16:23:16 +02:00
IntegratedQuantum
c7a67eb42a Add a zon (Zig Object Notation) parser in preparation for #733 2024-09-28 19:55:22 +02:00
IntegratedQuantum
629d76a2e1 Use a sprite sheet for animation and move animation data into the textureInfo json to make it easier for texture packs to overwrite these without changing the actual block data.
fixes #664
2024-09-26 20:33:59 +02:00
IntegratedQuantum
7f7dcd190a Refactor: Shorten the player inventory name.
It didn't particularly help anyways. In the future syncing should be done automatically instead of manually anyways.
2024-09-26 19:33:19 +02:00
careeoki
280a6221fa
Stone tiles (#731)
* Tweak bricks, add stone glactite tiles, tweak grey chalk

* Sandstone + marble tiles, redo marble bricks, and tweak a bunch of textures randomly because im insane

* i hate git

* Tweaks, make glacite bricks consistent with tiles

* Add limestone tiles

* Add limestone tile texture

* Make stone bircks consistent wile stone tile

* formatting
2024-09-26 19:19:13 +02:00
IntegratedQuantum
13cd1db703 Add contributing guidelines.
Probably still incomplete, but should be good start.
2024-09-25 20:45:47 +02:00
IntegratedQuantum
d27029ee2b Allow slightly changing the cave radius parameters in the biome settings.
A negative radius is interpreted as adding terrain instead of removing terrain.
This is used in the new void_roots biome and fixes #725

Until #231 is implemented I give this biome the entire area below -50000.
2024-09-17 20:03:22 +02:00
OneAvargeCoder193
e61163e43b give lava interior fog 2024-09-15 17:49:06 +02:00
IntegratedQuantum
e9fdad732d Make flying through caves fun again (removes CPU-side occlusion culling)
This is not quite the performance improvement I had planned.
On the GPU-side the raster occlusion culling step got more expensive, since there now are more chunks checked on average.
On the CPU-side the cost of traversing all the occluded chunks is roughly equal to the cost of the previous occlusion culling heuristic.
On the bright side the cost is now constant, whereas previously looking into the sky was twice as expensive.

fixes #526
fixes #514
fixes #259
2024-09-15 17:26:56 +02:00
IntegratedQuantum
d7055f6998 Some small performance improvements to the CPU-side mesh traversal.
Should help implementing #526
2024-09-15 13:02:02 +02:00
IntegratedQuantum
bfea4d9105 Fix one of Zig's accidental memcpy's introduced when refactoring chunk.Neighbor
https://github.com/ziglang/zig/issues/13938 strikes back
2024-09-14 16:12:39 +02:00
IntegratedQuantum
72207c973e Refactor: Use decl literals, a recent addition to Zig. 2024-09-14 14:54:49 +02:00
IntegratedQuantum
330187b9ae Update zig version 2024-09-14 13:42:25 +02:00
IntegratedQuantum
8987dc4eb0 Pull zig from a github repo instead of relying on ziglang.org, this should be more stable.
fixes #719
2024-09-13 23:55:27 +02:00
Zachary Hall
cf6e9df663
Fix Zig download url (#718)
* Update debug_linux.sh

* Update debug_windows.bat
2024-09-13 22:04:15 +02:00
Zachary Hall
51e0d55a0c
Don't trigger window drag when trying to click on a window button (#695)
* Refactor getting X positions of buttons in preparation for not moving the window when clicking the buttons

* Prevent moving the window by the buttons

* Use tabs instead of spaces for indentation, done using sed.

* Fix formatting actually now with sed in while loop

* Attempt to fix indentation

* Add minimum width and change return type of getButtonPositions

* Include window ID in size error

* Fix orientation lines showing when clicking button and incorrect scaling for button press detection on windows

* Don't include windows without titlebar in window size requirement

* Take into account closability of windows when calculating min width

* Add single quotes around window ID in the width error message for clarity

* Fix chat window automatic sizing, refactoring the minimum window size check in the process
2024-09-12 20:20:11 +02:00
ITR
e07a51c9d9 Was accidentally checking against steppingHeight instead of height.
Fixes #703
2024-09-10 18:44:42 +02:00
IntegratedQuantum
f9079be9ca T to open chat.
extracted from #412
fixes the first half of #428
2024-09-09 21:11:59 +02:00
IntegratedQuantum
c5a9ea53cd Clamp /tp coordinates to prevent people from crashign the server by teleporting to a distant location.
This is a temporary work around, until #310 is implemented.
2024-09-09 20:28:46 +02:00
IntegratedQuantum
9f63353f4a Fix rendering of empty strings in debug menus.
fixes #704
2024-09-09 20:23:05 +02:00
IntegratedQuantum
a5a1f53e90 Use a VirtualList for client entities to ensure stable pointers on resize.
fixes #648
2024-09-08 10:51:09 +02:00
Carrie
eecad02ced Add breaking textures. 2024-09-07 22:32:08 +02:00
ITR
df76d2da1b Added ctrl+a to select all text in a text-box 2024-09-07 22:27:19 +02:00
IntegratedQuantum
1764de2912 Fix height check for cave biomes.
fixes #693
2024-09-06 22:45:02 +02:00
IntegratedQuantum
b162199138 Add a VirtualList which preallocates a large amount of virtual memory to ensure that resizing doesn't invalidate pointers.
There is no direct use case for this yet, but I'm sure this will become handy in the future.

fixes #671
2024-09-06 22:22:15 +02:00
ikabod-kee
b748dbec4b Add files via upload 2024-09-06 19:59:07 +02:00
ITR
d6ec78bb44 Remove spammy warning from biome generation. 2024-09-05 21:34:00 +02:00
Mikael Klages
aa04731efb
Ignore user generated backgrounds in the assets/backgrounds folder. (#682)
* Ignore user generated backgrounds in the assets/backgrounds folder.

* Add back newline at end of file in .gitignore
2024-09-05 21:16:49 +02:00
Mikael Klages
a5ae38aba0
Fix #676 Player keeps forwards momentum when sliding against block (#681)
* Fix #676 Player keeps forwards momentum when sliding against block

* Fix velocity stopping one frame too late
2024-09-05 21:16:10 +02:00
OneAvargeCoder193
5cb12cc3ed
Models (#657)
* Added ability to load .obj files

* remove .mtl file

* Replaced z up with y up in obj because apparently it is better

* Make cubyz support blockbench models correctly

* Not working changes

* Segfault

* Fixed bugs because i felt like it

* Catch up

* stuff

* Stuff

* Catch up

* Remove unneccessary code

* Changes to hopefully fix things

* Remove debug log

* Remove exportModel function

* Updated new blocks

* Fixed some std.log.err calls

* aaa

* I AM SO HAPPY YEEEEESSSSSSSSSSSSSSSSSSSSSSSSS

* im silly

* remove commented line

* Remove useless code

* remove thing

* remove backgrounds

* export function just in case i make an oopsie

* add 1 to indices

* final exportModel fix before i remove

* remove export model

* i forgor to do the uv stuff

* hopefully final exportModel change

* yoo

* final changes

* fixed memory leak
2024-09-04 22:18:45 +02:00
ITR
e1d715ce1c Fix fps cap slider being shown as 144 when the settings are opened, despite being unlimited in the settings. 2024-09-04 20:54:31 +02:00
ITR
3c7bd88f6a Reset fadeOutEnd when chat lists are created.
Fixes crash when reentering world in singleplayer after a chat message has faded out.
Fixes error mentioned in https://github.com/PixelGuys/Cubyz/issues/649#issuecomment-2327506297, but does not affect #649
2024-09-04 20:53:58 +02:00
Mikael Klages
2950c152bb
Fix issues with check_format.py (#667)
* Made format_check use os.sep when checking if it should ignore a folder

* Made format_check specify utf-8 encoding when loading files.

* Fixed documentation using wrong filename for format_check.py
2024-09-04 20:53:02 +02:00
ttmso
830db8185e
Fix overwriteing held item when copying block (#662)
undefined
2024-09-04 20:36:42 +02:00
Mikael Klages
d5ae89f846
Player physics fixes and more debug info (#663)
* Add more player debug info to debug.zig

* Made format_check use os.sep when checking if it should ignore a folder

* Made format_check log the file path if an exception occurs

* Made format_check specify utf-8 encoding when loading files.

* Extracted repeated code from player collision check

* Added back eyepos check that affected physics

* Made unstuck always unstuck upwards for the time being (affects #521)

* Added "coyote time" to eyes when you step off a ledge (fixes #636)

* Added eye data to debug info

* Use smarter eyebox check suggested by Quantum.

* Made collideOrStep return Vec3d with correct index set instead of Vec2d.

* Made sure debug loads atomic bools

* Make eye coyote debug number prettier by not showing it being less than 0

* Revert format_check.py changes to have them in a separate commit.

This reverts commit bebdaa57ce74c0d8152e9a3eedeb2ed96a1515ce.
This reverts commit 1e05bd42982ec3516a4f273a5ba3972d70efe1d8.
This reverts commit 2b4944e60c7441e29c7f96bfcc2d0f3436a01ca8.

* Fix accidentally replacing the wrong argument in a67aa290
2024-09-04 20:31:20 +02:00
IntegratedQuantum
afe744fa7d Fix margin calculation in the CaveBiomeMap.
fixes #640
2024-09-03 21:59:17 +02:00
Carrie
53f9abe23b Update diamond and stick material 2024-09-03 20:24:03 +02:00
IntegratedQuantum
1dc0cfa010 My driver doesn't seem to like discards in a while loop.
fixes #654
2024-09-01 21:58:06 +02:00
IntegratedQuantum
542e1270c5 Fix buffer overflow when receiving a brute forcing port message produced by trying to connect from a symmetric NAT.
Should fix #655
2024-08-31 20:25:31 +02:00
IntegratedQuantum
cb20d886dd Fix the enter name prompt not showing on first game launch. 2024-08-31 10:33:53 +02:00
IntegratedQuantum
e49353aad9 Reduce locking in the ThreadPool to avoid locking while calling any task related functions.
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.
2024-08-29 15:16:06 +02:00
IntegratedQuantum
4cbf907256 Refactor the collision code, moving it outside of the Player struct. 2024-08-18 19:09:09 +02:00
IntegratedQuantum
47356faa23 Fix some item drop physics and visuals.
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.
2024-08-18 18:49:51 +02:00
IntegratedQuantum
f0f64e369c Scale the item drops to 0.25 2024-08-18 14:01:54 +02:00