Hacker

Harindu Fonseka

@harindulk

Joined Nov 2026Game Developer at Starfun GamesSri Lanka

Elsewhere

Projects

  • Flagsmith for Unity

    Flagsmith Experimentation HackathonNov 2026

    Ship one build, give different players different versions of your game, and see in Flagsmith which version does better. Without remote config, a Unity game ships its tuning inside the build. Changing a jump height, turning off a broken feature or testing a new tutorial means a new build and a wait for store review. Flagsmith solves that for web and mobile apps, but it has no Unity SDK. Its FAQ points Unity developers to the .NET SDK, which runs on timers and background tasks. Unity's WebGL player has no threads for those to run on (I read the SDK's source for this; I did not run it in a WebGL build), and the team's own "Unity SDK" issue (#3623) was closed as not planned this month. I built Flagsmith for Unity, an open-source Unity package, and tested it against self-hosted Flagsmith 2.295.2 in Docker and against Flagsmith Cloud's free plan. A Unity developer adds one component and marks fields with [FlagsmithValue("run_speed")]. The running game then follows its flags: remote config, kill switches, and live tuning that lands on the next refresh (about two seconds with the refresh set to 2). GetExperimentFlag and TrackEvent connect the game to Flagsmith Experimentation, so a designer can A/B test a tutorial and read the result in Flagsmith. A window inside the Unity Editor edits flags without leaving Unity, for everyone or for one player (a tester's phone, or the game you are running). The package runs on Unity's main thread with UnityWebRequest, so it works in WebGL. It caches the last good flags for offline play and refuses to run with a server-side key. The repo also has Flag Runner, a small runner game that uses all of it (character and world art by Kenney, CC0). Flip a flag and the game changes while it runs: the character's skin, the speed, a winter event that reskins the whole level, a kill switch that removes the spiked walls. A self-hosted setup brings up the server side of the demo in two commands. The docs site has a playable WebGL demo that runs the real package in the browser. The page stands in for the Flagsmith API for the tuning flags, so it needs no login, and its tutorial A/B test is real: it runs on Flagsmith Cloud for visitors who take over from the autoplay bot and play a run of their own. An Agent Skill lets a coding agent set a game up and run a whole A/B test through the Flagsmith CLI. There are 39 automated tests: 26 for the package and 13 for the skill script, the site build and the server helper. Who would use it: Unity developers and designers who want to tune a live game, switch off a broken feature, or test two versions of something on real players. Most of the testing was on self-hosted Flagsmith. The flag, experiment and event calls also pass against Flagsmith Cloud's free plan, and an Android build runs on an Android 16 emulator (not yet on a physical phone).