Author Topic: RandTrack : random race-track generator  (Read 16253 times)

De-M-oN

  • Posts: 126
Re: RandTrack : random race-track generator
« Reply #30 on: August 13, 2014, 03:42:18 PM »
I love the slope where my ferrari nearly wants to jump :)

BUT:



O.O

overlapping? Seriously? Why it works? wow...
well done. really. thats impressive that you got this working.
edit: Found this in tracked.doc :
Quote
Note that creating too sharp turns may result in some parts of the scenery
crossing each other. This can frequently result in display bugs in the game,
so you should check in the track viewer that there isn't too much overlapping.
So it seems to be supported, but you have to watch out for overlapping scenery it seems ;D

Also I love it, that you can change the track lengths. Thats awesome as well.
random lol thought by me: A tunnelonly track :D

An complete other question:

d:\NFSSE\SIMDATA\CARSPECS\

Do you see ANY possibility to modify them? ..

I would like to edit the car performances so much to have some variation here too. Especially I would like to change some gear ratios (longer, standard, and short) that would improve also the simulation feel of the game even more. Or imagine a high speed car with 50000 kg and 500 km/h crashing the traffic cars xDD I love doing stuff like that for fun xDDD

But changing gear ratios and so on would be so awesome. I'm sure taking off the 250 km/h limiter of the toyota would make it drive ~330.

But there is no editor at all to change the car performances. Any chance you can decode them?
I tried already hex editoring every single character by increasing the hex number. It just didnt work ._. (for nfs porsche it did. I found weight and some speed value^^ But porsche has an editor for this now anyway)
« Last Edit: August 13, 2014, 04:01:23 PM by De-M-oN »

andrewj

  • Developer
  • *****
  • Posts: 1338
Re: RandTrack : random race-track generator
« Reply #31 on: August 13, 2014, 09:00:30 PM »
The game engine does not mind the track overlapping itself, but it can cause rendering glitches.  I plan to prevent it in the future, but for now it is not a big problem (and it only happens on closed tracks).

Tunnel only track is possible, but maybe a bit boring;)

Car specs: sorry that does not interest me.

Soon I will make a release of this program, and then take a break and work on other projects for a while (e.g. my DOOM editor).

De-M-oN

  • Posts: 126
Re: RandTrack : random race-track generator
« Reply #32 on: August 14, 2014, 04:33:49 PM »
Quote
Tunnel only track is possible, but maybe a bit boring;)

Sure :D But as you mentioned randomized scenery this came in mind :D

Quote
Car specs: sorry that does not interest me.

hmm :( :D

But if it would interest you: Is there a chance? The files are also very small, but contain the car data.
Is it such a hardcoded thing that there doesnt exist an editor for this?

Or say it else: Would it be possible for you to edit these files/understand these files and make a tiny spec editor for this? Just in theory.

Or are they absolutely hardcoded that there is absolutely no way? :(

can you pleeeease tell me that? That would really interest me.
and:
I would consider giving you a money donation if you're able to make such an editor for this. If you can somehow understand the files, a little interface for editing them would be hopefully not a hundreds of hours work. But however: please tell me if you would in theory able to understand the files.
I also wonder what makes a file "understandable" ?
I mean: NFS4's FRD Trackfiles or even the NFS 1 track files - it is the same like with the carspec files: You see in them only compiled machine code. And there is no source code available. So I wonder: What makes the files understandable? And why (if its the case) is the carspec file not?

Maybe you can clear things a little bit up. It makes me so sad to see the little spec files, but no editor for it : / The goal seems so close you see the files and so on and grmpf. :D damn you machine code. : /

Beside of that I'm looking forward for the randtrack program and thank you so much for this so far. I didnt expect you'll do it. Awesome and thank you very much.

andrewj

  • Developer
  • *****
  • Posts: 1338
Re: RandTrack : random race-track generator
« Reply #33 on: August 24, 2014, 09:33:31 AM »
Understanding binary files can be a difficult process.  It is often called "reverse engineering".

One way is to make a list of everything you can think of that will be in the file, e.g. one thing might be the maximum car speed, and then look for these values with a hex editor.  When you think you know what something is, change it with the hex editor and see if it actually changed in the game.

Also comparing the files against each other can be useful too.  E.g. load two files in a hex editor in two different windows, and flip between them.  When some parts stays the same, try to think what the cars have in common.  When some parts are different, think about what is different with the cars.

Until now I have worked a lot with this game, and have figured out many things about the track format which was not documented before (e.g. the speed of AI cars can be controlled).  But I am tired of that.  Maybe in the future I can look at the car specs, possibly as paid work, but right now I am concentrating on making the first release of RandTrack.

andrewj

  • Developer
  • *****
  • Posts: 1338
Re: RandTrack : random race-track generator
« Reply #34 on: August 26, 2014, 04:56:11 AM »
The 0.45 release is ready! :)

http://sourceforge.net/projects/randtrack/files/0.45/

I will be uploading a basic web-page for the program shortly.

Have fun ;)

