Tạo custom map với BrowEdit P.II
Sunday, May 10, 2009 4:35:10 AM
Khi nào rảnh rùi tớ dịch sau vậy, hihi

Index
Step 1: Getting started.
Step 2: Spring Cleaning.
Step 3: Texture editing.
Step 4: Height editing.
Step 5: Slops.
Step 6: Walls.
Step 7: Placing Objects.
Step 8: Water.
Step 9: Gat Tiles.
Step 10: Gat Tile Height Editing.
Step 11: Lighting.
Step 12: Editing your Lights.
Step 13: Ambient Lighting.
Step 14: Effects.
Step 15: Sounds.
Step 16: Sprites.
Tips and Tricks.
Step 1: Getting started.
First thing to do is get an idea of what you want to do in your map and to write it down or draw it out before going in an making it. Also messing about first and learning about the tool first will help you make a better map in the end. Then you can load Browedit and select an existing map (Maps can be loaded from your grf file or from the data folder) with the approx size you want (This is because Browedit can not create new maps yet, even thou the option is there it's heavily bugged with lightmap out of bounds errors and inability to show textures ingame and probably other bugs).

Step 2: Spring Cleaning.
We now have to clean out all the stuff on the map (unless we are just doing a small edit of the map). Under Tools use the Clear Map to clean out the map. This allows you to have a clean empty map to start working on (When clearing a map and you don't see the Tools > Clear Map then get the plugin from the downloads page). You will want to add a texture to your map and fill the map with that texture or another texture (Explained in the next step) before saving as currently Browedit crashes if you don't.

Step 3: Texture editing.
Now we get to put in our textures. Pressing the T key will bring up the texture window. Under the menus you will find all sorts of textures to work with (Double click on the sections to open/close them). Single click the textures you want and they will be added to the side list in the normal window (Only visiable if your in texture or wall edit modes which you should be still in texture edit at this point). I recommend the black texture from the root folder of your grf which I think is under basics as your first texture to use as a base and for the edges of your map (Best not to work to the very edge of a map as walls and doing slopping can be more difficalt or imposible). Unless your doing a sky map like Yuno or the Valk map you will want to select one of the textures as a base from the right side of the screen and using the Edit > Fill with selected texture fill the map with that texture.
If you add a texture you don't want you can replace it by having it selected and holding the shift key and clicking on a new texture in the texture window. The other way is to use the Edit > Remove unused textures which will remove any texture that hasnit been placed on your map (If there are textures after it you did use the texture order will be out and you will have to re go over them which can be painstacking so chose your textures wisely from the start).

Placing textures is simple and easy and is the first thing you should do in making your map. In the side texture list any texture that you drag the red box over to encase all or part of the texture will be what you use wen placing onto the map. Then using the = and - keys to resize your texture, space to rotate it, [ and ] to scroll though the maps texture list, H and V to change the texture's horizontal and vertical facing of the selected texture and [ and ] to change which texture is selected, and put down the textures how you want them. I should point out that Gravity uses the tiles at half normal scale in their maps as well as having them at other scaled sizes (Including some that Browedit can't do) so look at official maps for the scale of things. In case you do a miss take you can use the undo key U to undo it. I should also point out that to do invisable tiles simply use the backspace key to change the area covered by your tile brush to invisable tiles. These are handy for maps like the content="text/html; charset=utf-8" http-equiv="Content-Type" /> content="Word.Document" name="ProgId" /> content="Microsoft Word 11" name="Generator" /> content="Microsoft Word 11" name="Originator" /> valkire map for changing to transended jobs (A tile with the colour FF00FF will also do the same thing but will not get jet black shadows with lightmaping which is handy to stop the edge shadow that you would get from the edge of your map or the edges of the invisable tiles that make black shadows).

Step 4: Height editing.
Once we have our textures placed on the map we can start editing the height of these textures. If we goto the menu and select Edit Mode > Detail Terrain Edit and then the size you wish to edit the height of the tiles with. If you want a guide to how high you should make things I recommend using a Prontera house as a guide for height, a least until you get used to how things are (Other objects can be a good guide to heigh but some are not so be careful which you use). To raise or lower tiles simply use the left mouse button to raise and right + left mouse buttons to lower the tiles you have the grid over. To do alot of tiles the same way it can be advantages to use the C key to copy the tiles your mouse grid is hovering over and pasting the copied tile height to the new location with the left click of your mouse (The P key will bring back the copied selection again if you need to use it more then once).
If you hold down Ctrl while having part of your grid coving a max height you want or max deapth you can use the left and right mouse buttons to raise or lower tiles to the same height or death as the the rest. This is another greate way to do walls or make slop areas ready for the F or S keys (Their explained in the next section)


Step 5: Slops.
Now the fun part, making ramps and other kinds of slopped serfaces. This can get alittle tricky since the maps have this thing of merging from the topleft to the bottom right. In other words when you make a slop using the F key it will make the tiles join from left to the right and from up to down (You will get what I mean if you try and make a slop of your own. To fix the sides use the copy key C I talked about before with a grid only covering the slopped tiles and paste over the other parts to fix up the slop edges). You can also use the Edit > Sloping to turn on/off sloping of tiles with a grid of 2x2 or bigger to also create slops.


While this may be so when using the F key, it isn't so for the S key (Stands for smooth, I think). Using the S key we can make smooth curved slops for hills, lakes, etc (Really handy for smothing out areas) and the more we use it on the same spot the more it will smooth out the area (The area is the size of your height editing tool grid which can be changed with the = and - keys). You can also use the Edit > Sloping mode to allow you to slop tiles yourself a bit like how you raised the tiles with the left mouse button to raise and right + left mouse buttons to lower.

When making cliff faces you might want to experiment to find a system that works for you and feel free to put bumps, etc in your cliffs to give it a bit more of a non man made look. Also if your using the S key to make the slop you might want to only use it once for a more cliff look else it will make it less and less of a cliff and more of a slop.



Before moving on it is best you get the textures height and slops how you want as things become more difficult and / or time consuming if you have to come back to previous steps
Step 6: Walls.
Once we have finished making our slops and other height changes (stairs and such) we will have to put in the wall facing for the tiles that are raised or lowered and don't have a slopped tile connecting from all the different sides.
Goto Edit Mode > Wall Edit and using the , and . keys (, is for the vertical facing walls and . for the horizontal facing walls. Pressing the key once will put a wall on one side, pressing the same key again will remove the wall) place your walls in on the tiles on your map (The wall tools will use what ever texture is selected). Wall on tiles will only cover 2 sides, to do the other sides you have to use the adjusting walls. If you hold down the ctrl key while using the , and . keys browedit will do all the tiles in a row up until the edge of the map or where your tiles are not raised / lowered from each other, which ever come first ( Example of adding walls in this vid of Borf's http://youtube.com/watch?v=0YgAEkwkx-4 ).

Once your walls are in you can use the W key (and ALT W for vertical faces) to fix up the look of the wall (Do not use this on the edges of your map or it will make a spiked line across it). You can place walls in individually and flip them on the horizontal/vertical axis to get them more to your liking if you want as the W key will do the whole wall the same and you might want some of it different or something.

Browedit can also now alter the walls by single clicking the walls while in wall edit mode which will bring up a window and you can then adjust the box to change how that wall displays the texture. This is handy if you which to give it a slop or to change what is show on the wall to be a smaller or larger area for the texture as well as flipping the single part of the wall horizontal or vertical instead of the whole wall with the H and V keys (Hold Alt for vertical faces when using the H and V keys).
Step 7: Placing Objects.
Now we move onto the part where we get to put all our objects in. First we select our objects by opening the object window with the M key. Then selecting our object much the same way as the textures we close the window and pressing CTRL left click where you want to place your object (It will snap to the ground where ever you decide to place the object) and then you can drag it around ((Holding down the Shift key will snap it to the grid which you can change the size of with the number keys on your keyboard, 1 across to 0.) or raise / lower it using the Page Up and Page Up keys as well as rotate the object and resize it (Holding down the Shift key while using the other keys will do them at greater intervals, good for fast rotating and quickly raising / lowering an object). Another thing to know is that holding CTRL can be usefull to rotate an object and ALT can be usefull to rescale an object but it might be better to use the propertise (ENTER key to open the propertise window) to be more accurate.

If you wish to select/edit multiple objects at once you can use the Edit Mode > Object Group Edit to select, copy and move multiple objects (Use the [ and ] keys to change from select to edit). In Object Group edit you can copy your selected objects with the D key which will copy all the objects currently selected ready to be moved to where ever you which to place them (They will be at the same height as the original and if you have Snap Objects to Floor on they all will snap to the ground when you move them which wouldn't be good if you have something like a sakura tree).
You should note that not all objects keep the angles very well, but if you use the left rotation box (in the propertise window) do not expect them to be same in the editor to how it is in-game, so check them in-game (It's only that box that does it and if you leave it at 0 you will have no problems). Also heights and placement of objects can be a little different in-game as well, which is something you might notice if you happen to try and making big leafy trees or a Sakura (cherry blossom) trees or some of the houses will have moved over a bit (I know of one prontera house that does this).
Note: If you wish to remove an object just select the object (or objects if your in the group edit) and use the Backspace key to delete the object or objects. You can also copy a group of objects with other stuff like the tiles their on and the lightmaps. This vid shows an example useage of it in an earlier version: http://youtube.com/watch?v=zTUrpFEmKZo
Step 8: Water.
To edit the water on a map you simply goto Windows > Water to open up the water properties window, and simply edit the height of the water to what you want (you have to use negatives for water above the 0 height). And for wave height you edit the Phase setting. The SurfaceCycle is the setting that says how fast the water moves the waves. Best to check your changes in-game if your messing with the water unless it's only the height.

You won't see any of the changes execpt the water height and type which you can also change with the [ and ] keys in the water edit mode (Edit > Water Edit).
Step 9: Gat Tiles.
Now we tell the editor where we want to walk and not walk by using the Edit Mode > GAT Edit mode to allow us to set where players can walk. to do this we simply use the [ and ] keys to change the top tile on the list on the right to the one you want and left click (You can draw with this tool to, so to speak). Feel free to come back to this step if you suddenly decide to change something.

If you add the following to the eathena source you can add no char and no vend gat tiles to your map (If you do they will only work on a server with the source edit so if you use this add the source code to a txt file with your map if your sharing the map out).
-- mapmap.c --
static struct mapcell map_gat2cell(int gat)
{
struct mapcell cell;
memset(&cell, 0, sizeof(cell));
switch( gat )
{
case 0: cell.walkable = 1; cell.shootable = 1; cell.water = 0; cell.novending = 0; cell.nochat = 0; break; // walkable ground
case 1: cell.walkable = 0; cell.shootable = 0; cell.water = 0; cell.novending = 1; cell.nochat = 1; break; // non-walkable ground
case 2: cell.walkable = 1; cell.shootable = 1; cell.water = 0; cell.novending = 1; cell.nochat = 0; break; // no vending
case 3: cell.walkable = 1; cell.shootable = 1; cell.water = 1; cell.novending = 0; cell.nochat = 0; break; // walkable water
case 4: cell.walkable = 1; cell.shootable = 1; cell.water = 0; cell.novending = 0; cell.nochat = 1; break; // no chat
case 5: cell.walkable = 0; cell.shootable = 1; cell.water = 0; cell.novending = 1; cell.nochat = 1; break; // gap (snipable)
case 6: cell.walkable = 1; cell.shootable = 1; cell.water = 0; cell.novending = 1; cell.nochat = 1; break; // no vending & no chat
default:
ShowWarning("map_gat2cell: unrecognized gat type '%d'n", gat);
break;
}
return cell;
}
static int map_cell2gat(struct mapcell cell)
{
if( cell.walkable == 1 && cell.shootable == 1 && cell.water == 0 && cell.novending == 0 && cell.nochat == 0 ) return 0;
if( cell.walkable == 0 && cell.shootable == 0 && cell.water == 0 && cell.novending == 1 && cell.nochat == 1 ) return 1;
if( cell.walkable == 0 && cell.shootable == 0 && cell.water == 0 && cell.novending == 1 && cell.nochat == 0 ) return 2;
if( cell.walkable == 1 && cell.shootable == 1 && cell.water == 1 && cell.novending == 0 && cell.nochat == 0 ) return 3;
if( cell.walkable == 0 && cell.shootable == 0 && cell.water == 0 && cell.novending == 0 && cell.nochat == 1 ) return 4;
if( cell.walkable == 0 && cell.shootable == 1 && cell.water == 0 && cell.novending == 1 && cell.nochat == 1 ) return 5;
if( cell.walkable == 0 && cell.shootable == 0 && cell.water == 0 && cell.novending == 1 && cell.nochat == 1 ) return 6;
ShowWarning("map_cell2gat: cell has no matching gat typen");
return 1; // default to 'wall'
}
You can get the gat tile images I use from here which go with that source edit (Source edit is included in a TXT file in the zip with the gat file images).
Step 10: Gat Tile Height Editing.
(This step should be only done after you have done the others as it can be a pain to redo it after using the Edit > Set Gat Height) To edit the height of a GAT tile you simply do it much the same as you edited the height of the textured tiles. This allows you to either walk in mid air, walk in the ground, and walk on top of things like chairs, bridges, etc. You can also you the slopping keys or the Edit > Sloping to slop the GAT tiles for ramps and stuff much the same as you raised and lowered objects with the Page Up and Page Up keys.

Step 10: Lighting.
Now we move into the part on lighting. This is where we make our sunlight as well as any other kind of lights we want. First we will want to do the smaller lights as the lights are rendered according to the order you placed them and if you place the sunlight first it tends to kill all other lights except where there are shadows. To place a light you simply change over to the light editing mode Edit Mode > lights Edit and place the light much the same as you would an object except the light will be a 0 height so be careful where you place the light or it might end up under your textured tiles. Simply drag (Left click the light first to select it) the light where you want it and hold the CTRL key and drag to raise/lower the light (The dragging motion will go in the opposite direction to the light but the light icon is where the light comes from).

To render the lights you have placed simply goto the Generate > Calculate Lightmaps to tell Browedit to render out your lighting onto the map (You can see the progress in the pop up window which changes colour as it goes across. If you hold the mouse over the bar it will give you the percentage it's upto and you can also see the editor doing the lightmaps with the Preview button). To show the lightmaps on your map goto View > Lightmaps to make the lightmaps visible on your map. Using the Generate > Calculate Lightmaps Without Shadows is a quicker way to preview your lighting then Generate > Calculate Lightmaps as it doesn't have to spend the time doing shadows. Also using Generate > Calculate Lightmaps for Selected lights you can see how a single light lights your map and if you have tiles selected in Global Height Edit you can use Generate > Calculate Selected Lightmaps to only do that selected area of the map, good for a quick fix up if you just only happened to do a small edit.



I should point out that at the time of writing this Browedit doesn't cast shadows off walls, you have to use igun if you want the sunlight to do this.
Step 11: Editing your Lights.
With your lights placed you might want to edit them to make them a different colour or to make them brighter or duller. To do this left click on the light and press enter to bring up the Light's Properties box.

Browedit’s lighting has changed from the old system that we had before with only the settings of Position, Colour & Intensity. We now have Range, Max Light Increment, Light Falloff and Casts Shadows settings added to the light properties’ box.
Name: You can name your lights for easy referance later.
Position setting: This is the x, z,y coordinates of your light. With this you can manually type in the coordinates for your light in the horizontal, height, vertical axis of the map (This is the only way you can do a sunlight source light which you would set to something like -3000, 25000, -3000).
Colour: These 3 boxes are for the Red, Green, Blue colour light settings of your lights. 0 being white and 1 being 100% of that colour so use decimal places to get something nicer (Like 0.3).

Intensity: This controls mainly the intensity or brightness of the light. It also controls the Light Falloff in that it limits how close the Light Falloff can go towards the centre of the light. What this means is the larger the number is for Intensity over the Range of the light the less distance the Light Falloff will cover and thus increasing the area covered by the light where it’s all the same brightness. While if the Intensity is less then the Range the falloff will reach centre without reaching the Max Light Increment level, creating a darker light than what you set with the Max Light Increment.

Range: There isn’t much to this setting; Range controls how far the light can cover before stoping regardless of the Light Falloff setting. I believe it counts the distance in the number of lightmap cells in distance from the light (This is from the light to the ground so the height of the ground and the height of the light will affect how far the light covers).
Max Light Increment: This setting I believe is the brightness of the light and doesn’t go past 255. When using this treat it like a brightness setting and you shouldn’t have any problems handling it.
Light Falloff (0-1): The Light Falloff sets weather the light has a kind of blurred edge (Like the feather setting in Photoshop when using the selection tools). With this setting Borf for some reason set this as a box like the other settings instead of a tick box so you have to set a 0 to 1 (decimal places control the feathering / blurred edge), 0 being off, while 1 is full feathering or blurred edge around the light.


Casts Shadows: This setting is so you can set a light to either cast shadows off objects or not. This allows you to have lights in things and not worry about the shadows coming off the objects (Gravity used it for lava rocks and other such things that would give off their own glow or light source). Use the Generate > Smooth Lightmaps to smooth out the lightmaps if you want them to blend better.

Examples usage of lightmaping can be found in the following vids:
http://youtube.com/watch?v=eBJVpq8ZSCc
http://youtube.com/watch?v=w_cE6jCpnDk
Step 12: Ambient Lighting.
This can be a little fiddly as Browedit only shows changes to the Diffuse settings. As far as I've found from messing around with the Ambient Lighting you only really change the diffuse settings for lighting on the map. Shadow to change the wall lighting. The other 2 Ambient and Alpha I'm not overly sure about (I think the ambient controls the colour of the light as well and the Alpha changes the affect of the ambient lighting on the map. A bit like the Alpha channel in some of Gravity's Images).

To edit the Diffuse colour (R,G,B) simply think of it as a percent (1.00 = 100%, All white being 1.00 1.00 1.00 and all black being 0 0 0).

Add you map to your server and test it out and make changes where you feel it's needed.
You should note that the the Ambient Lighting in browedit is linked into the lightmaps to make it more accurate (currently has a bug which makes the ambient lighting alot stonger then it should be. Borf is working on fixing it). While it shows them more accurately the client shows lighting with shadows within a boxed center area. The shadow controls the intencity and colour of shadow side of walls and objects. If you have walls that are too dark ingame or off in colour try changing this. The Alpha setting is, well I'm still not sure what that does if it does anything at all, probably the strangth of the ambient lighting overlay.
Step 14: Effects
To place effects you will need to first pick the effect from the numbered list under effects. Don't worry their all named and if you want to know how they look ingame use the @effect command to try them out. Once you picked the effect and while in Effects Edit simply place them by holding CTRL and left clicking the mouse which will place an icon with the effect number and name above it. The posision of an effect is something you will need to check ingame as effects ar not always at the same height as the icon in browedit also the scale and rotation isn't working so leave them as is. The Loop Time is also tricky to set. You will either need to find the effect in an existing map or work out the timing from trial and error ingame.
Step 15: Sounds
Sounds are bugged. So I'm leaving this bit till later.
Step 16: Sprites
Sprites are the last thing you do and isn't really needed but is a fancy way to show off your map with chars and npcs without having to place them in with the server and login with the ro client.
Tips and Tricks
Mazes: If you need a good maze try using the lightmap export and with Photoshop clear the lightmaps to completely black and draw white paths where you want your maze paths. Then once you have the lightmaps imported back in use the Maze Stuff and browedit will raise the tiles ready for you to add walls (Sorry but it doesn't do it for you, and it uses the ground textures you already have placed). The other way is to use the Room Maze which will use the first 3 textures from your map's texture list (First for the top, so make this one black. Second for floor, and the Third for walls) to create a maze of rooms with doorways joining them. These are great ways to create mazes for dungeons so try them out.
Hills: Use this to create random hills for open field maps. It's a greate way to give a field a random terrain height feel. Cancel at the time of writing this is the same as accepting the stuff you put in the boxes, Borf might fix it later.
Cave Dungeon: This will create a random dungeon that is suppost to be a cave but it will need you to smooth the walls once it's been generated.
Mountains: There are no settings to this one like the Hills feature has. It will simply give you a mountain (Or just the slop) using the 2nd and 3rd textures from your list. The 2nd for flat(ish) ground and the 3rd for cliff faces. Greate tool but you might want to go around the edges cleening the textures up a bit to make them blend in or something.
Objects: Never be afraid to experiment and add lots of objects, but while your at it check them ingame to see if their correctly placed, scaled and rotated. Also you can add your own objects with Borf's 3ds to rsm converter.
Lights: When adding sunlight your best option is to have a light placed at -2500 25000 -2500 with a range of 2000000 and set the intencity of 256 and turn off light fall off and also if you create a light and set it to be placed at 2500 25000 2500 with a range of 2000000 and set the intencity of 256 with a Max Inc of 128 and to not cast shadows it will lighten your shadows to a grey colour instead of the black. If you have coloured lights or small lights period you might want to drop the max inc of the sunlight and sun shadow filling light to allow the coloured/small lights to come though better. Good for street lights, etc for a night effect (setting the ambient light to a dark blue will also help give it that much more of the night time look). Another thing to look at with lights is placing them inside objects. If you open the properties of an object you wish to place a light in while your in the object edit mode you can set the opacity to 0 which will allow lights to pass though an object. This is handy for lava rocks giving off their own glow and for street lights and the like where you would like the light source coming from inside the object
Walls blocking lights: This is a handy trick for when you want a wall blocking a light or to even cast a shadow (without having to do the wall shadows with igun). Simply find a flat square (or rectangular object) and content="text/html; charset=utf-8" http-equiv="Content-Type" /> content="Word.Document" name="ProgId" /> content="Microsoft Word 11" name="Generator" /> content="Microsoft Word 11" name="Originator" /> stretch the object to cover the wall (Best to place in side the wall as not to block the light on the side of the wall you do want lit) this object will then block unwanted light from passing though the wall to the other side. Great for dungeon or inside building walls where their is a light on on side and there isn't on their other. You can also scale the object into the negitive and the object will then never show up in the client as the clients never show the back side of any objects to save on graphics processing.
Reducing visual lag: You may have visual lag while using the client. It happens if you have a slow computer or everything visable. Your best to have only the stuff you want visable that your working with. If the water is under everything you might want to turn it of. Turn off lightmaps unless your checking your lights and grids can slow things down to so you might only want to show them when you need them. Objects are another thing to sloy down your graphics as the more you place and the more that are on the screen the more your video card has to render onto the screen. Zoom in or turn them off if you don't need them on the screen. If you only have the textures visable it's easier to zoom out to minimap too.
Minimaps: Making your own mini is easy but you might want to take in some of the Reducing visual lag tips to make it easier to zoom out in View > Topcamera mode and zoom out untill you can see the whole map from above, then turn on your lightmaps, objects and water (If it's not under the entire map and isn't visable already), then take a screenie with Alt+Print Screen and paste it into an image editor (Photoshop, paint dot net or paint, it doesn't matter), crop and save as a bitmap (Best to save as a 256 colour aka 8 bit bmp) in your ROdatatextureÀ¯ÀúÀÎÅÍÆäÀ̽ºMap folder with the map name ready to be listed in the resnametable (See guides).
Adding Your Maps
The following are guides to adding your maps. If anything is missing, wrong or out of date let me know in IRC.
http://www.eathena.ws/board/Adding-Maps-t161810.html
http://www.eathena.ws/board/guide-Adding-Maps-t183090.html
End of Guide
Link:http://browedit.excalibur-nw.com/?a=viewtopic&id=533








Unregistered user # Friday, October 23, 2009 11:04:08 PM