33 Commits

Author SHA1 Message Date
IntegratedQuantum
aae66ea77f
Update Zig to use the new Writergate version (#1664)
For reference: https://github.com/ziglang/zig/pull/24329

some commits have been extracted from #1583, but the x86_64 backend has
been disabled due to its horrible performance.

Remaining work:
- [x] Wait for official builds on ziglang.org and upload them to our
repository
- [x] Add workaround for https://github.com/ziglang/zig/pull/24466
- [x] Fix TODO comment about ANSI support in stdout
- [x] Check for compile-time performance changes → it went from 13.1 to
11.9 seconds 🎉
2025-07-15 23:00:29 +02:00
IntegratedQuantum
c2ef9aba62 Remove the root . . . . . . . . . . import, replacing it with @import("main")
To fully solve the ZLS issues I had to also add the import to the other executables.
2025-03-27 21:16:35 +01:00
IntegratedQuantum
84fe4088fd
Add testing to the CI (#1246)
* Update ci.yml

* Fix compilation failure of testing code
2025-03-25 21:09:53 +01:00
IntegratedQuantum
09fc516828 Move all the allocators to a separate file. They can now be imported with main.heap (analogous to std.heap)
I also removed the unused BufferFallbackAllocator which was from a time where I was still experimenting with different allocators.
2025-03-09 16:26:41 +01:00
IntegratedQuantum
bc02bb0587
Use (an adapted version) of zig fmt to format the source code. (#1140)
* 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!
2025-03-02 16:36:58 +01:00
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
c7a67eb42a Add a zon (Zig Object Notation) parser in preparation for #733 2024-09-28 19:55:22 +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
289e3c61f1 Add VSCode section headers to make navigating large files easier. 2024-07-14 11:31:57 +02:00
IntegratedQuantum
3a74300a43 JsonElement.get and .put can now handle Vector attributes.
fixes #430
2024-06-02 20:09:34 +02:00
IntegratedQuantum
0acb0e2c80 Update zig
This one was annoying.
2024-04-03 13:57:38 +02:00
IntegratedQuantum
05769cc765 Some improvements to error handling 2024-01-31 15:35:15 +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
4f789c4cca Update zig, forcing constness 2023-11-21 16:23:24 +01:00
IntegratedQuantum
e61709cb69 Rethink the allocation strategy.
Instead of one general purpose allocator per thread, there now is one stack allocator per thread, which behaves like a basic stack.
Using this allocator for all the trivial allocations, makes the game overall more efficient, even if some larger allocations now require going through the global allocator.
Maybe in the future the stack allocator could be extended with a temporary arena allocator functionality?

This should help with #171 by almost halfing the CPU usage of the receiving network thread. However the issue remains.
2023-11-21 16:06:19 +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
7c3d3462c9 Update zig version to 0.11.0-dev.3879+5804f3f75
Note: Requires running `zig fmt` in the mach subfolder to work.

Zig did some weird stuff there. Partially helpful, partially annoying. But it made me clean up some old code, so that's a good thing I guess.
2023-06-28 19:54:52 +02:00
IntegratedQuantum
4d092126cc Store the player position on the server to prioritize terrain generation. 2023-05-28 19:31:03 +02:00
IntegratedQuantum
bb904828e8 Save/Load the gui layout. 2023-03-15 22:25:32 +01:00
IntegratedQuantum
0d064fc9da Dynamic gui scale and some refactoring and fixes. 2023-03-12 17:11:00 +01:00
IntegratedQuantum
ff7df1bdbc The for loop update. 2023-02-21 21:34:09 +01:00
IntegratedQuantum
a03f957743 Move the parse function into JsonElement to simplify usage.
And some more refactoring...
2023-01-24 12:48:21 +01:00
IntegratedQuantum
0ac3346cc4 Start working on itemdrops. 2023-01-24 12:06:02 +01:00
IntegratedQuantum
56f83aedbc Load block drops. 2022-12-14 20:28:49 +01:00
IntegratedQuantum
3bc3fa8620 Settings loading and storing (using fancy comptime reflection). 2022-11-27 20:19:49 +01:00
IntegratedQuantum
df36109ee5 Add the player inventory(no gui yet), fix compile errors from last commit and fix a data race. 2022-11-22 15:46:04 +01:00
IntegratedQuantum
0f0b0b6ac4 Start working on items. 2022-11-19 19:22:49 +01:00
IntegratedQuantum
cb5135da6e Add temporary entity rendering(it's a green rect) and receive entity data from the network. 2022-10-10 10:44:26 +02:00
IntegratedQuantum
055ccf88d3 Add the client-side of the handshake. 2022-09-11 16:45:34 +02:00
IntegratedQuantum
0a3311ee56 Block loading. 2022-08-29 23:15:33 +02:00
IntegratedQuantum
4af97d93c6 Add json parsing. 2022-08-28 23:14:32 +02:00