This is version 2.0, not indicating that the tutorial has made a big
step forward (it has not) but it seemed like a nice number to end my involvement
in the scenery tutorial. That means, that unless some major breakthrough
is discovered, you are looking at the final version of this document. If
you don't like that, or want to notify me of something concerning this
tutorial, contact me at m.p.j.keizer@sepa.tudelft.nl
In this document, I will try to share the knowledge I accumulated over the last months about the editing of GP2-scenery structures.
Therefore I would like to start with some theoretical basics you have
to know about when trying to understand what I try to make clear. Then,
an overview of the commands used while editing scenery, from Addie’s Command-library,
supplemented by some practical tips concerning the use of these commands.
This is followed by a step- by -step guideline how to build the scenery.
In chapter 4 I made some drawings of basic structures and formations as
examples of scenery-editing. The appendix contains some things I couldn't
place elsewhere, like a FAQ and version updates. But first:
Also credits to addie, for finding the basics about scenery editing (amongst other subjects as pilanes etc.), and taking the time to write it down in the command-library, pitlane-tutorial and GP2-trackediting tutorial. Without him, command 0xB8 would still be unknown!
I would also like to thank everyone who found out thinks for GP2, it
becomes even more clear you can't do it all yourself. The funny thing is,
you don't have to! So I use sometimes pieces of information that are not
originally my own finding, but rather combinations of different sources
and quick notes by someone, that I tried to take together in a comprehensive
and easy-to-read form. So when you think your name should be explicitely
called in this tutorial, let me know, and I'll add you to the following
list of contibuters!
John Verheijen, Swervin' Irvin', Snqqpy.dog, Glenn Durden, Michael
Hompus, Babbel, Bob Culver, Jason Sinnbeck,
And of course to all trackeditors that keep making even-better-looking
tracks. On one hand I really hate that, because it costs so much more time
to make a decent track relative to others! But I really hope this tutorial
helps all trackeditors to enhance their tracks to a next "generation".
You can determine where the arms will end up by looking at this compass. You see a full 360-degree turn is from 0 - 65535, or, if you like, from -32767 to 32768. Using non-perpendicular swivel-arms can be useful if you want to make sure that arms of scenery-commnds of different tracksections do not overlap one-another, for instance in a sweeping section or a tight hairpin.
Unfortunately, the swivel-arms do not (yet) show up correctly in the
trackeditor. They are all drawn as if perpendicular to the track. So you'll
have to use your imagination for now. Alternatevly, you can use the trackeditor
of Iso-Hannula to view the correct location of the ribbons.
Note that if you change the Scenery1 (0xB8) a2 value in the middle of your track, that a ribbon has to cross the track. That gives sometimes an ugly scenery flash. Therefore you have to switch the ribbons off temporarily. How to do that will be explained later.
In this document I normally presume, for most cases, that the ribbons
are equally distributed. Otherwise it will be explicitely announced.
Because the ribbons can show up on any side, I will try to explain the numbering with the following drawing.
Imagine a tunnel. You see that the ribbons are numbered consecuative. Note that it is NOT necesarry to know in this case how many ribbons come from the right, and how many from the left. So look at a2, number of ribbons to the right, as a determination of WHERE these ribbons are cut into a number to the left and a number to the right. If you remember this picture, you will also be able to see easily why you have to rotate the texture on ribbons to the left, and not on the right.
So from right-down to left-down we find the texture-location values: "19,11,12,13,14,18".
If there’s a "cut" in the middle ("2") then the right side constitues of (from bottom) rightbank (19), ribbon1 (11) and ribbon2 (12). The left side constitues of (from bottom) leftbank (18), ribbon4 (14), ribbon3 (13).
In the case there’s a value (Scenery1 (0xB8) a2=3), then the rightside consistets of rightbank (19); ribbon1 (11); ribbon2 (12); ribbon3 (13). The leftside is (f.b.) leftbank (18); ribbon4 (14);
I expect you will see the logic in this, and work the other situations
out yourself.
You could however also use the main scenery-ribbons to make a pitbuilding
that is visible from the pitlane as well as from the main straight. Therefore,
you must enable the ribbons near the start/finish-area, and make the ribbons
start at the edge of the pitlane-road. You can (for instance) make pitboxes
that seem to be carved out of a high rock. An example of the use of pitlane
scenery can be found on the "StuwLake" track.
Here you see two different solutions to the same problem. The aim is
to build a bridge. Both setups are with three ribbons to the right. On
top you see that the visible side of the ribbons (marked in a light pink
here) is faced down on the side where it matters, the water and the trees
to the right. That means that you won't see any of this scenery; it's all
transparent. On the bottem-drawing, you see that basically the structure
is the same, but that the direction in which the ribbons to the right are
defined, is flipped. All of a sudden, the visible side of the ribbons
is faced up, and thus you can now see the water and the trees. Note that
the right bank is to be removed here, and is therefore dotted.
a1: Offset Into Sector (for the 0xaf/0xb8 pair)
a2: Angle Of Left Arm; (useful: negative value); -16384 (90° to
the left)
a3: Angle Of Right Arm; (useful: positive value); e.g. 16384 18432
20480 24576
In a single track-sector there can also be several pairs of 0xaf/0xb8
them with different offsets in cmd 0xaf(175).
See paragraph 1.4 for an example.
In the top image the value is 16384 (its a right arm; left arm would
be -16384). The value in the middle image is 20384. The value in the bottom
image is 12384.
for more details on the angle value, see compass chapter in glossary.
There are also the cmds 0xc0 (192) and 0xc1 (193). They act basically
as cmd 0xaf (175) but they define just a single swivel arm. see following
sketch:
a1: Offset Into Sector
a2: Location Code Type B
Default: Ribbons/Banks off
For switching them on, use 0xb9 or 0xd9.
Do ONLY insert this cmd at the same position as a 0xaf/0xb8, 0xc0/0xb8
or 0xc1/0xb8 pair. (see original tracks for reference). NEVER have it alone.
If you do,
gfx bugs of the strange kind may happen.
When you see it, you will recognise it. Its a floating line starting
somewhere around the border of the iamge leading into the "helmet of the
driver".
Before going on you may first want to have a look at the cmd 0xaf(175),
0xc0(192) and 0xc1(193). Because these cmds do define the offset into the
sector and
number and angle of the swivel-arms.
If number (1 or 2) and angle of the swivel-arms is defined, you can set up the structure of the swivel arms with 0xb8 (184).
Arguments:
a1: unk; ?always 0
a2: values 0..4 basically it gives the location of the track within
the 6 ribbons. You can also refer to it as the number of ribbons to the
right of the track
a3 .. a14: coordinates of ribbons, as can be seen in the sketches
Origin of x- and z-coordinate is the middle of the track.
When double-clicking on a cmd 0xb8 in the track tree, the scenery editor
opens and you see a cross section of the choosen scenery structure cmd.
There you can
set the several arguments and immediately see what happens. If you
are new to it, you may want to check out a2 "ribbons to the right" at first.
PH: Scenery is determined as a series of RIBBONS that run along the
side of the track these ribbons are defined by the scenery commands along
the tracks, all this
defines the actual shape of the scenery, you then have to map a texture
to the scenery in the same way as you map a fence or gravel trap using
the (0xbc commands)
by changing the location code in the 0xbc commands from left/right
verge to fence or ribbon you can change the look of the scenery
it seems that the 0xc8 commands at track section 0 also change the default scenery used for the ribbons.
You should think of the ribbons as being continuations of the grass
verge only the height about the road can be defined as can the distance
from the road hence giving
the ribbon a low x( horizonal) and a high z (vertical is going to make
a vertical wall (outside the track fence, hence monaco) now map a brick
texture to it and you
have a real wall. map a set of trees to it and you have a forest a
la monaco or hockenheim, map grass to it and you get a grassy hill ala
Brazil.... getting the picture
yet!
You should think of the ribbons there are six of them (not always 3
each side (this is defined by a2) as providing you with extra surfaces
simply to map textures.
[actually there are 4 of them; the very first ribbon to the right and
the very first to the left of the track is called "bank" in GP2]
addie: the maximum number of cmds 0xb8 seem to be 128. if you insert
another one, the very last of them in the track gets lost. MK experienced
even crashes
here.
a1: Offset Into Sector
a2: Location Code Type B
Do ONLY insert this cmd at the same position as a 0xaf/0xb8, 0xc0/0xb8
or 0xc1/0xb8 pair. (see original tracks for reference). See 0xb0 for an
example of a
gfx-bug that can happen when not following this rule.
To switch them off again, use 0xb0
Default: Ribbons/Banks off
most of the time a2 is equal a3; exeptions e.g. in f1ct03 f1ct05
MB: take a look at the 0xba cmd. it does about the same as connect [bridge] fences...
MK: This command is used to force the scenery to "shortcut" the track.
When scenery is made in a curved tracksection, normally the scenery follows
the curvature
of the track. When this command is used, the scenery makes a shortcut,
thus following a STRAIGHT line between two scenery-connection points (0xB8
cmds).
Note that the scenery5 command is a SWITCH that can be set for some
part of the track, and some ribbons using the location code.
The a2 value (and/or a3 value) indicates to which ribbon- locations
the command is applied, you can thus force individual ribbons to shortcut.
Normally, you use this only on the INside of a corner.
See also section 3.5 [in scenery tutorial]
a1: Offset Into Sector
a2: Angle Of Arm; (0xc0: useful: negative value; 0xc1: useful: positive
value)
For extensive description of the meaning of swivel arms, see cmd 0xaf
(175).
a1: Offset Into Sector
a2: Location Code Type A
a3: Length; (of the darkend or light up zone)
a4: Light Up Or Darken Factor; MK: seems to be between 0 (dark) and
15 (bright).
Example in Monace t22-t24
In this example the cmd 0xcd (205) is used to lighten up the frontwindows
of the massenet-hotel. Or in technically terms: to lighten up the texture
on ribbon 4.
a1: Offset Into Sector
a2: Location Code Type B
Do ONLY insert this cmd at the same position as a 0xaf/0xb8, 0xc0/0xb8
or 0xc1/0xb8 pair. (see original tracks for reference). See 0xb0 for an
example of a
gfx-bug that can happen when not following this rule.
To switch them off again, use 0xb0
Default: Ribbons/Banks off
Type <A> Location Codes
used for scenery7, 0xD0?, 0xC7?
Type <B> location code
used for Scenery4, Scenery2
Type <0xBC>
used for 0xBC, 0xC8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
In the right part of the table, you'll see an example of the calculation
of an situation, where the goal is to change the lightlevel of the entire
right side of the track. Then, you'll have to insert a Scenery7 ( 0xCD)
command, which should be applied to the right fence, the right verge, the
right bank, and the right ribbons 11 and 12 (in case of [0xB8;a2=2]). So
you add the type <A> values of these places, and add thus 2+32+128+256+512
= 930. This value is placed in the a2 of (0xCD).
· Make sure that every Scenery1 (0xB8) command has
an accompaning Scenery3 (0xAF) command.
· Remove ALL 0xB0; 0xB9; 0xBA; 0xC0, 0xC1, 0xD9 commands.
· Insert a Scenery4 (0xD9) command in the first tracksection
with a2=63.
With these simple actions you are able to make simple scenery-tracks like the Tunneltrack I built.
Now, you can build some basic structures by adjusting the Scenery1 (0xB8)
values. The way to make it look like a specific thing, like trees, is to
map a texture on the ribbons using the 0xBC command. But that’s a story
that will be told elsewhere…
You should look at this pair as being practically one command, split
in two parts. They should always remain together, else you will get errors.
Note that you can also form pairs 0xC0 - 0xB8 and pairs 0xC1 - 0xB8. These
pairs define the scenery on only one side of the track. More on that in
section 3.5.
In the TE 1.6.7 there is a good representation of the distance a ribbon has to the track. So this will certainly point you to situations where the ribbons make the error described here.
Secondly, a graveltrap on the outside of a corner means that the verges are a lot further form the track than elsewhere. That means, you also have to move your scenery backwards, as otherwise, you will have some scenery overhead when you accidentally drive through the graveltrap.
Another way to create a similar (yet slightly different) effect is by using an 0xC0 or 0xC1 command, instead of the 0xAF command. By doing that, you refrain from defining the scenery on both sides of the track, and choose to define only one. I will make a drawing to clearify this:
I would like to emphasize I drew the ribbons curved, like they appear
in the game, but NOT like they appear in the Trackeditor.
On the left, you see a normal defined scenery, with 0xAFs and 0xB8s.
In the middle, you see the real situation when one of the 0xAFs is replaced
with a 0xC0. This command defines only the left side, making the game connect
the rightside ribbons without taking this 0xC0 and it's accompanying 0xB8
into account.
On the right side, you see that the first curved section has a scenery5,
0xBA command. That causes the ribbons to go straight WITHIN that particular
tracksection.
Note that the scenery5 command is a SWITCH that can be set for some part of the track, and some ribbons using the location code. There is also another command that influences this setting in some way, I believe 0xC7 or 0xC6. You are warned!
The work on Circuit Ultima set me on this. In the Casino corner,
there is a building to the right, made of ribbons. You should examine this
building closely, it's extremely complex, and cost me a few hours to understand.
In t25, the second scen1 (offset 1) defines the right side of the
facade of the building. After that, there follow in t27 three scenery-lefts.
Then in t29, there is a scenery-left (0xC0) , followed by a 0xAF. At this
moment, 4 Ts later and over 4 scenery-lefts, the building-definition continues.
In the meantime we have rounded a 120 degree righthander. Yet, the building
is flat. That's quite logical, as I can't make a guess WHICH curvature
should be taken, if you have crossed four tracksections. That let me to
the conclusion that it would make more sense if it was a straight line
from one definition to the other.
In the meantime, from TE1.6.9 or so, the multiple-scenery cmds is very well implemented in the trackeditor, and this should no longer lead to any problems. It is just good to know that it is possible to use more scen1's in one TS. They all must have a 0xAF or 0xC0/1 before them ofcourse, otherwise things will get mixed up. The offset that you put in the 0xAF/0xC0/1 is used by the 0xB8 to define where it's located. This particular thing is not yet implemented in the TE, and all scenery definitions appear to have taken place at the start of the TS.
The main way to switch ribbons on is using the Scenery4 (0xD9) and Scenery
2 (0xB9) commands.
The way to switch an individual ribbon off, is using the 0xB0 command.
The values in the arguments of these commands indicate a texture location,
of type <B>.
In this picture you see how it works. The bars indicate whether a ribbons
should be switched on or off at a particular tracksection. You should have
a picture like this in your head, when you're making the scenery. Now,
you see on this picture where you have to insert the commands in order
to get the commands switched on and off. Between bracketts, I have placed
the appropriate a2 value of the particular command. On the right you see
the <B> type location codes, directly from the location-table
in 2.2. Note that every command has to be inserted at the first tracksection
in which it should work. For example, the first command should be inserted
in t1, and the last one in t19 (not drawn in the picture)
Paul Hoad has made a drawing in the TE just like this, so you can monitor where your ribbons go in case you miss one. It is accesible by clicking a 0xB8 in the pitlane, or on the track.
Switching a ribbon to another side therefore usually implies to switch
a ribbon off, and on again. To know which ribbon you have to switch off
can be figured out, but as an extra service I put a table here. Note that
the back-switching implies the temporarily switch-off of the same ribbon
as the switch-forward.
ribbons to right | 0 | 1 | 2 | 3 | 4 |
0 | X | 1 | 1,2 | 1,2,3 | 1,2,3,4 |
1 | 1 | X | 2 | 2,3 | 2,3,4 |
2 | 1,2 | 2 | X | 3 | 3,4 |
3 | 1,2,3 | 2,3 | 3 | X | 4 |
4 | 1,2,3,4 | 2,3,4 | 3,4 | 4 | X |
By the way, this method does not work always. It's partially an unknown
section of scenery-editing, and I can't really help you much here. Trial
and error is the thing, unfortunately. One way to help you is this: Apply
in the trouble-zone (temporarily) a good recognizable, and different texture
to all ribbons, like water or gravel. This way, you can easily spot in
the game which ribbon# gives the problem.
This command does not apply to objects. For objects, there are other
commands that define the lightlevel, but these are still unknown.
Normally, if you just change the number of ribbons to a side, and adapt
the 0xB8 values, there will be a piece of scenery crossing the track. Sometimes,
though, you are lucky and are bug-free. But if you're not, you obviously
have to switch off a ribbon for one TS. The problem it, to determine which
one. A method that works is to put a different texture to each ribbon,
and then you can easily spot which one is crossing the track. Then you
know which one has to be switched off. A bit of a trial and error, but
I can't think of anything else right now.
If you come up to a certain structure that you wonder about, let me know, and I can include it.
The hill is the right side of the track. Note that the slopes of the
bank and the first ribbon are equal, the split is made because of texturing-
use.
The thing that makes a wall look like a real wall is ofcourse the texture. But I initially decided that texturing commands and uses are outside the scope of this tutorial. If anyone feels it should be included, let me know.
Here you see trees on both sides of the track, the vertical ribbons (12 and 13). The right side has a small hill, on top of which the trees are build. On the left side, this hill recedes a little near the trees, giving an increased idea of depth.
Left you see the grandstand used in the original Brazil track, before
start/finish. It's just a plain slope, covered with crowd-texture. The
main advantage of using ribbons for grandstands, over objects, is that
you can easily curve the grandstands. That can be seen too on the original
HockenheimRing, where the grandstands are curved for a long way. In the
middle you see the grandstands that are build there, where there is a little
roof build. The dimensions are a bit exaggerated, for clearity reasons.
On the right you see a made-up grandstand, which you can find on the Elkhart
Lake track (by Romeo and me), where the stands consists of two rows, clearly
set apart by a vertical ribbon with another texture. These places are ideal
for some advertisements.
The illustrations used in this tutorial show the ribbons and banks colour
coded so as to make it simpler to understand which ribbon is doing
what.
Here is the key to the colour coding.
< tunnel_0.jpg >
OK. Lets get started. In the diagram below we are locating the ribbons
to form
the outer bases of our hill. Hence the large X values to take them
out a long
way out from the track, and the absence of height (all Y values = 0)
since our
hill will naturally be starting from ground level.
< tunnel_1.jpg >
With the track section 2 scenery command we start to raise the ribbons
and bring
them back towards track, thus creating the start of our hill.
Note: For the values used in this tutorial, track sections 1 &
2 should be in
the order of 10 units length to give a nice result.
< tunnel_2.jpg >
The scenery command at the start of TS#3 is really just a continuation
of the
trend set by TS#2 scenery values. Remember that the rate of rise (gradient)
of the hill through TS #1 is controlled by the values at the start
of TS#2,
and that TS#2's gradient is controlled by TS#3's values. The reason
that this
had been pointed out is that if you study the Y values between the
TS#2 command
and the TS #3 command you will notice that about 55-60% of the rise
of the hill
occurs DURING TS#1, and TS#2 is left with about 40-45% of the remaining
height
that makes up the Y co-ordinates total value at TS#3. This gives our
hill a
"rounding off" effect.
Remeber that both TS#1 & #2 have to be of a similar length for
this to be valid.
< tunnel_3.jpg >
You could leave out TS#2 altogether and just have a straight hill rise
to the
start of TS #3. Alternately, you could put more sections in for an
even nicer
rounding effect on the hill side. Whatever you feel like!
You have no doubt noticed that Ribbon 3 finishes TS#2 (i.e starts TS#3)
at the
same co-ordinates as ribbon 4. That is because we have to turn ribbon
3 off for
it's journey through TS#3 as it must cross the track. If it was still
higher
than Ribbon 4 we would see it suddendly stop when turned off. Not very
pretty.
So we piggy-back it briefy on ribbon 4 to hide it's changing of state.
To this extent, TS#3 must have an 0xb0 command to turn ribbon 3 off.
The section offset a1 will be 0, and the location code for a2 will
be 4.
Also, TS#3 is typically very short. Just one length unit is normal.
Now to the start of TS#4. Ribbon 3 has crossed the road and is connected
to the
top of ribbon 2. Time to turn it back on. The simplest way is to just
throw in
an 0xd9 with an a1 value of zero, and with a2 = 63. This turns 'em
all on.
Also notice that there has been a slight increase in the hill's height
again.
This is optional, but I think it looks a little better this way.
< tunnel_4.jpg >
TS#4, like TS#3, is also usually just 1 unit in length.
And now last, but by no means least, we reach TS #5; the actual start
of our tunnel.
The values used here are simply copied throughout the length of the
tunnel.
< tunnel_5.jpg >
During TS#4, ribbons 2 & 4 have been lowered, taking the still-connected
ribbon 3
with them. This gives us the front face of the hill that becomes the
roof of the
tunnel in TS#5 once lowered.
When you get to the exit, it is simply a reverse of the entry (except
that you will
still have the 0xb0 before the 0xd9 of course) and then you can adjust
the values to
achieve the desired result. For example, the ficitious Eagles Nest
circuit (available
from Sjon's) shows a nice version of an exit that becomes a hillside
spectator mound
on one side.
The only other thing to mention here is that the track verge values
used are 15. If
you go for a tight tunnel with small verge values, say about 12 or
less, you may
notice that you have flags being waved by a marshall's arm which is
protruding from
the wall on the side of your tunnel. Ghost marshalls perhaps? Kinda
spooky, and not
too reassuring for Schuey, Fissi, Damon & co as they blast on through....
The commands used for view-ahead are 0x81 and 0xBE. Exactly why there are two commands remains unknown, but just remember to put an 0x81 AND and 0xBE in the middle or before every corner. It is advisable to use the same distances in both commands, although not neccesary. For the location code, I would say use 63, but maybe 48 works just fine.
Maybe the best way to check the "view distance behind" commands is by driving the track the wrong way around. Then, you can immediatly spot that for a long straight, the view-command is placed AFTER the straight, not before. So build them in exactly the same way as the view-distances in front, when thinking of driving the wrong way. Use the commands 0x82 and 0xBF.
The units of these commands is the same as the tracklength-unit so you can calculate which values you need by looking at the length of the straight following your command. Most of the time, values around 150 are enough.
- Insert a lot of Scenery3 (0xAF) and Scenery1 (0xB8) commands,
before and after each corner at least. Make sure the Scenery3 command comes
before the Scenery1 command! To do this efficient, insert a scenery3 command
in the first TS, "copy" it, and "paste" it at strategic places. Then, insert
a Scenery1 command at TS0 and fill in some decent values. Now, "copy" this
command, then paste it at exactly the same locations as you put the Scenery3
cmds in. Don't miss any, and don't put in too many. Next, include a scenery4
[0xD9] command [a2=63] in the first TS, like told above. Then, remove all
the influencing commands as explained in Ch3, Guideline.