Jump to content
granQ

Tutorial: Making roads in Terrain builder

Recommended Posts

I found there is a lot of threads, wiki's that describe the process for getting roads into a custom island without using Terrain builder.

Thanks to Bushlurker and M1lkm8n for helping me out yesterday, hopefully this guide can help some other people getting started.

This guide aims to give the basic, its possible to work with different layers and such but it won't be covered here.

Part 1: Terrain builder

First step is to check our map frame properties.

It's important that the location is the same as the following:

Zone: 31

East:200000.000

North: 0

mapframe-properties.jpg

No matter where your island is located, it needs to have these values. Don't worry about sun position and similar as that is controlled by the config.

Now lets identify the tools we need.

View Shapes = Lets you see the roads we make, should be pressed down.

Layers shape = Go into the layers manager, select shapes and then add a new layer called roads

Add polyline = This tool we can click on the map to make our roads.

shapes.jpg

Now we are ready, I will not import my roads from some database but "paint them" myself as my island is fictional.

Personally I load up the satellite and start tracing.

Left click at your starting point and then click once as "waypoints" while you follow the road. End it with a double click.

Once you are done (or perhaps just do 3-4 roads to continue this tutorial and see it works)..

What you need to do is to select all roads and right click on one of them to bring up the menu.

Select Database properties

database_properties.jpg

Click on New and name it ID and Integer.

Now select all the rows, and use the "autofil". Type in 1.

database.jpg

Last thing to do is to export our roads to shape files.

In the top menu, do the following:

File->Export-> Shapes..

export.jpg

My path is: sfp_roso_c\roads\roads.shp

Part 2: P Drive files

Now first thing we want to do is to create a RoadsLib.cfg

To get started, copy the content of my file.

// 1 = Country road

// 2 = City road

// 3 = Gravel road

// 4 = Bike road

// 5 = Path

class RoadTypesLibrary

{

class Road0001

{

width = 10;

mainStrTex = "a3\roads_f\roads_ae\data\surf_roadtarmac_main_road_ca.paa"; // lowercase!

mainTerTex = "a3\roads_f\roads_ae\data\surf_roadtarmac_main_road_end_ca.paa";

mainMat = "a3\roads_f\roads_ae\data\surf_roadtarmac_main_road.rvmat";

map = "road";

order=1;

};

class Road0002

{

width = 8;

mainStrTex = "a3\roads_f\roads_ae\data\surf_roadtarmac_main_road_ca.paa"; // lowercase!

mainTerTex = "a3\roads_f\roads_ae\data\surf_roadtarmac_main_road_end_ca.paa";

mainMat = "a3\roads_f\roads_ae\data\surf_roadtarmac_main_road.rvmat";

map = "road";

AIpathOffset = 2.5;

order=2;

};

class Road0003

{

width = 3;

mainStrTex = "a3\roads_f\roads_ae\data\surf_roaddirt_road_ca.paa"; // lowercase!

mainTerTex = "a3\roads_f\roads_ae\data\surf_roaddirt_road_end_ca.paa";

mainMat = "a3\roads_f\roads_ae\data\surf_roaddirt_road.rvmat";

map = "track";

AIpathOffset = 0;

order=3;

};

class Road0004

{

width = 2.5;

mainStrTex = "a3\roads_f\roads_ae\data\surf_roadtarmac_highway_ca.paa"; // lowercase!

mainTerTex = "a3\roads_f\roads_ae\data\surf_roadtarmac_highway_end_ca.paa";

mainMat = "a3\roads_f\roads_ae\data\surf_roadtarmac_highway.rvmat";

map = "main road";

AIpathOffset = 3;

order=4;

};

class Road0005

{

width = 1;

mainStrTex = "a3\roads_f\roads_ae\data\surf_roaddirt_path_ca.paa"; // lowercase!

mainTerTex = "a3\roads_f\roads_ae\data\surf_roaddirt_path_end_ca.paa";

mainMat = "a3\roads_f\roads_ae\data\surf_roaddirt_path.rvmat";

map = "track";

AIpathOffset = 0;

order=5;

};

class Road0006

{

width = 10;

mainStrTex = "a3\roads_f\roads_ae\data\surf_roadconcrete_city_road_ca.paa"; // lowercase!

mainTerTex = "a3\roads_f\roads_ae\data\surf_roadconcrete_city_road_end_ca.paa";

mainMat = "a3\roads_f\roads_ae\data\surf_roadconcrete_city_road.rvmat";

map = "track";

AIpathOffset = 2.5;

order=6;

};

};

Save it to the same folder as you exported the roads.

To see the roads in buldozer when you edit, we need to create the following:

P:\scripts\editor.sqs

~0.1
result = buldozer_LoadNewRoads "P:/sfp_roso_c/data/roads/";

YES / is used. It isn't a typo, the path should be with /.

Part 4: Config

Last thing we need to make sure is to get the roads working ingame.

In your island config make sure you have this (with your correct paths of course)

newRoadsShape = "\sfp_roso_c\data\roads\roads.shp";

All done! :)

Please, feel free to post this to the different wiki's (Armamapmaking, PMC, BIS..)

  • Like 1

Share this post


Link to post
Share on other sites

For some reasons TB exports my roads only to roads_polylines and roads_polygons.

Anyone with the same problem????

Share this post


Link to post
Share on other sites
For some reasons TB exports my roads only to roads_polylines and roads_polygons.

Anyone with the same problem????

