Case study

Throne of Lies: Medieval Politics

A highly engaging and successful online PvP social deduction game with advanced moderation systems, scalable design, and rich in-game AAA social features.
Back
Back to Projects

Overview:

Throne of Lies: Medieval Politics is an online player versus player (PvP) social deduction game that brings players into a complex web of intrigue and deception as they struggle for power and survival. The PC-Gamer featured game boasts a diverse cast of over 50 classes across four factions, providing unlimited replayability and fostering a dedicated community of players who have logged thousands of hours in the game. The project has gone through a full development cycle, from architecture to launch and updates, and has organically achieved nearly half-million game activations. Throne of Lies incorporates advanced moderation systems, scalable design, and rich in-game social features to enhance player engagement.

High-Level Breakdown

Featured by PC Gamer

Throne of Lies: Medieval Politics (Online PvP) lead game developer, architect, producer and publisher; IP successfully sold in 2020.

  • Full Development Cycle: From architecture to launch and updates, organically grossing $500k+.
  • Online Matchmaking System: Automatically gather and display connecting players with chat.
  • Moderation System: Role-based report<>review system with priority queues and automations.
  • Friend System: Robust with rich presence, invite, follow (self-invite), social trophies, blocking.
  • Discord: C#/JS SDKs, rich presence system, realtime GBaaS integration, join/follow/invite systems.
  • Realtime Engagement: Role-based, in-game query<>action system directly integrated in Discord.
  • Build Pipeline/Automations: Post-build code generation for parsing and continuous integration.
  • Achievements: Funded on Kickstarter; 2x award finalists; featured on PC Gamer: i42.quest/pcg
  • Successfully Sold: After being acquired by PT.farm, I was rehired back for 18mo for online multiplayer backend updates.
SteamCharts: 2017~2019 @ 244~914 average CCU

Game Backend as a Service (GBaaS) Integration:

When first started creating Throne of Lies in 2016, we went through through a variety of GBaaS:

1. UNET (2016)

2. PlayFab + Photon (2016)

3. GameSparks + Photon (2017)

4. BrainCloud + Minimal Photon (2022)

While going through these transitions, I learned a great deal about GBaaS and realized there was no central "hub" to both discuss and compare these services. Late 2016, I created:

  1. The Mega GBaaS Comparison Sheet
  2. The GBaaS Devs Discord Community

GBaaS: Epic Online Services (EOS) - Open Source

During the course of our development, when Epic Games was announced with EOS, there was no Unity SDK available. I decided to make one -- then integrate it into our game on a separate branch, just in case we got invited to the Epic Store.

  • Skip to the open source code examples to check out my coding style!
  • The first and only working Unity port, at that time; even praised by several EOS staff and personally invited to apply for their Mega Grant.
  • More

GBaaS: GameSparks (GS)

Used GameSparks until they went obsolete -- while personally one of my favorite GBaaS, it was sad to see them go (not just because they were bound to my game).

  • After GameSparks was acquired by Amazon and announced deprecation, there were still linger issues that I took the initiative to fix: Convinced staff to open source their community SDK so that I could patch their broken/obsolete Websocket (that wouldn't allow higher versions of Unity or standalones on Windows 7, Mac or select mobile devices).
  • Created and managed the entire backend, including authoritative cloud scripts, NoSQL mongodb, LiveOps, automated events, economy, inventory, quests, authentication, self-serve GDPR compliance, matchmaking, live game tracking, moderation review/report/escalate systems, server-side anti-hacking. anti-VM detection, Discord integration, Photon integration, Steam integration.
  • More

Realtime Online Multiplayer: Photon PUN

  • Used RPCs for realtime chat, matchmaking, state synchronization and event triggers.
  • Created custom, 3rd-party authentication with both GameSparks and BrainCloud.

Other Online Multiplayer/BaaS Implementation

  • BrainCloud (BC): Completely ported the game from GameSparks to BrainCloud in 2022.
  • Microsoft PlayFab (PF): Created GBaaS architecture and implemented solutions before GS.
  • Unity UNET: Learned online multiplayer with UNET, and made the worlds 1st UNET tutorial: i42.quest/unet 

Dynamically-Loaded Store

  • Created a dynamic economy, complete with inventory, that would sync to other parts of the game.
  • Nearly 200 items dynamically loaded MVC-style from a server-side JSON catalog.
  • Relevant Soft Skills: 15+ years of Photoshop experience. creative writing experience.

Game Design

  • 50 classes: Crafted and balanced over 50 classes with the protagonists and antagonists having an average 1~2% win margin difference (hyper-balanced, with an average 51% antagonist win rate ), despite the mathematical `100!` number of ability combos.

  • 4 Factions: The antagonists, 1 of 2 protagonists that could appear, and a neutral faction.

  • Evil Recruitment Conversion Mechanics: Good players could be converted by the evil factions into a completely revamped “evil version”, joining the opposing rank upon doing so while still keeping balance.

  • Unlimited replayability: We boast the average veterans maintaining thousands of hours of gameplay while still returning back for more, due to the sheer number of combos and player interactions.

  • Art Direction: While the game was, admittingly, not the prettiest, it was unique and consistent in theme - we owned it and made it our own.

  • Music Direction: The choice of music composition ended up scoring us a “Great Soundtrack” tag on Steam.
  • Lore: I personally created most flavors of text in the game, from lore, to ability/item names and item flavor text.
  • Intrigue: Every item, ability or class weaved its way throughout the deep storytelling of the realm surrounding Castle Adiart, slowly awakening mystery and intrigue.

  • Audio/Video Editing & Storytelling: Crafted the monologue, decided upon and pieced together the background music with Audacity, and decided the trailer content in our 1st story trailer. See the backstory in our pre-alpha story trailer on YouTube: The Court Wizard & The Sage.
  • Scalable Plug n Play System: Every class and ability in the game is essentially like an NES cartridge - if you want to change up some balance, you can simply drag an ability in this slot and it will work.

  • Globally Sync’d: If you updated a class, every information piece in the game would be updated to reflect this without any other changes. Most data is runtime-generated.

Customization System

  • Fully and dynamically cloud saved/loaded.
  • Incognito Options: Randomize Gear, Show Default Squire Title

Synchronized, Modular Classes/Ability System

  • Using ScriptableObjects for classes and abilities, all classes/abilities in the game can be mixed and matched like plugging in a game cartridge.
  • As classes/abilities are changed up, all information in the game, including complex information cards, will update to reflect the changes.

Microtransactions

  • Purchase in-game gold with real-life money, via Steam’s multi-step flow.
  • Pay-to-win strictly forbidden ;) aesthetics only!

