34 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
824840a776 Fix formatting 2025-05-13 21:48:58 +02:00
IntegratedQuantum
73bbdcc033 Allow arbitrary and duplicate Save names.
This is done by replacing all illegal file name characters with `-`. Unicode is still preserved because it doesn't seem to be a problem for modern file systems.
The idea of file name encoding/decoding is discarded, instead the name is just stored in the zon
fixes #606
2025-05-13 21:10:14 +02:00
IntegratedQuantum
8bcc00f536 Sort the world list in save selection by least recently used.
Also did some further refactoring to make it easier to deal with different world paths (#606) in the future.
fixes #1311
2025-05-13 20:39:12 +02:00
IntegratedQuantum
ab4beca0f4 Rename the server thread to make it easier to distinguish in a profiler or debugger.
I would also rename the main thread, but that doesn't seem to be possible.
2025-05-13 19:54:48 +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
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
OneAvargeCoder193
47a854d3cc
make a open log button (#946)
* make a open log button

* move to function

* make an icon

* do something

* small changes
2025-01-23 18:37:37 +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
10a1322058 Use the default port where possible.
Also make sure that another port is used and communicated correctly when the default port is already in use.
This allows opening multiple singleplayer worlds on the same computer.

fixes #605
2024-08-01 22:05:20 +02:00
OneAvargeCoder193
5281b77e9e
Made the open folder button work on windows (#586)
* Changed the saveFolder function so that it does the correct command on windows

* Changed the saveFolder function so that it does the correct command on windows

* why
2024-07-24 09:42:56 +02:00
Carrie
67cce6f25a Fix some text, add default_background 2024-07-23 20:44:34 +02:00
IntegratedQuantum
412d5b93b8 Improve world selection and creation interfaces.
fixes #577
fixes #576
fixes #575
2024-07-20 16:32:09 +02:00
IntegratedQuantum
e48f0d2fdb Fix crash when deleting world in the world selection screen.
fixes #486
2024-06-24 22:22:05 +02:00
IntegratedQuantum
e1b15fd8cf Add the save_creation screen.
fixes #79
2024-06-18 19:13:07 +02:00
IntegratedQuantum
638de5e1df Regenerate all LODs whenever a biome was changed.
fixes #360
2024-06-03 19:18:50 +02:00
IntegratedQuantum
899083569d Remove redundant window ids. They were asserted to be equal to the file name, now they are initialized to the file name, removing the need for setting it manually.
This makes adding new windows simpler, also affects #273.
2024-03-19 22:17:46 +01: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
a61fe26fab Update zig: Andrew broke it all. 2023-11-28 00:04:01 +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
4327a50c5e Add a secret option that allows skipping the menu and automatically entering a world. 2023-08-27 17:39:54 +02:00
IntegratedQuantum
a703cb6c6a Occlusion culling 2023-08-15 21:11:40 +02:00
IntegratedQuantum
7cb347ce3c Update zig to 0.11.0-dev.3990+f2d433a19 2023-07-14 11:24:18 +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
e2280c2b63 Update zig version to 0.11.0-dev.3380+7e0a02ee2
Zig got worse at copying unnecessary stuff onto the stack :(
2023-06-06 13:38:38 +02:00
IntegratedQuantum
cc97c0d296 Add a ServerWorld which at the moment generates empty chunks. 2023-04-13 21:04:46 +02:00
IntegratedQuantum
b98f565f2e Start working on the server:
It can now do a handshake (sort of).
I also added a CommandQueue for the gui system to prevent issues from closing windows while they are being updated.
2023-04-09 11:28:21 +02:00
IntegratedQuantum
b0ea868fa4 Remove the window title and fix ItemSlot pressed behavior. 2023-04-08 14:58:25 +02:00
IntegratedQuantum
e09bc9eb4e Add the save_selection gui. 2023-04-04 22:38:41 +02:00