Save System [BTS]
Today we're pulling back the curtain to give you a glimpse into one of the core systems we've been working on: our optimized cloud save system. This may sound like a mundane technical feature, but it's actually going to make a huge difference by providing offline gameplay in the future!
The Challenge
When developing an online game like SwordFall, we face a critical challenge: how do we ensure your game data (characters, weapons, progress) is always safe and synchronized, without making you wait through long loading screens every time you play?
Traditional approaches often involve downloading all your data from the server each time you start the game. This works fine but create lots of request (or load) on our servers during peak hours.
Our Smart Solution
Our development team has created a version-based storage system that's both efficient and secure. Here's how it works:
- Local Storage: Your game data (weapons, armors, spells, companions, etc.) is stored locally on your device
- Version Tracking: Each piece of data has an associated version identifier
- Smart Synchronization: When you launch the game, instead of downloading everything, we simply check if your local data versions match what's on our server
If everything is up to date (which is most of the time), you'll jump straight into the game without any waiting. Only when there's new or changed data will we download the specific information needed.
The Technical Bits
For the technically curious, we're using a flexible system built around our StorageData<T>
class that manages game entities like weapons, armor, spells, and companions. Each category of data is stored in separate dictionaries.
We also keep track of game configuration settings like the current game version and helpful tips:
public class Config
{
public string Version { get; set; }
public string[] Tips { get; set; }
...
}
Security Without Sacrificing Speed
Another clever aspect of our system is how we handle security. Many games validate every single player action on the server to prevent cheating - but this creates constant communication that slows down your experience.
Our approach is more targeted:
- Regular UI manipulation is handled locally for responsive gameplay
- Server validation only kicks in during critical moments like competitive matches, upgrades and purchases
- This creates a perfect balance - you get the responsiveness of a single-player game with the security needed for fair online play
Why Local Storage Is Secure: Action-Based Validation
Some of you might wonder: "Isn't it risky to use local storage? What if players modify their save files?" This is a great question that deserves explanation.
Our system is built on a principle of verification. We allow your device to load and use local data for a smooth experience, but we validate all meaningful actions against our server records before they're processed.
Real Example: The Currency Modification Scenario
Let's walk through a concrete example:
Imagine a player modifies their local save file to show they have 1,000,000 gold coins (when they actually only have 500). Here's what happens when they try to use that fabricated currency:
- Player attempts to purchase a premium card pack costing 1,000 gold
- The client sends this purchase request to our server
- Our server checks the player's actual balance (500 gold) in the database
- The server determines they don't have sufficient funds and rejects the transaction
- The server sends back their actual balance
- The client app updates the local save to reflect the correct amount
The player never gets to complete the fraudulent purchase, and their client is automatically corrected to show their real balance. This happens so quickly that honest players never even notice this verification process.
Match Integrity Protection
We apply similar principles to competitive matches:
When you enter matchmaking, our server:
- Validates your entire deck against your account's actual collection
- If you try to use cards you don't own, matchmaking is immediately canceled
- Players attempting to use modified save files to access unavailable items are flagged for review
- This ensures every match is played on a level playing field
This action-based validation system gives us the best of both worlds - the speed and responsiveness of local storage with the security of server-based validation exactly when it matters.
The Benefits For You
This system delivers several key benefits:
- Faster loading times: No more waiting for data you already have
- Less bandwidth usage: Great for players with limited data plans
- Offline capability: Many game functions will work even without a perfect connection
- Security where it matters: Fair play in competitive matches without constant checking
What's Next?
We're continuously refining this system based on testing and player feedback. In future updates, we're planning to add:
- Even more granular synchronization for larger game assets
- Background syncing during gameplay for seamless updates
- Extended offline capabilities
We hope this peek behind the curtain helps you understand some of the work that goes into making SwordFall run smoothly. Our goal is always to create the most enjoyable experience possible while respecting your time.
Stay tuned for more dev insights, and as always, we welcome your feedback!
The SwordFall Dev Team