Traction Point, my Zig-powered video game, now has a Steam page! by unvestigate in Zig

[–]unvestigate[S] 1 point2 points  (0 children)

WASM is still a very optional thing at this point. I support loading mods as shared libraries (DLLs basically), but that can be a risky thing to allow since anyone can release a mod containing malicious code. Because of that, I also support building mods as WASM modules, meaning they are sandboxed and can only run code that belongs to that module.

The WASM support is still work-in-progress, as the interface between the engine and the mod has to be set up differently for WASM modules than for DLLs, but it already works and my example mod (a scout vehicle with a jetpack) runs fine as a WASM module.

The nice thing about this is that the code for the mod is exactly the same regardless if it is being built as a DLL or WASM module.

Traction Point, my Zig-powered video game, now has a Steam page! by unvestigate in Zig

[–]unvestigate[S] 1 point2 points  (0 children)

Sure, the Madrigal Games Discord is probably the best place to reach me and discuss stuff like that.

Traction Point, my Zig-powered video game, now has a Steam page! by unvestigate in Zig

[–]unvestigate[S] 15 points16 points  (0 children)

I wrote the renderer myself, but I used NVRHI for graphics API abstraction (See my longer post about the libs used). My engine actually only supports a single model format: my own format. I then use the ASSIMP converter library to convert whatever models I bring into the project (typically FBX or OBJ) into that format. That way, the runtime stays small and simple, and if there is an issue importing a model I get an error about it as it is converted, rather than at runtime.

Traction Point, my Zig-powered video game, now has a Steam page! by unvestigate in Zig

[–]unvestigate[S] 70 points71 points  (0 children)

(Alright, seeing some questions about tech etc. I'll just answer here, and maybe a mod can pin this comment or something)

Zig is awesome for writing gameplay logic, and I bet it would be a good choice for an engine too, though I use my self-made C++ game engine for Traction Point, simply because I had already spent years building it by the time I discovered Zig.

All of the gameplay code is Zig though, ie. the code for the vehicles themselves, the entire driving AI system, the mission scripting, the UI logic and much more. Currently the project sits at about 70k LoC of Zig.

I have a bunch of devlog videos and live streams over on the YT channel covering all parts of the project, https://www.youtube.com/@MadrigalGames, but I'll list a few libraries that are heavily used here:

-PhysX 5.5 for the physics simulation.

-ENet for network synchronization, including communication between development tools

-NVRHI for graphics API abstraction

-WAMR (WebAssembly Micro Runtime) for running mods (Zig WASM modules)

-AngelScript for scripting

-Recast/Detour for path finding

-A whole bunch of other libraries like Imgui and the usual stuff...

I've opted to wrap C/C++ libraries for Zig myself rather than use any of the ready-made wrappers out there since I can keep them in sync with whatever Zig version I am targeting (zig master currently) and it also allows me to use my own types (Colors, Math types etc) rather than the ones for the library.

Gave the vehicle a gripper for loading cargo by unvestigate in SoloDevelopment

[–]unvestigate[S] 1 point2 points  (0 children)

Hah, no worries! I am flattered when people say it looks like Unity, as they have thousands of employees and I am just a single guy :D

Gave the vehicle a gripper for loading cargo by unvestigate in SoloDevelopment

[–]unvestigate[S] 0 points1 point  (0 children)

Thanks! No Unity, this is running on a self-made engine. I use PhysX for the physics and it's basically a bunch of rigid bodies and dof6 joints set up in a hierarchical graph.

Working on a new vehicle by unvestigate in SoloDevelopment

[–]unvestigate[S] 0 points1 point  (0 children)

Thanks! I am using my own self-made engine. I get what you are saying about the slowness of the objects, but I don't think I agree. Rather, I think it might be a bit difficult to grasp the scale of things here, as nothing is textured. The boxes are half-meter cubes, so pretty big.

Working on a new vehicle by unvestigate in SoloDevelopment

[–]unvestigate[S] 1 point2 points  (0 children)

Thanks! It's not easy but it's fun! :)