After clearing the heavy wet snow from the driveway this morning, I spent most of the day coding on a MUD.
This scratches the itch to make something game-like without getting bogged down with graphics. I can get right into the parts I enjoy creating.
Its fun to take yet another stab at socket programming and message parsing. It’s also rewarding to get a world up and running relatively quickly where you control all the rules.
I had some old code but, as is always the case, it was bad. I don’t know what that other me was thinking. I started from scratch this time. It’s written in Go since I’ve been working with that for the day job lately and Go works well with this sort of project. Sometimes you want to learn a new language or framework and sometimes you just want to make something with comfortable tools. Today was the later.
In the past I’ve created these sorts of things in the traditional way with text files for data storage but for this project I added Postgres for my storage layer. It’s overkill but the whole project is overkill. No one is going to play this but it’s fun to hack on something that’s completely of my design.
Here is the world in all it’s glory after a few hours:
look
Room 1 - (19c4361b-f382-43e7-b708-03b5d73b3454)
The first room
Exits: East
Say Hello mud!
You said 'Hello mud!'
I even took the time to create admin tools to work with the database. So I can just run migrations from my admin tool or seed the database quickly.
I worked on the code in Nova, the Mac editor from Panic and it’s very good. It is very Mac like and extensible. While it seems most people use it for web dev there are some decent plug-ins for Go. I can do most everything I do in VS Code in Nova except debugging. I did have to swap over to VS Code a few times since its so easy to debug there.
The best part of this project so far is getting into the flow. I find it less likely that I can get into that mental state when I’m working on a project consulting for others. It takes a lot to get up to speed and if I didn’t create the architecture or requirements I find it slows me down. When I do my own projects I am far, far more likely to just bang away and find 4 hours have passed. That’s the part of this work that is most enjoyable. When the code seemingly writes itself. If you were to stop and look over your own shoulder you would probably have no clue what is going on but the person in that trance like flow does know what’s going on and it works.
The only downside to that state of mind is being interrupted. Even a simple question that breaks the spell can be far more irritating than it really should be.
This project amuses me and it’s in good enough shape to shelve it and come back when that inevitably happens. Of course by that time older me with think today’s me quite a silly person for some choices I made here but for now I’m content.