TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: OpenGB – modular game back end engine with first-class scripting

20 pointsby NathanFlurryabout 1 year ago
I’m tired of getting screwed by game backends like Microsoft PlayFab and Unity Gaming Services. To get a simple cross-platform friends system, we’ve bent over backward fighting against their limited APIs to jerry-rig the behavior we need.<p>These backends “solved” their platform’s rigidity by tacking on a clunky scripting layer [1] [3] with a proprietary KV database [2] [4] (look ma, no transactions!). They proceed to claim you can build a LiveOps game on this rubbish without testing, database migrations, monitoring, BI tooling, etc.<p>We got fed up and built an open-source backend engine as an alternative: Open Game Backend.<p>OpenGB is comprised of four components: the engine, modules, scripts, &amp; registries.<p>Modules &amp; Registries<p>No two games have identical use cases, but these game backends try to provide the same API to everyone. For example, PlayFab has 44 API endpoints for their economy API [5], yet every developer I know still finds it too restrictive to use in a serious game.<p>Instead, OpenGB assumes game developers will start with off-the-shelf modules, then fork &amp; write new modules as their needs grow. Everything down to auth, tokens, &amp; rate limiting are implemented as modules so they can be modified. Forking a module is as simple as `opengb fork &lt;module&gt;` to pull code in to the repo.<p>Scripts<p>I love niche game engines &amp; languages, so I’ve seen a lot of weird tooling. But these cloud scripts are some of the most tedious platforms I’ve written code for. Even their example code has race conditions [6] and requires 306 LOC to implement a simple transaction [7].<p>We built the scripting API to feel as much like a game engine as possible. All of the complexities of database queries&#x2F;migrations, schema validation, and networking are abstracted away in a cozy engine-like scripting environment where game devs feel at home. It&#x27;s dead simple to write a leaderboard module from scratch in a couple minutes: https:&#x2F;&#x2F;opengb.dev&#x2F;build&#x2F;crash-course<p>Official Registry<p>We don’t intend to ship a truckload of half-baked services like PlayFab &amp; UGS does. We want to build a solid engine that others can extend with modules.<p>To help developers bootstrap their backends, we maintain an official registry of modules (written by us &amp; external contributors) that are thoroughly reviewed for performance, testing, &amp; docs. We hope other devs also share their registries, similar to the Unity Asset Store community. See: https:&#x2F;&#x2F;opengb.dev&#x2F;modules&#x2F;overview<p>We’re currently working with a few studios rolling OpenGB out to production. If you give it a spin, we’d love to hear your thoughts below or in our Discord: https:&#x2F;&#x2F;rivet.gg&#x2F;discord<p>Documentation: https:&#x2F;&#x2F;opengb.dev<p>GitHub: https:&#x2F;&#x2F;github.com&#x2F;rivet-gg&#x2F;opengb<p>A few more notes:<p>- Licensed permissively under Apache 2.0, go nuts<p>- Leverages PostgreSQL’s features &amp; extensions, similar to Supabase<p>- Generates type-safe client SDKs &amp; Open API specs for your modules<p>- Supports Deno, NodeJS, Cloudflare Workers<p>[1] https:&#x2F;&#x2F;learn.microsoft.com&#x2F;en-us&#x2F;gaming&#x2F;playfab&#x2F;features&#x2F;automation&#x2F;cloudscript&#x2F;writing-custom-cloudscript<p>[2] https:&#x2F;&#x2F;learn.microsoft.com&#x2F;en-us&#x2F;gaming&#x2F;playfab&#x2F;features&#x2F;entities&#x2F;entity-objects<p>[3] https:&#x2F;&#x2F;docs.unity.com&#x2F;ugs&#x2F;en-us&#x2F;manual&#x2F;cloud-code&#x2F;manual&#x2F;scripts<p>[4] https:&#x2F;&#x2F;docs.unity.com&#x2F;ugs&#x2F;en-us&#x2F;manual&#x2F;cloud-save&#x2F;manual<p>[5] https:&#x2F;&#x2F;learn.microsoft.com&#x2F;en-us&#x2F;rest&#x2F;api&#x2F;playfab&#x2F;economy&#x2F;catalog<p>[6] https:&#x2F;&#x2F;github.com&#x2F;Unity-Technologies&#x2F;com.unity.services.samples.use-cases&#x2F;blob&#x2F;main&#x2F;Assets&#x2F;Use%20Case%20Samples&#x2F;Daily%20Rewards&#x2F;Config%20as%20Code&#x2F;DailyRewards_Claim.js#L38<p>[7] https:&#x2F;&#x2F;github.com&#x2F;Unity-Technologies&#x2F;com.unity.services.samples.use-cases&#x2F;blob&#x2F;main&#x2F;Assets&#x2F;Use%20Case%20Samples&#x2F;Command%20Batching&#x2F;Config%20as%20Code&#x2F;CommandBatching_ProcessBatch.js

2 comments

capncleaverabout 1 year ago
This looks like a great tool and sort of makes me wish I was starting a new game rather than hand-knitting more cruft into our homemade backend. Kudos for open-sourcing it with a proper license.
评论 #39728880 未加载
CJBBabout 1 year ago
This looks like an incredible tool, so much more flexible than existing options. What&#x27;s next on the roadmap?
评论 #39728895 未加载