GT5 Random Race Generator

  • Thread starter Jump_Ace
  • 36 comments
  • 9,473 views

Jump_Ace

Compare Yourself To The Best Of Your Own Abilities
Staff Emeritus
9,422
United States
Portland, OR
Jump_Ace
JUMPxACE
Hey All,

Over the past year or so I've been thinking about making a random event/combo generator for those times where you want to race but don't know what to race (and assuming the WRS doesn't interest you that week). Or perhaps you are organizing a local LAN event (or an online racing event in a lobby :)) and need to come up with some random combos to level the playing field. So last night I came up with this excel document.

Now this program may be more trouble than it's worth due to:

A) It's limited to Excel (but should be compatible with Open Office, though I haven't tried it yet)

B) Maintaining the list of cars and syncing it with the cars you own in the garage may not happen

C) I know everyone will probably ask, that's great but can you put it online? My answer to that is 'Maybe' since I'm not technically gifted at writing code online, unless there is a wordpress plugin to run excel inside a post, or something similar to export an excel to the web?

D) I'm using what little info we have with regards to the tracks and cars (but it's still in Beta testing anyway) so once GT5 comes out along with a complete car list, it will need to be updated

Here is what the combo generator Can do:

- Generate a combo that includes:
- Which Car, Tires, Track and Laps

- I have 3 different combo types:
- A 100% completely random generator (all cars, any track, any tires, laps from 1 to 10 - yes, it could be 9 laps on the Nurb! :nervous:)

- A realistic combo generator where Really Fast Cars (Le Mans, F1, etc) won't be run on Really Short Tracks (Ice Arena, Tsukuba, Suzuka East, etc.) and Really Slow Cars won't be run on Really Long Tracks (Sarthe and Nurburgring 24hr). Also, the lap count for Really Long Tracks is between 1 and 3 laps and Really Short Tracks is from 5 to 10 laps.

- A realistic combo generator for just tarmac tracks (no Ice Arena, Rally Courses, etc)

I wanted to get some suggestions and feedback from you on (tweaks/fixes, would you ever use it?) in Excel, try it out and let me know what you think. Just press the F9 Key to refresh the combo generators. Below is an attachment to my first version.

Jump_Ace's Crazy-Random Combo Generator

Jerome
 
Last edited:
I don't quite understand this concept...

EDIT: re-read it and now I get it, great idea, should be great for those competitions I'll do with my brother.
 
