Creating and Joining Two Basic Rooms


Tutorial Info


Tutorial
In this tutorial, we'll teach you how to create two rooms, and join them with an exit. Whenever working on maps, it's always a good idea to work in isolated, or work directories so you can keep everything organized. I like to setup folders off my RasMaker directory in my MAX-FX Tools directory, but wherever you feel comfortable is fine. There is a little setup involved as usual, lets go through this checklist before we begin:
  1. Make sure you have decompressed the Basic Room Example Mod.mpm file, found in the C:\Program Files\MAX-FX Tools\ExampleMod\ directory. For more information on using RasMaker, click here.
  2. Make sure you have a new level open by going to File > New.
  3. We also need to load some textures into the game for use. We'll use the textures in the example .lvl for now, as to not confuse things. To import these textures into MaxEd, go to Material > Insert Material from file… When the file open dialog pops up, find the example level here: C:\Program Files\MAX-FX Tools\MaxEd\Examples\. There is only one .lvl file there so open that. It will take a second to load it into MaxEd, but when it is finished you'll see that you now have some textures available for use in the bottom left window. Just leave those be for now, we'll come back to them later.
Click for larger image
figure 1

Click for larger image
figure 2

Click for larger image
figure 3

Click for larger image
figure 4

Click for larger image
figure 5

Click for larger image
figure 6

Click for larger image
figure 7

Click for larger image
figure 8

Now, onto creating the rooms. First, switch over to Build mode (F3). Now, on the grid, make a square, and when you get back to the first point press the Right Mouse Button (RMB). This will do a default extrude on your square one grid unit high. (see figure 1) The room isn't nearly as high as we want it to be, so let's extrude it's height a bit. Switch to Polygon Edit mode (F4). Click on the ceiling of the room and drag upwards. How tall you make the room is entirely up to you, but for simplicity's sake lets keep it around 2 grid units. We have one room's geometry somewhat completed now, we need one more room of equal size. Go through the steps we just went through to make a second room of equal size. Also, make sure the second room is lined up with the first room and are about 2 grid units apart (see figure 2).

We should also do a little texturing job on the two rooms so we can visualize what the connected rooms will look like. Since we're not out to win any texturing awards with this one, we'll just use the ones included with the example .lvl. Look to the bottom left of the MaxEd window. You'll see a dark gray area. This is the texture browser and the drop down menu above it are the texture categories. This is a just a quick one-over of basic texturing, we'll get into more in-depth texturing in another tutorial. First off, switch into Texture Edit mode (F6). When texturing in MaxEd, it helps to move the camera 'inside' the room you're texturing so you're certain you're texturing the right face. Change the texture category to the left to 'Wood'. Scroll down the available textures in that category until you find one called WALL38_512X256.JPG. Click on that texture. Now, click on one of the walls of the room. Now, you probably don't see the texture and are wondering if you did something wrong. Well, you probably didn't, we just need to switch out of Wireframe mode (F2). Hit F2 and you should be able to see the texture on the walls. Now, using the same method, switch back to Texture Edit mode (F6) and texture the other three walls in the room (at this point you should only have to click on the walls unless you selected a different texture from the list by accident. You should now have 4 textured walls in one of the rooms. Let's texture the ceiling and floor now. Select the WOOD_SQUAREPANEL02_256X256.JPG texture from the Wood category. We'll use this one for the ceiling. Click on the ceiling and the ceiling should now show the wood panel texture. For the floor, switch to the Carpet texture category, there's only one texture there, select it and click on the floor of the room. Viola! The room is completely textured (see figure 3). Go through the same process to texture the other room. At this point, the rooms should be almost (if not) identical.

Now, we need to create a "hallway" between the rooms. Switch back to Build mode (F3) and create a smaller room in-between the two larger rooms, make it's base about 4 square grid units, and make it as tall as the other two rooms (see figure 4). If not already done, go ahead and texture this hallway like the other two rooms. Notice now, that in the world hierarchy in the top left corner of the screen, that you have three meshes, one for each room we've created so far.

