8 ms·
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 Di
by michal-z 5y ago
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.
- SrslyJosh 5y agoAny plans for multi-platform in the future?
- michal-z 5y agoNo, 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.
- Rygu 5y agoWhy Zig?
- indymike 5y agoWhy not Zig? Its a pretty fun language...
- AnIdiotOnTheNet 5y agoWell there are still quite a lot of compiler bugs. I personally have open issues going back as far as 2018. Knowing the compiler has bugs and that new ones are constantly being discovered makes debugging a pain because you have a lot less confidence that the problem is your code. I have many times blamed the compiler for my mistakes, something I've almost never done with C.
- indymike 5y ago> I have many times blamed the compiler for my mistakes, something I've almost never done with C. Early on, I remember dealing with lots of bugs in C compilers in the mid and late 80s. It takes time.
- pjmlp 5y agoPersonally I dislike the @ love, feels a bit like being in Objective-C land, imports feel like JavaScript AMD modules, and still use-after-free issues. Otherwise it is pretty much Modula-2, with C flavoured syntax and compile time execution. Overall, the use-after-free is what irks me.
- dnautics 5y agoNot OP, but here is what I can think of: - Low level - great C interop - Good toolchain ergonomics, except for no pkg manager yet - Great cross-compilation - Fast compilation (incremental coming soon) - Ideal for things where ownership rules can get complicated (ECS e.g.)
- genocidicbunny 5y agoThe C interop is especially useful for gamedev since so many libraries have a C interface and thus can be relatively easily used in Zig.
- collegeburner 5y agoIntersting, some follow up questions: - Fast compilation: isn't it llvm? So how faster compared to C++/Rust/others that use it? - Ownership rules/ECS: what about zig makes this especially good? The only language that comes to mind in this respect is Rust and its borrow checker, is it similar in Zig?
- runevault 5y agoPart of Rust's problem last I knew was it throws a lot more than it necessarily has to at the LLVM backend. So a front end that takes the time to lessen the burden could run faster despite using the same tooling.
- actuallyalys 5y agoPart of it (perhaps the majority) is excessive intermediate code. But at least some of it is that Rust's abstractions are more complex/involved. The "zero cost" doesn't refer to compilation time.
- runevault 5y agoIs that part paid in the Rust or LLVM portion of the compiler chain?
- klyrs 5y agoBecause zig needs better game development tooling!
- zarzavat 5y agoZig is like C but better. It fixes all the pain points of C without adding any extra complications (Rust - borrow checker, Go - GC, C++ - everything).
- pcwalton 5y agoMemory safety is a pain point of C, and Zig doesn't fix that. There is no free lunch: you either accept garbage collection or deal with something that resembles the borrow checker.
- kristoff_it 5y agoYou could build the same argument for all other types of correctness: either your program is formally validated to be correct, or it's broken. While there is some truth to that, if that's the only analysis you're willing to do, then you're going to fail spectacularly hard at recognizing the advantages of TypeScript over JS, for example. Zig and C share a similar relationship across many axes, including memory safety.
- pjmlp 5y agoFrom my point of view in terms of memory safety with Zig, we could just use Modula-2 or FreePascal/Delphi instead, but they aren't as fashionable.
- speed_spread 5y agoAs much as I love Delphi, the language syntax hasn't aged well. Single pass compilation was great to have in the 1980's but nowadays even the humblest Raspberry Pi will chew through thousand of lines of C++ and link an optimized executable within seconds. We deserve and can afford a lot more comfort than Pascal (and siblings) provides. Incidentally, modern language ergonomics also adds much in the way of coding safety, making usage of explicit allocation control a more manageable problem than it was 30 years ago.
- pjmlp 5y ago
- klyrs 5y agoThis is really looking great! You say you left your job... do you have income yet, or is that an item on the todo list? Any clues about the game you're working on?
- kristoff_it 5y agoMichal has a GitHub Sponsors profile, people that are interested in what he's doing should consider supporting him there. https://github.com/sponsors/michal-z https://github.com/sponsors/michal-z
- Shadonototra 5y agoCongrats! 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
- genocidicbunny 5y agoIf 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.
- Shadonototra 5y agoWell 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..
- skocznymroczny 5y agoCould 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.
- Shadonototra 5y agoWell, 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-graphics-with-zig https://devlog.hexops.com/2021/mach-engine-the-future-of-gra... Everyone wins
- slimsag 5y ago(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.
- losvedir 5y agoWhat's the game? I guess based on DirectX it will be for Windows only?
- cyber_kinetist 5y agoThe tech looks really great. What kind of game (genre) are you planning to make?