Yea, I made one for GTPSP in excel. But it is sooooo rudimentary and embarrasing that I never showed anyone else. :lol: (I'm an Excel Noob)
 
Not sure why or how I double posted, sorry guys. I saw Kekke's randomizer but I don't know how to create an exe like that, plus it didn't have tire choices. But maybe he'll make a new one? Until then, I'll keep plugging away at this. :)

Jerome
 
Just got a chance to download and try it. (since I was at work when I posted earlier)

But honestly, I really like it. It is super easy to use and get the job done. If you release this when the full track and car list is given... I'll be all over it.
 
I tried it on OpenOffice on my macbook (running OS X) and it works great although it doesn't refresh with the F9 key instead I had to use the reload option under File (on my macbook pro, the F9 turns off the illuminated keyboard).

My only suggestion since I do prefer racing stock cars using tires that would simulate their real world performance (similar to the list PD provided in GT5P or the tires used for the TT demo for the Normal and Tuned 370Z- N3 and R1 tires respectively) is to have a random generator for Real World Tarmac Combo. Other than that I can see myself using this generator quite often even for TT. Nice work!
 
Congratulations, I like it. 👍

Is it possible to generate this: NASCAR with N1 tires? I wouldn't like that race. Maybe you could offer filters for us to use whenever we want or something similar to what you've made for slow/fast cars on long/short circuits, but with tires and fast/slow cars. Do you understand?


If you want some help, just tell me. I'm graduated in Computer.
 
Thanks! Really great! I always thought of making something like that,
but I knew others would be better at doing it so I just waited:$
 
Congratulations, I like it. 👍

Is it possible to generate this: NASCAR with N1 tires? I wouldn't like that race. Maybe you could offer filters for us to use whenever we want or something similar to what you've made for slow/fast cars on long/short circuits, but with tires and fast/slow cars. Do you understand?

Yes, that can be done rather 'easily'. If you look at the sheet there are some cars with the tag 'fast car' next to them, for any car you don't want to have road or economy tires, I can put in that group to essentially use just racing tires only.

Thanks for the feedback guys and glad to hear it works in Open Office too!

Okay so I decided to pull out some of my college text books from when I was taking Java (only 200 level mind you so I'm still an amateur) and I'm very rusty. But I did manage to make a post on my site with a generic combo generator. Right now there are only two options for each topic (just enough to make sure it works).

Click here.

Now it's essentially the Uber-Combo Generator where it's 100% random. I'm not sure if I can configure it with the proper 'If' statements based off of what the random output is unfortunately.

I'm hoping someone out there does know how to do that, I'm all ears and here is a snippet of the code I created in my blog post:

Code:
<center><script type="text/javascript">
function selectRandomItem(box1) {
var box1 = document.getElementById(box1),
rand = Math.floor(Math.random() * box1.options.length);
box1.selectedIndex = rand;
}
</script>
<center>Track:</center>
<select id="tracks">
<option>Deep Forest</option>
<option>Trial Mountain</option>
</select>
<center>Car:</center>
<select id="cars">
<option>Honda</option>
<option>Acura</option>
</select>
<center>Tires:</center>
<select id="tires">
<option>Road</option>
<option>Sports</option>
</select>
<center>Laps:</center>
<select id="laps">
<option>1</option>
<option>2</option>
</select>
<center>
<button onclick="selectRandomItem('tracks'), selectRandomItem('cars'), selectRandomItem('tires'), selectRandomItem('laps');">
<div align="justify">Generate!</div>
</button></center></center>
<br></br>
<p></p>

Jerome
 
Last edited:
I don't know JAVA very much, I'm used to program in ASP (VBScript). Anyway, I'll take a look at your code and try to help you with the 'If' statements. 👍
 
That link you posted Jump Ace is all that it takes in my opinion. Simple and effective. Good Job. 👍
 
I just hold down the right key in my garage and randomly hit x and then I do the same for track selection.

A "quick race" option would make this a lot more pleasant.
 
Hey Jump_Ace. :)

1) I don't know Javascript;
2) don't take my code as a final version, but just a help for you to make something good. There must be a way much easier to achieve the same results.

Since you're going to make a complete database of cars and tracks in GT5, this hard work could be useful not only for the Random Event Generator, but also for something more sophisticated. You could, for example, allow visitors of your website to search cars, and then you could show them a picture of each car next to the name. Also, we could copy all the description that comes with every car in GT5 into your website (if it's not illegal), and then you would have a huge resource of information about classic, popular and racing cars on the web. I could make that if your server offers support to SQL and ASP.

Regarding the code, here's my logic explained:

There are two SelectBoxes for track and two for car. Two of them (one for car and one for track) are filled only with only short tracks and slow cars, whereas the other two are filled with all cars and tracks. If the user checks the CheckBox 'No slow cars in long tracks', then when he presses 'Generate!', the two SBs that have all the tracks and cars will disappear and the other two will appear; if the user doesn't check the CheckBox, the two SBs that have only short tracks and slow cars will disappear and the full list SBs will appear.

You noticed that when the user check the CheckBox, fast cars and long tracks are never chosen, which is a problem. We/you need to implement a system that randomize a car and then, based on which car was chosen (fast or slow), it randomizes the track from a specific "database" (short, long or any track). Since you're the man of "randomizing" here, I'll let this to you. :lol:

The worst thing about this logic is that you'll need to write 3 "databases" for cars, fast/slow/all cars, and there will be many repetitions of cars from "slow" and "fast" in the "all" list. It will happen with tracks, too.

I'll be traveling for a couple days and won't have internet connection. Leave me a message to remind me of this thread if I forget. XD. And if you implement something new, please let me know. ;)

Code:
<center>


<script type="text/javascript">