You're probably saying to yourself, "Why do we have three rooms, I thought we were only joining two? And where are my pants?". Well, we're getting there, slowly but surely. The task at hand now is to unite the three meshes into one. To do this, we need to switch to Object Edit/Move mode (F5). Select the middle 'hallway' room by clicking on it, some green lines should pop up around the corners of the mesh. Now, press U on the keyboard, and then select the room to the left by clicking on it, a dialog will come up with some options, just leave it be and press OK. Now, you have united these two meshes into one. Notice also that there are now only two meshes present in the world hierarchy. Now, repeat the same process to unite the room/hallway mesh into the remaining room. After doing so you'll notice that there is now only one mesh present in the world hierarchy.

Now to the tricky part: we need to create an exit in the hallway between the two rooms. First, switch to Grid mode (F12). We need to reposition the grid so that it is vertically parallel to the hallway. If you're not already, move the camera inside one of the rooms, it doesn't matter which one. Face the wall in that room that is opposite from the hallway. Switch to Polygon edit mode (F4) and hold your cursor over that wall, don't click it. Now, press A on the keyboard and you will notice that the grid is now aligned to that face of the mesh (see figure 5). Using PageUp/PageDown on the keyboard, move the grid so that it is in the middle of the hallway (see figure 6).

Exits are basically little zones that help the engine render the levels in a more efficient manner, keeping your framerate up. Switch to Exit mode (F7). This next step is critical, you need to go in the right order and select the right vertices. You'll notice you have 4 accessible vertices from where the grid is currently positioned. Starting with the top left vertice (making sure that the upper edge of the left face is highlighted), and click. Now, move your cursor to the top right vertice (making sure that the right edge of the top face is highlighted), and click. Move your cursor to the bottom right vertice (making sure that the lower edge of the right face is highlighted), and click. Now move your cursor to the bottom left vertice (making sure that the left edge of the lower face is highlighted), and click. Right-click, and a dialog should now pop up that says "Mesh is separated into two by exits". If you don't get this dialog, try again, practice makes perfect. You'll know you have an exit when you get that dialog and you see a transparent, teal plane there in the hallway (see figure 7). To experience exactly what exits do for your framerate, position the camera inside one of the rooms, looking through the hallway into the other room. Make sure you are not in Wireframe mode (F2) and you can see the textures. You'll see your framerate at the top left of the editing window. Now, hit Caps Lock on the keyboard and watch your framerate jump. This is simulating the effect exits have in-engine. Hit Caps Lock again to toggle that off.

Last step to creating your basic room: placing a few simple entitles and grouping. If you haven't already done so, lets reset the grid to it's default location by switching to Grid mode (F12) and pressing R on the keyboard. This also resets the camera to the default position as well. Move the camera so that you are inside one of the rooms. First up, the Jumppoint, or player start point. Switch to Build mode (F3) and pick a spot on the floor with your cursor, don't click the spot but just press N on the keyboard. A dialog box will come up with a list of entities. Select Jumppoint from the menu and hit OK. You should now see a large red sphere in your floor. This is where you're start in the two rooms.

Now, to add a light in each room. Switch to Grid mode and move the grid up to the ceiling. Just like placing the Jumppoint, switch to Build mode (F3) and select a nice spot on the ceiling for a light. Press N on the keyboard again, but this time select Pointlight from the menu. Hit OK and there's your light. Repeat the same process for the light in the other room (see figure 8 for what the rooms should look like now).

Grouping everything is simple, switch to Object Edit/Move mode (F5) and hit CTRL+E. This auto-groups all rooms and entities. You'll now notice in the world hierarchy that you have two meshes and when you expand those meshes, it lists the entities present in those rooms.

That's if for creating your first basic rooms and joining them! However, you still can't play the level, check out the tutorial on compiling your map into a .mpm file on how to do that.

» Download basic_room.zip.