Download now at legionsoverdrive.com Freedom of movement returns

Map Editor is now public. Basic instructions inside.

Discussion in 'Custom Maps' started by Fixious, Mar 21, 2013.

Thread Status:
Not open for further replies.
  1. Fixious

    Fixious Test Lead

    Controlling Objects
    The map editor is now available to everyone. Simply host a game and press F11 to start the editor. A few notes and quick-tips before going on:
    • It will only function properly in windowed mode. In fullscreen the menus at the top are cut-off, rendering it useless basically. If you don't know already, Alt+Enter will change from windowed/fullscreen mode.
    • Make sure Editor Mode is set to Yes at the Create Game screen.
    • She's pretty touchy. Certain menus will simply crash the client, namely the light editor. For now just stay away from that. It isn't needed to make a map anyways, and changing the skybox and fog can be done outside of the editor.
    • Save often! File > Save Mission As > NewMap.mis. Ctrl + S after significant changes.
    • Ctrl + Scroll Wheel controls brush size.
    • Hold Alt to rotate an object.
    • Hold Ctrl + Alt to bring up object scale control; middle white box controls scale uniformly.
    If you're looking to make a map the size of Frostbyte, host Frostbyte. Zenith? Host Zenith. There are only two actual map sizes in Legions, which is defined by a squaresize value of either 8 or 16. Both Elegiac and Frost are 8 for example, while Zenith and Mirage are 16. For this example I'll simply start with Frostbyte. Once you're in the game you might as well stay in observer mode. Spawning isn't really necessary. Once you've started the editor, go to Edit > World Editor Setting, and set the visible distance to 8000. You can also turn off object names if they are distracting (they're all called null anyways):


    [​IMG]

    This removes the fog and makes things a bit easier to work with.

    Each red dot is something you can either remove or modify. Clicking on one, such as one of the blocks by the flag stand, will select it and bring up 3 arrows. Hover your mouse over one of the arrows until it lights up, then click and drag in a direction. Clicking and dragging the yellow, purple, or turquoise lines will allow you to move the object in both corresponding directions (so dragging the yellow line allows you to freely move on both the X and Y plane). Hold Alt to bring up rotation options. Hold both Alt and Ctrl to bring up scale options. In scale mode, adjusting the center white box will control the entire object at once, allowing you to shrink/expand uniformly. You can select a bunch of items at once by simply dragging across them. If you do select a bunch of items and find that you can't move them, it means one of them is locked. I'm not aware of any quick and easy way of finding which items are locked.

    [​IMG]

    That's the bare-bones for controlling an object and modifying them. Of course, if you move the wrong item you can go to Edit > Undo or Ctrl + Z to undo your action(s).
    Last edited: Aug 20, 2013
    Dino, Belberith, 57thRomance and 6 others like this.
  2. Fixious

    Fixious Test Lead

    Importing New Objects
    Once you've become accustomed to moving existing objects around, it's time to move onto importing new ones. Again, I'll use Frostbyte for our example. Go to Window and select World Editor Creator. At the bottom of the window that appears there are 4 expandable sections containing items you can place within a map. You'll likely be accessing the Interiors section the most, so lets go there. Expand the box, and open legions > data > interiors. 8 new sections are now available. Feel free to browse through them and select your own items. For now I'll just expand towers and select sniper_with_notches.​
    The tower is placed in front of you, but lacking any kind of lighting data. With the object still selected, go to Lighting > Quick Relight Selection. Depending on your computer this may take a few seconds. Once done, the object will display the correct textures and lighting.​
    [​IMG]
    After this the object will act just as the previous objects did. You can move/scale/rotate it however and wherever you want. Every new object you place in a map (other than those from Static Shapes) must go through this same Lighting process. You may notice that the object doesn't appear to create any shadows of its own on the terrain. This can be corrected by going back to Lighting > Quick Terrain Relight. I'll cover this a bit more in the Modifying Terrain post.​
    Now, what good is a sniper tower without an ammo station? To place an ammo station on the tower we have two options: simply copy/paste an existing ammo box from the map, or import a new one. While copy/paste is the easiest, I'll cover importing a new ammo station as well since it requires a few steps you might not know. Go back to the window with the 4 expandable sections and open Static Shapes > legions > data > shapes > props > ammodepot, and select ammodepot. Place the ammo station where you want it, then go back to the 4 expandable sections. Expand Mission Objects > Mission, and select Trigger. A window will pop up asking for an Object Name, along with a Data Block dropdown. As far as I'm aware the name doesn't matter, so just call it ammobox. From the Data Block dropdown box, select AmmoStationRefillTrigger and press Ok. An empty box will appear on your screen. Place it over the ammo station you placed earlier, making sure it extends just a little bit further around the ammo station. You don't want it inside the ammo station. With the trigger still selected, go to Window > World Editor Inspector, and make sure the active box is checked. Press enter to save the changes.​
    [​IMG]
    You now have a working ammo station. Press Shift or F11 to go back into the game and test it.​
  3. Fixious

    Fixious Test Lead

    Modifying the Terrain - Terrain Editor

    We've covered objects (mostly), so now lets cover terrain. I'll use our Frostbyte map again as well, for consistency. Go to Window > Terrain Editor. All the red dots will disappear, and a circular brush will appear wherever you move your mouse. To change how the brush behaves go to Actions > and select whatever you want. I'll select Adjust Height, which has a keyboard shortcut of Ctrl 1. Click and hold anywhere on the terrain and move the mouse up or down to create a basic hill. If the brush is too small/too big, simply go to Brush > Brush Size, and select the appropriate size. I've never really noticed any difference in Brush Pressure so you can ignore that for the time being. The Hard Brush option will create hills with very sharp slopes. For Legions it's best to use Soft Brush, but it's up to you.

    [​IMG]

    You notice again that shadows aren't updated in real-time. Any time you make a hill or set of hills, or even just modify the terrain a bit, it's best to do a quick relight, so again go to Window > Quick Terrain Relight. This will make the hill easier to see and work with in the editor. Go ahead and press Shift or F11 to go back into the game and test the hills. They're likely quite sharp and not very fun to skii on. Relighting also helps to show these details.

    [​IMG]

    If they're sharp like that, simply go back to the editor and select Action > Smooth. When smoothing a hill I've found it better to use a smaller brush than the one I did to create it. It allows you to be more precise, and not worry about over smoothing it. Once you've found the best brush size, click and drag over the sharp parts of the hill to smooth it out. If you think it looks smooth enough, do another Quick Terrain Relight to make sure. Once that's done, enter the game and test it out for yourself.

    With the Adjust Height option you can also create depressions/bowls by dragging the mouse down, which are usually found around bases to allow cappers/LO to exit quickly (Frostbyte front bowls, Reactor front and side bowls, etc). Just like hills, you want these to be smooth as well.

    If you want to raise a portion of terrain just slightly, the Add Dirt option from the Actions menu might be your best bet. Simply click and hold over the area and it'll slightly rise as the brush adds dirt to the area. If you want to do the reverse, select the Excavate option.

    If you're adding a tunnel or base that is lower than the terrain and need to remove a section of it, select the Set Empty option. You'll likely want to use a smaller brush for this, usually no bigger than 5x5. If you need to bring back a portion of empty terrain, select to Clear Empty option and paint over the empty spots.

    The Select option allows you to paint over a terrain selection. Once selected, go to Adjust Selection and adjust it to your liking.
  4. Fixious

    Fixious Test Lead

    Modifying the Terrain - Terrain Texture Painter
    We've modified the shape of our terrain, now lets modify the look of it. Go to Window > Terrain Texture Painter. Since we're working with an existing map, it already has textures applied to it in certain areas. Frostbyte is made up of 4 snow textures: snowbase256, snowrough02, snowrough01_256, and snow_floor. Select the first texture (in this case snowbase256), and press Change. A Windows Explorer box will appear. Depending on where the box opens to by default, navigate to live/legions/data/terrains. This is where all the terrains or stored for the maps in Legions.​
    [​IMG]
    If you open Desert and select the first sand texture, it will replace the image in the top left corner of the Terrain Painter box. Clicking anywhere on the map will then replace the previous snow texture with the new desert texture. You can do the same for the rest of the texture images, essentially turning Frostbyte into a desert map if you so choose.​
    [​IMG]
    If you want to paint a certain area of the map with a specific texture, simply select it from the box and paint over the area you want. Any texture you want to use must be one of the four images in the Terrain Painter box seen above. As stated earlier you can change the brush size to whatever size you want from the Brush menu. The Hard Brush option is also available to use here. It's also worth noting that each texture you place in the Terrain Painter box must be unique. That is, you cannot add a texture that's already in the Terrain Painter box. It must be 4 different images.​
    Bestking, JCARTEL and Jordahan like this.
  5. Fixious

    Fixious Test Lead

    Modifying the Terrain - Terrain Terraform Editor
    The Terrain Terraform Editor under the Window menu controls a variety of terrain options. I won't cover them all because I simply don't know what they all do. I'll cover the ones I feel you'll likely use the most. After you've selected the Terrain Terraform Editor option, feel free to close any other opened windows. You won't need them anymore.​
    [​IMG]
    The terraform editor box will default to the first operation within the box below it, in this case the General operator. The Min Terrain Height box sets the minimum height of the terrain, while the Height Range box controls the different between the minimum and maximum terrain height. Setting the Height Range to a higher value will make the map hillier, while a lower value will make it more flat. Setting both to 0 will, of course, make the map completely flat.​
    The second option in the terraform editor window is fBm Fractal, which controls the number of hills on the map, along with how rough they are. If you want to create a map with random hills placed throughout it, set the fBm Fractal settings to your liking and press Apply at the bottom. If nothing happens, select the General operator, then click back on fBm Fractal and press Apply again. In this case I chose a Hill Frequency of 8 and left everything else in fbM Fractal the same, and set the Min Terrain Height to 50 and Height Range to 250. After doing a Quick Terrain Relight to update the shadows this is the result:​
    [​IMG]
    You'll notice that while the terrain was adjusted, the objects on the map were not. You'll have to move them manually if they get covered by the terrain. Also note that it kept the textures in the same locations, which can result in some wonky visuals. Textures you may have intentionally placed on slopes now appear in flat areas, for instance. I believe there's a setting that allows you to control texture placement by height, but I've never messed with it. Perhaps someone with more experience can chime in on this.​
    To add more operators, simply click the dropdown box and select them. I'll add the Rigid MultiFractal operator with default settings and click Apply:​
    [​IMG]
    As you can see it added a lot more hills, giving it a Stygian look. If you decide to add another operator, such as the Canyon Fractal and nothing happens, delete it and add it again. This same principle applies to any other operator you add that doesn't seem to work. After messing around with various Fractals I ended up with this weird concoction:​
    [​IMG]
    While cool looking, it's perhaps not the best map to ski on. To fix this we can add the Smoothing operator. Within the Smoothing operator box you can select how many passes the editor should make when smoothing the map, along with how aggressive it is. I set it to 10 passes with a default aggressiveness of 0.500, which resulted in this:​
    [​IMG]
    That's the basic function of the Terrain Terraform Editor. There are more operators, but I haven't really messed with them. Some simply don't work or function correctly. Making a map with random hills such as this can be a decent place to start when creating your own map. It can give you a starting place, which you can then modify to your liking. Or you can simply modify an existing Legions map. Up to you!​
    Bestking, Defender, jago and 3 others like this.
  6. Fixious

    Fixious Test Lead

    Flags, Player Spawns, and Lights
    To make things easier, when creating a new map it's best to simply leave the existing player spawns and flags on the map. You can delete them if you want, but adding new ones back into the game can be a pain. It means dealing with team index's and what-not, and only complicates things. Player spawns act just as other objects do; select one to move it around. Spawns are represented by a green sphere when selected. Wherever the green arrow points is the direction the player will spawn facing.​
    [​IMG]
    Flags are made up of 4 separate objects: The flag object itself, the flag scoring trigger, the flag clamp, and the base flag stand model (called FlagGoal). If you're making a map and need to move the flag, make sure you've selected all 4 objects at once before moving it. Otherwise it turns into an annoying process of putting the pieces back together properly.​
    [​IMG]
    As the image shows, I've selected all four objects. While the map editor doesn't tell you how many objects you've selected, you can see 4 different boxes within the selection, ensuring you've got them all.​
    Each flag is also usually accompanied by a light object that adds a glow around or above it. You can select that too if you want, or add your own by going back to Window > World Editor Creator, and expanding Mission Objects > Environment, and selecting sgLightObject. An object box similar to the ammo station trigger will appear. Give it a name, and select what kind of light you want to appear around the flag or wherever you're placing the light object. In my example I'll simply type orange in the Object Name field and select orangelight from the dropdown. Pressing OK places a light bulb icon in front of you. Move it wherever you want the light to appear.​
    Note that when entering the game to check the light object it doesn't appear to be there. This is another task the requires relighting, however Quick Terrain Relight nor Quick Relight Selection will work in this case. You must select Filtered Relight from the Lighting menu. This will take a noticably longer time to complete. When clicking Filtered Relight, all interior objects will turn black for a few seconds, along with the game lagging a bit. Give it a while, and you'll see the light object now displays properly.​
    [​IMG]

    UPDATE: I forgot to mention something somewhat important when talking about flags. Most, if not every time you make a new map you'll end up with doubl flags. If your flag is home and looks extra bright, it's because there are actually two of them. The way I get rid of this is to join the opposite team and grab the 'double flag'. The one that remains can be deleted. As you can see below, the 'real' one has the IFF's above and below it:

    [​IMG]

    In this case simply delete the one on the flag stand and save the mission. Make sure you delete the actual flag itself, not the trigger. If you're not sure, select what you think is the flag and look at its dataBlock. It will simply say Flag.

    [​IMG]
    Jordahan, stefygraff and Triad like this.
  7. Fixious

    Fixious Test Lead

    Sky, Fog, and Precipitation
    I sadly no longer have my epic sand Frostbyte map from before because I closed the editor for the night, but I'll continue to use Frostbyte for our example. To change the skybox, go to Window > Mission Editor Inspector, and from the top box expand SimGroup - MissionGroup > SimGroup - Environment, and select Sky.

    [​IMG]

    From the bottom half of the window, scroll down to the Media section. The materialList option controls what skybox gets displayed on the map. Click the white box to the right with the 3 black dots to open Windows Explorer again. In this instance I'll select the Elegiac skybox, which can be done by navigating to legions/data/skies/Elegiac, and selecting sky_day.dml.

    [​IMG]

    Pressing open will immediately apply the skybox to the map; no relighting required. You can choose any skybox you want from the skies directory, but it must be a .dml file. Selecting one of the png's or jpg's will crash the client. Press Shift or F11 to go back into the game and see how it looks.

    UPDATE: If you apply the skybox but it doesn't appear, make sure useSkyTextures is checked. Some maps such as Zenith have it unchecked by default.

    [​IMG]

    While the skybox itself looks nice, I'm not a fan of how it looks with the blue fog. To change the fog color, scroll down 3 sections from Media to Fog. This section controls the fog settings. I'll change the fogColor numbers to 0.66 0.66 0.8 0.75, which is the fog color on Fallout. This will give you more of a white/light purple fog color. Feel free to mess with the numbers to create the fog color you're looking for.

    [​IMG]

    [​IMG]

    If you look at the first image above this post, you'll see a fogDistance option above fogColor, along with a visibleDistance option above that. These two settings control how thick the fog is, and how close it renders around the player. If you want thick fog with low visibility, set the visibleDistance to a lower number such as 500, and fogDistance to 70. Again, feel free to mess around with these values to get more comfortable with how they interact with each other. Since fog settings won't really affect the Editor (if you set the visible distance to 8000), jump in the game and see it look.

    [​IMG]

    To remove snow flakes from the map, go back to either World Editor Inspector or World Editor Creator and delete the Precipitation entries as seen below (click them, then press Delete on your keyboard).

    [​IMG]

    To add snow, fluff, or rain to a map open the Mission Objects box in the World Editor Creator window, expand the Environments section and select Precipitation. Again, a box similar to the ammo box trigger and light object appears. Give it an Object Name and/or Name , then select whatever you want from the dropdown. I'll select rain and press OK. You'll notice that after pressing OK, wherever the rain drops hit an object a white box appears.

    [​IMG]

    This can be fixed by opening World Editor Inspector with the rain object still selected, and scrolling down to the Collision section. Uncheck doCollision. This will remove the white boxes.

    [​IMG]

    An alternate method would be to make the splashSize 0.0. This removes the white boxes, and allows for collision.

    [​IMG]

    This same window can also control how many snow flake/rain drops appear, along with how fast they come down. Scroll all the way up to control the numDrops value. The boxWidth and boxHeight values control how close together the drops are, so a lower value in each box will create a tighter spread. Scroll down to the Movement section to control the minSpeed and maxSpeed values. You can add more than one Precipitation object as well (Frostbyte uses 3 different snow Precipitation objects).​
    Last edited: Jan 14, 2014
    Frez and Jordahan like this.
  8. Fixious

    Fixious Test Lead

    Saving, Renaming, and Hosting Your Map
    Once you're happy with how your map looks, go up to File > Save Mission As. In the box that appears, you must manually add ".mis" to the end of the map name. So you would simply type "New_Map.mis", and press Save.​
    [​IMG]
    Once you've saved the map, go to legions/data/missions and open the .mis file you just saved. At the top, change whatever map name is in MissionName = "Map" to the name of your map.​
    [​IMG]
    Once that's done, navigate to live/server/preferences, and open the config file. Scroll down to the first //CTF section and add the follow red line:​

    // CTF
    $Host::Mission["CTF", "BladeRun"] = 0;
    $Host::Mission["CTF", "ZenithCauldron"] = 1;
    $Host::Mission["CTF", "Elegiac"] = 2;
    $Host::Mission["CTF", "Fallout"] = 3;
    $Host::Mission["CTF", "Forgotten"] = 4;
    $Host::Mission["CTF", "Gorge"] = 5;
    $Host::Mission["CTF", "Moonshine"] = 6;
    $Host::Mission["CTF", "Mirage"] = 7;
    $Host::Mission["CTF", "Sleepwalker"] = 8;
    $Host::Mission["CTF", "Nivosus"] = 9;
    $Host::Mission["CTF", "Frostbyte"] = 10;
    $Host::Mission["CTF", "Stygian"] = 11;
    $Host::Mission["CTF", "TheCore"] = 12;
    $Host::Mission["CTF", "Genesis"] = 13;
    $Host::Mission["CTF", "Reactor"] = 14;
    $Host::Mission["CTF", "OTtN"] = 15;
    $Host::Mission["CTF", "Grassy"] = 16;
    $Host::Mission["CTF", "New_Map"] = 30;


    Note that if a map with a value of 30 already exists, simply change it to 31. If 31 exists, use 32 and so on. Now scroll down to the second //CTF section and add the follow lines of code to the very bottom, right above //FCNC:

    $Host::Maps::MissionFile[30] = $MissionPath @ "New_Map.mis";
    $Host::Maps::Weight[30] = 0.8;
    $Host::Maps::MinPlayers[30] = 0;
    $Host::Maps::MaxPlayers[30] = 24;


    This entire section of code must be added. Note how each line has [30] in it, as it references the previous line of code. If you used a different number, use that instead of 30. This is important. Save the file.

    If you did this correctly, fire up Legions and host your map! If the map lighting looks weird when you first host the map, simply open the map editor, go to Lighting and select Full Relight. This should fix the map permanently.

    Bestking, Frez, Belberith and 2 others like this.
  9. Fixious

    Fixious Test Lead

    Incase you're blind, this tutorial only covered CTF maps. I haven't gone into making a CNC map because frankly I'm not familiar with it. I know how to do some stuff, so I might look into it some more later on. I think there's potential to do some really cool stuff with it though.
    OBLIVION likes this.
  10. Fixious

    Fixious Test Lead

  11. Fixious

    Fixious Test Lead

    Good news! I've figured out to use the Save Mission As command, so you no longer have to overwrite existing maps. I've updated the Saving, Renaming, and Hosting Your Map post with new instructions.
  12. Poponfu

    Poponfu Lead Developer

    Two tips I think are handy:

    When you are making complicated bases , put groups of things that you are going to want to select later but would be a tedious selection in their own simgroups as you work. This way you can just twirl down a simgroup and shift select the objects in it and work faster. ( you can find simgroups in mission objects and click and drag the objects into it .. or open up the .mis file and just copy and paste them into a named simgroup )

    Holding shift and draging object(s) selected will make a duplicate in place. This makes mirroring things very fast. I am always deleting half a base as one side gets further along and doing this then rotating 180.
  13. Fixious

    Fixious Test Lead

    Shift still puts you back in the game, though. If you bind downjet to something else, Shift will then work as you suggested.

    But that's a pain to do if you use the editor quite a bit, since you're constantly having to rebind it back to Shift when playing a real game.
  14. Poponfu

    Poponfu Lead Developer

    Oh mine is rebound. Its a very handy thing for mirroring bases so id use it at some point.
  15. Fixious

    Fixious Test Lead

    I have updated the Sky, Fog, and Precipitation section to include another method for removing white boxes when applying precipitation. This method allows for collision, meaning you can be protected under structures from rain or snow. For whatever reason they didn't do this with the snow on Frostbyte so it just goes straight through objects. The picture below shows it better with rain.

    [​IMG]
    Hi!, Defender and Dabbleh like this.
Thread Status:
Not open for further replies.