Using semantic web technologies to build an "infinite" text-based adventure game
April 23, 2021
Did you ever play a Fighting Fantasy book ? Roughly they are these role playing games where you are given a choice, say “help the man?” and if you choose “Yes” then it directs you to a page number, where it will describe the outcome of your choice. It’s a popular and early form of Role-Playing Game (RPG) which inspired subsequent games like Dungeons & Dragons and helped shape the RPG genre as we know it.
On PC it’s notable that Fighting Fantasy’s designs gave rise to the text-based and the point-and-click adventure game which continue to be popular to this day.
A Multi-User Domain is a real-time multiplayer virtual world and it’s usually text-based. It’s a concept deployed to various different domains including gaming, where players share a virtual world in which they might “choose their own adventure”.
Since the age of about 5 I’ve been fascinated by the idea of making a game with infinite choices. I made a game in which I was the server. I’d say “so what do you want to do?” and what the player said, I’d draw it. It had awful rendering time but great gameplay. Whenever I tried to write it into a book like Fighting Fantasies, I ran into a simple mathematical problem and couldn’t finish it. The truth is that writing a storytelling adventure game like The Walking Dead is the art of giving the illusion of choice. Giving real choice, you’ll find that the tree of possible outcomes grows exponentially and quickly becomes unmanageable. You must truncate outcomes and make choices lead to the same storyline until the very end.
Not so with the Multi User Domain.
A Very Brief Intro to the Semantic Web
For the unitiated I’ve prepared a brief intro on the basics of the semantic web. If you already know about all that, then please skip ahead.
The Infinite Text-Based Adventure Game
Where SQL data is characterised by its constraints on data, RDF data is characterised by its openness. I can add a
canFly property to a
Car storage, without needing to perform a database migration or define this property on any other car.
So at this level the Multi-User-Domain project is an effort to define a shared specification on a virtual world, which developers can extend and build on to infinity.
There is a lot of fun to be had in the building of a world, even without any “text-based adventure”, simply by creating a village, coming back in 6 months to find that your village is now a city, or that the bartender at the saloon you visited last week is complaining about another player who came in and challenged them to a duel. The world server doesn’t have to define what a duel is, what a saloon is or what a memory is, it just needs to allow players and machines to write to it in RDF. By defining common specifications for the interoperability of services, the client can discover a service which allows them to challenge bartenders to duels and expose this to the player.
Building on the open and interoperable properties of semantic data, and defining common specifications for the interoperability of services, we can build a decentralised game, extended on the fly and bursting with life. It can continually surprise the players and architects of the worlds which compose it, forever evolving and forever changing. A community of worlds for humans and web crawlers to interact with.
Of course this implies that the game’s stories need to be decentralised, open to the twists and turns of player choices. Anyone who’s been “Dungeon Master” in Dungeons and Dragons knows the perils of players derailing quests with their unpredictable behaviour, but often that unpredictability is what makes it so fun and it’s what makes every campaign unique. Because of this open property at the heart of the MUD experiment, writing stories will be less “one big tree” like a Fighting Fantasy and more loose connections and federations of short and flexible event trees, changing on the fly like the game itself. But let’s find out when we’re vaguely ready to start serving stories :-)
I’m interested, what’s the next step?
- “I want to write code”. Please find the high-level documentation.
- “I want to build worlds, but I don’t want to write code”. Please find the high-level documentation.
- “I want to play!”. Contact me! When we’re ready for players, I’ll be in touch.
We want to create an open community which is accomodating for developers of any skill level and background. It’s all about learning, experimentation and having fun :-)
Did I mention that the code is open-source, free, gratis and publicly accessible to read and extend?
Get involved and let’s make it happen!