haskell-org / summer-of-haskell

Source code of summer.haskell.org
http://summer.haskell.org/
Other
86 stars 74 forks source link

Godot bindings & game #132

Closed abarbu closed 1 year ago

abarbu commented 3 years ago

Repository: https://github.com/abarbu/godot-haskell

Godot is ripe for becoming a practical platform for building games in Haskell.

The current bindings were originally constructed by SimulaVR. I then upgraded them to the point where building games is viable. I implemented the first fully-working game, a 2D game from the Godot tutorial (Creeps). 2D games are now viable.

The project would have 4 steps:

I think this would in general be beneficial to the community as a whole in a few practical ways.

  1. There really isn't a fully-featured engine you can use to make 2D or 3D games in Haskell. This can bring a whole new type of user to Haskell. Godot is literally the only option we have. We could build bindings to Unreal's Blueprints, but not the rest of the engine which relies too heavily on C++ features. Even this would be very hard; the maintenance burden of Unreal bindings is so high even the JS community can't keep up. Unity isn't viable at all. Implementing a Godot-level engine in Haskell is beyond what the community can do. So if we want a game engine in Haskell and a community building Haskell games, Godot bindings are the way to go.
  2. This new application will probably uncover other issues in GHC and in language bindings. The general idea of wrapping a large core like Godot in Haskell is exactly how machine learning libraries work in Haskell as well. Improvements to this use case will help there as well. Python has amazing support for this use case, while Haskell has seen little push in this direction.
  3. Games are performance-sensitive. This can serve as a whole new type of benchmark.

I would be happy to mentor this project. I have Haskell & Godot experience, as well as plenty of experience mentoring students.

jaspervdj commented 3 years ago

That sounds really good; although it seems like a lot of work, considering that the projects are supposed to be only half-time this year. Especially "Upgrade the API to make it memory safe" may be a daunting task for students. I suspect it's possible with the right mentorship, but it may be better to set less strict requirements. Do you know anyone who would be able to co-mentor this project?

abarbu commented 3 years ago

That's a fair comment about more memory safety and the fact that this year is screwed up with COVID. The API is perfectly usable without those changes, you just have to stash away some pointers. This is how the previous 2D game works and how SimulaVR does things as well. I updated the steps to focus on the 3D game which is the most fun and accessible piece.

abarbu commented 3 years ago

@KaneTW one of the primary authors of godot-haskell will serve as a 2nd, backup, mentor.

jaspervdj commented 3 years ago

This sounds great, thanks! Do you want to submit this as a PR or should I take care of adding it to the website?

abarbu commented 3 years ago

Just noticed that this had languished. We've made a lot of improvements to make the bindings even more fun to use. Feel free to add it to the website. If not, I'm happy to create the PR.

jaspervdj commented 3 years ago

@abarbu Please create a PR if you find the time, I've been a bit swamped with work stuff.

jaspervdj commented 1 year ago

Cleaning up for 2023, if you receive this notification and have ideas from this year, please submit them!