littlelogs

Keep a social journal of your work progress as you make and learn things.

rhitakorrr
rhitakorrr

I’ve spent the last few days working on an engine for text-based games in #Elm, the goal being to use this engine to code the #MidnightMurderParty interactive segments. Turns out, modeling a game engine in a purely functional, strictly typed language is tricky. Since game objects have different properties and behaviors, modeling them as the same type (so they can be stored in a List or Dict) isn’t really straightforward.

After some research, I decided to go with an Entity-Component-System (ECS) approach, which has been a challenge as the first time I’d heard about such a pattern was on Friday. Since then, I’ve written some terrible code, refactored many times, and only now have something that looks promising enough to move forward with. There’s still a lot to figure out (cross-entity/component messaging, for example), but at least now I have an idea of how this might work.

josh
josh

Ooh this sounds really interesting. Now I need to go read about what ECS is. Are you planning to open source the engine or at least write about how it works when you’re done? I’d definitely read that.

22 February

rhitakorrr
rhitakorrr

Pretty much everything I do is publicly available on GitHub, including this engine. I’d love to write about how it works if I ever finish my blog!

22 February

josh
josh

Oh nice!

22 February