Where to start
Hi. In my last post I said that I’m making a terminal based adventure game. What’s next is to start. Great!
I’ve started to think about how to build the game and how people will play it. Will it be a browser based game? Will it be available on Steam? What about mobile? Download from a website? If it’s text based why not just add it to homebrew for mac, chocolatey for windows and relevant package repos for linux? Should I use an existing engine or build it from scratch? I’ve heard there’s a cool new browser tech called WebAssembly, should I use that? Okay I’m in a question spiral.
The quick answer is it doesn’t really matter and I can pick any path forward and start making something before making hard decisions on these questions. I’ll come up with answers as I go and then I’ll try to figure out how to refactor the code to work the way it needs to. Or just throw it away and start again.
That said I did spent a little time thinking about the questions. Here are some of my thoughts.
At first I thought that Python would be a fun choice. I could learn a language I don’t know very well, Python has a wide audience, it’s dynamically typed so I won’t get stuck on the encoding of every little data object. Also Python is not Java or Javascript, both of which I would rather avoid. However, Python doesn’t easily produce static binaries and cross compilation is not inbuilt meaning attempts at doing that won’t be straightforward and might not work as intended.
I was so close to choosing Python but it’s pretty important to me that the game be accessible to users on different systems in as easy a way as possible.
Go is what I know best. I’m already going to be learning a bunch so it makes sense to start with something I know. I have written interactive terminal programs in Go already so I have a sense of how I would do a simple response loop and I would like to learn more complicated things. Go is also pretty approachable for new programmers.
Coding the game in Go also seems like a pretty decent technology choice given the following.
- A terminal based game running in a web browser, while cute, seems like it involves much more scaffolding than a terminal based binary executable. I would prefer to spend my time making the game rather than scaffolding. Side note: I actually used Twine once in a project and it caused major collaboration issues on the team — sharing files was a pain. Also since I know how to code and use git it seems unnecessary for me for individual projects.
- A game running locally can save state in files rather than on a remote server meaning zero server cost. A web based game without a server to save game state to can’t save progress across page reloads, and that seems like a useful feature. I don’t want to pay server costs if I can avoid it.
- It will cross compile easily and produce a static binary that makes installation easy across many platforms.
- It sounds fun. (The most technical reason of all)
So, I’ve decided to use Go for now. Great. Now if you don’t know Go it’s always a good time to start learning.
I suggest starting with the Go tour, moving on to the language specification (trust me it’s very approachable compared with other language specifications — for one thing it’s all on one page which is handy for search purposes), and then finally reading effective go.
Next time I’ll create a git repository and start coding.