Not sure if I get you right, but I had to create the "roads.shp" file by hand first (in the data/roads directory). Then I could export the road shapes from TB into that file.

Jens

---------- Post added at 10:46 PM ---------- Previous post was at 10:41 PM ----------

But I got a problem by my own as well: Basically this tutorial works for me without any problems. But only with the abc_sample map, which is set to Zone: 31 East: 200000.000 North: 0.

My own map is in another Zone and has different values for easting/northing, and I can't change these values as soon as they are set in the mapframe.

So any chance I can get the roads to work with my different coordinates?

Jens

Share this post


Link to post
Share on other sites

Nope. All terrain data must be in 200000e and 0N

Once imported into terrain builder you should be able to select the data from the raster layers and manually change the cords.

Share this post


Link to post
Share on other sites

OK, I reworked my map and have now everything set to 200000e and 0N. Made my roads layer, did a polyline road and set the database entries as desired. The current result is, that I can see the shape of the road on the ingame map, but I get an error on loading the map, that "a3\roads_f\roads_ae\data\surf_roadtarmac_main_roa d_end_ca.paa" is missing. Once the map is loaded, I can see the road ingame, but of course the texture is missing.

Any ideas?

Jens

Share this post


Link to post
Share on other sites

looks like you might have some extra spaces in your RoadsLib.cfg

surf_roadtarmac_main _roa d_end_ca

vs

surf_roadtarmac_main_road_end_ca

Share this post


Link to post
Share on other sites

Well, what can I say? :) Honestly, I checked it 50x but didn't see it ...

Jens

Share this post


Link to post
Share on other sites

How can you create good looking crossroads with this method? For me roads just overlap and its awful!

Share this post


Link to post
Share on other sites

I can see my roads in bulldozer, i can also see the trees that i filled a shape with in bulldozer. But in game i only see the trees. any suggestions of where i should start?

Share this post


Link to post
Share on other sites

Part 4: Config

Last thing we need to make sure is to get the roads working ingame.

In your island config make sure you have this (with your correct paths of course)

newRoadsShape = "\sfp_roso_c\data\roads\roads.shp";

maybe the config forgotten :confused:

  • Like 1

Share this post


Link to post
Share on other sites

Hmm, I followed the instructions to the letter but I'm not getting roads in bulldozer.

I have everything set to 200kE and 0N, I fixed the errors in roadconfig and all the paths to my road data are correct. I'm not sure what could be stopping them from showing up in bulldozer, Any Ideas or help would be greatly appreciated.

Share this post


Link to post
Share on other sites

I can get my roads to show up in bulldozer, however, they are the wrong texture i believe... I want to use the main highway, which should be ID 4? no matter what i put down, it gives me what im assuming is a dirt road. i have fixed the errors in the roadslib. i had this working at one point.. smh

EDIT: I can see the roads just fine in BD, but ingame they are just some kind of dirt road. Am i missing files somwhere? What all needs to be in the config?

Edited by Cupcake_Actual

Share this post


Link to post
Share on other sites

when use the script, i dont see texture of roads in BD, only roads white. Any suggestion?

tks

Resolved. Some spaces "unwanted" in the way. lol

Edited by VovoNauta

Share this post


Link to post
Share on other sites
when use the script, i dont see texture of roads in BD, only roads white. Any suggestion?

tks

Resolved. Some spaces "unwanted" in the way. lol

I'm sorry to disturb you mate, but can you explain how u fixed it?

OMG, I got it.. Sorry for dumb question.. read first, ask later... gl

Edited by J_g0re

Share this post


Link to post
Share on other sites

when exporting polylines to roads.shp i have thoses files in mymap/data/roads

http://i.imgur.com/bggXhIO.png (671 kB)

So i have no roads.shp to edit the config.cpp of the island with:

newRoadsShape = "\sfp_roso_c\data\roads\roads.shp";

Nevermind, got it sorted, just switched to "selection" instead of "current layer" in the export windows.

Edited by jomi_satchel

Share this post


Link to post
Share on other sites

I've followed this guide to the letter, yet roads will not appear in TB for me. I've placed several roads and done all the steps yet they do not appear in buldozer at all.

Share this post


Link to post
Share on other sites
How would I join roads together?

Do you mean join them as in join the shape files? If so make sure the snap button is on and the vertices are near each other. Select the two verts and right click then select join selected vertices

Share this post


Link to post
Share on other sites
Do you mean join them as in join the shape files? If so make sure the snap button is on and the vertices are near each other. Select the two verts and right click then select join selected vertices

On a related note - has anyone figured a good way to control the curvature that A3 appears to put on roadshapes?

For example - you can put in a line with a sharp turn and a long straight - but the road you get in game has a much longer curve that does not follow the vertices you place on the TB map, as if there's a minimum curve that roads can have.

I can manage it by breaking the roads into straight segments that have no curves, but that seems a very inelegant way to do it (and it looks pretty schonky).

Share this post


Link to post
Share on other sites

Add more vertices in your corner sections, this way it has more points to calculate the curve and you get a smoother "bend" on the road pieces - even on sharp bends.

You do have to watch though as too sharp and you end up with overlapping road textures sometimes. :)

Share this post


Link to post
Share on other sites

I think I had the overlapping problem before and so was trying to keep vertices to a minimum, and so I get the other problem.

Thanks!

Share this post


Link to post
Share on other sites

One more road related question: LODs for bridges.

I placed the LOD in the same position as the visible bridge object (A3 Asphalt Bridge) - but AIs refuse to drive over the bridge.

Is there a knack to getting this working?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×