Dynamic Chat Modulations/Links

  • For new players, confusing acronyms are dynamically replaced with full context and info links.
  • Dynamically replace known player content or glossary terms with action-filled, clickable links.
(GIF)

Deathnote Feature

  • When a player dies, their killer may creatively taunt the dead by leaving a drawn deathnote when their death is publicly revealed.
  • Fan Favorite: Players loved this, as we were constantly thinking of ways to make things more fun during downtime.

AAA Moderation Report, Queue, and Review System

  • In-game review system for both volunteer “Guides” and official staff to participate.
  • Smart queue system, prioritizing repeat-offenders and more-critical situations first.
  • Automated escalation system, passing lower-priority cases to lower-tier moderators.
  • Each mod rank had a maximum allowed action, where higher punishment requests would auto-escalate.
  • Logs and player info with numerous filters/analytics to determine a fair case judgment.
  • Escalation system to pass notes, evidence, and notable logs for second-opinion requests.
  • Before the 2.0 moderation system, in-game reports used to utilize the Discourse API to create forum tickets.

Moderation 2.0 Report Review Tool Breakdown

  1. View Report Info: As seen on the center of the screen, one may review the caseId, predefined reason, both the accuser and reporter (since sometimes the reporter has a history of a reporting everyone, for example), and the player-described reason.

  2. Reported Match Player List: Every match, for a limited time, is saved, complimenting the report tool. View the accused, the reporter, their in-game alias, permanent username/id, the outcome of the game and when they left. One may also view their moderation history outside the match.

  3. View Player History: One may view stats regarding the reporter/accused to deduct the integrity of the report. Did the player have a huge ban history? Does the reporter seem to report every game? If reported for gamethrowing, is the accused a new player? This helps take things into consideration for gray-lines that may require further clarification to ensure a just action.

  4. Chat Filters & Special Flags: Being a social deduction game based on chat, going through an entire match’s chat history is tedious. Due to special flags logged throughout the match, we can filter exactly what we want to see; fully color-coded. This may just be the most ambitious parsing project, yet.
    For example:
    The “trollbox” ability would allow a player to speak through another player’s mouth. If this is used in an unfortunate way, sometimes the wrong player may be reported. In the logs, we essentially get truesight to see the original authors of messages.
  5. Search: If filters weren’t enough, search for keywords to make reviews easy and highlight only relevant lines.

  6. Evidence Box: This was not only logged (and webhooked to a private Discord channel for mods to review), but would be used for our escalation system, including a summary to the next reviewer.

  7. Judgement Buttons: Mods can choose either Innocent or Guilty. Guilty will check for a whitelist of moderation status and ensure rank is high enough for the suggested action. If under-ranked, the report will file as top-priority for a higher-ranking mod to review the next time they request a new report - as well as a webhook to a private Discord channel.

"Thronebot" Discord Bot - Realtime, In-Game Moderation

  • Commands (via whitelisted mod) will engage with GBaaS to issue in-game actions in realtime.
  • Including: Warnings/bans, gold, popup messages, name changes, queries, memos.

