PixelGuys / Cubyz

Voxel sandbox game with a large render distance, procedurally generated content and some cool graphical effects.
GNU General Public License v3.0
420 stars 49 forks source link

Ship the source code and zig compiler #118

Closed IntegratedQuantum closed 7 months ago

IntegratedQuantum commented 11 months ago

This should be possible with the Zig compiler, but I'm not 100% sure if it would work on windows (if a visual studio installation is needed, that would be problematic).

But this would be advantageous in so many ways:

It does come at some cost though:

Requirements

IntegratedQuantum commented 10 months ago

This is basically done. I only need to get certainty on whether this actually works well in practice without needing to install extra packages or something like that.

archbirdplus commented 10 months ago

Downloading Zig12 was the least of my problems building Cubyz, probably thanks to run.sh doing that for me. It probably saves bandwidth from having me google why my homebrew Zig11 fails with a useless error.

Building Cubyz after applying commit 9978fd2 also helped me isolate the Zig crash. I suppose for normal use-cases, Cubyz-libs would work just fine. But it does make prototyping or using an unofficial Cubyz-libs more complicated.

IntegratedQuantum commented 10 months ago

I suppose for normal use-cases, Cubyz-libs would work just fine. But it does make prototyping or using an unofficial Cubyz-libs more complicated.

That is true. But I found that it isn't too hard, since you can just change the entry in the build.zig.zon to import a local file. It still requires a few extra steps sadly, like packaging the library into a tar.gz every time and clearing the .seed field, otherwise zig just keeps using the outdated version from the cache.

archbirdplus commented 10 months ago

Yeah as soon as I had to build it more than once I wrote a Makefile for tar/gz'ing it. I wonder if you can do that in the build.zig?

IntegratedQuantum commented 10 months ago

It should be possible to add custom steps that execute arbitrary code. But honestly I don't know how to use that in practice.