Mapping Tutorial
Mapping - Part II: My First Map
Okay! Now let us start with our first map!
- Start CS2D
- Click the 'Editor'-button
That will start the map editor with a blank map. You could now start filling it but it is recommended to create a new map with your own settings instead.
- Click the 'New Map'-button
This opens the following menu! Don't be confused. I already changed the values on the following screen.
Map Size
Selecting the right size is important for the minimap. Your minimap will look pretty stupid when you have large unused areas in your map! Moreover it's a waste of space and memory to make a map bigger than necessary! Our first map will be pretty small. We use a 10x10 tiles map with scrolling water as background and the 'aztec.bmp' tileset.
- Enter 10x10 as size
- Click the 'Tileset'-field and select 'aztec.bmp'
- Click the 'Background Image'-field and select 'water1.jpg'
- Enter 1x1 for scrolling speed
- Check the 'Scroll background like tiles'-checkbox
Note that the size is defined in tiles. One screen (850x480) can display a map area of 26.5x15 tiles (850/32 x 480/32)! 'Tileset' and 'Background Image' are both simple image files. A tileset has to be selected but the background image is not necessary. You can also select a background color. This color is only visible if you do not use a background image. The default background color is black.
Scrolling Options
Moreover there are some scrolling options. They allow you to scroll your background image. Of course it doesn't make sense to enter something here when you do not even use a background image! The two numbers define how fast and in which direction your background will be scrolled:
- 1. Value: X axis for horizontal scrolling. Positive values: scroll to the right, negative values: scroll to the left
- 2. Value: Y axis for vertical scrolling. Positive values: scroll to downwards, negative values: scroll upwards
The checkbox 'Scroll background like tiles' connects the backgrounds with the tiles. This means your background will be scrolled as well when you scroll the map. Hint: It's hard to see the difference with a scrolling background in the editor so you should test this option in-game at the next opportunity!
Enough about these settings! Let's click 'Create' to generate a new map!
- Click the 'Create'-button
You should now see something like this:
Note that there is a new background (which scrolls!) and that the tileset has changed! You also have a very tiny minimap now. The area without grid is 'outside' your map. You can't set tiles in this area but you are allowed to create entities there.
Scroll to the Center
Let's scroll to the center!
- Use the arrow keys or W/A/S/D to scroll to the center of your map
- OR Try to click at the center of your map
You should now see the whole map surrounded by water without grid! If not: Try again and make sure that your map has a size of 10x10 tiles!
Drawing Tiles With The Pen Tool
Now we will set our first tiles!
- Click the 'Edit Tiles'-button
- Click at 'Tile #1, Wall' in the tiles list
- Click the 'Draw Tile by Tile'-button (Pen Tool)
Hint: Point at a tile in the list for a short while to see its number + its properties!
Now draw a row of tiles as you can see it on the screen! Keep one tile free at each border. You should do that on each map. It avoids problems with map shadows and makes your minimap look better!
- Click + Drag in the map area to draw the tile
Take a look at the image on the right. That's how it should look like!
Did it work? If you 'painted' a wrong tile: Rightclick a tile without wall to select this tile and afterwards correct wrong tiles by left-clicking them! Alternatively you can use the undo function (Ctrl+Z)!
Drawing Tiles With The Rectangle Tool
It's not that easy to draw rectangles with the pen tools. Therefore we have the rectangle tool. It works this way:
- 1. click: define the first point/corner of the rectangle
- 2. click: define the second point/corner of the rectangle
The rectangle will be created in the area between those two points. You can cancel the process with a right click. After setting the first point you will see the size of the rectangle at the top of the screen. Moreover the area which will be changed is highlighted.
We will now test the rectangle tool! Use it to create the missing three walls!
- Click the 'Draw Rect of Tiles'-button (Rectangle Tool)
- Draw the three missing walls with 3 rectangles
Does your map look like the one on the screen? Good job!
Note that you see your big rectangle on the minimap as well!
Drawing Tiles With The Fill Tool
Two tools used. One tool left! Select the fill tool and a floor tile and afterwards fill the area in our rectangle!
- Click the 'Fill Area with Tiles'-button (Fill Tool)
- Click at 'Tile #16, Floor - Step' in the tiles list
- Click into the center of your map to fill it!
This is what your result should look like:
Setting Spawnpoints
This is the principle of setting tiles. It's really easy as you see!
However we are not ready yet! CS2D can't work with this map because it does not know where to spawn players! That's the point where we have to take a look at entities! Entities are used to specify certain places and areas or to put cool stuff and effects in a map.
- Click the 'Edit Entities'-button (light bulb)
You will now see a long list of entities. For our map we just need two of them: Info_T and Info_CT! They are used to tell CS2D where it can spawn players. You can set as many of these both entities as you like - but be careful: You should place them on floor tiles inside your map only!
- Click at 'Info_T'
- Click into the top left corner of your map with a floor tile
That's our spawn for the bad guys! We also need some police forces to fight those terrorists:
- Click at 'Info_CT'
- Click into the bottom right corner of your map with a floor tile
Now we created both spawns. Congratulations! Our first map is ready and functional! Note: If you point at one of the spawns you will see a yellow highlighted area. This area is buy zone where you can buy stuff!
Save Your Work!
All you need to do now is to save your map!
- Click the 'Save Map'-button (ATTENTION: SAVE! NOT LOAD!)
- Enter a name like 'dm_myfirstmap'
- Click the 'Save'-button
Done! Your map has now been saved and can be tested! Have much fun playing it! The fastest way to test it is the hotkey F12. The same key also allows you to return to the editor after testing. Hint: Use the prefix 'dm_' for 'Deathmatch' if your map does not contain a special goal (bombspot/hostages/VIP/flags etc.)!
Continue with part III where you will get some useful hints for making good maps!