One of the more pressing items on my list of “things to do before releasing VoB on the Play store” is to set up a global server list such that “public” servers can be discovered by clients. This way, to try the game out against other humans, you don’t have to convince them to play with you, help them install the game, and set up your own server.
This is a cool problem, because it gave me an opportunity to create a REST API and learn about how to deploy apps on Heroku. At any rate, the first iteration of the API supports the following features:
- Public servers POST to /server to let the app know they are online
- Public servers DELETE to /server/:id before closing to let the app know they are offline
- Public servers POST to /game when a game is complete and upload a json document containing all the actions taken during that game and the result (anonymous for now)
- Clients GET / to receive a list of active servers
- GET /game retrieves a list of all games played
Right now the implementation is extremely simple, the posted games are the only ‘persistent’ item, so if the app sleeps, the server list is lost, but the games remain in a PostgreSQL DB. I’m really excited by this, as I think it will provide an opportunity going forward to adjust game balance based on real data rather than what “feels” right.
I intend to add more detailed server info, such as how many people are currently on the server and whether the server is waiting for the game to start or the game is underway. Once that occurs, the sleeping problem will go away on its own. In the meantime, active public servers send a GET request to / every half hour to prevent sleeping.
I also morphed the ValleyOfBonesServer into a server management tool. Instead of simply spawning one server when started and closing it when closed, the Server can now spawn multiple servers on different ports, each of which can be “public” (listed on the global server) or not and can be monitored and killed individually.
For the moment, I’ve created two AHS Gaming servers that should be up pretty much 24/7 – now that it’s cold outside, running my desktop constantly helps heat the apartment instead of wasting energy like during the summer.
Maybe next week I’ll have a cool graph or something to show from the game data collected so far.
Oh, and I almost forgot – I added a new unit:
Meet the Light Mech. It will probably be the namesake of the next VoB release, and is intended to be a slightly cheaper mech unit for a more specific anti-personnel function. I have a few other unit changes that might be coming soon, so keep on the lookout.