Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Random Race Generator and API

  1. #1
    Superkart Pilot JasonSandwich's Avatar
    Join Date
    Jun 2017
    Location
    Arizona (UTC -7)
    Posts
    280
    Platform
    XBOX1 X

    Random Race Generator and API

    In the spirit of Spongleton's Randomizer page, I've created my own that spits out a bit more detail. This takes the list of cars, tracks, weather, classes, and times to try to give you a pretty crazy race. I turned the script into an API just to play with Azure functions.

    Here's the most basic output both tall and wide.

    The API will spit out HTML or XML to be used how you like. Here's the API documentation https://pc2randostorage.blob.core.wi...C2RandAPI.html. See how to use it in your chat here.

    I'm hosting all of the images myself and am missing a good amount so I did the best I could with what I had. Let me know if you find this useful or have any questions. If it gets too expensive to host, I'll make sure to give plenty of warning before it moves or is taken down.

    Click image for larger version. 

Name:	Capture.JPG 
Views:	42 
Size:	78.9 KB 
ID:	259665
    Last edited by JasonSandwich; 05-09-2018 at 02:28. Reason: updated image
    Xbox One X with public OS - Thrustmaster TX with T3PA - Arizona (UTC -7h) - Check out the Randomizer (pc2rando.jasonsandwich.com) (thread)
    The following 8 users likes this Post: Hammerpgh, Maskmagog, Olijke Poffer, pcars rookie, Rober, sas5320, VelvetTorpedo, Zeratall


  2. #2
    Kart Driver pcars rookie's Avatar
    Join Date
    May 2015
    Posts
    50
    Platform
    PC
    Thank you JasonSandwich, this is a great idea, well done.
    Windows 10 Pro, I7-6700K, 16GB Ram, G27, GTX 1080 Gaming X 8GB, triple monitor,
    The following 2 users likes this Post: Hammerpgh, JasonSandwich


  3. #3
    Superkart Pilot JasonSandwich's Avatar
    Join Date
    Jun 2017
    Location
    Arizona (UTC -7)
    Posts
    280
    Platform
    XBOX1 X
    I sloppily put together a mobile-friendly page that lets you choose the options in the API. Give it a swing.

    https://pc2randostorage.blob.core.wi...2RandCell.html

    It looks terrible on desktop. I'm not a CSS wizard or a web developer.
    Last edited by JasonSandwich; 01-06-2018 at 16:01. Reason: saved too early
    Xbox One X with public OS - Thrustmaster TX with T3PA - Arizona (UTC -7h) - Check out the Randomizer (pc2rando.jasonsandwich.com) (thread)
    The following 2 users likes this Post: Hammerpgh, Maskmagog


  4. #4
    Superkart Pilot JasonSandwich's Avatar
    Join Date
    Jun 2017
    Location
    Arizona (UTC -7)
    Posts
    280
    Platform
    XBOX1 X
    A few more minor updates make the cell page and the desktop page more friendly.

    https://pc2randostorage.blob.core.wi...2RandCell.html

    Click image for larger version. 

Name:	Screenshot_20180605-134429.jpg 
Views:	1 
Size:	58.4 KB 
ID:	255649Click image for larger version. 

Name:	Screenshot_20180605-134434.jpg 
Views:	1 
Size:	46.7 KB 
ID:	255650
    Xbox One X with public OS - Thrustmaster TX with T3PA - Arizona (UTC -7h) - Check out the Randomizer (pc2rando.jasonsandwich.com) (thread)
    The following 2 users likes this Post: Hammerpgh, ShneebnaMRR108


  5. #5
    Superkart Pilot JasonSandwich's Avatar
    Join Date
    Jun 2017
    Location
    Arizona (UTC -7)
    Posts
    280
    Platform
    XBOX1 X
    I just made another minor update and a few tweaks on the back end. The primary landing page will now redirect to the narrow width (mobile) site if it detects a narrow display.

    I know some people out there are using this. I hope you enjoy! http://pc2rando.jasonsandwich.com
    Xbox One X with public OS - Thrustmaster TX with T3PA - Arizona (UTC -7h) - Check out the Randomizer (pc2rando.jasonsandwich.com) (thread)
    The following 2 users likes this Post: Hammerpgh, Maskmagog


  6. #6
    Superkart Pilot JasonSandwich's Avatar
    Join Date
    Jun 2017
    Location
    Arizona (UTC -7)
    Posts
    280
    Platform
    XBOX1 X
    Want to use this in your stream chat? I made a quick custom command for a random car or track and simplified it to be used with common chat bots. If you'd like to add these to your chat, create a custom command to call the API.

    In each sample below, "car" can be replaced with "track". You can specify dlc and karts for the car. There are lots of fancy ways to use this. Example uses the Nightbot command below.

    Click image for larger version. 

