GPL Track Creating - Walls

From Grand Prix Legends Wiki
Revision as of 22:27, 5 May 2009 by David Fletcher (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Authored by the GPLEA



Walls is the term used to describe the way each Section is broken down. These walls are all the flat regions of the track: asphalt, grass, banking, concrete; as well as all the real walls: armco, hedge, rows of people, etc. The way the wall 'acts' depends on the surface type it has, so let's look at the surfaces...

1- Asphalt

2- Concrete

3- Curbs

4- Grass

5- Dirt (makes dust!)

6- Gravel (makes dust!)

7- Banking (makes dust!)

8- Some sort of very vicious surface, probably was intended to be water.

10- Left-most wall

2048+ - a wall that you can crash into - e.g. armco, hedge, brick wall etc.

2048 - Drive through (grass verges etc)

2049 - Very hard, armco, etc.

2050 - Same as 2049

2051 - Soft, 'elastic'

2052 - Like 2051, but not as 'elastic'

2053 - Soft, hay bales

2054 - Soft, car sinks into (hedge?)

2055 - Soft, softer than 2054

2056 - Hard, not metal, cars bounces off a bit

2057 - Hard, metal, armco

2058 - Soft - hay bales

2059 - Hard, metal, armco

2060 - Bouncy rubber

2061+ - Drive through


Ok, when you start out making a new track (gtk-file that is), you have by default 2 walls, one that is surface type 10, and one that is surface 1 (Asphalt). The type 10 needs to be the leftmost wall, it defines the outer boundary of the track, so no matter how many walls you add, the 10 needs to be your leftmost wall.

The walls are manipulated in GPLtrk, you start out with the asphalt and the 10; you'll at least need 2 more walls to define the drivable area, and they both need height. To stop the cars from toppling into neverland, you need to use surface 2056 or higher.

Most likely, you'll be adding lots of walls per section, and you'll have one hell of a time reducing this number when release day comes to get nice FPS....

How to add walls: click on one of the existing walls in GPLtrk, right click and choose 'add after' or 'add before'. Then you'll need to wibble with the width until you're right, BUT: a wall *must* have width! It needn’t be much, but compilation will fail if you don't do this. Some walls are required to be very thin; for example fences, or rows of people. Make sure you give them width!

If possible, avoid having your walls crossing traces. Weirdness will definitely occur, especially if you are planning on adding altitudes.


Height

You set height for the walls by selecting the targeted wall in GPLtrk. There hardly is any limit to height, but there are a few things to consider. All walls with height will have to be defined with textures for all sides in the .tex. (see section on textures).

Remember that if you add height to a wall, a wall coming directly behind it will need to be even higher, and it'll need another wall behind it to fill the void. If you add walls as earthbanks, barriers or similar, also remember that any 3dos placed on top of them will have to be adjusted in height in the tso.

You can also in fact, give the walls negative height. This isn't used very often, only in cases where there is a rapidly rising tight hairpin and so on to 'camouflage' the inevitable gap on the inside of the corner.

When working with height: if you have a wide wall, and it sits on top of a trace, a 20++ wall will usually not 'bend' with the terrain, with ugliness as the result. A trick is to use a different surface, 4 or whatnot.


The Unknown values, and Their Known Uses...

Unk3= chooses texture in conjunction with surface type.

Unk1= has a snazzy feature: in the case where you use a wall with height and thickness as armco, barrier, whatever, and you have a repeating texture being chopped off ('ants' when it was supposed to show 'pants'), you can add a value here to 'push' the texture to the right. The value is the same as elsewhere (20000 = roughly 1 metre). Experiment, this is very useful!

Unk4= The big business.

Whenever you have walls with height and width, you'll need polygons on the ends, else you'll have ugly green gaps. The fences & rows of people may not need this, because they can be made very thin. To add these polygons, you'll have to do some unk4 work. The exciting thing with unk4 is that you can add several values to it that do different things!


The most used values are:


unk4=2. Used on walls where you want the texture to stretch across only once. Very handy when you make a tirewall or similar.

unk4=8. Used where you want one texture to be mapped only once if there is a certain patch of grass on a wall - the lay-by's at Goodwood is an example.

unk4=32 : adds a polygon to the start of the wall. Remember to define this in the tex!

unk4=64 : adds a polygon to the end of the wall. Remember...wob wob!

unk4=96 : adds polygons to both ends.


Now, you usually want to use these in conjunction with the texture stretching only once, so add 2 to that unk 4 value for every side (34,66,104...). The easiest way to observe this is by not setting an unk4 value for the asphalt: you'll have odd texture mapping!

Walls with height and texture behave strangely when you make a corner: the textures will stretch on the outside, and cram on the inside. (rows of people will be very fat when in bends!). To remedy: add 2 entries in the tex; one texture for your 2056 wall on straights, and one for corners. This usually is enough.

When using kerbs and special grass, you may want the textures to stretch only once across the wall (unk4=2): if you're next to a trace with altitude, this will leave gaps in the track, so you need to plan carefully!

unk4 is also used to control optimizing, for a complete rundown on the unk4 codes, please check the trk23dow/GTK part. But while we're at walls, another neat value is that of 131072. This makes sure a polygon isn't added to the top of a wall with height - always use it on rows of people, fences, treerows, anywhere that you won't see the top! Saves 3do size, and ups performance. 1024 should also be added to any wall that is to the right of a clipping problem: if you have a seriously banked corner, you may experience clipping; this often helps.

There are loads more that you can figure out and add up; again, check the trk23dow/gtk section, but always remember unk4=2,32,64,98,1024 & 131072. These are set on individual walls while the others are set as a flag on wall0 of a section.

In general, try to keep the number of walls down. You can have lots in each section, but performance will suffer. The good thing about using walls where the elevations are constant (like the banks at Goodwood), is that the texture on the far side will not be drawn, and this increases performance. In fact, this is better FPS-wise than using altitudes. The downside is that if you use a 2056 wall, wide, then want a row of people on top of this made with a wall, that wall needs the height of the 1st wall + that of the people, which again means that the mip will have to be 2x the height, since the lower half will be invisible.

To finish off, let's look at a typical section of track: this one taken from Goodwood:


Goodwood


To the right of the track, I start with a 2056 wall with some height. The texture used is a grass verge. This is an airfield track, so it's the only way to cammo the end of the world!


Next up is a surface 4 wall: slippery grass, non-smoker.


Here we have a surface 7, this is slightly more spooky to drive on, and it will create a cloud of dust when you run on it. Still looks like grass because of tex-work.


Next up are two surface 3 walls: one for the actual kerb, and one for the white line/transition mip. Usually needs unk4=2, but beware of traces!


Asphalt, Must have unk4=2


Surface 3 again: white line/transition (I have a fetish for these)


Some more grass


2056 bank starts (hard bank this!). This bank uses different textures for top & sides. Height is about one metre.


In this bank is another wall that looks like a fence, and another wall being a row of people ( the 2 2056's). This is followed by a type4, a 3do, a type6, then the obligatory 2056w/height (row of trees on this occasion) and finally the type 10 wall.


Whew!

Updated 29-Jan-2001

Transferred to the wiki: 16.04.2009