Jump to content


Track building basic tutorial


  • Please log in to reply
202 replies to this topic

#1 Bernd Nowak

Bernd Nowak

    Denny Hulme

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 1,716 posts
  • Gender:Male
  • Sim interest:GPL

Posted Apr 02 2009 - 05:38 AM

I wanted to add a basic tutorial how to build a track for GPL. But mostly for dummies like myself.

I went over to this site and followed it http://home.online.no/~bi-knu/editing/.

Now I have doen the faboulus oval and may have understand what I did until the original tutorial reaches Part 5 Adding Objects.

Now I'm stunned. OK, it tells that they are speeding but some steps first helping me to understand what I do :)

Part 4: Adding Textures (http://home.online.n...rktuto/four.htm)

I took a close look with Winmip and checked the mips. I have attached a screenshot of the found mip files to the needed from the mytrack.tex file.

0 0 0 10.0 10.0 error  
1 0 0 10.0 10.0 asphalt  
4 0 0 10.0 10.0 grass  
6 0 0 10.0 10.0 gravel  
2055 0 0 10.0 10.0 hay 
2055 0 1 10.0 10.0 hay 
2055 0 2 10.0 10.0 hay 
2055 0 4 1.0 1.0 hay 
2055 0 5 1.0 1.0 hay 
2056 0 1 10.0 10.0 trees  
2056 1 1 10.0 10.0 barrier

Syntax is clear but the different MIP file types not (Type, Mapp, Sub-Im). If some nice soul could help me here.

Then we proceed fast to part 5 adding side objects (http://home.online.n...rktuto/five.htm).

This section must be changed to the trk23doz format and there need to be added a HSV file. My question to make life simpler would be to proceed without adding side objects at this stage as it looks like as soon as I have a 3DO I can add things with different programs to the track.

What I have so far:

mytrack.gtk (with 7 sections)
mytrack.tex (assigning textures to walls)

Maybe I have

I have no pitlane (need to figure out how to add this)

What is needed now to create a running track ?

Help is appreciated :)

Attached Files


Edited by Bernd Nowak, Apr 02 2009 - 05:43 AM.


#2 npattinson - guest

npattinson - guest
  • Guests

Posted Apr 02 2009 - 01:11 PM

View PostBernd Nowak, on Apr 3 2009, 12:38 AM, said:

Syntax is clear but the different MIP file types not (Type, Mapp, Sub-Im). If some nice soul could help me here.
MIP types differ in the following respects -

Transparency - a mip may be either be

1) opaque
2) opaque or completely transparent on a per pixel basis. I'll call this Transparent.
3) opaque, completely transparent, or partially transparent on a per pixel basis. I'll call this Semi-Transparent.

Colour bits - how many bits are used for each of red [R] green [G], blue [B] and alpha [A], alpha being the transparency.

Palette - does the mip use a palette or not. A mip with a palette has a limited number of different colours, in GPL that limit is always 16. A mip with a palette always has 8 bits each for RGBA. Mips with palettes are smaller, since rather than storing the colour for each pixel, which takes up anything from 16-32 bits, they store the number of the colour in the palette, which only takes 4 bits.

Now for the types.

T0 - Has Palette, Opaque, R8, G8, B8, A8 . NB the 8 alpha bits are unused.
T1 - Has Palette, Transparent, R8, G8, B8, A8. NB the only values used in alpha should by 255 (opaque) and 0 (transparent)
T2 - Has Palette, Semi-Transparent, R8, G8, B8, A8
T3 - No Palette, Opaque, R5, G6, B5, A0
T4 - No Palette, Transparent, R5, G5, B5, A1
T5 - No Palette, Semi-Transparent, R4, G4, B4, A4
T7 - No Palette, Semi-Transparent, R8, G8, B8, A8

