This sprint was all about data and opponents. With the game now live in Azure and backed by a real CI/CD pipeline, it was time to replace the placeholder JSON storage with a proper database – and add something I’ve been wanting for a while: AI players.

Goodbye JSON, Hello PostgreSQL

Until now, all game state, player data and friend lists had been stored in local JSON files on the server. That approach worked surprisingly well during early development – especially since I had built a flexible read/write layer around it. But it was never meant to scale.

This sprint, I migrated everything to PostgreSQL running as a service in Azure. Thanks to the abstraction layer I had already written, the transition was smoother than expected: I only needed to swap out the low-level database functions, while the higher-level logic could remain mostly intact. The migration covered:

  • Game states
  • User profiles
  • Friend lists
  • Game history

I chose to skip heavyweight migration tools like Flyway for now. Instead, I’m managing schema versions with a lightweight internal model that fits the pace and size of this project.

PostgreSQL has already shown clear benefits – especially under load with multiple games running simultaneously. Queries are faster, concurrency is smoother and everything feels much more production-grade. This is a big step forward in stability and readiness.

Reworking Account Login: A Detour and a Pivot

This sprint, I reworked the entire account system – and ran into my first real setback.

After building my own login system, I discovered Microsoft Entra External ID, which promised everything I needed: secure, scalable identity with Google and Apple login built in. I spent several days integrating it, but hit a wall when I learned that Google no longer supports sign-in via embedded webviews – a dealbreaker for my setup.

Rather than hack around it, I pivoted to platform-native login instead:

  • Google Play Games Services on Android devices.
  • Apple Game Center on Apple devices.

Both services offer seamless integration, though with slightly different behavior.
On Android, players are automatically signed in with their Google account as soon as the game launches, provided they’ve accepted sign-in before. On iOS, the game attempts to authenticate with Game Center at startup – if the user is already logged in through system settings, it works silently; otherwise, iOS prompts them to sign in.

To avoid privacy, security, and long-term maintenance issues, I’ve decided not to support email/password login at all. Instead:

  • Android players use their Google account.
  • Apple players use their Apple ID via Game Center.
  • Everyone else gets a simplified guest account.

This setup keeps things secure, easy to maintain and tailored for mobile platforms. However, cross-platform login and account linking won’t make it into the first release – without Microsoft Entra or a custom solution, it simply became too complex to solve cleanly in time. But the current approach is solid, and I’d rather launch with something stable than rush a half-finished system.

Screenshot: Fantis is automatically logged in with Google Play Games Services during the splash screen at game start.

Meet the AI Players

While playing Connect 3D against myself has been useful, it’s definitely not the best way to test a multiplayer game. So I finally added a set of AI players, each with different play styles and difficulty levels:

  • BasicBot – makes completely random valid moves.
  • GreedyBot – tries to block the opponent and complete lines.
  • SmartBot – simulates a few steps ahead using a basic evaluation function.

These bots are built into the server and follow the same rules and protocols as human players. This means I can start matches with them just like I would with any user. It’s already made testing much easier and more fun – and it opens up interesting opportunities for single-player or training modes in the future.

Screenshot: Spying on a match between two AI bots – to no surprise, GreedyBot won this one.

Creating AI opponents also helped stress-test the networking and game state logic. Bots don’t mind playing thousands of games in a row, and they’re great for finding edge cases. I’ve been running some fully automated matches overnight, analyzing the logs in the morning.

Up Next: Stats, Ranking and Smarter Matchmaking

Now that we have proper storage and testable opponents, the next step is to:

  • Add game statistics for players (wins, losses, draws).
  • Introduce a basic ranking system and player progression.
  • Implement matchmaking for playing against random opponents.

Let’s see how far we can push the multiplayer side of Connect 3D next.

Elena