[ANN] I Made an Open-Source Game Engine in Haskell - Mischief

Hello! For the past 6+ months I’ve been working on a free, open-source, game engine written in Haskell, called Mischief. The engine is code-first, uses the ECS (Entity Component System) paradigm, and currently has libraries to facilitate assets, input and rendering! It is also decentralized, meaning it is made to be modular, extendable and to make it easy to plug libraries and features in and out.

It has many tools that I’ve been working on, excited to show others. The queries, which are a functional spin on classic data-oriented and ECS-based tools. The hot-reloadable asset system that lets you lazily load asset and subassets. The strongly-typed and extendable material system which lets you write any sort of low-level rendering logic directly in Haskell, with minimal boilerplate. The animation system which leverages Haskell pattern matching to immediately create an expressive state machine. I can’t possibly fit all of these in a post so I’ll let you discover them for yourselves in the official books and docs (yes, every library is documented with introductions, examples, and how-to guides).

The engine itself is a creative outlet of mine. Code is my craft and my art. And that also (hopefully) comes through in the games which can be made in this engine. Stylized, creative, fun games. Every bit of it is designed to streamline human expression and creativity, to let you control every aspect without overwhelming you.

You can read more about the engine, what it is, and how to use it over here.

If you’re at all interested in the engine, want to see cool stuff made in Haskell, to chat with the community, or just be there to support Mischief, please join the official discord server.

As a side note, no sort of “generative AI” (LLMs or otherwise) was used in making this, and I plan to keep it that way (see the “AI” policy at the roof of the repository). I also strongly discourage any talk of “AI” in the official community spaces, as I’m personally extremely burnt out on the subject and want to create a space supportive of people that feel the same.

I’m sure there are issues, bugs, sloppy pieces of code. I guarantee all of it is made by me and just a byproduct of having to maintain and test a very large API surface with little outside help. It will get better over time, with your help! Feel free to contribute by posting feature requests or bug reports as issues on the official repository.

I’ll also attach a video of a little example where I’m spawning a few sprites, moving them around, and playing with their configuration live (sorry about the bad framerate and quality, I had to heavily compress it to be able to post the full thing):

showcase1

25 Likes

It wouldn’t let me post more than two links so I’ll put the rest here:

The official repository
The community and engine values

1 Like

This is a really good project. I never tried ECS and I plan on giving it a try at some point. I think I will have another look on your book when I decide to do it. It does seem well

On another note, I am a big fan of football manager. Do you think I could look into your ECS to create a football 2d simulator? I do have the dream of one day making this a reality on day. This may be a silly game idea but I am still curious about it

Oh yeah totally. The main current limitation that I feel compelled to warn about is that the engine doesn’t have any official physics system yet, meaning you’ll have to roll your own or use bindings for something like box2d.

1 Like

@Daniel-P thanks for your recommendation! Sure, I will get back to you when I start playing with it!

Wohoo!! Awesome stuff. I’ll have to try it out.

I’ve only skimmed stuff, but I love the haddock-based “book” idea. I might use it for my engine as well.

cc @wiz the maintainer of tons of game engine tooling in Haskell as well as his own engine

1 Like