Live data from Hacker News

Zig gamedev project – left my job to build games in Zig lang

github.com

81–90 of 126 posts

Re: Zig gamedev project – left my job to build games in Zig lang

#81
post #2

I'm using Zig language full-time to create an indie game. Also, I've created zig-gamedev project to build game development ecosystem for this language. Using DirectX 12 for rendering, Bullet for physics. I'm ex-AAA game developer and graphics programmer.

Any plans for multi-platform in the future?

No, sorry, it will stay Windows 10+ only. I want to focus on building interesting stuff (demos, games, audio-visual experiments) I don't have bandwidth to support and maintain code for several platforms.

Re: Zig gamedev project – left my job to build games in Zig lang

#82
post #52

I think Zig is great and I'm following it with interest. But I think people should be aware that it is not really stable yet, at least in my experience from trying it earlier this year. I ran into a compiler crash: https://github.com/ziglang/zig/issues/7865 . I attempted to fix the compiler crash myself ( https://github.com/ziglang/zig/pull/8372 ), and I found a fix that worked, but apparently it was not the right fi…

As a counterpoint, we've written several thousand lines of code in Zig for a new financial accounting database called TigerBeetle [1], and all we've seen were two compiler bugs. The first was already fixed a few hours before we reported it, and the second was not a showstopper and something we could easily work around. On the other hand, because Zig has incredible velocity, we're also seeing that std lib contribution…

For the sake of curiosity, did you consider Rust, and if yes why did you consider it was not suitable for your needs ? I know Zig and Rust are quite different languages, but it is my understanding that they share the same low-level approach without sacrificing safety

Re: Zig gamedev project – left my job to build games in Zig lang

#83

As a former game developer, I don't get why the people start from scratch by developing their own rendering engines or even game engines. Using Unity, Unreal or even Godot is helping you to launch your game 100x faster. I know it might be fun to develop your own engine but it will take a lot of time and it still won't be as usable as an engine developed by 100x more engineers.

There are some great titles where the whole game was built around a unique feature provided by a custom engine. It probably wouldn't have been possible to do "Teardown" in Unity, for example; not without making some serious compromises, at least.

I'm curious why do you think it's not possible to make a game like "Teardown" using Unity.

Re: Zig gamedev project – left my job to build games in Zig lang

#84
post #39

Earlier quoted context omitted.

Contributions are another one I think. Both the authors and potential collaborators might find it more attractive to use their language of choice. Compilers also tend to pose a variety of challenges that force one to really dig into a language.

Yep. I know it's entirely other end of the language spectrum, but I think that's why Typescript got successful while Flow did not; Typescript is in Typescript, while Flow is in OCaml. And nobody knows OCaml. OTOH, eslint is making waves now and it's in golang, so. Who knows.

I'm not a golang fan, but one thing I've noticed about go is that it is possibly the most approachable yet real programming language for beginners I've ever seen. I think this is part of why go is doing so well in the devops space. Sys admins who are not really well versed in programming but know enough to write some scripts here and there are able to bring their domain specific knowledge of admin tasks and write code to contribute.

Re: Zig gamedev project – left my job to build games in Zig lang

#85

Earlier quoted context omitted.

Congrats! Full time indie is a fun and scary adventure at the same time, good luck! One question, why DX 12? i'm kinda sad when i see indie choose proprietary non-portable tech.. Not to say that vulkan is better (i hate it), but i'm curious

If the OP is an ex-AAA graphics programmer, DX12 is probably more familiar than Vk. AAA likely means consoles which at the very least means you end up doing DX12x for Xbox, and at that point you may as well also do DX12 for PC.

Well the most popular consoles doesn't use DX at all

Switch uses GL/Vulkan

And the PS4/5 uses something akin to Vulkan

On PC Vulkan is probably more used than DX12, i can't remember the time i seen DX12 in a setting.. i think i only seen it once..

Re: Zig gamedev project – left my job to build games in Zig lang

#86

Earlier quoted context omitted.

If the OP is an ex-AAA graphics programmer, DX12 is probably more familiar than Vk. AAA likely means consoles which at the very least means you end up doing DX12x for Xbox, and at that point you may as well also do DX12 for PC.

