79 Commits

Author SHA1 Message Date
IntegratedQuantum
22488a28ae CI: Check for trailing spaces and (missing) newlines at the end of the file
fixes #737
2025-02-12 17:36:44 +01:00
IntegratedQuantum
59cc2b3ae2 Allow specifying the rotation mode state in of blocks for most structures.
fixes #1006
2025-02-07 21:15:10 +01:00
IntegratedQuantum
38dcb5480e Add an ore rotation mode that allows you to put the ore on top of any other block.
fixes #611
2025-01-30 21:37:03 +01:00
OneAvargeCoder193
fabc5c1aef
Added crouching and block based friction (#926)
* basic_crouching

* added crouching and block based friction

* use 1 / in friction calculation

* fix some issues

* remove spam

* make flying disable friction

* add slipping to the crouch when you move to fast

* change parameters to 20 and 0.2

* final changes

* fixes

* fix issue when flying

* lower the slip limit

* change slip again

* only change crouch perc when on ground

* small fixes

* other changes

* change slip limit

* revert to linear

* make friction more accurate

* fixes i think

* clamp it

* swap min and max if max is smaller

* change it again

* make it symmetrical
2025-01-26 19:53:02 +01:00
IntegratedQuantum
659deab1f4 Rename sepcial texture and texture info file names.
Should make adding these just a little less painful.
fixes #954
2025-01-24 22:59:32 +01:00
IntegratedQuantum
93f28e6621 Allow disabling ambient occlusion per face using the textureInfo.zig.zon.
I also disabled it for a bunch of plants.

fixes #362
2025-01-23 23:30:18 +01:00
ikabod-kee
0f4b93330e
Add Block Health (ft. QuantumDeveloper) (#945)
* PR!

* Rename hardness to blockHealth

* Replaced Hardness!

* Adjusted new blocks

---------

Co-authored-by: IntegratedQuantum <jahe788@gmail.com>
2025-01-23 22:35:00 +01:00
IntegratedQuantum
faaae6ff4a Add a block breaking animation
fixes #620
2025-01-22 21:32:10 +01:00
IntegratedQuantum
1b1f61cae9 Change some warning messages to error messages.
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
2025-01-12 15:54:53 +01:00
IntegratedQuantum
bf2a78a0e6 Load the block breaking textures into the block texture array.
progress towards #620
2025-01-12 14:59:12 +01:00
IntegratedQuantum
de2e4aedb4 Rename ZonElement.free to deinit to follow zig convention. 2025-01-01 20:27:31 +01:00
IntegratedQuantum
19b1e7e002 improve how block drops are configured. 2024-12-29 16:10:28 +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
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
15758746d9 Remove error spam message when reading block textures.
fixes #735
2024-10-19 15:48:13 +02:00
IntegratedQuantum
e36137ebae Fix broken for when inside of blocks.
fixes #738
2024-10-07 20:42:02 +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
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
72207c973e Refactor: Use decl literals, a recent addition to Zig. 2024-09-14 14:54:49 +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
IntegratedQuantum
2d359ccb86 Turn chunk.Neighbors into an enum.
Syntactically this seems to be a pretty neutral change, some expression get longer, other get shorter.
But I guess it increases type safety and I could also replace some of the more magic operations, like `neighbor ^ 1` with a named function.

fixes #602
2024-08-03 17:21:20 +02:00
IntegratedQuantum
b7a1371f0b Open the block gui when right clicking it.
Also removed the keybind for the crafting gui, since it can now be opened from the game.

fixes #237
2024-08-02 21:24:08 +02:00
IntegratedQuantum
6dc106fb9f Store light data in a separate buffer and compress it.
Slightly slower, but halfs GPU memory usage and allows storing 3× more faces on the GPU.
Also makes meshing a bit slower, but transparency sorting should be a lot faster, since it's shuffling around less memory.
2024-07-27 14:27:53 +02:00
IntegratedQuantum
60b17ed6ef Only draw the outer layers for leaves. The number of layers is configurable.
Makes #579 less useful, but it would still be beneficial.
2024-07-23 21:27:47 +02:00
IntegratedQuantum
daf2f0332e Remove some deprecated APIs to become compatible with the latest master zig. 2024-07-18 21:09:32 +02:00
IntegratedQuantum
289e3c61f1 Add VSCode section headers to make navigating large files easier. 2024-07-14 11:31:57 +02:00
IntegratedQuantum
47752e37f3 Hide technical blocks, like opaque leaves, from the creative inventory.
fixes #507
2024-06-23 11:17:57 +02:00
OneAvargeCoder193
4e7f365f0c
Added collisions and a first person controller (#489)
* Added collisions and first person controller

* Made collision detection not have 12 if statements

* Added some more stuff

* Delete assets/backgrounds/client_539.png

* Fix issues with fences

* Made stepping work

* Added momentum and tweaked speed and friction values so you have less control in the air

* Remove debug print

* Avoid expensive copy of the model struct.

---------

Co-authored-by: IntegratedQuantum <jahe788@gmail.com>
2024-06-19 10:22:58 +02:00
IntegratedQuantum
3a9b228efe Add lodReplacement blocks to optimize leaves and remove torches in LOD.
fixes #482
2024-06-18 10:16:47 +02:00
IntegratedQuantum
d179868243 Improve anisotropic filtering setting. 2024-06-08 15:34:21 +02:00
IntegratedQuantum
503768b791 Draw the air fog when a block doesn't have its own fog.
fixes #403
fixes #335
2024-06-05 17:05:42 +02:00
tillpp
82a127db1c
Qol shortcuts (#382)
* better shortcuts: no more arthritis simulator

* remove auto-format

* better shortcuts + back to menue option (without world exit tho)

* WIP exiting the world

* Requested changes

* no crash and better exit message.

* Localizers have fun translating this!
2024-05-26 09:10:28 +02:00
IntegratedQuantum
bb25c0181e Show internal leaves faces.
Fixes #217 at a heavy performance cost.
2024-05-17 20:50:04 +02:00
IntegratedQuantum
e2459d1fbd Remove all the commented java code.
Most of it is already implemented elsewhere or no longer applicable and would need to be rewritten from scratch.
closes #129
2024-04-20 10:58:59 +02:00
IntegratedQuantum
2dfbe98844 Add texture hot-reloading for Linux and Windows.
Closes #106
2024-04-02 16:47:32 +02:00
IntegratedQuantum
0159b65e51 Remove the Permutation and generate all variants of the fence model.
Progess towards #68
2024-03-22 21:27:10 +01:00
IntegratedQuantum
69e1fe2f15 Allow rotation modes to create rotated versions of given block models.
A step towards #68
2024-03-20 15:25:19 +01:00
IntegratedQuantum
a1ddb6755d Pass the texture instead of the block to the GPU.
The block doesn't need to be known for rendering, all the info is in the texture now.
This is another step towards arbitrary models #134
2024-03-12 21:38:38 +01:00
IntegratedQuantum
80a4d2d35a The fog data is now part of the texture.
This is not really optimal, as this doesn't ensure that all textures of a block have the same fog, but this is an important step towards not storing the block id on the GPU and additionally this allows changing the fog of a block in future resource packs.
2024-03-12 11:45:38 +01:00
IntegratedQuantum
a682169562 Add absorption textures - previously absorption was constant throughout the block. 2024-03-11 21:02:56 +01:00
IntegratedQuantum
53657292d7 Add reflectivity mapping and allow opaque blocks to be reflective. 2024-03-08 22:37:55 +01:00
IntegratedQuantum
1cc6410ef6 z is now up
Closes #272
2024-02-26 17:31:42 +01:00
IntegratedQuantum
2c33f3779d Switch to a self-made list data structure that doesn't return OutOfMemory errors. 2024-01-30 16:34:40 +01:00
IntegratedQuantum
de004841b7 Handle OutOfMemory errors centrally for the globalAllocator and derivatives.
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.
2024-01-29 17:22:20 +01:00
IntegratedQuantum
048b48e5c7 Update lights when placing emissive blocks and fix ambient occlusion
The ground had no absorption. Fixes #222
Helps with #221
2023-12-05 20:09:52 +01:00
IntegratedQuantum
91a52e6dae Add anisotropic filtering and make leaves transparent again. 2023-12-01 16:29:32 +01:00
IntegratedQuantum
df075aa7df Prevent signed integer modulo in the animation frame calculation.
fixes #176
This created negative values when the time was negative, resulting in wrong animation frames.
2023-11-17 11:39:37 +01:00
IntegratedQuantum
d6ab3d587b Use glBufferStorage to tell the driver that certain buffers are only uploaded once and never changed.
Should fix #144
2023-11-15 17:42:07 +01:00
IntegratedQuantum
e398824cab Refactoring: Use const instead of var where possible.
When I started to use zig, I mostly used `var`. But over time I adapted to using `const` where possible which is more readable and the compiler is currently optimizing it better.
2023-10-22 21:12:45 +02:00
IntegratedQuantum
045ba9c65a Precalculate animation data to avoid recalculating it a million times in the fragment shader.
Improves performance by about 1 ms in a test scene.
2023-10-02 23:49:24 +02:00