A Cloud based auto-battler? Yes!


Early concept

No need to hide, I was inspired by Super Auto Pets. I find that game so interesting in it’s concept, I had to dabble in this field myself. As usual I see a technology I liked and I had to know, I had to be able to reproduce it. How does it work? How can I make it work? I went ahead and drew up the early concept for a game:

  • A game with 3 stages: Menu - Shop - Arena
  • In the shop you can buy, sell units
  • Having 3 of the same unit merges and levels it up
  • All units have some kind of special effect
  • The arena is a battle simulation, after the battle, go back to Shop

Easy, small steps first

I had my Menu down, it’s easy, just a button to start the game. Let’s try to make the Shop:

  • Generate n units you can buy
  • Units can be sold after buying them
  • Merge units when necessary
  • Reroll shop units
  • Lock units to save them for the next round

Having everything down, next step is the Arena.

Writing the Arena

This is the hard part. I come from the corporate (mostly) service development environment. Everything needs to work fast and just be done with everything as quick as possible. Game development is different. Back to animation, events, everything starts to break. I had my early Arena code, it was fast, calculated the whole fight in a few milliseconds, but how do I show it to the users? A few days later, after a lot of redesign, I had something I was happy with. Animations are going, the player is able to follow the fight. Awesome.

Where is the Cloud? I read Cloud in the title

You need to fight with someone. For testing and development I had a hardcoded team by default, but that can’t stay. Do I write predefined enemies? No. I let users battle each other. How do I do this? Cloud. The concept is simple:

  • Every turn the user uploads their team
  • Gets another user’s team with the same level
  • Battle! Woo!

What’s Cloud in this?

I use Azure Functions for the Upload and Team getting. Azure Functions lets you define a really lightweight API and it’s all serverless. Azure will scale these function calls for your needs. Nobody plays my game? No cost, it just won’t run! Thousands play my game? Okay that will cost me, but the server won’t struggle. It’s a really simple, but powerful solution.

Serverless, but where is the data then?

Datastorage is also in Azure. The Functions application communicates with an Azure Tables database. You guessed it, also serverless! My whole backend solution is serverless, scales (both in performance and cost) to the playerbase.

Conclusion

It just works. I think after all of this work and (re)design I find this solution so simple and straight forward and yet, I had to think so much on how to go about it.

Get Setr's Auto Battler

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.