Name:	cartrack.JPG 
Views:	113 
Size:	16.8 KB 
ID:	257733


    • Nightbot (Twitch): $(urlfetch https://pc2randomizer.azurewebsites.net/api/PC2Randomizer?format=car&karts=false&dlc=false)
    • Deepbot (Twitch): @customapi@[https://pc2randomizer.azurewebsites.net/api/PC2Randomizer?format=car]
    • Streamlabs Chatbot (Twitch/Mixer): $readapi(https://pc2randomizer.azurewebsites.net/api/PC2Randomizer?format=track)
    • Botisimo (Twitch/Mixer/Discord/YouTube): $(fetch https://pc2randomizer.azurewebsites.net/api/PC2Randomizer?format=$(query)) use is !command car or !command track


    Let me know if you find more. Details and updates will be here. Thanks.
    Last edited by JasonSandwich; 21-07-2018 at 18:28. Reason: added more, un-url'd the text
    Xbox One X with public OS - Thrustmaster TX with T3PA - Arizona (UTC -7h) - Check out the Randomizer (pc2rando.jasonsandwich.com) (thread)

  7. #7
    WMD Member DinoM's Avatar
    Join Date
    Oct 2011
    Location
    Sopianae
    Posts
    80
    Platform
    PC
    Can you just mix multiclass races?
    MoBo=Asus Z97 Pro Gamer, CPU=Intel Core i5 4690, GPU=Asus STRIX GTX970 DCII 4GB GDDR5, RAM=16 GB HyperX Beast/Savage DDR3 2400 MHz CL11, Case=Phanteks P400 TG AG,
    Screen=Sony KDL32W705 1080p, OS=Win 10 Pro 64bit, Audio=Realtek bilt in MB SPDIF/OPT, Connect=1000/200 mbit/sec, Wheels=Fanatec CSR, PSU=Thermaltake Smart SE 730W,
    Group: 5% CLUB
    SORRY, MY BAD ENGLISH.

  8. #8
    Superkart Pilot JasonSandwich's Avatar
    Join Date
    Jun 2017
    Location
    Arizona (UTC -7)
    Posts
    280
    Platform
    XBOX1 X
    Quote Originally Posted by DinoM View Post
    Can you just mix multiclass races?
    I'm not sure what you mean. If you want a second or third class to set up a multiclass race, just run it again. The car class is the final thing in parenthesis when the car is returned.

    The big randomizer (in my signature) returns as many as four classes along with a car for you to drive from one of those classes.
    Xbox One X with public OS - Thrustmaster TX with T3PA - Arizona (UTC -7h) - Check out the Randomizer (pc2rando.jasonsandwich.com) (thread)

  9. #9
    Superkart Pilot
    Join Date
    May 2015
    Location
    London
    Posts
    821
    Platform
    XBOX1 X
    Fantastic work Jason, I am going to really find this useful
    2018 Indycar League on pCars 2 - http://consoleracing.boards.net/boar...ar-league-2018
    Vintage F1 on pCars 2 - http://consoleracing.boards.net/boar...1-championship
    Xbox One X, TM Ferrari Italia 458 TX, Xrocker Gaming Chair, Samsung 30" TV, RsDash.
    The following user likes this Post: JasonSandwich


  10. #10
    Superkart Pilot JasonSandwich's Avatar
    Join Date
    Jun 2017
    Location
    Arizona (UTC -7)
    Posts
    280
    Platform
    XBOX1 X
    I wanted to share some notes about this little project:

    • This is a free time labor of love. I'm not looking for money and it costs almost nothing to host.
    • There's no tracking at all on my end, no social media widget, nothing for you to block in any ad blocker. Go ahead and try it. I'm a security/privacy nut and I don't want to force anything like that on someone.
    • It's fully hosted through SSL on Azure. The reason I redirect to the Azure page instead of masking it is so you know exactly what you're getting. Nothing to hide.
    • I pulled the images from the Project CARS website and am hosting them myself. No hotlinking or sucking bandwidth from someone else's server.
    • I do use Javascript which can be a turnoff but you're welcome to view the page source to see that I'm not doing anything funky.
    • You are welcome to integrate this via API or share this anywhere with anyone. I'd like to make racing as fun as possible. I think a random race with buddies is some of the most fun you can have with PC2.
    • The meat of the script is written in PowerShell and can be run on the desktop with little modification.

    You'll come across some impossible combos, some tracks that are weird, etc. Just roll the dice again and get something fun.

    You guys are great. This is getting used (I see bandwidth out) and that's what I really want.
    Xbox One X with public OS - Thrustmaster TX with T3PA - Arizona (UTC -7h) - Check out the Randomizer (pc2rando.jasonsandwich.com) (thread)

Similar Threads

  1. Why AI random fuel in pratice, qualifyng and in race?
    By jamespoly86 in forum General Discussion
    Replies: 5
    Last Post: 13-12-2017, 09:05
  2. [Bug?] Random flickering during Race
    By xeek in forum Technical Help & Support (PC)
    Replies: 2
    Last Post: 23-09-2017, 20:14
  3. about the random wheather in a custom race
    By Didd31 in forum XB1 - Technical Help & Support
    Replies: 0
    Last Post: 23-06-2015, 19:08
  4. Probably a stupid idea but what about a track and car generator
    By nomen nescio in forum Feature Suggestions
    Replies: 0
    Last Post: 22-06-2015, 09:57
  5. Track generator
    By gp20 in forum Feature Suggestions
    Replies: 6
    Last Post: 21-05-2015, 10:56

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •