Jump to content

Welcome to Xbox Society

Xbox Society is an adults only gaming community.  We operate a casual, laid back approach because we appreciate that when you factor in family, work etc.. you might not get a lot of time on your beloved xbox and gaming hobby so the time you spend here needs to be hassle free and fun.

We have plenty of casual challenges and competitions, coupled with weekly gaming events and a friendly, vibrant community
Register
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
Guest

Nice mate this is awesome :)

 

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.

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
JasonSchlueter

I've had some spare time lately so I turned my randomizer into an API which I will share soon.  For now, you can check it out without loading or running anything, it's just a javascript web page that calls the API.

Here's the raw return: http://pc2rando.jasonsandwich.com/

Here's a slightly cleaner sample: https://pc2randostorage.blob.core.windows.net/assets/PC2RandOut.html

I'll be adding images of the cars and tracks as they exist (you'll see some broken images for now).  Let me know what you think.

JPpEPJS.png

  • Like 1

Share this post


Link to post
Share on other sites
Guest

Nice I love it! :up: 

Share this post


Link to post
Share on other sites
JasonSchlueter

I made some updates to the cell page to make it a bit more thumb friendly.  I've also added the cars and track from the latest LeMans DLC.

Share this post


Link to post
Share on other sites
JasonSchlueter

I'm floating this to the top for a few reasons.  I've added some commands so you can use this in a Twitch/Mixer/Discord/YouTube bot.  The randomizer landing page has gotten an update and it looks good both on cell (narrow) and desktop (wide).  It automatically chooses which display based on width.  The API page has had a huge update as well.

Share this post


Link to post
Share on other sites
KPDub

@JasonSchlueter what game modes are in this game - multiplayer and how easy are time trials to set up.  Would be keen to look at adding this to our events, especially as its only £20 in the ultimate game sale.  

I loved the first game, downloading the demo for PC2 to see what its like

Share this post


Link to post
Share on other sites

×