P.S. web page is up now: http://randtrack.sf.net/
« Last Edit: August 27, 2014, 04:06:43 AM by andrewj »

De-M-oN

  • Posts: 126
Re: RandTrack : random race-track generator
« Reply #35 on: August 28, 2014, 04:13:51 PM »
*____*

It does a really awesome job with the shapes. Totally random and fun to play :)

I have so much to say, I already forgot the most I think. But I try my best to remember all.
hm yes - where to start ;D

I think I start with the carspecs first:

I found this in the nfs spec file:

Quote
These files (one per player car) describe the car performance.

Usually, installing these files to the hard disk (by editing PATHS.DAT)

makes Need for Speed inoperable (no acceleration is possible) because the

game modifies SIMDATA\CARSPECS\BY_R&T. However this can be prevented by

making the check file read-only (run ATTRIB +R BY_R&T).



Note that copying one of these files on top of another one will affect the

car performance and handling, but not the engine sound. So if the max rpm's

of the two engines are not the same, the sound can get badly altered because

the correct sound sample is not available.



These files are somehow compressed, because by modifying a single byte in

the file one can reach various results such as : an instant system crash ;

a car that materializes under the road and cannot move, with 11 gears (!) ;

a car without front wheels, that keeps spinning at its initial position...

compression? Seriously?  :'(
That would explain why I got nothing via hex editoring every character to a higher value - I got the same issues like in the quote, but never a result.
Compression .. damn.. I fear this destroys any chance of reverse engineering these files at all?  :'(

___

I like it, that it also has a possibility for some high slopes like the one near of end of this track:

http://www.share-online.biz/dl/TYLAG1BNBW1

It was very fun. You drive down to a cave (which fits well on the deep area) After the cave you drive a huge slope up.

And Start/finish line has a good straight line for a good speed.

Shape:
http://abload.de/img/unbenannt130ymk34.png

Also some tracks it generated were nice to drive with the rallye mode physics. There was one vertigo ridge which was drivable whole track at full throttle at rallye mode. What a fun :)

Especially I found also a thing very impressive - especially for a first release:

You even consider traffic signs! It was so impressive to see that there were curve signs on sharper turns placed with correct placement and correct arrow direction. Thats awesome :)
It was also surprising to see a tunnel at autumn valley with even an never seen wall texture for a tunnel. Thats cool.
Your software has such an awesome quality - like always. Really impressive. Thank you!

Suggestions for the GUI:
Offer a tunnel probability setting
Offer a slope steepness setting (for example a setting on high would have a good probability of extra high slopes.

Slope steepness and some other stuff seem already to be different probabilities per track if I've seen correctly. If so - thats nice then and makes sense. Thank you.
_
It seems to me that there is no variable track width? Maybe you can randomize the track widths within a track as well.

I think when the curves settings is implemented, there will be with less curves a better possibility for straight parts?
At the moment I have long courses, but all with curves, and not much possibility to gain a good top speed.
Curves setting alone isnt optimal I guess though. Because this would make less curves, but not a track with lots of curves and sharp curves while having a top speed part as well.

Another thing:
I'd like to drive the original tracks backwards: If there is an randomize algorithm possible and newer nfs have backward direction possible without an extra track file for this - I would assume this can be computed like the mirrored versions which already nfs 1 does offer.

So would it be possible for you to upload us all tracks in backward direction? If it is possible via an algorithm I would assume it would be doable?
__

Here is a config.dat file for you which has all stuff unlocked!

http://www.share-online.biz/dl/CB9JH1BNQBP

This will help you with making the code for the vegas track then.
__

Quote
I suspect the speed value was created by a human player playing
  each track (rather well) and recording the speed at each segment.

Definitely!

The ai is goddamn accurate at especially Vertigo Ridge.

They drive in perfectly accurate speed the curves. No cheating - they drive the curves at the speeds with which the curves are possible to do. Its actually very accurate!
They even drive the ideal line most of the time. EA did a very good job here.


So far a huge thank you to your work!!

:)

