The Goal
For this strategy game, the focus was on building a secure backend to handle base building and army management. Since it's a competitive game, I needed to make sure all logic—upgrades, resources, and combat—was verified on the server to prevent cheating.
What I Built
I set up the game to rely entirely on Braincloud for server-authoritative logic.
- Data-Driven Game Design: Kept building stats, unit balances, and game constants on Braincloud, letting the team push balancing updates without a new app build.
- Server-Side Logic: Wrote Braincloud Cloud Code (JavaScript) to handle all sensitive actions. When a player trains a unit or attacks another player, the calculation happens securely on the server.
- Core Gameplay Loop: Wrote the client-side systems for managing resources, base building, and recruiting an army, keeping everything synced with the backend.
- Inventory & Crafting: Added an inventory system that supports item crafting to give players more depth in how they manage their hero and resources.
- Shield Mechanic: Implemented a PvP shield system. The timer and expiration rules live entirely on the server.
- UI Toolkit & MVC: Used Unity's UI Toolkit along with a custom MVC framework to handle the massive amount of UI required for a strategy game.
- Component Library: Built a reusable library of UI components to keep the look consistent across dozens of menus and speed up development.
Takeaways
- Security First: Moving core logic to Braincloud Cloud Code was a great exercise in writing secure, server-authoritative game loops.
- UI Scalability: Building a standardized UI component library with UI Toolkit proved essential. It made assembling complex menus much faster and less prone to breaking.