Could be personal preference. I worked with OP at Intel during the early days of Vulkan and he was the go-to person for anything Vulkan related, so he's certainly familiar with the API.

Well, that is not a pragmatic approach to make games, specially for indies, to just target one graphics API, that limits the audience you can reach

We solved this issue already with WebGPU, it uses what ever is native to the platform you target..

https://devlog.hexops.com/2021/mach-engine-the-future-of-gra...

Everyone wins

Re: Zig gamedev project – left my job to build games in Zig lang

#87
post #61
post #54

Earlier quoted context omitted.

I believe Zig takes a more nuanced and balanced approach to memory safety as a spectrum, rather than the extremes you present of either GC or borrow checker. For example, Zig offers spatial memory safety, and provides test allocators to catch temporal memory safety issues. That's already an order of magnitude improvement over C. Memory safety is also just one aspect of safety, whereas sometimes programmers conflate t…

Ada, Modula-2 and Object Pascal, minus compile time execution that they lack, and you have Zig almost 40 years ago. Sad that we have to go in circles to keep programming fashion going, instead of adopting best practices from the get go.

You say "minus compile time execution"... but when you take comptime away from Zig, you lose both generics and compile-time reflection. The remaining language is C without a preprocessor. So, yeah. Strip out the most useful and innovative feature from the language, and it looks primitive.

Re: Zig gamedev project – left my job to build games in Zig lang

#88
post #40

As a former game developer, I don't get why the people start from scratch by developing their own rendering engines or even game engines. Using Unity, Unreal or even Godot is helping you to launch your game 100x faster. I know it might be fun to develop your own engine but it will take a lot of time and it still won't be as usable as an engine developed by 100x more engineers.

I know it might be fun to develop your own engine That's it right there. You can spent years pretending to write a game while optimizing your from-scratch engine for features that probably no-one will ever use [1]. But I think it depends on what your goal is. If it's a small hobby project, and you enjoy the process of writing your own engine (which, granted, can also be a great learning experience), then why not? You…

Well, though I’ve also seen people do the same thing inside of existing engines, for example trying to use Unity but become so frustrated with its design so much that they begin to spending their time building their own external systems and tools. It seems more of a mindset problem than what engine you actually use (whether you build your own or not).

If you have some amount of self-discipline and implement your custom engine to be minimal and only tailored to your game (as many indie games have demonstrated), I don’t see how it can’t be done.

Re: Zig gamedev project – left my job to build games in Zig lang

#89

Earlier quoted context omitted.

There are some great titles where the whole game was built around a unique feature provided by a custom engine. It probably wouldn't have been possible to do "Teardown" in Unity, for example; not without making some serious compromises, at least.

I'm curious why do you think it's not possible to make a game like "Teardown" using Unity.

Maybe it would be feasible now, since Unity introduced the new job system, a scriptable render pipeline, and HPC# (high performance C#) with the Burst compiler. But these features didn't exist when Teardown started development, and right now they still seem to have some warts (the DOTS stack still seems to be a bit unstable and subject to frequent change)

Re: Zig gamedev project – left my job to build games in Zig lang

#90

Earlier quoted context omitted.

Could be personal preference. I worked with OP at Intel during the early days of Vulkan and he was the go-to person for anything Vulkan related, so he's certainly familiar with the API.

Well, that is not a pragmatic approach to make games, specially for indies, to just target one graphics API, that limits the audience you can reach We solved this issue already with WebGPU, it uses what ever is native to the platform you target.. https://devlog.hexops.com/2021/mach-engine-the-future-of-gra... Everyone wins

(I'm the author of that post)

Michal is a seasoned AAA dev who has worked at AMD, Frostbite, EA DICE, Intel - I'm sure he knows exactly what tradeoffs he's making.

Different folks have different goals, and that's OK. My goal with WebGPU is to aim for a future where we have truly cross-platform graphics. I suspect your goal is similar.

But I don't think it's wrong to aim for the present, to use an API you're familiar with, or to want to get as low-level as you can get. That's pretty admirable, honestly, and I'm happy people are doing that in the Zig ecosystem.

Heck, maybe one day Michal's work with DirectX here leads to a DirectX backend for a Zig WebGPU implementation. :)

Experimentation is good.

Post reply on HN