Type 7 is only supported in my rasterizers, the older rasterizers had only partial support for it. Type 6 does exist, but again the support in the older rasterizers was incomplete, and the code for it in my rasterizers is wrong :( It probably had little practical benefit over type 3 anyway.

In general I don't think you're ever forced to use a particular mip type. But no doubt there are practices that are commonly adhered to. For instance I imagine the number of different colours you need in an asphalt mip is generally small and it's always opaque, so asphalt mips probably tend to be type 0.

I imagine Sub-Im is the number of sub images. Each mip contains a full sized image, and a number of smaller images each with half the number of pixels of the previous one in both height and width. Mips always need height and width to be powers of two.

Not sure what Mapp refers to, but it could be whether the texture is repeatable or not. Things like asphalt and grass textures are designed to be repeatable, their left edge matches the right edge and similarly for the top and bottom edges. By contrast things like car skins are not repeatable. Repeatability can be controlled separately for left/right and top/bottom.

Nigel

Edited by npattinson, Apr 02 2009 - 01:13 PM.


#3 Nurby Yogi

Nurby Yogi

    Denny Hulme

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 369 posts
  • Gender:Male
  • Location:25km from green hell
  • Sim interest:GPL

Posted Apr 02 2009 - 01:40 PM

View PostBernd Nowak, on Apr 2 2009, 01:38 PM, said:

Syntax is clear but the different MIP file types not (Type, Mapp, Sub-Im). If some nice soul could help me here.

Hallo Bernd,

Here I have learned something. :P
(hier habe ich etwas gelernt.)

http://gplmz.bcsims....ansparent area
Have a look at toomis post.

http://gplr.bcsims.c...p?showtopic=247
Have a look a Ginettos post.

Perhaps it helps.

Greets Yogi

#4 Bernd Nowak

Bernd Nowak

    Denny Hulme

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 1,716 posts
  • Gender:Male
  • Sim interest:GPL

Posted Apr 03 2009 - 12:31 AM

Now that was help indeed :)

Thanks Nigel and Yogi !

I will try to explain some basic MIP stuff first :)

#5 Bernd Nowak

Bernd Nowak

    Denny Hulme

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 1,716 posts
  • Gender:Male
  • Sim interest:GPL

Posted Apr 03 2009 - 01:06 AM

OK,
here's how I have read the MIPs for the tutorial and again some questions:

Quote

For the mips used in this example:

ASPHALT.MIP:

Its' a type 0 MIP which has Palette, Opaque, R8, G8, B8, A8 . NB the 8 alpha bits are unused.
There are no subimages
The bitmap is 256*256
Mapping is 3 which means it will be stretched vertical and horizontal (which seems very unusual. Mostly it's mapping 0 which means it will be repeated vertical and horizontal)

GRAVEL.MIP

Again it's a type 0 MIP which has Palette, Opaque, R8, G8, B8, A8 . NB the 8 alpha bits are unused.
There are 4 sub images which have sizes 128*128 (first) and the 4 sub-images 64*64, 32*32,16*16,8*8
Mapping is 0 which means it will be repeated vertical and horizontal

HAY.MIP

Its' a type 0 MIP which has Palette, Opaque, R8, G8, B8, A8 . NB the 8 alpha bits are unused.
There are 4 sub images which have sizes 128*64 (first) and the 4 sub-images 64*32, 32*16,16*8,8*4
Mapping is 0 which means it will be repeated vertical and horizontal

TREES.MIP

It's a type 1 MIP which has Palette, Transparent, R8, G8, B8, A8. NB the only values used in alpha should by 255 (opaque) and 0 (transparent)
There are 5 sub images which have sizes 256*128 (first) and the 5 subimages 128*64,64*32,32*16,16*8,8*4
Mapping is 2 which means it will be repeated horizontal and stretched vertical

BARRIER.MIP

It's a type 1 MIP which has Palette, Transparent, R8, G8, B8, A8. NB the only values used in alpha should by 255 (opaque) and 0 (transparent)
There is 1 sub image which have sizes 256*32 (first) and the 1 subimage 128*16

As you can see the asphalt.mip has mapping 3 which I have checked with asphalt.mip from GPLPS installer and they all have mapping 0 and different sub images.

That leads to my second question why there are with only 5 mips so much different sub images ?

And for Nigel, I used RaceCon and RaceCon shows Repeat Horizontaly = yes, Repeat Vertically = yes for MIP mapping 3. Or is PapyBMP the tool to be used instead of RaceCon ?

Still I need to check how to create the track and what I need else :)
I have the GTK and the MIPS. It seems easy to create the MIPS but certainly needs some page on the Wiki telling a bit about MIPS and how to work with them :)

#6 Bernd Nowak

Bernd Nowak

    Denny Hulme

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 1,716 posts
  • Gender:Male
  • Sim interest:GPL

Posted Apr 03 2009 - 01:09 AM

I should attach the MIPS :)

Attached Files



#7 npattinson - guest

npattinson - guest
  • Guests

Posted Apr 03 2009 - 05:21 AM