I can offer you later a config.dat file with insane high times and insane low top speed for each track, so that you can actually fill record tables with the generated tracks.

andrewj

  • Developer
  • *****
  • Posts: 1338
Re: RandTrack : random race-track generator
« Reply #36 on: August 31, 2014, 04:26:36 AM »
Yes if those carspec files are compressed (or encrypted) then it explains why nobody has been able to understand their contents -- it becomes extremely difficult to reverse engineer them.

I will add your suggestions to the TODO list.

Variable track width: this is possible.  I noticed that most tracks of the game are not varied much, so I did not worry about it for now.  Though RandTrack does make the road wider on corners.

When curves setting is implemented, there should be more straights and maybe larger curves.  If you want to play with it yourself, look at layout.lua script file and in PIECES table there are two straight pieces, try increasing probability there.  For larger curves, search for "scale_prob" in the code and increase it (upto 100).

I think a program to reverse a closed track would not be too hard to make.  (open tracks are harder since they are not straight near the end)

I don't need the unlocked config for Lost Vegas, thanks, because you can play it by copying the TRI file and FAM file onto another track.  Same for TR5 I think.

Actually with the AI speed I will need your help to get the AI speeds to be better.  Right now I suspect that RandTrack is making the AI cars too slow (right?).  I made the cars go slower around sharp corners, but it does not handle slopes yet.  Eventually I want to have a setting for it too, or does the game have a skill setting somewhere?

De-M-oN

  • Posts: 126
Re: RandTrack : random race-track generator
« Reply #37 on: September 05, 2014, 03:38:42 AM »
Quote
Yes if those carspec files are compressed (or encrypted) then it explains why nobody has been able to understand their contents -- it becomes extremely difficult to reverse engineer them.

I really wonder - why did EA protect them for that so hard o.o And this "by R&T" file lets me a little bit assume that they (R&T) actually wanted it :x Also EA makes me wonder that they even dont offer the sourcecode of this game even at this age of the game ..

Quote
I will add your suggestions to the TODO list.
Thank you :)

Quote
Variable track width: this is possible.  I noticed that most tracks of the game are not varied much, so I did not worry about it for now.  Though RandTrack does make the road wider on corners.

mainly the open tracks have it. For example city segment 2 or the alps.
It gives more variety if there is changing widths :)

Quote
When curves setting is implemented, there should be more straights and maybe larger curves.  If you want to play with it yourself, look at layout.lua script file and in PIECES table there are two straight pieces, try increasing probability there.  For larger curves, search for "scale_prob" in the code and increase it (upto 100).
Ok :)
I wish something like said in previous to happen as well from time to time (the "sharp and many curves while having also a top speed part example")
And variable slope lengths - I like for example the jump at lost vegas. I made a much more extreme version of this with tracked. It actually lets the supra fly to 330 km/h before it lands again on the ground :D

Quote
I think a program to reverse a closed track would not be too hard to make.  (open tracks are harder since they are not straight near the end)

hmpf thats a point :S

Maybe you can extend the end of the track so that it works?

Quote
I don't need the unlocked config for Lost Vegas, thanks, because you can play it by copying the TRI file and FAM file onto another track.  Same for TR5 I think.
Sure you can. But isnt it a lot more comfortable if you can just choose it in your game? :P Just copy over my config file and you're done. Or do you want to unlock them yourself? The time tables are replaced with the file as well then though if you take the config.

Quote
Actually with the AI speed I will need your help to get the AI speeds to be better.  Right now I suspect that RandTrack is making the AI cars too slow (right?).  I made the cars go slower around sharp corners, but it does not handle slopes yet.

Didnt know that you already had considered them in this version already. I've tested a little bit.

Its a bit strange sometimes. And its mainly the slopes - so yes I notice that the slopes arent done yet.

I got a decent AI on a rusty springs track. They were a bit slow on an upward slope, but rest of the track was pretty fast and challenging.

Now comes the strange part:

On a Autumn Valley they slow down on a light curve and a longer DOWNhill slope, while they were way too fast on the first sharp and shorter steep downhill slope. Rest of the track was ok if I remember right.

On a Vertigo Ridge the same: There was one area at which they were quite slow, again on a long downhill slope part. Rest of the track they were constantly too fast. So fast, that they even sometimes flew over my car on a sharper curve. Or sometimes I see a car crashed/slided away on the road (probably because he took the curve too fast :D )

I think it will be easier to do this step by step. Means that we first optimize it on normal curves (means testing tracks without any slopes)
I could imagine that they're already ok then. Because the rusty springs track worked well, except for the high slope. I'm unsure about vertigo ridge though. They were VERY fast on that track.

