A Game of Snails is nowhere close to being complete or even really playable, but I’ve decided to get as much of it done as I can before the end of May and then just put it online - regardless of completion or bugs. There are no rules to One Game a Month, after all, and I can then continue to work on a more complete release for the month of June. Or, if I feel like a break from snails, make some other quick game in the meantime and let it rest until I want to work on it again.
I’ve decided to go ahead and upload all the code to GitHub. It’s unbelievably messy. Hopefully I’ll get to clean it up a bit before the end of May.
As for the actual state of the game - today I got the server running on Heroku. It took a few hours in total (I had no idea what I was doing). The client is still being run locally, but using the Heroku-hosted server. Since I’m trialling AWS for the year already I wanted to use EC2 for this, but had problems with the verification phone call and impatiently decided to go for the free Heroku to get something up. I felt that it was important to get something running outside of my local environment asap instead of panicking about deployment at the end of the month. I’m using MongoHQ to host the database for the snails - free version of both Heroku and MongoHQ.
Remember my old feature list? I’ve updated it (mostly the Race section), but really not much has been completed in terms of gameplay features. I’ve mostly spent the past few weeks working on GUI and server stuff. Now I can finally start working on a proper race formula. This may not be done before the end of the month, but we’ll see.
As for actually getting this thing onto Heroku, the main things I needed to do were:
Updating my package.json
Creating a Procfile (the Heroku documentation says this needs to be a text file, but in reality the extension should not be .txt)
Enabling long polling as Heroku does not support websockets.
Moving all the server stuff from the lib folder and into root
Listening for the proper server port that Heroku assigns, not 3000 as I was using on localhost.
Updating the database to connect to the one I set up in MongoHQ
Updating port on the client.
It doesn’t seem like much in the end, but all of this took at least a couple of hours to work out (with various breaks).
So right now…things seem to work. One thing I should have thought about but didn’t was how slow the server responses are compared to running locally…which is of course to be expected, but I was not expecting this much delay. It takes maybe 0.25 - 0.5 seconds to perform some actions.
Up next, I’ll try to get a rudimentary race formula up and running and then maybe make the whole thing look a little more presentable. I don’t know if I’ll have time to do much else before the end of the month, so May’s One Game a Month entry will be a broken, incomplete game (for now).