Discord Bot - Invite/Join/Follow Features

  • Private and public invite/join/follow features directly from Discord:

  • Custom Invite systems with realtime info before Discord officially supported them:

Discord Bot - Realtime stats

  • Public game over summary webhooks with winner list:

Discord Bot - Smart Self-Claim Steam Key Dispenser

  • Utilized DiscordJS, Discord OAuth2, MongoDB Atlas, and Redis.
  • First of its kind to give away actual keys (instead of simply selecting a winner).
  • First of its kind to verify the user has a real Steam account with no VAC issues or banned alts.
  • 1,000 keys given away in 1 hour with no issues.
  • Commercialized later as a standalone bot: Dragonclaim

Social / Rich Presence

  • The very first live game to use Discord RP - and contributed to make it first work in Unity!
  • In-game friends list with rich presence, including invite/follow systems.
  • Optional “invite code” system for streamers and large parties.
  • Steam friends auto-synchronized.
  • Realtime Discord status updates.

Auto-Triggered Timed Events

  • Xmas, Halloween, April Fools, Anniversary...
  • Both server-side and client will trigger in-game events at a fully-automatic scale.
  • Limited holiday items, changed scenery, altered particles/UI.
  • Discord Webhook events, from lore-notable NPCs, appearing in #general or #news.

Anti-Hack Security: Realtime Stream

  • Realtime security alert stream via Discord webhooks to private channels.
  • See screenshot below, demoing catching an actual man-in-the-middle attack attempt.

Anti-Hack Security: VM Detection

  • The first known game/software to create a reliable VM detection system without fault.
  • Players don't normally play with VMs, anyway, which generally indicates hackers or attempts to play with unsupported devices (causing impossibly difficult bug reports).

Self-Serve GDPR System

  • Get Data: Once per 30d, players may self-serve request the entirety of their data in JSON form.
  • Anonymize: Players may delete (anonymize) their account, after a 30d grace period.

Relevant Soft Skills

  • Entrepreneurial Experience: Technical sales, organic marketing, self-sustainment, team building.
  • Paralegal: Copyrights, worldwide-filed trademarks, contracts, terms of service, GDPR, EULA.
  • Mandarin Chinese(中文): Intermediate-level speaking, reading, writing and typing helped with local events/streamers.
  • Art/Lore Direction: Although limited by budget, the art is unique with vibrant lore.
(GIF)

Other Notable Experience

  • [De]Serialization: Mastered Newtonsoft since 2016, with custom typings and architecture.
  • OAuth2: “Login via” Steam, Discord, Twitch, Epic Online Services, FB.
  • Server/DevOps: JS, Nodejs, Nginx, ExpressJS, REST API, Stripe (custom payments), auto-mailers.

Conclusion

I am a full-stack experienced, backend passionate dev/architect with the niche specialty of online game development. While I have been making online games since 2016, I have been coding throughout most of my life; both professionally and as a hobbyist.

Questions? Contact me!

Role:

As the lead game developer, architect, producer, and publisher of Throne of Lies: Medieval Politics, I was responsible for overseeing the entire development process and ensuring a high-quality and engaging gaming experience. My tasks included crafting and balancing the game's classes and factions, designing and implementing robust online systems, creating in-game lore, and directing the game's unique art and music. Additionally, I managed the project's technical aspects, from backend architecture to server operations and security measures.

Stack:
  • Unity
  • C#
  • JetBrains Rider/Webstorm
  • MongoDB
  • MongoDB Atlas
  • NoSQL
  • GameSparks
  • BrainCloud
  • Microsoft PlayFab
  • Photon PUN
  • OAuth2
  • Steam API
  • Discord API
  • Discourse API
  • Stripe API
  • Mailchimp API
  • Sparkpost API
  • Newtonsoft
  • Photoshop
  • Audacity
  • ScriptableObjects
  • Regex
  • More @ StackShare

Problem

Developing an online multiplayer social deduction game like Throne of Lies presented various challenges, including the need for a reliable and secure online infrastructure, a balanced and engaging gameplay experience, and an effective moderation system to maintain a positive community. Additionally, the social deduction genre is highly dependent on players' interactions and communication, demanding a robust chat system and diverse in-game scenarios to foster rich player engagement.

Solution

To address these challenges, Throne of Lies was built using a range of cutting-edge tools and technologies, including Unity, C#, and various backend-as-a-service (BaaS) platforms. The game's design was meticulously crafted to provide balanced gameplay with over 50 classes across four factions, resulting in a hyper-balanced win rate and unlimited replayability. Advanced moderation systems were implemented, including an in-game report, queue, and review system, as well as real-time Discord bot moderation. Robust chat features, such as dynamic chat modulations, links, and a unique deathnote feature, were incorporated to enrich player interactions and enhance the game's social aspects.

Next