function VerifFilters()
{

	if (document.filters.filter1.checked)
	{

		document.ShortTracks.elements['ShortTracks'].style.display='inline';
		document.SlowCars.elements['SlowCars'].style.display='inline';
		document.AllTracks.elements['AllTracks'].style.display='none';
		document.AllCars.elements['AllCars'].style.display='none';

		selectRandomItem('ShortTracks');
		selectRandomItem('SlowCars');
		selectRandomItem('tires');
		selectRandomItem('laps');
	}

	else
	{

		document.AllTracks.elements['AllTracks'].style.display='inline';
		document.AllCars.elements['AllCars'].style.display='inline';
		document.ShortTracks.elements['ShortTracks'].style.display='none';
		document.SlowCars.elements['SlowCars'].style.display='none';

		selectRandomItem('AllTracks')
		selectRandomItem('AllCars')
		selectRandomItem('tires');
		selectRandomItem('laps');
	}

}

function selectRandomItem(box1) {

	var box1 = document.getElementById(box1),
	rand = Math.floor(Math.random() * box1.options.length);
	box1.selectedIndex = rand;

}

</script>



<form name="ShortTracks">
Track:


	<select id="ShortTracks" style="display:none;">
		<option>Deep Forest</option>
		<option>Autumn Ring Mini</option>
	</select>
</form>

<form name="AllTracks">
	<select id="AllTracks">
		<option>Nürburgring</option>
		<option>La Sarthe</option>
		<option>Deep Forest</option>
		<option>Autumn Ring Mini</option>
	</select>
</form>

Car:

<form name="SlowCars">
	<select id="SlowCars" style="display:none;">
		<option>Isuzu</option>
		<option>Daihatsu</option>
	</select>
</form>

<form name="AllCars">
	<select id="AllCars">
		<option>Lamborghini</option>
		<option>Ferrari</option>
		<option>Isuzu</option>
		<option>Daihatsu</option>
	</select>
</form>

Tires:
	<select id="tires">
		<option>Road</option>
		<option>Sports</option>
	</select>
<br><br>

Laps:
	<select id="laps">
		<option>1</option>
		<option>2</option>
		</select>

<br><br>

<button onclick=VerifFilters()>
<div align="justify">Generate!</div>
</button>

<br><br>

<form name="filters">
<input type="checkbox" name="filter1"> No slow cars in long tracks.
</form>

</center>
 
/\ Thats funny you mention that about creating 3 lists and I recently had come to the same conclusion. Depending on the track selected, say Sarthe for example, it will call upon a different list of cars. Yes it's more data entry but in the long run, may be the best way to go. I'll take a look at your snippet and see what I can do on my site. Thanks very much Vulcao for taking your time to help out :)

Jerome
 
That link you posted Jump Ace is all that it takes in my opinion. Simple and effective. Good Job. 👍

I have to agree with that,with somewhere between 950-1000 cars and alot of tracks I'd use that alot, nice work.
 
/\ Thats funny you mention that about creating 3 lists and I recently had come to the same conclusion. Depending on the track selected, say Sarthe for example, it will call upon a different list of cars. Yes it's more data entry but in the long run, may be the best way to go. I'll take a look at your snippet and see what I can do on my site. Thanks very much Vulcao for taking your time to help out :)

Jerome

Why not do it in a database, and add properties to cars to identify which circuit type they can run on? Otherwise you'll be creating so many lists with cars it will become unmanageable. At least to me it seems more logical to do it like that.
 
Why not do it in a database, and add properties to cars to identify which circuit type they can run on? Otherwise you'll be creating so many lists with cars it will become unmanageable. At least to me it seems more logical to do it like that.

I'd be all over that if only I knew how. My programming is pretty much limited to HTML and Java and a simple project like this is pretty tough for me.

Update: Here is what I have now, I basically started over again : /. I finally got some help at www.eggheadcafe.com and got the if statement built. Now if the track type is 'Long Track' only fast cars will drive on it and if it's a 'Short Track' only slow cars will drive on it. I will be updating that so that 'slow' and 'normal' cars will go on Short Tracks as well as 'normal' cars on Long Tracks. But I did dress it up a little and got rid of the menu list so it's a normal text field.

