BF42 Pathmapping Part 3

PAINTING THE PATH

Image File: PM3\_Banner.png

PREFACE: This tutorial was created before the debugger was released and before it was possible to generate pathmaps. Generated pathmaps still need hand editing, so this tutorial is still very useful. This tutorial explains how to create pathmaps from scratch. It is much faster to generate pathmaps and then hand edit them.

This is Third part of the Pathmapping tutorial. In this part we will focus on creation of the Pathing around static objects and other obstacles.
We will continue our work on the original Battlefield 1942 level Aberdeen, it is assumed that you have completed Part 2.

Static Objects & Pathmaps
We will be using Ed42 further to Edit our .tga Pathmap images, to prepare for this, we need to split the images back into terrain tiles.
Huh ? Didn't we just have Tiles.
True, but the big difference now is the size of the image. The image is now the same size as our pathmaps, and so when used as a “low-resolution texture” on our level, and editing this in Editor42, we will be editing the pathmap pixel for pixel in a “wysiwyg” fashion. This will allow an awareness of the physical pathmapping limitations which will result in better pathmapping of Static Objects.
No rest for weary, we trudge on, and get on with the next step. If you are familiar with Terrain splitting, well ... get to it. Otherwise the easiest way i can think of doing this ... is coming up ...

There are few files i need you to organise for this task. First we need to poach two programs from the Pathmap Preview Tool ... at least i know you have them. Browse to the preview tool's folder and make a copy of \_nvdxt.exe and tgaSplit.exe, then paste a copy of these to the same folder as our 24bit pathmaps. We will also need two new folders, please create the new folders DDS and TX. Last but not least, three .bat files i have included with this tutorial, \_Car4Map.bat, \_Infantry1Map.bat & \_Tank0.bat must also be copied to this folder, as they will do the work for you. When your list of files now should include these.

Image File: PM3\_1.png

The .bat files have one setting that may need to be changed for larger maps.
tgaSplit.exe car4Level0map24bit.tga 4
The value is the Segment size again, and is 4 for Aberdeen and similar size maps. For larger levels the value must be changed to suit.
The .bat files are setup to use tgaSplit.exe to split the appropriate 24bit.tga file to .tga tiles, and converts the .tga tiles to .dds, using \_nvdxt.exe and leaves the files in the DDS folder for collection at your convenience. phew. Double-click \_Infantry1Map.bat to run this process on Infantry1level0map24bit.tga.

Image File: PM3\_2.png

Then browse to the DDS folder.

Image File: PM3\_3.png

This is the Pathmap in a terrain texture tiles, that we will copy back to our “infantry” map's texture folder, and then we can attack the pathing with vengeance and Ed42. So, select all the .dds files, cut them, browse to the Textures folders of the Aberdeen “Infantry” Map and paste the files, overwriting all the old ones.
At this stage we do not need to repeat this step of splitting the Car or Tank pathmaps. Modifications to the Infantry Pathmap can be “pasted” into the other pathmaps, saving the time and effort to do it all again.
!!! Custom Objects !!!
Note: if you are working with a Mod or Level that is using Custom Static Objects, you will need to ensure that Ed42 is able to display these objects correctly, otherwise you may find pathing those objects rather difficult.
On most occasions extracting the objects.rfa & standardmesh.rfa of a Mod to your “BFDEV” folder (or whatever you have setup for Ed42) will do the trick. But if you get stuck you might find this tutorial by Augustus very handy.

Image File: PM3\_4.png

Also note that you can setup two separate “DEV” folders and switch between them by changing Ed42's $basePath

Ready ? open the “infantry” level in Ed42.

Image File: PM3\_5.png

Things may look the same at first glance, but if you look closer along the bottom of the ridge, you will notice how chunky .. ahem .. pixelised it actually is. So all that resizing was for a reason, and that was it ... mmm ... moving right along.
Lets get into painting this thing. Last time we painted the map, it was using a texture. From here we will only be using solid colors, mostly White. Black or any other dark colour is good for cleaning up mistakes, but don't fiddle correcting a mistake every time you make one. Instead, keep going and then come back and fix all the whoopsies in one go, otherwise you may spend more time in the texture dialog then painting.
Open the Texture dialog, and change the single layer, but this time select a New Plain Colour.

Image File: PM3\_6.png

Now Edit the plain color.

Image File: PM3\_7.png

A standard Windows color requester will pop-up. This will select the color we will paint with, as we are adding to the pathmap we will need pure white.

Image File: PM3\_8.png

And on your way out, don't forget the lights. Ambient 1.00 & Sun 0.00
Almost done. When painting the pathmap it is very important to use the right brush. To start with we will use the smallest brush possible of just 1 pixel. We also need to make sure the colour we paint is not blurry, so the Opacity must be set to 100%.
Lastly the shape of the brush, do not use any of the fancy, blurry brushes that help blend textures, that is exactly what we do not want. In general, always use the Square brush, as this will give the cleanest edges. You can use the circle brush, if you feel it necessary, when you are covering large out-of-the-way areas where losing or gaining a pixel or two due to a bit of blurriness is not going to matter much.

Image File: PM3\_9.png

Before you start paint, lets have a practice in an area off to the side, and get to know how this works. Have a scribble, draw some straight lines, draw some curvy lines, big dots, little dots ... hey, sign your nick if you like.

Image File: PM3\_10.png

Stop staring at my childish looking sig, and have a closer look at the shapes. Note how big 1 pixel of the pathmap appears on the landscape, and that 1 Grid square in Ed42 is 4 x 4 Pathing Pixels. When you are looking at an object that you are about to path, keep in your mind the scale of the Grid vs the pixels and try to evaluate the objects position within these pixels.
The area 1 Pathmap pixel covers is quite large and this why a bit of thought in placing objects can be beneficial, as an object that has to be pathed and does not line up with a pathmap can be a nightmare. This is not to say that every object must be placed at perfect 90° angles, but rather look to see if you can match doorways or other features of an object as best you can, or decide in advance that the object is of no concern to the Bots and will be completely pathed-out.
Also be aware of the texture filtering that blurs the pixels. Where the are a lot of close objects, and you are trying to weave a tiny path through the middle, it can be difficult to be sure of your pathing. At times you may need to use a bit of guesswork or to-ing n' fro-ing to touching up things to be sure.

Now lets get back to our little patch of turf. First we'll do the pathing for the Sandbag wall. Depending on what your comfortable with, you can paint it by hand, or with a little help from the camera, you may even find the Road tool handy again. Also, viewing from directly above can help you to judge where the pixels lay beneath objects.
Start at one end of the wall, and move along, painting as you go.

Image File: PM3\_11A.png

Image File: PM3\_11B.png

You may need to check that the corner has a solid join. To get a clearer view of the texture, you can toggle the display of Objects in Ed42 with the [O] key. The result is a neatly pathed sandbag wall.

Image File: PM3\_12.png

BF42 Pathmapping Part 3B