Gamedev with GLMakie (the path less taken). Is it possible?

It’s an option, as shown by (the currently marked solution, though I dare say it’s the wrong option, and better available even in Julia for games; for plots, maybe nothing as good in any language), and I see in the docs:

Add one or more of the Makie backend packages GLMakie.jl (OpenGL), CairoMakie.jl (Cairo), or WGLMakie.jl (WebGL), RPRMakie (RadeonProRender)

[All of those support 3D, even CairoMakie, and RPRMakie ray-tracing. You may want that and OpenGL possibly, or its successor Vulkan.]

Possibly. Nim was on my short-list of interesting languages before I discovered Julia. It does have a possible advantage over Julia. Julia is garbage collected, and that choice is usually great. There are ways around it, as you want for real-time (still until we have real-time GC, as exists in e.g. Java). I don’t know for sure if GC pauses are a real problem if soft-realtime (as for games) is the goal.

Nim is used for audio, and audio is very latency-intolerant (why you want no GC, and thus Nim is good since it has such an option). You can play audio with Julia, and at least one solution to playing files does fork a new process to play it, so Julia’s GC isn’t involved, but it’s also not very elegant to do. GLMakie doesn’t handle any audio that I know of, since it’s a plotting/visualization library after all. There’s at least one recent 3D game engine in Julia, and two or more 2D game engines. Nim might have more or better, or integrate better with e.g. from C++.

I believe this B+ game engine may be the future for Julia, but I can’t yet try it:

(@v1.10) pkg> add https://github.com/heyx3/B-plus

You can add some of its subprojects, that are already registered, such as this (and BplusCore it adds):

(@v1.10) pkg> add BplusApp

that depends on GLFW and CImGui.

another option is GitHub - AliceRoselia/Nebula.jl: An ambitious game engine leveraging rich Julia ecosystem not sure why I can’t install it:

An ambitious game engine leveraging rich Julia ecosystem, inspired by Gamezero.jl and Starlight.jl in its pre-pre-pre-alpha stage.

[…]
The author believes that it is time for game developers to abandon the old scripted ways of game development and embrace the new paradigm of game development.
[…]
To achieve this ambition, this library leverages several libraries in the Julia ecosystem.

  • Leveraging the Julia’s ModelingToolkit ecosystem, game developers can make their own physics system easily!
  • With help from Julia’s GPU ecosystem, GPGPU compute rendering offers the flexibility of software rendering without sacrificing hardware power!
  • High performance simulation of entities/particle/etc leveraging Julia’s HPC ecosystem.
  • Juliaaudio ecosystem for audio processing and more!
  • To control entities, Julia offers an ECS of your choice such as OverSeer, a powerful ECS system!
  • When it comes to AI, Flux and Alphazero.jl come to mind!

and JulGame.jl is another option (games already made with, 3D coming later), and:

(@v1.10) pkg> add Starlight
[..]
⌅ [98e33af6] ↓ SimpleDirectMediaLayer v0.4.0 ⇒ v0.3.0

may be good already (but has no activity for 2 years):

Features of the default backend, Telescope, include:

If you have a 2D game in mind, then most any software could do, even Python, since it’s usually not too demanding. If you have 3D in mind, or advanced features, or mobile, then you really need to think carefully if Julia is the best option. It probably isn’t yet, but may get there.

You can likely call all Nim libraries (as opposed to reusing Nim frameworks for sure), and I count 18 projects across 4 categories, and I can tell you we’re far behind what is claimed there:

Game Libraries

  • nimgl - NimGL is a Nim library that offers bindings for popular libraries used in computer graphics.
  • glm - Port of the popular glm C++ library to Nim.
  • GLAD - Multi-Language Vulkan/GL/GLES/EGL/GLX/WGL Loader-Generator based on the official specs.
  • enu - 3D live coding with a Logo-like DSL for Godot, implemented in Nim.

Game Frameworks

  • […]
  • naylib - safe Raylib wrapper.
  • c4 - Modular and extensible 2D and 3D game framework for Nim.
  • paranim - A game library based around carefully chosen abstractions.

Game Engines

  • NimForUE - Nim plugin for UE5 with native performance, hot reloading and full interop that sits between C++ and Blueprints.
  • […]
  • godot-nim - Nim bindings for Godot Engine.
  • […]

Rules Engines

  • turn_based_game - A game rules engine for simulating or playing turn-based games.
  • pararules - A RETE-based rules engine made for games.
1 Like