I'm Forever Blowing Bubbles
So far, all of the blog posts you've seen have been from the designers and artists. But we thought you might like a peek into the inner workings of 8Realms from a developer, so here I am to introduce you to the Electronic Ghosts of Empire Past, Empire Present, and Empire Future via the medium of the Bubble.
One of the trickiest questions to answer when building a game is how to handle a new player's first experience of it. You want them to get into the action straight away, but you don't want to bewilder them. You want them to be able to play with their friends. You don't want them to arrive on a server to find it empty (either because no-one has joined, or because players who have joined have stopped playing), but you also don't want them to join a server where everyone is waaaaay ahead of them. In 8Realms, we decided to solve these various problems with the 'Bubble'.
When you start a new game of 8Realms, you're not immediately placed onto a regular server; you're put into the Bubble for the duration of the Ancient age. It's much shorter than the other ages, so don't worry, you'll reach a full-blown server soon enough. Your 'empire' at this stage is just a village of primitive people, who regard sharpened flint as cutting-edge technology. They daren't venture far from the village, and they keep to themselves. You learn the ropes of the game by getting them ready to enter, and take on, the world. The village needs expanding, technology needs developing, and so on. Once your villagers are ready, you leave the Bubble and head out into the world. At that point, you get moved to a full server. This solves the problem of getting people into the action without being swamped with functionality; we introduce it gradually.
Exactly how we decide where to put a player leaving the Bubble is still a work-in-progress, but we can use this to solve our second problem – getting you near some of your friends – and it goes a long way towards solving our third problem.
It's easy to clump players moving from the Bubble together so they have someone to interact with. And anyone who tries 8Realms but decides that, awesome though it is, it's not their style (after all, no game appeals to absolutely everyone) will probably decide this in the Bubble, so their empire won't be found abandoned on a full server. We can also avoid putting them on a server that's a long way advanced, so they're not hopelessly outclassed by people who arrived earlier.
Rather like moving from Cambridge to San Francisco, though, migrating from the Bubble to a full server is a tricky enterprise, because there's a lot to move. The three main technical constituents of 8Realmsare the event log, the gamestate, and the queue. The event log is the Ghost of Empire Past. It's a record of everything you've ever done; the research you've carried out, the buildings you've built, the units you've trained, and so on. It allows us to work out what the state of your empire was at any point in the past, should we need to. The gamestate is the Ghost of Empire Present. It's what your empire looks like right now. And the queue is the Ghost of Empire Future; it's what your empire is going to look like. It's the bit of the game that knows that your current research topic will finish at 3.45 this afternoon and you'll finish training up some villagers into Spearmen in ten minutes' time.
Empire Present is pretty easy to deal with; we just have to package up the state of your little empire and send the info to the new server. To avoid having to replicate the whole event log, we just save the gamestate inside an event, and use that as a base. It means that the server can't see what you did in the Bubble, but if we need to know we can always ask the Bubble for the data.
The more difficult proposition is getting anything your empire was in the middle of doing (researching or constructing a new building, say) to finish when it's supposed to on the new server. To set up Empire Future, we run through the gamestate we received to see which buildings are being built and when they're supposed to finish, and insert things into the queue for the right time. When things finish, we write an event to the log to say 'it's done' - this means we also have to recreate a few of the events from the Bubble, so that when we say 'it's done', we know what 'it' was.
Being a game developer is fun: we're forever blowing Bubbles at Electronic Ghosts. :)