Quote
Eventually I want to have a setting for it too, or does the game have a skill setting somewhere?

Nope. The game doesnt offer any skill setting.

Gadavre

  • Posts: 38
Re: RandTrack : random race-track generator
« Reply #38 on: September 23, 2014, 02:26:49 AM »
Andrewj
Hello! I understand this program creates a random road tracks for nfs1 and special edition? Games are very good, but on large monitors unpleasant to play, and put a high resolution games impossible. Maybe if you are very fond of these games, it would create a program to optimize the resolution of the game on modern monitors?
Can we compete on your road tracks with cars bots?

De-M-oN

  • Posts: 126
Re: RandTrack : random race-track generator
« Reply #39 on: September 23, 2014, 05:31:27 AM »
You can use dosbox svn: http://ykhwong.x-y.net/

and use a scaler like 2x Sai. (or try some other - its a matter of taste)
With 2x Sai you lose a little bit sharpness, but it lessens aliasing a lot.

https://www.youtube.com/watch?v=jbr-FWeYCFI&hd=1 (watch on highest quality level to avoid getting fooled by youtubes video compression)

I play it on a 30" monitor.

AI - read my previous post - it isnt very well working at the moment.
« Last Edit: September 23, 2014, 05:43:10 AM by De-M-oN »

andrewj

  • Developer
  • *****
  • Posts: 1338
Re: RandTrack : random race-track generator
« Reply #40 on: September 23, 2014, 10:37:59 PM »
Games are very good, but on large monitors unpleasant to play, and put a high resolution games impossible. Maybe if you are very fond of these games, it would create a program to optimize the resolution of the game on modern monitors?
There is no source code for the NFS1 games, so it is impossible for anyone to make a "port" to modern systems.

With DOOM, John Carmack released the source code, which allows all the modern ports like PrBoom, ZDoom, Doomsday (etc) to exist.  Unfortunately the source code to most games never gets released (or worse, it is lost forever).

Currently the AI (bot) cars do work on the generated tracks, but their level is quite low.  For my skills (using a keyboard) they are usually a challenge, but for experienced players they are probably quite easy to beat.

De-M-oN

  • Posts: 126
Re: RandTrack : random race-track generator
« Reply #41 on: January 19, 2015, 11:33:57 AM »
Quote
but for experienced players they are probably quite easy to beat.

They're too fast on vertigo ridge. Like mentioned in the past.

The AI also does a little bit suit your skill. They drive slower if you've bad skill. But they try their best if you have good skill.

https://www.youtube.com/watch?v=A6LOmbgD_lw&hd=1

I'm not a bad driver, but for lots of tracks especially at vertigo ridge tracks they are definitely too fast. On some other circumstances they are slower. But that doesnt matter that much.

I just have one big wish:

Can you please finish the other tracks at least? I can understand that you want more downloads for this program. But you also didnt advertise it anywhere like mentioned earlier, didnt you?

I mean seriously: Nobody would assume a random track generator for NFS 1 in a forum of a doom level random generator. Please put it on some nfs sites like nfscars.net and such. Or should I do that for you? But I think thats shit. Because its your program and not mine.

But please please please develop it further. You did such a fantastic start with it ..

Please do it. Or can I do it myself somehow? What would have to be done to support other tracks? I would be even ok if it would only generate the shapes, decoration was a nice addition, but main wish was random shapes.

If you would do this, if I pay you for the work, then tell me. Maybe I can afford it. But please dont let this project die :(

andrewj

  • Developer
  • *****
  • Posts: 1338
Re: RandTrack : random race-track generator
« Reply #42 on: January 20, 2015, 01:53:03 AM »
Relax man, I will definitely work on it again :).  Maybe in a few days time I do some stuff.....

When it is more complete (supports all the tracks), then I will go on some websites and promote it.  Yes that is my job, not yours.

De-M-oN

  • Posts: 126
Re: RandTrack : random race-track generator
« Reply #43 on: January 20, 2015, 03:39:29 AM »
thx  :) :) :) :) :) :) :) :) :) :) :) :) :) :)  :-*

andrewj

  • Developer
  • *****
  • Posts: 1338
Re: RandTrack : random race-track generator
« Reply #44 on: January 22, 2015, 04:07:10 AM »
Did some work on open tracks.

Here is a very basic CY1 track you can try.  The track is a lot less curvy than closed tracks.  Finish position is wrong, I know.