Haskell roguelike - Conclusion
Fin
That is about as far as I can take this example, without it getting too complicated for a blog post. I hope that if you have made it all the way to the end of these posts you’ll have a good idea of how to implement all the fundamentals. You’ll probably have many ideas to improve on what I’ve done. The code base still weighs in at around 1400 lines of Haskell and I think that is pretty impressive for how much the game already can/could do.
I hope that these posts have been useful and give you some ideas for how to implement roguelikes or anything else really :)
The code is available on github. See the source.zip
archive or the _Source
directory for the code without all the tags used by my Hakyl include compiler. These are both created when the makefile is run.
Comments thread on /r/haskell subreddit
Some ideas
Here are some ideas for features you could implement.
- Smarter utility AI
- Utility of wander could prefer longer paths over shorter ones to try wander further, or prefer least visited paths to avoid wandering in circles.
- Better logic about remembering what goal is being sought. E.g. when following a player remember where they were so even if they move out of the fov the actor can still move in that direction.
- Use field of view for things other than seeing. E.g. have a larger fov that allows actors to hear sounds that other actors make
- Implement an inventory system so that a player can pickup and drop items
- Combat. Look at how other roguelikes do this. Getting your actors to fight the player or each other using the utility AI is great fun.
- Pheromones / smell trails. A world history that can be used by actors to follow other actors etc.
As always look around to see what other people have done. RogueBasin was a great source of information for me
Extrax
- ASCII console GUI. Quick and dirty ASCII terminal GUI frontend
Thanks
Thank you for reading this far, happy coding.