PDA

View Full Version : Mapping Road Intersections


Rhino
2009-11-01, 03:01
Since I keep finding myself explaining over and over again to many different people on how to crate Road Intersections I thought it was about time I made a tut for this.

In this tut I have crated a very simple City Block and some empty surrounding terrain to turn this:
http://img441.imageshack.us/img441/7439/intersectiontut01.jpg

Into this:
http://img42.imageshack.us/img42/7414/intersectiontut02.jpg


Essentially you will be learning the proper methods of placing intersections and working with them to ensure your roads are nice and clean and to avoid any rework later on in the map.


What Are Road Intersections?

Just encase some of you are still wondering just excatly what is a Road Intersection, in real life terms it is "a junction where one street or road crosses another" and in BF2 terms it is pretty much the same thing, but it is instead a static object that connects roads where they cross to avoid bagginess and the textures not meeting correctly, ie, one of these:
http://img202.imageshack.us/img202/1948/intersectiontut03.jpg

There are many different types of Intersection Statics but these are some of the most common, basic cross intersection, T Junction and a 45deg intersection.


Requirements for this Tutorial

The main basic requirement of this tutorial are:
BF2 Editor v3 (http://realitymodfiles.com/rhino/editor/BF2_EditorSetup_v1.3.exe) and some basic understanding of it.
Roads Tutorial (http://bfeditor.org/forums/index.php?showtopic=1236) (Tutorial 6 in My Tutorial list (https://www.realitymod.com/forum/f189-modding-tutorials/20862-map-tutorial-list-where-start-mapping.html)) though most of this will be covered in my tut on how to crate roads.
A map to work on, can make a blank 256x2 map for practice like I have for this tut if you dont have a map to hand.

If you want to go into more advanced stuff like crating your own road textures and intersections then Photoshop/GIMP and 3DsMax(8 or 9) will be required but I will only touch on thous things very briefly and this tut is mainly about how to place road intersections in the BF2 editor, not crate/tweak them.


1. Getting Started

First load up the BF2 Editor and your Map in the Level Editor if you have not already done so.

Now before you place down any roads or intersections you really first need to plan your basic road layout. This planning stage is critical to saving time and ensuring you have a good road layout with intersections at every point you need them. If you miss any points and you place down your road over a point you need a intersection, you will then later need to delete that road you placed, place down that intersection and then recreate that road onto the intersections.

When I was making Muttrah City v2 I first went at it without any real road plan and was placing roads as I went. Not only did I find myself recreating roads over and over and over again but I also found that my city blocks where not coming together very well as a result. As a result I basiclaly scrapped all the work I had done on the map apart from most of the sea front and then drew up a full plan in photoshop of my entire city layout which I pretty much stuck to pretty much stuck to though the rest of the development of the map with only straying off it very slightly from time to time. Not only did I find my flow of making my roads was far easier but also sped up my entire maps development with crating the blocks etc. Here is a old WIP pic of Muttrah showing my planned road layout:
http://img513.imageshack.us/img513/5011/untitled2mo3.jpg
(12th of September 2007)


Anyways enough history about Muttrahs development and onto crating our own road plan. For Muttrah City v2 I drew the road plan onto the map's temporary colour map very much like this tutorial HERE (https://www.realitymod.com/forum/f189-modding-tutorials/21688-tutorial-image-colormaps.html) which if you know how to do I would very much recommend you doing it this way as it will help you save you loads of time in the long run BUT really any old plan will do providing you have a plan so to keep this tutorial simple I'm just going to take a screenshot, open any old 2D Image editing software such as Paint or Photoshop etc (I'm going to use Photoshop since I prefer it) and simply draw lines on the map where you want your roads, like so:
http://img97.imageshack.us/img97/463/intersectiontut05.jpg

Key:
Red = Tarmac Roads
Green = Dirt Track Roads

First of all it may look like my dirt road is going though a building but actually its going though this archway:
http://img97.imageshack.us/img97/6281/intersectiontut07.jpg

Now if we look where roads join onto each other we can tell where all the intersection statics need to go marked in yellow on the tarmac roads and light light blue for the dirt roads:
http://img442.imageshack.us/img442/8923/intersectiontut06.jpg

As you can see in total we have 6 tarmac road intersection and 2 dirt track intersections.

Now we have our plan we can move onto the next stage of placing down our intersections 8-)


2. Placing the Intersection Statics

First we are going to concentrate on the Tarmac road intersections since they are the most important, will come to the dirt track intersections later so stick with me on this :)

First of all, all the static road intersections are located in: Objects/Roads/Statics/
http://img156.imageshack.us/img156/7786/intersectiontut08.jpg

In this folder you will find lots of different intersections, mainly the same intersections with different textures and in the /pr/ sub folder is mainly custom intersections I made for Muttrah to fit some of the odd angles etc I had for some of my streets.

For my example I'm just going to be using the standard vbf2 intersections.

I'm going to start off with this street here which first requires a cross intersection here:
http://img413.imageshack.us/img413/1023/intersectiontut09.jpg

To place one, simply drag and drop the intersection of your choice (I'm using the "cross_intersection" for this one) into your map and move it into place like any other static, like so:
http://img252.imageshack.us/img252/9592/intersectiontut10.jpg

And then repeat this process for the rest of your intersections but just use the correct intersection static for the type of intersection it needs, like for this T junction intersection:
http://img20.imageshack.us/img20/1264/intersectiontut11.jpg

Until they are all placed like so:
http://img264.imageshack.us/img264/9251/intersectiontut12.jpg


3. Connecting the Intersection With Roads

Once you have placed down all your intersections you can now think about joining them up with roads :)

Simply use the road tool to place splines down between each road intersection joining the end to end, make sure you also use the same template as the intersection as well, like so, note where and how I have placed the splines:
http://img511.imageshack.us/img511/4839/intersectiontut13.jpg

With my splines, I have the first and end splines slightly offset from the centre of the road either to the left or to the right. This is to allow the road to draw better nearer the end of the next spline in from the start and end of the road. These splines that are just in from the start and the end of the road need to be placed just at the centre of the intersection, but just before where the middle box so to speak is on the intersection and overlapped the little foot bit going towards it. The next splines after this are to help control the splines direction and to ensure good tiling. Dont skip these splines in the centre as they are needed and try and keep a good flow of distance between them as in dont have 2 splines with hardly any distance between them, then place anouther spline that is much further apart as this will screw up the tiling.

Don't mind the colour difference between the road and the intersection. Once ingame, providing both the intersection and the road are using the same textures there colours will be the same.

A common mistake when placing the splines is to have the road go right though the intersection without stopping at it and this is incorrect since this just leads with edge of the roads being on the intersection which looks like crap and defeats the entire purpose of using the intersection static in the first place :p
http://img59.imageshack.us/img59/5392/intersectiontut16.jpg

Make sure your road ends just before the middle of the intersection like mine otherwise you might as well not being using intersections.

After you have placed your splines, your road and the intersection will most likley not match up perfectly like so:
http://img141.imageshack.us/img141/959/intersectiontut14.jpg

All you need to do to correct this is just move about your splines until you get a nice match :D
http://img3.imageshack.us/img3/7853/intersectiontut15.jpg

A small tip: If your working on a map that's on the grid, try and build your intersections and roads on the grid as well. This will allow you to snap your splines to the grid as well and will save you time on lining up your road ends to the intersection since they will be pretty much done with the snapping, thou always check your working ;)


Carry on connecting your intersections with roads like above until they are all connected like so:
http://img62.imageshack.us/img62/9792/intersectiontut17.jpg


4. Dirt Track Intersections

Dirt Tracks are a little different from normal roads with there intersections since there's dont require any static intersection like roads do. Instead all your basically need to do is overlap your dirt road over the top of a tarmac road, or anouther dirt road, like so:
http://img4.imageshack.us/img4/2193/intersectiontut18.jpg

Now the key for having your dirt road going over the top of the Tarmac road is the "Prio", aka Priority tweak of the road file which determines which road goes over which, thou it is quite buggy and doesn't always work but it should always be set up anyways :p
http://img97.imageshack.us/img97/7796/intersectiontut19.jpg
Basically it works by what ever road has the highest priority number goes on top, the 2nd highest goes under that and so on but only counts for roads that are actuality on top of each other, roads that are just on there own with not overlapping or under any other roads you dont need to set this but basiclaly you want the Tarmac road with a low priority of most likley the default 0, and the dirt road having a higher priority of 1+. If you have multiple dirt roads in the same space (very likely for a dirt intersection as your about to see) then the other road bit will need to also have adjusted priority to define which road is above which.

Moving on you will notice our dirt road intersection still isn't quite right, since there is no turning to the right when coming off the tarmac road onto the dirt road. To do this we need to add anouther small dirt road there to do that like so.
http://img94.imageshack.us/img94/7538/intersectiontut20.jpg

Now where my first dirt road had a priority of 5, this one has a priority of 2, making it go under the other road. Also note my dirt roads are setup for cars driving on the right hand side of the road, these little details can make a road look and feel more realistic so keep this in mind when your setting up your dirt road intersections ;)