View PostBernd Nowak, on Apr 3 2009, 08:06 PM, said:

That leads to my second question why there are with only 5 mips so much different sub images ?
I'm not 100% sure about this, but I would expect all mips to have enough sub images so that the smallest one is quite small. Some random original Kyalami mips I checked went down to 8x8, 8x4, 8x2, or 8x1. So maybe Papy's practice was to reduce until the longer side was 8. If the shorter side reaches 1 you definitely need to stop at that point though.

View PostBernd Nowak, on Apr 3 2009, 08:06 PM, said:

And for Nigel, I used RaceCon and RaceCon shows Repeat Horizontaly = yes, Repeat Vertically = yes for MIP mapping 3. Or is PapyBMP the tool to be used instead of RaceCon ?
No, RaceCon is better for identifying all details of the mip. I know I had some confusion in my code at one point about which way around these were, but I would have thought it was ok now. I checked out the original Kyalami asphalt.mip and that shows as repeatable in both directions which must be right I think.
Incidentally I don't think the term 'stretched' is really correct, 'clamped' is the term used by OpenGL documentation and elsewhere.

Nigel

#8 Bernd Nowak

Bernd Nowak

    Denny Hulme

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 1,716 posts
  • Gender:Male
  • Sim interest:GPL

Posted Apr 03 2009 - 06:11 AM

OK. After some crazy stuff (C++ Expection error in trk23doz.exe) and a lot of edits it finally compiled. But some hazzle to get able to drive it :)

The obvious thing was to edit 67season.ini file. Done.
But a lot more had been missing !

To drive around my great oval I found that the mytrack.3do needed a grass.mip. Ok I know that it was defined in the mytrack.tex file. I borrowed me some from another track. Would have been nice if trk23doz.exe would mention it :)

Next I read that I needed a horiz.3do which I borrowed again including the various horizXX.mips. No good.
Using sciss.exe I noticed I need a sky.mib and a ground.mip. Same procedure, once again borrowed from another track.

Same for track.ini as well as page0.pbf, page1.pbf and page2.pbf.

Now to edit the page0.pbf seems easy.

A pitlane is missing. How to add this ?

I need to correct the pitlane stalls (It's raining cars ) :)

I need to fix the borrowed horiz.3do to have a horizon which is adjusted to my small oval and need some tips how to do this.

For the TV1, TV2 and Pitlane Cam I used TrkCAMEditSetup.exe which seems to work.

And if I have all that I need to add some side objects as well as some AI.

I'm open for all tips and at least I can say that I have created a track for GPL :) As soon as I have finished the missing bits I will try to write a tutorial, based on the great GPL track creating guide. Interesting stuff for sure :)

#9 npattinson - guest

npattinson - guest
  • Guests

Posted Apr 03 2009 - 06:27 AM

View PostBernd Nowak, on Apr 4 2009, 01:11 AM, said:

For the TV1, TV2 and Pitlane Cam I used TrkCAMEditSetup.exe which seems to work.
CamEdit is an alternative, it can be found in the Tools/Utilities section here.

Nigel

#10 npattinson - guest

npattinson - guest
  • Guests

Posted Apr 03 2009 - 06:35 AM

View PostBernd Nowak, on Apr 4 2009, 01:11 AM, said:

A pitlane is missing. How to add this ?
I'm not sure as far as track.3do and .trk are concerned. But the entries in track.ini are tricky, and the AI often don't work during practice if they're wrong. My advice is to find one of the original 11 tracks with a similar pitlane location and use its track.ini as a model. By similar I mean, are the pit stalls all before the s/f line, all after, or some before and some after ?

In the case where some pit stalls are before and some after the s/f line, you need to know precisely how long your track is, and the answer may not be what you think. RaceCon shows the answer as the 2D length of the trk file. It may be useful to know this length in any case.

Nigel

#11 MECH

MECH

    Double poly killer

  • Administrators
  • PipPipPipPipPipPipPipPipPipPip
  • 2,403 posts
  • Gender:Male
  • Location:Here ->
  • Interests:My Girlfriend
  • Sim interest:GPL

Posted Apr 03 2009 - 09:04 AM

View PostBernd Nowak, on Apr 3 2009, 02:11 PM, said:

A pitlane is missing. How to add this ?

I need to correct the pitlane stalls (It's raining cars ) :)

Look at the helpfile in AiEdit it has a lot of the track.ini parameters explained.
There are also some problems described as well as some points to consider while making Ai.  ;)


Btw, if you are on the point of creating ai be sure to test the pitlane exits of the cars in all modes.
I've seen some pitstalls were the cars could get on track in novice but not in expert mode.
I believe this has to do with the amount of space between the pitstalls. If you set it to short the longer cars won't get out of the pits.


#12 Bernd Nowak

Bernd Nowak

    Denny Hulme

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 1,716 posts
  • Gender:Male
  • Sim interest:GPL

Posted Apr 03 2009 - 09:31 AM

The AI is the smallest problem at the moment because I must first create the pitlane and second find a way to place trackside objects as well as a lot of other stuff :)

