Jump to content
JasonSchlueter

Project CARS 2 Randomizer

Recommended Posts

JasonSchlueter

I have a link for some site that will give you a random car/track/date combo for setting up a open race on Project CARS 2.  I didn't like that it skipped out on weather, classes, time progression, and some other things about it.  I instead wrote up a PowerShell script that takes the current list of tracks and cars amongst other things and gives you random output to create a race.  This is not groundbreaking in any way but is a fun way to mix up your races.  I realize I'm the only one here who plays Project CARS 2 but I'm going to post the link anyway just in case someone joins and finds it helpful.

It's stored in OneDrive and should be treated as a living document.  I'll be adding the new cars/tracks and other options as things change.  Currently the easiest way to run it is to copy/paste the whole text into a PowerShell window and run it from there.  Nothing needs to be installed.

https://1drv.ms/u/s!AqUQHAUZXtjKkvBW0J-_RYsOBWNqxw

VWnG1Pr.png

Share this post


Link to post
Share on other sites
JasonSchlueter

I've made several updates to the script including:

  • Car classes now include selected car
  • No duplicate classes
  • Better handling of seasons
  • Better memory management (only loading the variables once instead of on each execution)
  • Amount of laps or race time provided, unrelated, totally optional (limited to 100 laps or 3 hours)
  • Unicode used properly
  • Slam "enter" for a re-roll instead of rerunning the script
  • formatting

I want to add the distance for each track layout and use that for an estimated race length.  The link still goes to the latest, greatest.  Thanks!

Share this post


Link to post
Share on other sites
JasonSchlueter

It was a slow day at work.  I made more changes:

  • Distances added to tracks
  • "suggested" race length includes laps with mileage or a random amount of time up to three hours
  • If it's a P2P track, no laps

X6pKLJP.png

Share this post


Link to post
Share on other sites
JasonSchlueter

I've made a few more updates.

  • Time and weather progression get different values.  Weather will even get "sync to race".
  • The amount of weather slots is variable instead of always using all four.
  • P2P races will get only one weather now.

Share this post


Link to post
Share on other sites
JasonSchlueter

I changed some weather logic.  If it's a P2P race, no weather progression and only one weather type is shown.  If the progression is "Off" or only one weather type is generated, the weather progression is set to off.  It didn't make sense to have 20x weather progression if it was only one type of weather.  Thirdly, any multiple weather mixed with multiple laps will give a weather progression number.

It sounds complicated but it's the right thing to do. :) 

Share this post


Link to post
Share on other sites
JasonSchlueter

With DLC on the horizon (and technically two sets of DLC already out), I added the DLC notification to both tracks and cars.  You'll now see which DLC is used in the random query.

Share this post


Link to post
Share on other sites
JasonSchlueter

The suggested amount of time is no longer random.  I'm guessing the average driving speed is 60 miles per hour (which is wrong but could be right) and dividing the length by 60 to get the amount of hours.  I don't know how to better guess how quickly a car (like above) will perform on a go-kart track in the snow at midnight.  Regardless, the suggested time is now grounded with some logic.

Share this post


Link to post
Share on other sites
JasonSchlueter

I have added the Fun Pack DLC cars and tracks to the randomizer.

Share this post


Link to post
Share on other sites
Sgt Sharkey

Nice mate this is awesome :)

 

  • Thanks 1

Share this post


Link to post
Share on other sites
JasonSchlueter

Thanks!

I made some weather changes last night.  Now it only gives a 30% chance of a snowy track if snow is allowed at that track.  Before it said "Snow or Winter".  I went through the tracks and added a "Snow" column to the array.

I have not changed the seasonal thing that I brought up in a different post.  I actually want to rethink the whole timing part.

  • Like 1

Share this post


Link to post
Share on other sites
JasonSchlueter

I also dropped the option to choose karting tracks.  It's a known bug in the game where you can't pick the karting tracks for custom races even if you choose the go kart.  I'm probably one of the five people who like the go kart so I'm sure it's not high priority.

It popped up for me a few days ago in the randomizer.  I just commented out the karting tracks in the array.

Share this post


Link to post
Share on other sites
JasonSchlueter

The script has been updated again.  I've made a few minor changes between now and the last post but the most important is fixing minor bugs and adding new cars and tracks for DLC.

Share this post


Link to post
Share on other sites
JasonSchlueter

If you'd like to give it a try but don't care for PowerShell or don't want to blindly run my script, I have a link on my personal web page which goes to a TIO (Try It Online) portal.

https://jasonsandwich.com/wp-content/uploads/2018/03/PC2Randomizer.html

The link itself is actually too long to post (over 10,000 characters) and most older browsers won't handle it.  Give it a shot!  It's the second link.

Share this post


Link to post
Share on other sites

×