And that pretty much covers the basics of road intersections :mrgreen:





Advanced Stuff about Intersections

First of all this stuff is not necessary and you can skip it but you might want to take a quick look just to know the possibilities :)

With road textures, you might want to use a custom road texture for your map much like I did with muttrah or you are using a road texture that currently dose not have any intersections with a matching texture? Well there is a solution for this :)

With muttrah, I used for the most the vBF2 intersections like I used in this tut like the "cross_intersection", the "T_intersection" etc. But there texture is different texture on them. I solved this problem quite simply with the map's texture suffix since the main texture used on these intersections is called "Tarmac_mirror.dds" where my muttrah road texture is "Tarmac_mirror_muttrah.dds" where muttrah's texture suffix is "muttrah", then I got my roads using the muttrah texture by simply making a new road template using the "Tarmac_mirror_muttrah.dds" textures :D

But this is not always an option since your using a road that has no intersection textures for it and you can't use the texture suffix since your on a woodland map for an example. One simple method to solve this problem here is to clone the intersection static, rename it and with the BF2Materials.exe tool change its texture paths for your new textures :)

Thou if you need a entirely new or bigger intersection of what is already there for w/e reason, they are very easy to make since really all they are is a flat model with a texture assigned to them :)
Here is one of the intersections I made for muttrah:
http://img252.imageshack.us/img252/5052/11012009035513.jpg

and its Hierarchy, basically a simpleobject without any col meshes:
http://img252.imageshack.us/img252/7289/11012009035924.jpg

Providing they are exported to the objects/roads/statics/ folder they will work just like any other road intersection :)




Anyways that wraps up this tut, hope you all find it useful :D

Wilkinson
2009-11-01, 03:05
Finally! A Proper tutorial done. Great one Rhino. Will refer Everyone to this one

Amok@ndy
2009-11-01, 11:08
really helpfull thx rhino

Rudd
2009-11-01, 15:10
your a star mate

Randyr[NL]
2009-12-22, 15:12
maybe a stupid question,
but will those intersections also
get the same color as the roads or will they not?

Rhino
2009-12-22, 15:13
as stated in the tut, yes.

Randyr[NL]
2009-12-22, 15:14
Ow nvm, should have read everything beter before :P

Randyr[NL]
2009-12-22, 21:53
Well i will make a map first, and customize those intersections later then :oops:

Randyr[NL]
2009-12-25, 16:37
but anyways, could you help me with this problem i got with roads?
i got this
http://img7.imageshack.us/img7/5994/whatswrongq.th.jpg (http://img7.imageshack.us/i/whatswrongq.jpg/)
pls tell me why its happening why i press make final road??.