HNHacker News
TopNewBestAskShowJobs

michal-z

126 karma · joined October 17, 2021

Independent Gfx Programmer. Working on indie game written in @ziglang. Building game dev ecosystem for @ziglang. In the past: AMD, Frostbite, EA DICE, Intel.

https://twitter.com/MichalZiulek https://github.com/michal-z/zig-gamedev

submissionscomments
michal-z··on Beacon Object File (BOF) library and command line tool written in Zig
Standalone command line interface for launching BOF files outside of Cobalt Strike Beacon environment. Under the hood it uses our bof-launcher library to accomplish its main task: running BOFs files on Windows (x86, x64) and Linux/UNIX (x86, x64, ARM, AARCH64) platforms directly from a filesystem.

bof-launcher is an open-source library for loading, relocating and launching BOFs on Windows and UNIX/Linux systems. It's an alternative to Trustedsec's COFFLoader and ELFLoader with some very interesting features:

* Fully compatibile with Cobalt Strike's Beacon. Can compile and run every BOF available at Cobalt Strike Community Kit and every other open-source BOF that adheres to generic BOF template.

* Distributed as a fully standalone library with zero dependency (it does not even use libc).

* Fully integrable with programs written in C/C++ and/or Zig progamming languages.

* Adds capability to write BOFs in Zig programming language - which is a low-level langauge with a goal of being a "better C". All the features of the language and rich standard library can be used in BOFs (hash maps and other data structures, cross-platform OS layer, http, networking, threading, crypto and more).

* Asynchronous BOF execution - capability to launch more time-consuming BOFs in a separate thread.

* BOF process injection - capability to launch more risky BOFs (i.e. privilege escalation exploits) by injecting it to a new process.

* Seamless support for both Windows COFF and UNIX/Linux ELF formats.

* ARM and AARCH64 support on Linux.

* Used in our cli4bofs tool that allows for running BOF files directly from a filesystem.

* Very flexible and efficient API allowing for so called BOF chaining.

michal-z··on [dead]
Zig compiler provides working cross-compilation out of the box.

zig-gamedev project provides Win32/D3D12 API bindings that can be used on Windows and Linux.

Wine with VKD3D-Proton provides robust solution for emulating Windows runtime.

Above components combined together gives very nice development environment for building DirectX 12 applications on Windows and Linux.

Project homepage: https://github.com/michal-z/zig-gamedev

Minimal DirectX 12 application that can be developed on Windows and Linux: https://github.com/michal-z/zig-gamedev/tree/main/samples/mi...

michal-z··on [dead]
Zig, DirectX 12 source code: https://github.com/michal-z/zig-gamedev/tree/main/samples/ra...

This works by capturing render output to a transient buffer and then playing it back at human-discernable speed.

michal-z··on Zig-gamedev project: DirectX 12 Mesh Shader benchmark
When drawing 200M triangles on GTX 1660:

    Mesh Shader emulating VS (no culling): ~26.8 ms
    VS with manual vertex fetching (no HW index buffer): ~50.2 ms
    VS with fixed function vertex fetching: ~24.8 ms
When drawing 200M triangles on RX 6800:

    Mesh Shader emulating VS (no culling): ~23.6 ms
    VS with manual vertex fetching (no HW index buffer): ~13.5 ms
    VS with fixed function vertex fetching: ~12.4 ms
michal-z··on Zig gamedev project v0.2.0 – physics support
I continue to build game development ecosystem for Zig programming language.

Zig gamedev project home: https://github.com/michal-z/zig-gamedev

New physics demo: https://github.com/michal-z/zig-gamedev/tree/main/samples/bu...

Prebuilt binaries for all demos: https://github.com/michal-z/zig-gamedev/releases/download/v0...

michal-z··on Zig gamedev project – left my job to build games in Zig lang
I'm perfectly aware. I don't want to build advanced tech, it's not my goal. I want to build simple tech that lets me build my gameplay easier than it is in UE5. In my opinion gameplay programming in UE5/Unity isn't nice at all. Way too abstracted and too generic for my usecase.

In my case, simplicity is the key for productivity.

michal-z··on Zig gamedev project – left my job to build games in Zig lang
It depends on many factors. You are describing your experience and then extrapolate for everyone. My game will be pretty small, not fully 3D. I don't need 90% of Unity features and Unity bugs :)

Before making my decision to go with Zig I've built small game in UE5 (https://michalziulek.itch.io/upacman). I've also used UE5 and Unity at AMD. I simply don't like those engines.

Different people have different approaches and mindsets. I'm much faster building my small, minimal codebase that does only what I need. Also, I'm improving my low-level programming skills and experimenting, doing things differently than most people (not using Unity) might lead to very original game.

michal-z··on Zig gamedev project – left my job to build games in Zig lang
Note, that it is easier to ship a game for one platform. I don't have resources to test several platforms.

WebGPU is just 3D rendering. I will also need vector graphics, machine learning stuff, video playback, etc. Windows gives me that for "free" (DirectML, Direct3D 12 Video, Direct2D, DirectWrite).

My main goal is to ship a game and build interesting demos/mini-games as part of zig-gamedev project. I don't want to spend my time supporting and maintaining code for several platforms.

Also, using wrappers like WebGPU adds another layer of abstractions. I want to write my shaders in HLSL using dxc.exe, I want to directly see messages from DX debug layer and have full control over my code. WebGPU would just slow me down.

My game will run only on Windows 10+ and I'm fine with that.

michal-z··on Zig gamedev project – left my job to build games in Zig lang
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.
michal-z··on Zig gamedev project – left my job to build games in Zig lang
Hi Guys, OP here.

> Why not Unity or UE5? Why Zig?

I'm building relatively small game, I don't really need full game engine. I try to write simple code that does only what I really need. I want to push Zig forward, I want to promote it. I was working with UE5 and Unity at AMD - those engines are really huge, bloated and they are changing very fast. I want to keep control over my code. Again, I don't need 90% of their features. I like low-level stuff and I want to master my skill.

> Why zig-gamedev project?

I want to help others learning Zig. I want to create demos, audio-visual experiments and even some art stuff. I'm interested in intersection of art and science. I want to prototype and experiment with ideas that potentially will be used in game (tech, algorithms, etc.).

> Why Windows and DX12?

DX12 is really well supported by Microsoft. They have great tools. They have interop with Direct2D and DirectWrite. They have DirectML (built on top of DX12). Windows itself has builtin decoders for most video formats (I will need this and I don't want to include entire ffmpeg).

I'm most familiar with DX12. DX12 is a bit less verbose than Vulkan.

I don't have a bandwidth to care about other platforms. Focusing only on Windows lets me write simpler and often more optimized code.

Also, drivers are really mature and stable.

> Why to take risk?

I was working for big corporations for ~12 years now. Money is good but you don't really realize your ideas there. You don't own what you build. Now, I want to create my own stuff, my way, using my ideas. Money will come later.

michal-z··on Zig gamedev project – left my job to build games in Zig lang
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.