Update 2: I have some more parameters set up with tire choices and lap count depending on whether the track type is long or short.

Update 3: I can't yet get the tires to randomize off the car choice because the car choice is based off the track type, so I may not be able to get that part working (on my own) but I might ask around. But really, it does take quite a few clicks to put a Ferrari on Road or Economy tires, plus the end user can just ignore any part of the random combo they don't like and fill in their own tire choice 💡 What I did do, was state if a Long Track is selected, to use the faster tires and since fast cars will likely get selected in this instance it will usually yield better tires for faster cars. This Dramatically decreases the frequency of getting poor tires on fast cars, so i may just keep it this way.

I did manage to add the lap randomizer (1 to 4 laps for long tracks and 5 to 10 laps for short tracks), tire choices. Structured the car lists to include fast and normal cars and slow and normal cars. I also hid the Track Type from the frame since it's an eye sore anyway :lol:


Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Jump_Ace's GT5 Random Combo Generator</title>
</head>
<body>
<center>
<Script Language="JavaScript">
var Tracktype = new Array("Short Track", "Normal Track", "Long Track")
var Shorttracks = new Array("Autumn Ring Mini","Tsukuba")
var Normaltracks = new Array("Deep Forest","Trial Mountain","Laguna Seca")//Rally Tracks just need to be added here
var Longtracks = new Array("Sarthe","Nurburgring")
var Allcars = new Array("Honda","Acura","Ford","Dodge","Datsun","Daihatsu","Ferrari","Bentley")//Used only in Else statement
var Slowcars = new Array("Datsun","Daihatsu","Honda","Acura","Ford","Dodge")//Slow cars has Slow and Normal Cars
var Fastcars = new Array("Ferrari","Bentley","Honda","Acura","Ford","Dodge")//Fast cars has Fast and Normal Cars
var Laps = new Array("1","2","3","4","5","6","7","8","9","10")
var Manylaps = new Array("5","6","7","8","9","10")
var Fewlaps = new Array("1","2","3","4")
var Tires = new Array("(E) Economy","(R) Road","(S1) Sports Hard","(S2) Sports Medium","(S3) Sports Soft","(R1) Racing Super Hard","(R2) Racing Hard","(R3) Racing Medium","(R4) Racing Soft","(R5) Racing Super Soft")
var Fasttires = new Array("(R1) Racing Super Hard","(R2) Racing Hard","(R3) Racing Medium","(R4) Racing Soft","(R5) Racing Super Soft")
var t=0 // Tracktype
var r=0 // Allcars
var i=0 // Shorttracks
var s=0 // Normaltracks
var f=0 // Slowcars
var p=0 // Longtracks
var g=0 // Fastcars
var d=0 // Laps
var u=0 // Tires
var b=0 // Manylaps
var c=0 // Fewlaps
var h=0 // Fasttires

function RandomName()
{
u=Math.floor(Math.random() * Tires.length);
t=Math.floor(Math.random() * Tracktype.length);
d=Math.floor(Math.random() * Laps.length);
document.FORM.TIRES.value=Tires[u]
document.FORM.LAPS.value=Laps[d]
document.FORM.TTNAME.value=Tracktype[t]
if(Tracktype[t]=='Short Track')
{
i=Math.floor(Math.random() * Shorttracks.length);
f=Math.floor(Math.random() * Slowcars.length);
b=Math.floor(Math.random() * Manylaps.length);
document.FORM.TRACK.value=Shorttracks[i] 
document.FORM.LAPS.value=Manylaps[b]
document.FORM.CARS.value=Slowcars[f]
}
else if(Tracktype[t]=='Long Track')
{
p=Math.floor(Math.random() * Longtracks.length);
g=Math.floor(Math.random() * Fastcars.length);
c=Math.floor(Math.random() * Fewlaps.length);
h=Math.floor(Math.random() * Fasttires.length);
document.FORM.TIRES.value=Fasttires[h]
document.FORM.TRACK.value=Longtracks[p] 
document.FORM.CARS.value=Fastcars[g]
document.FORM.LAPS.value=Fewlaps[c]
}
else
{ 
s=Math.floor(Math.random() * Normaltracks.length);
r=Math.floor(Math.random() * Allcars.length);
document.FORM.TRACK.value=Normaltracks[s] 
document.FORM.CARS.value=Allcars[r] 
}
}
</SCRIPT>
<table border="1" cellpadding="0" cellspacing="0" bgcolor="#E4E4E4" bordercolor="#808080">
<tr>
<td>
<H2 ALIGN="CENTER"><font face="Arial" size="1"><br>
</font><font face="Arial" size="3">Jump_Ace's GT5 Random Combo Generator</font></H2>

