random image
ForumNewsletterModDBSteam Community
Blog
July 25, 2012: Creating Multiplanet Maps
Dear fans of the Stargate Mod,

today I want to explain to you some details about the infrastructure we are using for creating maps for the Stargate Mod. This information might be of particular interest for you if you are planning to create your own maps for our Mod, but all others are of course also welcome to read on if they are interested in some technical details.

Now what is so special about creating a Stargate-themed map? Well, as you know from the TV show, the Stargate universe consists of many different planets that are connected by Stargates. If you had unlimited resources, then theoretically you could get from each gate to every other, as shown on the image on the left below.

All Stargates connected with each other Partial connection of Stargates
Stargate universe: a huge number of Stargates
form a gigantic network.
In-game setup: due to technical limitations,
not every Stargate is reachable.

It would be nice to have the same freedom in our Mod, but from a technical point of view, this is of course not possible. We can't just put all planets together into a single map – not only this would lead to very long loading times and large memory consumption, there are also many constraints imposed by the Source engine that force us to use only a small set of planets in every map as shown on the image on the right. We call these maps "multiplanet maps". How many planets fit of course depends on their complexity, but we have found that a number of four to six planets is practical and allows for an adequate complexity of the multiplayer missions in the Mod.

To show you the unique technique we are using, I'll take you a little bit behind the scenes of mapping for the Source engine. Creating a map typically involves running a software called Hammer World Editor which is used to create the world geometry (brushes), the logic objects and effects (entities) as well as input/output connections between the entities. The map then gets compiled to a binary form which is more efficient to handle by the engine and also contains pre-computed data for, e.g., lighting. This is how it is done in pretty much all Source engine based games nowadays.

Hammer World Editor
Stargate Command in Hammer World Editor.

Now where's the problem with this approach with respect to our Mod? Some planets that are used in multiplanet maps are used in multiple missions. A typical example is the Stargate Command (SGC) at Cheyenne Mountain Complex on earth – it serves as initial spawn point for the Tau'ri (humans) in most missions. The problem is how to ensure that each and every map we release has a consistent version of the SGC in it.

What do I mean by that? Imagine a map author wants to create a multiplanet map and puts the SGC into it by copying it. Now as time passes, the SGC map from which he copied gets revised and has some very cool new features that people would also like to see in the combined map. However, to achieve this, the respective part of the map would have to be copied again and recompiled. You can imagine that considering almost every multiplayer map having the SGC in it, this would be a cumbersome, manual and error-prone process, especially if the original author was not available any more.
This is where our approach called "multiplanet-merge" comes in. How does it work? It allows us to specify how a multiplanet map should be composed of various partial maps so that this process can be automated. The following image shows an example:

Map merging
Merging individual maps to create multiplanet maps.

Here, generation of two different multiplanet maps from three individual "planets" is shown: Multiplanet map "Goa'uld Invasion" combines the SGC with a map called "Ha'tak", whereas multiplanet map "Goa'uld Jail" contains the SGC and a planet called "Jail". Instead of manually duplicating the SGC map, the merge is only performed as part of the final compilation process of the map. This means that if the SGC map changes afterwards, the changes can be applied to both multiplanet maps automatically.

Using multiplanet-merge, we can also quickly generate a new multiplayer mission by combining existing planets – completely without the need to invoke Hammer World Editor! When we release the Mod, this might also come in handy if you are a mapper and you would like to create your own multiplayer map by putting one of your "planets" together with ours!

Is it really that simple? If you are experienced in mapping, you might know that it requires more for multiplanet maps to "work" than just gluing them together. Yes, the geometry is there, but of course the game logic has to be adapted, maybe some doors locked and team spawn points assigned. Multiplanet-merge allows us to do this as part of the merge and build process using a config file – you can compare it with the .qc file that you pass to studiomdl.exe when compiling a model. Hence, we gave it a similar name: .vmfc (Valve Map File Compilation Settings). VMFC is different from existing external compilation tools in that it allows for really reproducible results for every compilation of a map, (almost) independent from the system where the map gets compiled. And of course it also integrates well with our multi-skybox system!

I hope you enjoyed this blog post.
Thanks for reading!
0 comments | posted by Sidewinder

Disclaimer