A 'Top Gear'  test  track simulator
release oct.  07
last page update Jan 08

 

towards followthru

 

For a number of years my imagination had been captured by the GT driving games for the Playstation.  To the extent that I felt many times with the last versions, that I was driving in a real world.    During this period I played about with some driving code for the PC, based on the open source code made public by 'marco monster' , and then adapted, first to blitz basic by 'vorderman' , then to dark basic by 'masked coder'.    The basic code seemed correct,  but I was not convinced it was completely so and tried to add various sub-routines ... just for the effect rather than accuracy.    What was worrying was that it did not drive much like the GT series.

For any dark basic programmer who reads this, and wants to use that same code there are notes and links at the bottom of this page.

A simple track was made to test some ideas, but  a realistic track was never started.  Full collision testing with a 3d world , especially with the limits of classic dark basic, seemed beyond an amateur like me.   Nor did I have a ' 3d world building program'   able to make continuous,  adjoining 3d data which seems to be used for the best games.    I am restricted to placing simple individual 3d objects over a basic ground shape.     

Eventually an interest in the top gear TV program made one wonder if such a relatively simple track might be simulated, and once an internet satellite photo was found the experiment was attempted .... lack of clear images and info. becoming a major problem.


The NZ govt. has provided the local library with free public broadband access lately and I discover there have been 'Top Gear ' tracks made by others.    A fairly basic one for the free 'racer' program, and at least one for the commercial 'rfactor' .. and another more promising one under development I believe.   Also GTR2 has a  track.   Broadband users could search  youtube  for examples though the resolution is low.    The car physics in all those, should be better than that which I have used, but the 'feel' of the control input is important and you would have to test them.   
 Visually ? ....  hmm. can't see them well enough.  

 Have just found a few large images of the GTR2 top gear add on track and its quite good. The graphics engine can show the wire fences in front of some of the buildings (I'm envious) and can show rainy weather.  It should run smoother visually than mine, I imagine.  The buildings are a bit odd in places with approx. textures.   A simple plain grass texture is used.  The track is  an even, darkish bitumen with simplified  markings.   Added  tyres across runway to force turn into bacharach.    There would be many varieties of car to use .. hmmm.   Pity I didn't know about it earlier.   
 Many would like it, though I would prefer a softer, more subtle and varied look overall .... that's what I like in the GT  ps2 series.  Its not the amount of detail or lack of it, it's the skill, the subtlety with which the textures are balanced , to produce the effect of light  and naturalness.  

In any case,  this program was finally completed, and during the process I learned a bit more  about the theory of driving, adding new code where I could.  In particular I tried to get the changes and loss of grip according to theory, in a simple way.     So  I can't  claim accuracy for this sim,  but it does give me a reasonable sense of being on the track, and hopefully, may give interest and enjoyment to others.
It might be worth noting that though using the views zoomed is interesting,  they give  a deceptive idea of the spaciousness of the airfield.    ( Dunsfold Park , for those who don't know.)  
One has often found the replay views in other games, to be too  closely zoomed.   The advantage of your own sim, is that you get to choose all that .. .. and it really is very great fun finding a new view style.    Little work, and lots of result!

The graphics here admittedly fall short of commercial contemporary games .. which games utterly amaze this writer with the graphics power used, and the months of team effort required to build.   This sim. uses older software, and is just one person's spare time effort,  made without any solid real life data on the track.    
  

About the latest download version v 1.4  ... (  please ..     use a joystick if you can. )

The latest change is to a higher resolution track, with shaped, flat objects for the corners.    The bitmaps to produce the higher res. took ages to produce and were so large they had to be converted to jpg  format to fit on this site.  This unfortunately means that there is some colour bleeding and blurring  in use .  Frankly,  I'm not sure it was worth the effort .  But having started  I felt obliged to grind on !  
 Similarly for the addition of specular lighting to the track.  In my mind was the picture of  the way the best sims imitate light reflecting off the bumpy texture of the track.   After many attempts I decided classic dark basic can not do  this effect properly, so for now, I have settled for just a touch of even specular light.  
A more complete set of track arrows and distance markers has been added  ( using some of the older positions as these signs have changed from time to time).    There is also a slight change to the way grass is shown, and the last straight to Gambon is ( after re-checking)  slightly narrower .

Extra later notes .. I came across a driving sim. forum which was using and discussing this program. ( I read it with combined interest/ embarrassment!! )   There was a question about the speed of the replay laps in comparison to a stopwatch.   I had allowed the replays to run free of the speed limiter and they were therefore playing back slightly faster than when recorded.   The time and speed figures displayed were still correct to the original in fact, but to sort the matter out I have made the driving auto - speed limiter   non-optional and applied it to replays as well.
 ( 
Why did I not do this in the first place?  .. um .. because unknown to me until too late to do anything about it , the actual fps rate had not been running at the first specified amount.    Instead it had been uncomfortably low.   It never occurred to me that anyone would time the replays with a stop watch (!) so I thought a free  fps speed might give a slightly smoother replay appearance.    so .. er .. now you know ..   )

Otherwise, it looked to me that a few were getting odd graphical anomalies and textures in wrong places.  I'm sorry to say that since this  sim. uses an older programming language (which has had only one minor recent add on since it was replaced by the Pro version some years ago) it may be that some video cards, drivers or setups may not be compatible.  eg, when I first tested it on another  (win 2000 machine)  I had to  increase the camera view distance, because it was being read differently  and leaving some objects visibly 'wiped' across the screen over everything else.  Likewise, its possible the angle of view is not the same on some computers .. seems a very odd thing to me ,  but ....   I have re-done the images on this page with the high res. track, so at least people can see what its meant to look lke.  Sorry.  

There is a demo slow run so that a first user can follow the course layout from the drivers point of view.
By request,  it now has an option to show a mini map, with a marker for car position.
The  Liana still comes as standard, and  2 upgraded 4WD imaginary versions.
One new option is to set a slightly less sensitive steering response,  for all inputs.

The standard steering response is changed to give close to the true turn radius  (5 meters)  at slow speed, but with less response as speed increases.
The poor mouse control is improved by this non- linear arrangement I think ,  but I still very much prefer a joystick.
( The 'self- centering' mouse can be particularly annoying if you want to turn completely around at very low speeds,  though luckily you don't need that to be able to drive around the track.)  

The keys for accelerator, brake and start of run, are now moved,  so that there can be an option for keyboard only control with the left/ right arrow keys for turning ... .. people wanted this, and it has turned out to be quite reasonable on the slower speed car.    There was a choice between a more smoothed input, ( and a tendency to keep swinging about when not wanted)  and a more positive action that can show up in the replay.   So I put both on, but the more positive one is probably better as speed increases, and for the higher power car versions.   

A request for brakelight function has resulted in  a redrawing of the car texture more accurately ( and quite differently!!) for the rear end and light assembly.   Not as easy to do as thought, since the light shape spreads around the corners of the car.  Needed a new object to be extracted from the main car mesh, and  re-textured with light on.

A new import function will load replays made and logged on another computer.   The replays now use and recognise an invented file tag. >>  "  .rhun  "     ( .. an odd tag intended to avoid anyone else's more logical use of  "  .run  "  ) An old replay can simply be changed manually to that tag and it will be detected for import.   An older replay file may not have the total time integrated and will show zero time in the list if  re - saved as standard.     Files to import should go in the same directory as the standard replays.

A  texture pattern is now applied over the previously  smooth grass areas.  A true grass representation is still  a long way off.   Tests show this fairly low end computer could probably do it,  but  not when using classic DB language.
For now, I have added the option of a finer grass texture.     Two identical sheets of  ' spots'  overlay the two previous ground layers, and from some angles at least, suggests grass quite well to me .  The streams of spots appear to link up and suggest lines in places, even a certain amount of 3d depth .. well, at times.   

One unexpected result of the less sensitive steering option when using the joystick was to make driving the imaginary MAX liana, rather like some of the GT series ... in that  you cannot turn some corners if you approach them too fast.   In theory this can result from exceeding the grip 'allowance' for the tyres with consequent slipping .. ( which can happen normally in this sim. if say, you go too fast into hammerhead and brake ).     But the 'artificial'  lack of turn, is what I actually first liked about the GT series.  It gave a sense of direct control.   Before that I thought cars just  .. well .. always turned and pointed where  you wanted.   As some PC trial sims did.  They might spin out etc. but they felt too  'twitchy' and unsatisfying.  
I could never decide which was the accurate approach,  being unwilling to take my own car to the brink of control loss just to see what happened!       (  In fact the  design and weight of a car can tend toward  either reaction )
What I am now thinking , is that absolute accuracy is not required.   A computer simulation is lacking in a sense of  'being there' .    
Anything which exaggerates or distorts in such a way that you get  more sense of involvement with the road and corners and demands more input ( not just quick flicking of controls at blinding car speed )  is good.

In accord with that idea I have softened the 'springs' of the standard Liana halfway back to the earliest setting, and slowed the damping, the effect being to make the car appear heavier.   This exaggeration ( hopefully), partly compensates for the lack of bumps and shifts coming from the dead level track.  

A small camera bug has been fixed and some graphic 'tidying up' been done ..  and the most visible distant hills now appear with much more resolution .. ( which took a ridiculous amount of experimenting to get right .. nothing seemed to work without unpleasant  side effects  )
 Since some free game sites have picked up this sim. and may have an older version,   I have called this v 1.4  to  distinguish it.     

 

..The link to the ZIP file of the Top Gear  simulator  ( version date  29th  Jan.  08   ... 3.1 megs.. )  >>>    

Just extract this zip file to a directory and click on the exe.     Note that  the program is best located in its own directory since when you save  options or a replay,  they will be placed in the same directory as the main program .... which would get rather messy on the desktop for example.

My computer has an athlon 3000 + at 1.6 mghz, running XP, and uses the integrated ( motherboard) graphics chip.  It handles the program easily enough and I would guess that any modest computer with add on graphics card will do much better than mine.

The program runs on XP or earlier, but I am not sure about vista.  The latest news I have heard is that it should work, but I have  no idea where the replays and saved options will end up.  

For anyone who doesn't know the path taken by the top gear track, here is an image  which was taken high above the simulated track and then made into a  negative version.  
I have drawn over it roughly the path that a lot of drivers seem to take around the track.   It is a 'figure 8'  layout, which probably expalins why so many people complain of getting lost at first.

The red line each side of the first left turn has been thickened.  I've added that because drivers seem to choose different driving lines there.  One of the fastest times I ever did I went right to the outside edge of the track ( from quite early on ) before cutting in.  Most times drivers keep closer in .. and possibly go wider on exit.    In real life, it might depend on the cornering ability of the particular car as to which is the best way.    
( I have just seen the  youtube video from the drivers view, of the 'Ultima GTR'  beating all lap records,  [ if it is not a fake!]  and it also went right out to the edge before turning in.    It is quite uncanny for me, to see the real track so much like this sim. in appearance, though the ultima has a slightly lower view point .  Looks  like a scary, bumpy ride.  )  

Bacharach seems to get entered  a bit later with a sharper turn than shown ...  its quite hard to see until you get there .. and you are going max speed.   Which is possibly why drivers often leave the track just after the corner.    You can get around it without really lifting throttle  ( at least on this sim .. maybe I have the side straight too wide after all .... note ... ahem .. cough .. actually,  the new version is slightly narrower here )    but finding the line, on a broad unmarked sweep of runway, can be a problem .   The corner makers are not as much help as I thought they would be.

track shape   

 By the way, if it was me designing this track, and wanting to create more continuous control interest,  I would define a long curve to follow down the main runway from chicago to hammerhead.  Something similar towards Bacharach as well perhaps.   But then, this is the problem with a wide open runway space.   It is very spacious!  And painted lines across a wilderness of concrete are not as satisfying to me  as a narrower curving track with defined edges.

It was recently announced  that the top gear track will be available as a download for P.S. 3 - for Gran Turismo 5 , in some  'mutually beneficial promotional arrangement'   as far as I can tell.    It will no doubt be a wonderfully realistic track,  very much better than the one here, and with better driving!    So all you P.S. 3 users  and  GT fans may rejoice.

It is possible therefore that this page may not be here for very long , as it may offend some powerful  party.   Or they may ignore it, as it is really a bit of a non-entity and shouldn't affect either .    Or they may never see it ... but .. I don't really know what to do in the meantime.     Oh well,  as long as some people get to try it I suppose.  

And just in case, I can still insert some screen shots  here.   ( It just goes to show that if you take a view in the right place even a rough piece of work looks  reasonable ! )

    first left

chicago

 

hammerhead

 

gambon

 

bacharach 

 

-----------------------------------------------------------

Included here is the original version open source, free to use, dba   code by "Masked Coder" which is the basis of the driving here.   It was written with DB classic, so Pro may require odd changes.    But then, Pro has all these physics engines which probably could do the job better?      
 I have changed the old code so you have a block and spheres vehicle to drive without need for a special 3d model.  It has some very longwinded variable names .. which I suggest you change once you understand the code and start to modify and add to it.   Well .. I did anyway.   
The link   >>
   

And I have just realized that a user should see the physics explanation that went with that code.  I haven't room on this site for all the images that are in it, so I've just included the basic vehicle turning ones.  His web site was not active when I last checked.  Here's the material >>       

And here's a link to pages by a someone who has a practical way of explaining as well as theoretical ...
( Brian Beckmans car racing physics) >>  
   

There is plenty more out there.  The 'Racer '  free sim. is advanced and there's some good material there .  But I noted that the most advanced tyre grip theory ( the pacejka magic formula ... I wonder how you pronounce that? )  requires information to use that is not  likely to be made public by tyre companies.     One thing I thought significant was that some tyres have more gentle change of lateral force with steer angle.   They lose grip less suddenly. It means you can quite justifiably arrange the way your car drives for personal satisfaction!
To be honest, what I did was study the physics material only until I  'got the essential ideas sorted out' ,  then applied  it how I wanted ... as simply as possible.   What I aimed for most was weight transfer effect, change of grip with wheel angle and a summing of  grip, to know when it was exceeded.   Which is all pretty straightforward .. once you know that's what you have to do  .. .. though it needs  'tuning'.

DB classic programmers might be interested to know that the new high res. corners used images from 1024 up to 2048 pixels in one case  .. In theory DB classic reduces the images internally to 512 pixels max .. but in  practice  the result was quite different when using the larger images.  

It would be interesting to experiment further, getting the physics more accurate .   One graph I saw had an example line for the force you feel back on the steering wheel.   ( Oh ho, it might be worth getting the logitech wheel to work on my PC after all )    
But then , how are you going to know that your car is behaving as it should without  experience of such a car?     It may be more important in the end, to perfect the control inputs and  adjust to personal experience / taste .  Make it all enjoyable.  I'm not sure for example, that force feedback should be exactly as it is on a real car ...  maybe the best is to suggest the way you actually partly take your own weight during cornering on the steering wheel. ( If that's possible)   It's quite a sensuous ( ?) experience driving.   Maybe ..  and  hmm,  and errrr ..  and ...  ???

 --------------------------------------------------------------

The future  ...     Having learned a little about car simulation, I have a desire to make a better 3d world with proper rising and falling track with rough surface, and possibly exaggerated throwing about of the car to compensate for the lack of real motion when sitting in front of a computer screen.      I would   especially like to model some of the winding local roads here, which can be great fun to drive over, even in my small Suzuki Alto.       At least there should be little problem getting the data!   And I can use the performance and character of the alto as a definite model.  Yes it is low powered, but the roads in question are a good match for the speed.  And add power unitil the thing is barely on the road!

And besides, it would be pointless trying to make simulations of world famous tracks, which companies with many skilled programmers and artists, can do much better ( and finish in less than years!)  .. . I would never have done this top gear one, had I known that it would appear on the ps3.

But my local track may never happen .. it will be a lot of work .. and will probably require the use of blitz basic rather than classic dark basic ... hmmm  and wouldn't it be great to make a full G force imitating cage, or harness, or device that made it more real ?  Others have tried it.

 Or ...  quite likely,  I shall get involved in something else entirely.      

  David L.   Jan. 08

                                           Link to main dark basic   page > 

 Link back to  main  'Muddleglum Manor' home ( index) page >