<CENTER>
<FORM NAME="FORM">
<TABLE>
<TR>
<TD ALIGN="RIGHT" VALIGN="TOP"><B><font face="Arial" size="2">Track Type:</font></B></TD>
<TD VALIGN="TOP"><font face="Arial" size="2"><INPUT TYPE="TEXT" NAME="TTNAME" SIZE="15"></font></TD>
</TR>
<TR>
<TD ALIGN="RIGHT" VALIGN="TOP"><B><font face="Arial" size="2"> Track:</font></B></TD>
<TD VALIGN="TOP"><font face="Arial" size="2"><INPUT TYPE="TEXT" NAME="TRACK" SIZE="30"></font></TD>
</TR>
<TR>
<TD ALIGN="RIGHT" VALIGN="TOP"><B><font face="Arial" size="2"> Car:</font></B></TD>
<TD VALIGN="TOP"><font face="Arial" size="2"><INPUT TYPE="TEXT" NAME="CARS" SIZE="30"> </font></TD>
</TR>
<TR>
<TD ALIGN="RIGHT" VALIGN="TOP"><B><font face="Arial" size="2"> Tires:</font></B></TD>
<TD VALIGN="TOP"><font face="Arial" size="2"><INPUT TYPE="TEXT" NAME="TIRES" SIZE="21"> </font></TD>
</TR>
<TR>
<TD ALIGN="RIGHT" VALIGN="TOP"><B><font face="Arial" size="2"> Laps:</font></B></TD>
<TD VALIGN="TOP"><font face="Arial" size="2"><INPUT TYPE="TEXT" NAME="LAPS" SIZE="2"> </font></TD>
</TR>
</TABLE>
<P ALIGN="CENTER"><INPUT TYPE="BUTTON" NAME="Button1" VALUE="Generate!" ONCLICK="RandomName()"></P>
</FORM>
</CENTER>
</td>
</tr>
</table>
<br /> 
<br /> 
To Do:<br />
 - Specify tracks in the if statements instead of using Tracktype and remove Tracktype from the generator.<br />
</center>
</body>
</html>

I've placed the code on a separate page for now since WordPress was having a fit with the formatting. It's not centering the text at the top and when I hid the Track Type form, it's still leaving it's border. (picky, picky I know :P)

Click Here. Any suggestions on this are more than welcome! :)


Jerome
 
Last edited:
Hello Jump_Ace,

I've just arrived from travel. I'm a bit tired. Not sure if I'm able to read your code and understand it now, but I'm going to try. :lol:

One thing I was thinking about... I don't know the current code, but the old one never puts a slow car on Nürburgring. I think it should do so and then decrease the number of laps. I'm not able to think well now (:lol:), but I think it will be pretty hard to implement.

I'll keep in touch.
 
Last edited:
I can make that change, but I don't think it will be necessary because when I refer to slow cars I am referring to the Really slow ones, like the Model-T or the Daihatsu3-wheel (if it's going in the game) so the vast majority of cars (like 98% or whatever it turns out to be) will get picked for the Nurburgring. How I see it is if someone wants to run the Model-T on the Nurburgring, they can do that on their own.

I'm just trying to eliminate the extremes on each end; so a typical car like a Honda del sol (which is pretty slow but not Terribly slow) could run on the Nurburgring. Also, the fast cars will only be the F1 and Le Mans cars so they don't get driven on really small tracks (motorland for example).

