798 Commits

Author SHA1 Message Date
IntegratedQuantum
99a3d66bf1 Convert recipe files to zon.
fixes #767
2024-11-08 21:27:04 +01:00
IntegratedQuantum
f36ad5215f Add a volcano biome. 2024-11-07 20:57:41 +01:00
IntegratedQuantum
116d7b5e99 Remove zero chance biomes before constructing the biome properties tree.
fixes #766
2024-11-07 16:57:36 +01:00
IntegratedQuantum
7b4461ad00 Improve biome interpolation on biome changes.
Now it uses a 1d noise, to offset the biome positions and the height interpolation.

This should also fix #633 and helps reduce the impact of #766
2024-11-05 23:30:27 +01:00
ikabod-kee
9e4f347268
Added recipes (#761)
* Recipe File Changes

* Removed chisel from stone bricks recipe

* Removed stick recipes

* Re-added stick recipes + changed torch recipe

* Stick recipes removed

* More Stone recipes, iron ingot, torches
2024-11-05 20:10:19 +01:00
IntegratedQuantum
a0dce26ac2 Move the glPolygonOffset into a tighter scope so it doesn't affect the occlusion tests.
should fix the most severe problem of #765
2024-11-04 20:53:48 +01:00
careeoki
fabed5a4a0
Basalt blocks & Lamp (#764)
* Add basalt blocks, add lamp block

* Tweak lamp top, make torch light warmer, uranium glass light dimmer, lamp cooler

* Minor texture changes

* Tweak torch light

* Less light from uranium glass, tweak lamp

* Tweak torch light
2024-11-03 22:37:49 +01:00
IntegratedQuantum
44bce44ba5 Move inventory operations to a new file.
fixes #755
2024-11-03 15:43:25 +01:00
IntegratedQuantum
7847400b1f More refactoring of the inventory code by combining inventory and slot into one struct.
progress on #755
2024-11-03 15:11:32 +01:00
IntegratedQuantum
f4f37b460b Simplify how BaseOperations are executed.
progress towards #755
2024-10-31 21:24:58 +01:00
IntegratedQuantum
5d85d4045e Refactor: Combine both inventory drop operations into one using a (maximum) amount.
progress on #755
2024-10-31 21:00:32 +01:00
IntegratedQuantum
f878af9830 Remove the old item stack dropping from the protocol.
fixes #643
2024-10-30 20:06:21 +01:00
IntegratedQuantum
d64458ce48 Prevent depositing non-material items into the workbench.
fixes #753
fixes #598
2024-10-30 19:54:58 +01:00
IntegratedQuantum
4581552179 Only put one of each item into the creative inventory to hide the number.
fixes #754
2024-10-30 19:47:48 +01:00
IntegratedQuantum
d90627b6a5 Fix inventory crafting and allow filling arbitrary amounts using the fillFromCreative function.
fixes #752
progress for #643
2024-10-30 19:42:59 +01:00
IntegratedQuantum
2b7bde161e Introduce an InventorySource type to describe where an inventory comes from.
In future e.g. for a chest this could contain the chest location, so the server knows which chest to open.
more progress on #643
2024-10-28 20:21:42 +01:00
IntegratedQuantum
13974d12ab Fix crash from not initializing the Performance info struct of the ThreadPool. 2024-10-27 21:34:29 +01:00
IntegratedQuantum
a12a2d0bc9 Send sync operations back to the clients, if another client modified the inventory. In case a client receives sync operations it reverts all local unconfirmed changes, applies the sync and finally reapplies all unconfirmed changes.
A big step towards #643
I also added a testing window that can be used to test this in multiplayer.
2024-10-27 20:26:37 +01:00
IntegratedQuantum
2d02ae212c Refactor how basic inventory operations are done to prepare for sending them back to the clients.
more progress for #643
2024-10-27 16:29:18 +01:00
IntegratedQuantum
25a69fdacd Send confirmation for successful inventory operations back to the client.
more progress towards #643
2024-10-27 15:33:41 +01:00
IntegratedQuantum
79d7393c4e Serialize/Deserialize inventory commands and send them to the server.
More progress towards #643

I had to temporarily disable inventory crafting to make this work for now.
2024-10-26 16:42:00 +02:00
IntegratedQuantum
ac50505b31 Give each Inventory a unique ID.
More progress towards #643
2024-10-25 19:47:04 +02:00
IntegratedQuantum
377c2269cc Disable item consumption on block placement for now.
I'll figure out how to synchronize these changes in the future.
For now I'll just disable it to progress faster towards #643
2024-10-25 19:36:42 +02:00
IntegratedQuantum
d4dff4972a Remove some unused ItemStack functionality. 2024-10-24 22:15:09 +02:00
IntegratedQuantum
852437aca0 More robust memory management in the inventory.
fixes some leaks.
Now it only leaks when testing undoing an inventory close operation without redoing it. This should never happen in the real world.

more progress towards #643
2024-10-24 22:08:55 +02:00
IntegratedQuantum
e47bd8d262 Store the command payload as a tagged union instead of always storing all types.
This allows decoupling the payload from the undo steps, making it possible to launch subtasks with a different payloads (e.g. taking an item from creative and putting into the source slot instead of the dest slot).

Additionally this might also prevent some trouble when preparing the network data in the future.

Another small step towards #643
2024-10-23 21:11:25 +02:00
IntegratedQuantum
08b7549f2a Use more concise file API functions from the standard library. 2024-10-21 17:08:50 +02:00
archbirdplus
6b1e5ee5ce
Show task performance (#445)
* 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
2024-10-21 16:13:32 +02:00
IntegratedQuantum
15758746d9 Remove error spam message when reading block textures.
fixes #735
2024-10-19 15:48:13 +02:00
IntegratedQuantum
bc96144b18 Fix z-fighting for stairs behind glass
fixes #696
2024-10-19 15:19:49 +02:00
IntegratedQuantum
ce73339a74 Change some keys from on release to on press to make the UI more responsive.
fixes #715
2024-10-19 15:04:56 +02:00
IntegratedQuantum
b710ccad07 Squeeze all inventory operations through a simple structure that allows undoing operations.
more progress towards #643
This is the client-side prediction part of the client-server architecture.
2024-10-18 22:17:47 +02:00
IntegratedQuantum
051387e66b Fix item swapping on left click, previously they didn't swap because the inventory was trying to do a distribute operation instead of a depositOrSwap operation. 2024-10-16 20:29:55 +02:00
Zachary Hall
e6fa7498c6
Game controller support (#717)
* Refactor getting X positions of buttons in preparation for not moving the window when clicking the buttons

* Initial support for controllers

* Basic controller support

* Allow runtime download of gamecontrollerdb.txt

* Add new gamepad cursor asset, and use it.

* Various improvements
Allow saving and configuring gamepad mappings
Add gamepad sensitivity, for camera only
Adjust multipliers in usage of gamepad axes
Prompt for downloading controller mappings, and allow configuration

* Refactor startup window handling so that controller settings does not duplicate code, or have to detect if startup has finished

* Clamp cursor position to window size when changing via gamepad

* Add deadzone

* Implement changes requested

* Follow more suggestions

* Use atomics

* Use orelse for oldState in Gamepads.update

* Implement requested changes

* Fix accidental removal of whitespace on two empty lines

* Fix incorrect formatting on blank line due to Vim expanding tabs to spaces

* Fix build errors.

* Change unusual orelse usage with better if expression

* Add resettable keys

* Revert "Add resettable keys"

This reverts commit 902f032ec834161dcaac97cbe596788e0110e870.

* Update controller support

* Fix things I forgot about

* Fix more things

* Implement most requested changes and change button text to be more clear

* Update controller support

* Hopefully fix format without breaking it.

* Refactor getting X positions of buttons in preparation for not moving the window when clicking the buttons

* Initial support for controllers

* Basic controller support

* Allow runtime download of gamecontrollerdb.txt

* Add new gamepad cursor asset, and use it.

* Various improvements
Allow saving and configuring gamepad mappings
Add gamepad sensitivity, for camera only
Adjust multipliers in usage of gamepad axes
Prompt for downloading controller mappings, and allow configuration

* Refactor startup window handling so that controller settings does not duplicate code, or have to detect if startup has finished

* Clamp cursor position to window size when changing via gamepad

* Add deadzone

* Implement changes requested

* Follow more suggestions

* Use atomics

* Use orelse for oldState in Gamepads.update

* Implement requested changes

* Fix build errors.

* Change unusual orelse usage with better if expression

* Add resettable keys

* Revert "Add resettable keys"

This reverts commit 902f032ec834161dcaac97cbe596788e0110e870.

* Update controller support

* Fix things I forgot about

* Fix more things

* Implement most requested changes and change button text to be more clear

* Update controller support

* Hopefully fix format without breaking it.

* Implement suggestions

* Update controller mapping downloading to be more automatic

* Fix parameter in Window.Gamepad.ControllerMappingDownloadTask.isStillNeeded

* Revert order of window opening and opening next startup window in openStartupWindow

* Only download controller mappings the first moment a controller is plugged in

* Open controller mapping download UI when actually downloading mappings, or at startup if they have started before GUI initialization but haven't finished yet.

* Don't unnecessarily try to download controller mappings at init when it will be done once the first update happens anyways.

* Implement requested changes

* Remove debugging log output

* Implement changes to download_controller_mappings.zig
2024-10-14 17:31:59 +02:00
IntegratedQuantum
507dc35e20 Remove unreachable stun servers.
fixes #730
2024-10-10 18:14:05 +02:00
IntegratedQuantum
7901c721c3 Unlock the gui command queue mutex while calling window.open/close functions
This allows opening a window from inside the close function.

closes #736
2024-10-10 17:51:24 +02:00
IntegratedQuantum
cf7917787a Handle ConnectionResetByPeer seperately on receive to avoid crashing when the STUN server returns a ICMP port unreachable packet. 2024-10-09 20:54:58 +02:00
ataman6
02387a099d
Add gamemode and unlimited blocks key (#739)
* Add gamemode and unlimited blocks key

* Remove separate unlimited blocks key

* Make middle click work only in creative mode

* Rewrite code a bit
2024-10-08 19:02:24 +02:00
IntegratedQuantum
e36137ebae Fix broken for when inside of blocks.
fixes #738
2024-10-07 20:42:02 +02:00
IntegratedQuantum
e863e9f311 Remove unused milliTime parameter from the threadpool task vtable. 2024-10-07 20:28:48 +02:00
IntegratedQuantum
ad1b8617d2 Always use the position of the last chunk request packet to determine whether a chunk can be removed from the queue. This should prevent any false positives.
fixes #740
2024-10-07 20:22:06 +02:00
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