Real Weather for GTR2 UI Tools by Pixiv

From Simwiki.net
Jump to navigation Jump to search

Description

  • Weather files to support Pixiv's GTR2 UI Tools
  • Support user-selected weather slots like AMS2

Download

TBD

Initial Ideas

Example Folder Structure:

.
|-- 10min-slots
|   |-- Anderstorp
|   |   |-- Clear
|   |   |   |-- 0000
|   |   |   |-- 0001
|   |   |   |-- 0002
|   |   |   |-- 0003
|   |   |   `-- 9999
|   |   |-- LightRain
|   |   |   |-- 0000
|   |   |   |-- 0001
|   |   |   |-- 0002
|   |   |   |-- 0003
|   |   |   `-- 9999
|   |   |-- MostlyCloudy
|   |   |   |-- 0000
|   |   |   |-- 0001
|   |   |   |-- 0002
|   |   |   |-- 0003
|   |   |   `-- 9999
|   |   |-- Overcast
|   |   |   |-- 0000
|   |   |   |-- 0001
|   |   |   |-- 0002
|   |   |   |-- 0003
|   |   |   `-- 9999
|   |   |-- Rain
|   |   |   |-- 0000
|   |   |   |-- 0001
|   |   |   |-- 0002
|   |   |   |-- 0003
|   |   |   `-- 9999
|   |   |-- Storm
|   |   |   |-- 0000
|   |   |   |-- 0001
|   |   |   |-- 0002
|   |   |   |-- 0003
|   |   |   `-- 9999
|   |   `-- Thunderstorm
|   |       |-- 0000
|   |       |-- 0000
|   |       |-- 0001
|   |       |-- 0002
|   |       |-- 0003
|   |       `-- 9999
|   |-- Imola
|   |   |-- Clear
|   |   |   |-- 0000
|   |   |   |-- 0001
|   |   |   |-- 0002
...
|-- 120min-slots
|   |-- Anderstorp
|   |   |-- Clear
|   |   |   |-- 0000
|   |   |   |-- 0001
|   |   |   |-- 0002
|   |   |   |-- 0003
...
That's all sounds great and I'm really happy to see someone else interested in the frontend stuff because that's the stuff that makes it easier for people to get up-to-speed, especially considering getting from Vanilla GTR2 to Modern GTR2 is such a complex sequence of steps at this point.

What I can do is generate weather files or parts of weather files in any of way that would make it easy for you to engage with.

Weather in GTR2 the way we have approached it is so simple. It's just UserData\Log\weather.txt set to read-only. All the user has to do is select Changeable weather or one of TIW's slot options in-game.

I guess some questions to start would help us understand what we can do.

And I think the first step will be to generate some weather files to give you some idea of what you'd be working with.

Join us on the CCGEP discord if you're interested: https://discord.gg/meg7AdTxmK

[b]Are you interested in making a UI that would allow users to select weather slots similar to how AMS2 allows users to select weather slots?[/b]

If you can make it fancy and icon-based that's cool but it doesn't have to be. It could just be text and drop-downs or radio buttons even or whever you want to do.

Depending on how much energy you have, we could start off with just a UI for setting up the Race weather: Allow the user to select 4 slots each with 7 available weather slot types. If you're excited and have the energy, you could make a UI that allowed users to select weather for every session (Practice1/2, Qualify1/2, Warmup, Race) and each with a variable number of slots.

[b]Are you able to select random filenames that match a pattern like clear-rainy-overcast.txt? I would generated permutations of these for each location and you'd select the appropriate one.[/b]

If you know string matching, substring matching, and ideally regular expression matching, you're well on your way to accomplishing what I'm thinking of.

[b]Are you able to read and concatenate multiple files together?[/b]

If you were, I could generate files that the user-selected weather slots. There would be much fewer, only 7 types, with a number of variations for each location, and you would randomly select a file 

For example, the weather files might be clear-XXXX.txt, rainy-XXXX.txt, stormy-XXXX.txt where XXXX represents a number of variations of the weather in the slot (like varying conditions and temperature). You would select a random file that matches the slot type, for each user-selected slot, and then concatenate them all in a new weather.txt file that looks like this:
[code]Weather
{
	TestDay
	{
        Minute=N.NN
        {
            Conditions=X.XX
            AmbientTemp=Y.YY
        }
        ...
    }
    Practice1
    {
    ...
    }
    Practice2...
    Qualify1...
    Qualify2...
    Warmup...
    Race...
}[/code]

The MInute{}s with Conditions and AmbientTemp are provided for you by my files. You don't have to generate or mess with that in any way except to piece the files together to create a whole weather.txt file (which looks like the above).

[b]Are you able to read ZIP files?[/b]

If you can read a ZIP file of these weather combinations, that would a big win as there will be thousands of files generated and ZIP saves 10x+ disk space. TIW also found it's just faster.

Talk to TIW about how he did it.

But with Python, I imagine it will be even easier to open, list files, select a random item from the list, and extract a file.
That sounds great. If you're interested in a weather slots UI, something like how AMS2 lets you select weather slots, here's what I'm thinking,

If your UI could allow a user to select up to say 4 weather slots, from fixed list of weather slot types (Clear, Rainy, Stormy, etc.), and then select a random file from an agreed upon folder structure of pre-generated weather combinations,

Then I could generate those combinations and you'd just select from a pre-generated list of weather combinations.

Bonus 1: If you can read a ZIP file of these weather combinations, that would a big win as there will be thousands of files generated and ZIP saves 10x+ disk space. TIW also found it's just faster. Talk to TIW about how he did it. But with Python, I imagine it will be even easier to open, list files, select a random item from the list, and extract a file.

Bonus 2: UI allows the user to select weather slots by session (Practice1/2, Qualifying1/2, Warmup, Race)

Bonus 3: If the UI could read weather slot "pieces" and stitch them together into a whole weather.txt file then we could really reduce the number of files generated, reduce file size, and everything would generally be faster.

Details

Weather Slots:
- All weather slot types: Clear, MostlyCloudy, Overcast, LightRain, Rain, Storm, Thunderstorm
- Weather slot types are applied to weather slots which are Minute{} blocks in the Weather.txt file
- Example:
-- User selects: Clear, Rain, Clear
-- Weather.txt contains 3 Minute{} blocks for the given session:
--- Minute{ Conditions: 0, AmbientTemp: 20.00 }
--- Minute{ Conditions: 70, AmbientTemp: 20.00 }
--- Minute{ Conditions: 0, AmbientTemp: 20.00 }

GTR2 Weather Generator:
- 
- Generate "pieces of weather.txt" that represent only 

UI:
- App picks random weather-slot files, pieces them together, saves to weather.txt, sets readonly=true, user picks Changeable weather

Notepad


Scratchpad