Jerome
 
When a short track is chosen, why do you randomize the number of laps from the 'Manylaps' array? I think you should randomize it from the 'Laps' array. 7 laps at Tsukuba with a slow car is a lot.

Anyway, I'm thinking all the system should be based on probabilities, otherwise it will end up unbalanced. For example, we're considering Nürburgring as a long track, but it's not just a long track, it's a damn too long track (:lol:), and a lot of other circuits that are not so long will be classified as long tracks just like the 'Ring. I think the randomization has to be more accurate.

The first parameter should be 100% random, most likely the track. Depending on the track that was chosen, the probabilities are set for cars. Depending on the car chosen, probabilities are set for the tires and number of laps.

Something like this:

6 groups (matrix) of tracks based on their time-lap:

1) Kart tracks;
2) Autumn Ring Mini;
3) London, High Speed Ring, Eiger;
4) Grand Valley;
5) La Sarthe;
6) Nürburgring.


5 groups (matrix) of cars:

1) from 0 to 110 HP;
2) 110 to 200;
3) 200 to 320;
4) 320 to 450;
5) more than 450.
- could be based on Performance Points, too.


Imaginary situation:

The 100% randomized circuit was Nürburgring, index 6. An index 6 track sets the probabilities for cars this way:

Group 1) 5% of chance of being chosen;
2) 8%;
3) 15%;
4) 27%;
5) 45%;

Index 3 was chosen. Now a 100% randomization will select a car with index 3 (from the matrix 3). Cars with index 3 sets chances for tires like this:

N3 - 10%
S1 - 30%
S2 - 20%
R1 - 10%
R5 - 5%
- I know some tire types were missed, this is just an example.
- The user could be able to choose the difficulty of the race, which would affect the probability for tire type.


Finally, the number of laps may be randomized either after or before the tires. It's a combination of track index (in this case, 6) and car index (3). Then we have '6,3', which corresponds to:

1 lap - 90%;
2 laps - 7%;
3 laps - 2%;
4 laps - 1%.
------------

What do you think? I know that sounds complicated. That's surely better for an .exe program. Don't forget to read the message I've sent you.
 
Last edited:
The manylaps array was made so that you have one lap at Tsukuba. However, you do have a good point, in that normal and slower cars will be driving here. So I think you are right, I'll change it to randomize the laps from 1 to 10 on short tracks as well :cheers:

As for the probability of items, that is going to be beyond what I can do, tbh. This program is about as complex as I can manage. But if you can make an .exe out of something like this, I'd be happy to host the file on my site for people to download and use.

Or like you mentioned earlier, create one out of SQL and use ASP I can add ASP to the IIS on my webserver. However, I don't know if you create one in SQL if it will work on the MySQL I already have setup. I don't see why not, but I've been burned before when I've said that :lol:

EDIT: Updated my site to not use the theme for the generator and changed the code to use any number of laps for short tracks :)

Jerome
 
Last edited:
As I told you, ASP is waaay easier than JavaScript, and we can have similar results with both. However, there's one big difference between them, I don't know if you know: JavaScript is processed on the client (user); ASP is processed on the server. Is there any problem for you because of that? I'll try to make the program in ASP first, then an .exe in VB. I'll try to use SQL, but since I've been far of it for a long long time, I'm gonna need to remember a lot of things. And I don't think SQL works on MySql, XD. If it really doesn't, I can find another way around by using arrays or something.

If I finish it, maybe you can have a look at my code and convert it to JavaScript. ;)

PS: I almost forgot: thank you! 👍
 
Yes that is a concern with the queries being run on the backend instead of on the client side. Give me what you come up with for ASP and I will see what I can do in Javascript. But I've never done a 'translation' like that before so no promises.

You are most welcome and thanks in advance for working on the SQL portion :) And until that gets done, I'm going to call the alpha testing done. Beta testing will happen once I get all those 🤬 cars written in :scared: Once that is complete I'll be as done as you can get with this type of project.

Jerome
 
It seems that we're going to have more time to develop the program: GT5 is delayed again XD. Still not confirmed in Europe, though.
 
Back