But thanks a lot for looking at the AiEdit help file. Sure will do :)

#13 S.Beuchert

S.Beuchert

    Denny Hulme

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 636 posts
  • Location:2hr's from the Ring
  • Sim interest:GPL

Posted Apr 03 2009 - 10:56 AM

someday in the past there was a german Version of the GPLEA Trackbuilding Tutorial.
Translated by the WSRT
(Wild South Racing Team, Website is longe gone, they made this track : http://gpltd.bcsims....hp?track=wildsr  Wild South Raceway)


Thats what I have :
Attached File  Trackediting_Deutsch.rar   2.95MB   52 downloads







Maybe also for some interest for you
http://gplr.bcsims.c...hp?showtopic=99

#14 Bernd Nowak

Bernd Nowak

    Denny Hulme

  • Members
  • PipPipPipPipPipPipPipPipPipPip
  • 1,716 posts
  • Gender:Male
  • Sim interest:GPL

Posted Apr 04 2009 - 04:35 AM

Thanks Swen !

Interesting Excel sheet. Do some guys know or have the Track Calculator excel sheet ? And is there an another method of getting the excel data into GPL TRK ?

I think I have managed to put in a part for the pitlane.

Just a question:

[ pit_lane_0 ]
lane_on_right = 1			; 0 if lane on left, 1 if on right
lane_has_wall = 1			; 0 if no pit wall, 1 if pit wall exists
lane_bounds_dlong = 4613.9 639.0	; start/end dlong of the pit lane
lane_bounds_dlat = -18.1 -6.3		; start/end dlat of the pit lane
pit_board = 11.0 140.0 -100.0 100.0	; dlat of board, dlong of board, dlong LOS start, dlong LOS end (last 2 not used)

what is the measurement of the lane_bounds_dlong/dlat/board ? Is it decimal units ? Is it measurd from 0,0,0 of the track and where is 0,0,0 ?

Similiar question for this section:

[ pit_lane_0 ]
stall_0 = 255.00 -16.20
stall_1 = 241.74 -16.20
stall_2 = 228.47 -16.20
stall_3 = 215.21 -16.20
stall_4 = 201.95 -16.20
stall_5 = 188.68 -16.20
stall_6 = 175.42 -16.20
stall_7 = 162.16 -16.20
stall_8 = 148.89 -16.20
stall_9 = 135.63 -16.20
stall_10 = 122.37 -16.20
stall_11 = 109.11 -16.20
stall_12 = 95.84 -16.20
stall_13 = 82.58 -16.20
stall_14 = 69.32 -16.20
stall_15 = 56.05 -16.20
stall_16 = 42.79 -16.20
stall_17 = 29.53 -16.20
stall_18 = 16.26 -16.20
stall_19 = 3.00 -16.20

From testing I believe that -16,20 points to the right side from centerline with a distance of 16.2 (decimal units/meters/feet ???) :)

But from where is the 1st parameter been measured ?

How do you add flagmans and brake markers ?

How to work with the horizon ?

#15 npattinson - guest

npattinson - guest
  • Guests

Posted Apr 04 2009 - 04:40 AM

View PostBernd Nowak, on Apr 4 2009, 11:35 PM, said:

what is the measurement of the lane_bounds_dlong/dlat/board ? Is it decimal units ? Is it measurd from 0,0,0 of the track and where is 0,0,0 ?
Almost all the measurements in track.ini are in meters, and they tend to be longitude and latitude. So the longitudes are always positive, with 0.0 being the start/finish line. Latitudes can be positive or negative, negative is right of center, positive left of center.

View PostBernd Nowak, on Apr 4 2009, 11:35 PM, said:

Similiar question for this section:

[ pit_lane_0 ]
stall_0 = 255.00 -16.20
Longitude and latitude of the stall, again in meters.

Nigel




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Sim Racing Links