Game development - Haskell

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

IC Rainbow

I did quite a few gamedev-related code and found it is very helpful in gaining insight into "advanced" Haskell. I touched stuff like pointer-wrangling and unpacked types, benchmarking, concurrency and signal processing. And there are lots of academic material on the domain. The field is deep.

There are few agoras on this:

There is another regular game jam (ldjam.com) in a week and I invite y'all to participate.

Feel free to contatct me anywhere if you want mentoring, suggestions etc.

Check out the Haskell GameDev community on Discord - hang out with 60 other members and enjoy free voice and text chat.
James King

I threw together the beginnings of a text-based game in Haskell to demonstrate some Haskell programming mini patterns from https://kowainik.github.io/posts/haskell-mini-patterns the code is at: https://github.com/agentultra/adventure-engine

It's not much yet but feel free to fork to get started on your own :)

Collection of small Haskell patterns with detailed description, examples and exercises
A small text adventure game written in Haskell. Contribute to agentultra/adventure-engine development by creating an account on GitHub.
codygman

I came across something awesome the other day:

https://aas.sh/blog/making-a-game-with-haskell-and-apecs/

I found a project using apecs and Polysemy the other day with procedural map generation too! I'll look for the link

There have been so many frameworks, examples and prototypes released in an effort to pioneer games development in Haskell, and yet we still don't really have many (if any) commercial releases we can look to for inspiration. In this post I hope to clear the air a little bit and encourage new developers to try Haskell.
codygman

https://github.com/rasendubi/hrogue

A random game I build. Contribute to rasendubi/hrogue development by creating an account on GitHub.
IC Rainbow

I finished concocting a minimal viable engine to experiment with vulkan rendering pipelines. You can start drawing triangles in no time and get as fancy as you like.

  • The library part does only the common boilerplate bits and has some thin wrappers over vulkan types to simplify resource management.
  • The examples are to be copypasted and stuffed with details.

I expect there are few more areas that can be explored and promoted to a library, e.g. event loops part and frame resources.

https://gitlab.com/dpwiz/vulkan-setup-sdl

tristanC

That looks great and the example run fine on my x1 laptop, thanks for sharing! When trying the vulkan library I had issues with writing uniform values, is this managed through the Vulkan.Setup.Render.Model module?

IC Rainbow

tristanC said:

That looks great and the example run fine on my x1 laptop, thanks for sharing! When trying the vulkan library I had issues with writing uniform values, is this managed through the Vulkan.Setup.Render.Model module?

Model is for vertex-related attribute bindings (layout(location=0)).
Uniform buffers (layout(set=0, binding=0) are descriptor sets + ordinary buffers from Vulkan.Setup.Buffer. You can keep them mapped and updatable or offload to GPU and release host memory.

IC Rainbow

I jammed a game with that library: https://gitlab.com/dpwiz/orboros

It's not too complicated, but demonstrates more things in a real environment.

An LD47 submission: https://ldjam.com/events/ludum-dare/47/orboros
tristanC

That's very helpful, thank you!