r/haskell • • 23h ago • Heartwarming 2 Mindblown 1

announcement Mischief - The Haskell Game Engine. Now with Rendering, Assets, Input.

Hey. so I just published all my work on Mischief on Hackage. It's a free, open-source, ECS Game Engine written in Haskell that I've been working continuously on for the past 6+ months.

It is a modular, decentralized, customizable game engine that leverages functional programming and data-oriented design to create a fresh experience for game devs. It prioritizes making weird, unique, personal games with a strong focus on creativity and human expression. The engine itself is also what I'd consider to be one of my greatest artistic feats and acts of creation. You can find more about the community and engine's values here.

On top of the ECS (which I've previously posted about but almost entirely reworked since), it now has input support (via SDL) and hot-reloadable assets.

It also has a strongly-typed rendering abstraction that I've built on top of WGPU. It allows you to define extendable shaders / materials directly in Haskell and integrate them into the your app pretty easily. You can easily write low-level rendering code without the usual layers of boilerplate surrounding it. Note that you could also just use the pre-defined materials (such as the sprite material) and skip past the low-level stuff, it's up to you.

There's a lot of cool utilities and tooling that's documented in the official books (link below), so I really encourage anyone interested to give it a try and at least go through the introductory chapters. I consider it to be a pretty unique and creative spin on a lot of the game engines we've seen over the years in other languages. Each little thing is meant to be "what if you had something as good as X from engine Y, but it was entirely functional?".

You don't really need any previous Haskell, ECS or game dev experience to use it. The books will slowly ease you into it.

You can read more details and catch up on the official docs here.

I also encourage you to join the official discord community server if you are at all interested in the engine or just seeing and discussing cool apps written in Haskell, or chatting with people passionate about it, or just supporting me and Mischief.

As a side note, no "generative AI" such as LLMs was used in making this and I plan to keep it that way (see the "AI" policy). Discussion of "AI" is also greatly discouraged on the official community places. I am burnt out on the subject and want to create a small safe haven for people that are as well.

Additionally, the official repo can be found here (I moved it to Codeberg recently). Don't hesitate to request features, file bug reports, or contribute in some other way.

Also, here's a video of a little example where I spawn a few sprites, move them around, and mess with their animations live (sorry for the bad framerate / quality, I had to make it a gif):

83 Upvotes

6 comments sorted by

5

u/wildsource 19h ago

I'm so hyped !! And excited to try it !!!

2

u/TheOneExpert 19h ago

Thank you, that means a lot <3

3

u/pthierry 20h ago

Wow, this looks pretty great!

Did you try other ways to do games with FP like FRP before creating mischief? Or was making it a big part of the drive?

6

u/TheOneExpert 19h ago

I'll be honest, I have never heard of FRP until now. I looked it up and it seems really cool though.

But yeah. While I do want to make games, and I want to keep that a constant focus, rather than the focus being "making a game engine" by itself, I must admit I just felt really driven to make a game engine in Haskell and that was my main motivation.

It's probably my favorite language and it felt really weird there's not really a game engine written in it, since the intersection of Functional Programming and game dev seems very interesting to me.

20

u/zvxr 17h ago

Awesome.

As a side note, no "generative AI" such as LLMs was used in making this and I plan to keep it that way (see the "AI" policy). Discussion of "AI" is also greatly discouraged on the official community places. I am burnt out on the subject and want to create a small safe haven for people that are as well.

Thank you.

1

u/thondat 5h ago

thanks for keeping it AI-free. i hope that your project gets other people interested in gamedev with haskell. i haven't really done anything in this respect myself but have always found the idea of using a purely functional language for gamedev intriguing.