PZMods
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Mapping Tutorial! - Via Badgerflaps

Go down

Mapping Tutorial! - Via Badgerflaps Empty Mapping Tutorial! - Via Badgerflaps

Post  Zander Mon Jul 18, 2011 10:30 am

Badgerflaps wrote:First, a quick disclaimer. I'm not involved with the development of this game or any of the tools, so some of the following information my not be 100% accurate. If you see something you think is wrong, feel free to reply and I'll make a correction. I've probably forgotten to mention a few things as well. I'll update these posts as necessary.

This covers the basic functionality of Tiled and how it relates to Project Zomboid, as well as extracting the demo map and putting it back into the game so you can run around in your new world. I use WinRAR for this, but other similar tools will likely work as well. Extracting the map is optional, and you may prefer to use the clean map Binky linked to in the mod tools thread, in which case you can skip the extraction step.


Getting started

Open zombie.jar with WinRAR and go to the media directory. Extract test.tmx either by right clicking it and choosing extract, or by dragging it to a folder in Windows. Place test.tmx in the modtools folder which you should have after downloading the modding tools from Binky's post. There should be several image files and a few folders in there as well.

Run Tiled and click on the edit menu, choose preferences, and change the 'Store tile layer data as:' setting to 'CSV'. This will cause Tiled to save the map files in a format compatible with Project Zomboid. Now close the preferences and open test.tmx.


The interface

The main section of Tiled is the viewport. This is where you see your map. You can pan around by using the scrollbars, arrow keys on your keyboard, or by holding the middle mouse button and dragging. You can zoom in and out with the + and - keys on the numpad, or by holding CTRL and scrolling the mousewheel.


Layers

To the right of the viewport you should see a list of layers. These are used to group together different types of tiles in the map (walls, trees, etc.) as well as separate the different height levels (floor, ceiling, roof, etc.) Clicking a layer will select it, causing it to become highlighted. Any changes you make to the map are only applied to the selected layer.

There are two different types of layer. Tile layers are represented by the blue icon, and are the visual representation of the world (floor, walls, trees, etc.) They can only contain one tile per grid space. If you want two tiles in the same position (a floor tile and a chair, for example) they must be placed on separate layers.

Object layers (not to be confused with the blue tile layers named x_Objects) are represented by the purple icon and define locations in the world which are then used by the game to place items, trigger events, or dictate how likely zombies are to appear in a specific location. These areas are represented by a grey region in the editor, but they're invisible in the game.

Directly to the left of each layer is a checkbox for toggling visibility, and at the very top of the list is an opacity slider. This will make the currently selected layer translucent, allowing you to see things behind it without hiding it from view completely. Neither of these settings have an effect on the visibility of things in the game, they're simply to make editing easier. The buttons below the list allow you to make a new layer, change the order, as well as duplicating or deleting layers.

Each layer has a name corresponding to its height in the world and the type of tiles within it. 0_Floor is for the ground, 0_Walls is for walls on the ground floor, 1_Walls is for the walls of the first floor, etc.

Each layer is drawn in order, from bottom to top and back to front. You'll notice that many objects appear in front of walls that should be obscuring them, due to the object layers being higher in the list. There's no way around this at the moment, but as long as you make your walls and objects on the correct layers the game will sort them properly. There's a great writeup here for those that are interested.

Zander
Admin

Posts : 13
Join date : 2011-06-29

https://pzmods.board-directory.net

Back to top Go down

Mapping Tutorial! - Via Badgerflaps Empty Re: Mapping Tutorial! - Via Badgerflaps

Post  Zander Mon Jul 18, 2011 10:30 am

Badgerflaps wrote:Tilesets

Below the layers are the tilesets. These are all the tiles from which you'll be constructing your map. The Tileset window is assigned a tiny amount of space within the interface by default, and I prefer to move it over to the other side of the screen and resize it so I can see all the tiles on a single sheet at once. To do this you simply click and drag where it says tilesets, move it to your desired location, and then resize it as you would with any other window. The same can be done for the list of layers if you wish.

Tiles are organized into different sheets which you can switch between by clicking the names at the top of the tilesets window. You'll notice that any objects which are larger than a single tile (beds, for example) are split into multiple tile-sized pieces. It should be fairly straightforward to identify which piece goes where and to get them aligned. Clicking on a tile selects it, ready to be placed in the world.


Tools

There are two different tool categories, corresponding to the different types of layer discussed earlier. The tools are selected on the toolbar at the top of the window, and the category of tools available to you changes depending on which type of layer you currently have selected.

With a tile layer selected (blue icon) you can use the stamp brush, the bucket fill tool, the eraser, and the rectangular select tool. These function similarly to their equivalents in most image editing tools. You can use the B, F, E and R keys to quickly switch between these tools. These are the tools you'll spend the bulk of the time using.

The stamp brush is the standard painting tool. Clicking will cause a single tile to be placed at the highlighted position. Clicking and holding will allow you to draw tiles wherever the mouse cursor goes. Holding shift and clicking once, then moving the mouse and clicking again will draw a line between the two points, and doing the same but with CTRL and shift held down will allow you to draw an ellipse. Right clicking will change the selected tile to whatever is currently under the mouse in the viewport. This is often a lot quicker than finding the tile you want in the tileset window.

The bucket fill tool causes the highlighted tile and any adjacent tiles of the same type to be filled in. It's far quicker than the stamp brush if you want to create a large area using the same tile type, and is very useful for creating rooms when used in conjunction with the rectangular select tool.

The eraser removes tiles from the currently selected layer. You probably shouldn't use this on the 0_Floor layer or you'll be left with holes in your map.

