Dev Vlog #1: Battle History

This is part of the Games on the Block dev vlog series, where I show you my daily progress on the game.

Battle History Implementation

Today, I worked on Battle Histories.

Before this update, if you played a battle, you could see what happened and check the rewards, but once you left the screen, the battle was gone. There was no way to review past battles, show a friend something cool, or analyze how you defeated a specific enemy.

This was also a problem for us internally. If a bug occurred or something unusual happened, we had no way to go back and investigate what went wrong.

We previously tried to replicate battle history in the training grounds, but having a proper replay system is far more convenient.

battle_history.png

New Battle History System

Now, we have a history log where you can:

  • See the date and outcome of the battle (win, loss, or draw).
  • Check the battle location and account name.
  • View the submitted team and opponent’s team (if applicable).
  • See any environmental effects and Divine Energy used.
  • Replay the battle with full details, including turn-by-turn logs and position effects.
  • One challenge was displaying position effects in a clear way. Adding them to the history log would clutter the UI, so instead, you can still see them inside the battle replay itself.

Database Considerations

I didn’t implement all of this in a single day—the database design took time. I had to research storage solutions and decide on the best approach.

Right now, the PVE battle history is stored in a database. Currently, we have 10 battles, each averaging 79 KB in size. This may seem small, but as more players join and play hundreds of battles daily, storage usage will grow rapidly.

Cloud storage is expensive, so we had to make some decisions:

  • Not all battles need to be stored permanently. Most players only care about battles for a short time.
  • We implemented a one-week retention policy. Battles are stored for seven days and then automatically deleted using a TTL (Time-to-Live) index.
  • Exceptions for debugging. If a battle needs to be analyzed due to a bug, we can flag it to prevent automatic deletion.
  • Future features: Players might have an option to save special battles permanently if something exciting happens.

Upcoming Features

A couple of features are still missing:

  1. Share & Report Buttons:
    • A "Report" button to send battle details directly to us for debugging.
    • A "Share" button to allow players to send battle replays to friends.
  2. Expanding to Other Battle Types:
    • Currently, this is only for PVE battles.
    • Later, we’ll add support for PVP, Arena, and custom battles with separate history tabs.

Conclusion

This was an important update, and I hope to keep sharing progress whenever there’s a significant improvement. Hopefully, that means daily updates!

Thanks and see you tomorrow!