# Missions (1. Post)
In this post, Xiphoseer and I are going to be taking a look at one of the most important parts of LEGO Universe for giving us a sense of progression: the questchain!
You land in Avant Gardens, jumping out of your rocket. You see the landing cinematic, the glowing light around Wisp, the first time we've been met with a clear sky in LU. You walk up to him and hear the mission complete sound as you meet both of your objectives - escaping the Venture Explorer, and finding Wisp. It's a familiar noise from the Venture Explorer, but you can immediately tell that this is a much larger place. The tutorial is over, we're ready to get our first missions in this new world.

This is what we see and feel as a player, but what actually goes into making this happen, and what goes into reconstructing all of this to build a server emulator? Over the next few posts, we'll be trying to explain this mission and other parts of LU, so I'll stop procrastinating, and let's get into this!
## Clients and servers!
Before we start though, let's go through what we have as a potential developer, and what we need to make. The most obvious thing is that we need to download something onto our computer to play the game. This is known as a client, and fortunately we have copies of these clients from back when the game was still live. However, we'd also like to have a multiplayer game, so we're going to want different people's clients to be able to talk with one another.
What happens, then, if we let them do that? The first problem we run into is how do we know who's out there. It'd be like trying to play a game of chess with someone, over the postal system, without knowing their address. So maybe we can keep a list of people connected, somewhere. When you join the game you access that list, and find out the other people to whom you can talk.
This could work, but you begin to wonder whether or not you can trust everyone. For instance, this strange guy called 'Xiphosia', or something like that, keeps sending you messages that contradict everyone else's. Apparently he's just smashed the Darkitect for the third time in three minutes, using nothing but his bare hands. But there's no-one we can check this with, since everyone's only sources of information on what other people are doing are those same people! We need some way of checking that everyone is on the same page, that this Xipho person isn't getting confused about what's a Stromling and what's the Darkitect!
And so we make a decision. On that big list of names, we'll also keep a big map, containing information on the positions of every enemy, their health, what they're dropping, and who's smashing them. As well as sending out information to everyone else, players also update themselves on this big map, so that people can check whether or not to believe them. For instance, I don't personally believe that Xipho just managed to smash Butterscorch from over in Portabello.
But if different players can choose what to believe, people's views of the world could diverge pretty quickly, and so we decide to put rules in place on our map, and rather than each person judging for themselves, we get Bob to stand by the map and check everything the players tell them.
Now, however, the map contains literally all the information we need to know, so there's no point sending information directly to people any more, all we need to do is update the map. This comes with the benefit of extra security, since you don't need put your address down on a huge public list in order to place chess. Now you just need to give Bob that information, and that can't be a bad idea, right, Bob?
Bob?

Well, anyway... What we now have is a server which is in charge of running the game. All the clients connect to the server and send it information, which it judges, before letting the clients know, in return, how this information affects the world around them.
And that answers our basic question. We have access to the client, but the server was stored by LEGO, and so is sadly beyond our reach. The clients talk to one another via the server, and each waits for the server to tell it what to do, even if it thinks it knows, since if the server doesn't believe you've smashed the stromling, and isn't telling anyone else, there's no reason for your client to tell you that you've smashed it! That would jsut create more disagreements further down the line! In other words, the client needs the server to tell it what to do, and so it's our job to rebuild the server, using anything and everything we can find in the client.
## What does the client give us?
Since we know that we have the client, let's think about what's actually inside it. If we're programming a game from scratch, we could, in theory, send everything from the server to the client whenever the client needs it. In fact, we could generate images frame-by-frame on the server and just send them the the clients. The issue with this is just how long it would take, both for the server to render each frame for every player connected, and to send that information to the player. In order to move, you'd have to press a key, wait for the keypress to be sent to the server, then wait for the server to render the image and send it back to you, whilst doing that for everyone else online too. Meanwhile that stromling just smashed you.
Instead, it makes sense for the client to do some of the work, and for the server just to check it. For instance, the client renders the game, loads the maps and handles movement and physics - the server just checks it's telling the truth, and handles interactions with other players.
But here we can already see a tonne of little pieces that go together to build a game. You need physics for movement, you need maps, you need rendering, and all these systems need to interact. The original team had programmers, level designers, artists, and many more groups all designing their own pieces of the game, much of which is still stored in the client, although any interaction which relates to gameplay is still run on the server.
Because of this, we have pretty much all of the data we need, we just need a way to make it run. Unfortunately, all this data isn't just sitting their in the client for us to just riffle through, but fortunately for people like me, people like Xipho exist to make it simple! For this purpose we'll be taking regular stops off to look at [LUExplorer](https://xiphoseer.github.io/lu-explorer/), a tool to let you look in detail at the information the client contains.
For instance, there's a huge database in the client, known as cdclient.fdb. Inside this, there's a table containing every single NPC, every single mission, and since, as we've seen already, missions can contain multiple tasks, there's a table containing each of those. With time and experience in the format it's possible to pull this information together into a complete description of the mission, and that's what LUExplorer does!
It turns out there's more going on with the ['talk to Wisp Lee' mission](https://xiphoseer.github.io/lu-explorer/missions/1732) than you might expect - for some reason the game handles it differently than most missions to visit an NPC - so we'll get onto this particular mission later, and start with something a little bit easier. In our next post, we'll consider the mission Wisp gives you once you've reached him: to run to Epsilon like your life depends on it (which, if you stop for a chat with the purple fellows you meet on the way, it will)!
## References
Zone: Avant Gardens
~ <https://xiphoseer.github.io/lu-explorer/zones/1100>
<https://legouniverse.fandom.com/wiki/Avant_Gardens>
Scene: AG Battlefield (b)
~ <https://xiphoseer.github.io/lu-explorer/zones/1100/7>
<https://legouniverse.fandom.com/wiki/Paradox_Research_Facility>
Mission: "Escape the Venture Explorer"
~ <https://xiphoseer.github.io/lu-explorer/missions/1732>
<https://legouniverse.fandom.com/wiki/Escape_the_Venture_Explorer>
Mission: "Get Help!"
~ <https://xiphoseer.github.io/lu-explorer/missions/311>
<https://legouniverse.fandom.com/wiki/Get_Help!>
Object: "Wisp Lee"
~ <https://legouniverse.fandom.com/wiki/Wisp_Lee>
Object: <https://xiphoseer.github.io/lu-explorer/objects/6006/>
Missions: <https://xiphoseer.github.io/lu-explorer/objects/6006/73>
Object: Story Plaque
~ <https://legouniverse.fandom.com/wiki/Nexus_Force_Plaque>
<https://xiphoseer.github.io/lu-explorer/objects/8139>
Object: Trigger Cube (Human)
~ <https://xiphoseer.github.io/lu-explorer/objects/5652>
Script: Tooltip Collectibles
~ <https://xiphoseer.github.io/lu-explorer/scripts/client/ai/ag/tooltip_collectibles.lua>