The rectangular select tool allows you to specify an area in which you want to place tiles, making it impossible to alter anything outside of it. Click and drag to select an area, and you can now use the bucket fill tool to fill all adjacent tiles of the same type until you reach the edge of the selection. You can clear the selection by clicking once anywhere or pressing CTRL, shift and A.

Depending on what you intend to add to the world, you should make sure you have the appropriate layer selected. If you're adding a new road, you should select 0_Floor. If you're adding a second floor to a house, the walls should go on 1_Walls and the new roof should go on 2_Floor. Spend some time looking at what's already on each layer to find the one most appropriate for what you want to add.

With an object layer selected (purple icon) you can use the select objects tool and the insert objects tool. There's also an insert tile objects tool, but it's not supported by the game, as far as I know. You can use the S and O keys to quickly switch between these tools.

The select objects tool is fairly self explanatory. You click an object and a black box is drawn around it. You can then click and drag to move it around, and click on the bottom corner to resize it. If you right click an object and choose properties, you can see its name and type along with the size and location, as well as any custom properties.

The insert objects tool allows you to create new objects by dragging an area from top to bottom, which can then be manipulated with the select objects tool as described above.

Zander
Admin

Posts : 13
Join date : 2011-06-29

https://pzmods.board-directory.net

Back to top Go down

Mapping Tutorial! - Via Badgerflaps Empty Re: Mapping Tutorial! - Via Badgerflaps

Post  Zander Mon Jul 18, 2011 10:31 am

Badgerflaps wrote:Object properties

The object name and type in the properties specify what it actually represents. The only names in use in the demo map are 'zone' and 'roomDef'. Zone specifies that the object is an area and the settings should be applied to all tiles within it, and the roomDef name specifies that the room this object is located within is of a specific type. This may seem to be getting a little confusing. If so, don't worry. This object stuff appears to be entirely optional, though it will prevent socks from appearing in crates in the wilderness. From what Lemmy has revealed about the scripting system it will be much more straightforward in the future. For now I'll just describe what's present in the demo map.

The 0_Zoning layer contains four large areas (with three of them joined together to make a non-rectangular area), one for the tutorial area (the starting house, yard, shed and the house directly to the east), and three for the park. The names of these areas are both set to 'zone', and the types are set to 'tutArea' and 'The Park' respectively. The interesting setting here is zombieBias. It's set to 0.0 for the tutorial area, and 1.3 for the park, meaning zombies will never spawn in the tutorial area (though they may wander in, and will still follow you there), and they're 30% more likely to spawn in the park than everywhere else.

If you want to add the zombieBias setting to a new area you've created, you simply open the properties, double-click on <new property> and type in zombieBias, then double-click the empty value and enter whatever your heart desires. The setting name suggests it only affects the position of spawning zombies, not the amount, but I've yet to experiment too much, so I can't say for certain that using too big a number won't break things.

The 0_ItemZoning layer contains more areas named zone, with their type set to foodItems. These specify areas where food may be randomly placed at the start of a game. This is the only category of item which can be placed in this way, but there are likely to be more in the future. They may already be in the game, I haven't tried random things to see what happens.

The x_Objects layers contain at least one 'roomDef' area in the majority of the buildings, I think these are used to specify the type of objects which will be found in containers within the rooms, but some also have unique names. tutorialBedroom, for example, is used to ensure the player has access to the sheet and pillow, and it also serves as a navigational waypoint for the home invasion event. Again, Lemmy has talked about ways to specify these specific rooms via a script instead of needing to place them within the editor, so it should be more straightforward in the future.


Playing your map

When you've finished editing and want to run around decorating your beautiful new world with mushy zombie brain you need to put the file back where it came from. First, save it in Tiled, then open zombie.jar in WinRAR and go to the media directory again. Drag the test.tmx file that you just saved from the modtools folder into WinRAR and hit OK. This will overwrite the previous test.tmx file so if you want to keep it make sure you have a backup. Now you can run the game as normal and if everything has gone well you should appear in your edited map. Yay!


Other stuff

You'll notice some layers consisting of bright red tiles named x_NoRender. I believe these are used to specify outdoor areas in which things can potentially be obscured from view. When objects are located here and in line of sight, the game automatically renders them in front of walls with the semi-transparent dithering effect, allowing you to see yourself and anything else which would be visible to the player character but otherwise hidden from the camera. If you add any new buildings to your map you'll probably need to add to the 0_NoRender layer using the same red tile behind any new walls. It's not essential if you don't mind getting lost behind buildings though.

Outdoor containers need to be placed on a single interior floor tile for them to have a chance of containing items.

I'm not sure if the layer names are significant and need to be specific, or if it's simply for easy identification within the editor, with the layer order and tile properties dictating the order in which things are rendered. It's probably a good idea to stick to the existing conventions for the moment, or maybe even avoid adding any new layers at all.


Things you can do now which I haven't covered

You can make new tiles for your map, but I haven't played with that yet. I'm not sure I will, since there's a good variety already available.


Things you can't do yet but will be able to in the future

You can't add new items, quests or NPCs, or choose where or when they appear in the world, nor can you modify existing content beyond cosmetic changes. That stuff is currently all hardcoded, but it will be opened up sometime in the future, allowing you to make completely new scenarios, characters, weapons and all sorts of other lovely things.

I'm excited.

Zander
Admin

Posts : 13
Join date : 2011-06-29

https://pzmods.board-directory.net

Back to top Go down

Mapping Tutorial! - Via Badgerflaps Empty Re: Mapping Tutorial! - Via Badgerflaps

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum