Skip to content

Commit

Permalink
chore: update the readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
VitaliiAndreev committed Apr 20, 2020
1 parent f2067fa commit a8fe7bc
Showing 1 changed file with 53 additions and 37 deletions.
90 changes: 53 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,74 +1,90 @@
**War Thunder Preset Randomizer** (or **WTPR**) is a work-in-progress Windows application providing a player with means to randomly select vehicles to play, with extra features down the road. In its current iteration (Alpha) randomization is implemented based on game mode, vehicle branch and class, nation, country of origin, battle rating, and individual vehicle preferences. While presets are generated by **WTPR**, they still have to be assembled in-game.
**War Thunder Preset Randomizer** (or **WTPR**) is a work-in-progress Windows application providing a player with means to randomly select vehicles to play, with extra features down the road. In its current iteration (Alpha) randomisation is implemented based on game mode, vehicle branch and branch tags, vehicle class and subclass, nation, country of origin, rank and battle rating, and individual vehicle preferences. While presets are generated by **WTPR**, they still have to be assembled in-game.

There's a YouTube playlist for related information: https://www.youtube.com/playlist?list=PLTkOsj0Uogp4z4Px8IrmZIl_z6M60mmqX

The source code contains a prototype console application that picks random vehicles within a selected game mode, nation, branch, and battle rating. There's also a utility that automates **WT Tools** (see *Requirements*) to perform a full cycle of unpacking and converting game files into JSON and CSV files - that's how [JSON File Changes](https://github.com/VitaliiAndreev/WarThunder_JsonFileChanges) and [JSON File Changes (Dev)](https://github.com/VitaliiAndreev/WarThunder_JsonFileChanges_DevClient) repositories are maintained. Another bonus are utility LINQPad scripts for querying JSON, code generation, etc.
The source code contains a prototype console application that picks random vehicles within a selected game mode, nation, branch, and battle rating. There's also an utility that automates **WT Tools** (see *Requirements*) to perform a full cycle of unpacking and converting game files into JSON, CSV, PNG (among other) files - that's how [JSON File Changes](https://github.com/VitaliiAndreev/WarThunder_JsonFileChanges) and [JSON File Changes (Dev)](https://github.com/VitaliiAndreev/WarThunder_JsonFileChanges_DevClient) repositories are maintained.

Another bonuses are utility LINQPad scripts for querying JSON, code generation, etc, as well as SQLite queries (see *Application modes*) that should work even if some tweaks might be required.

### Requirements

In order to work **WTPR** requires an up-to-date version of the **War Thunder** client available at [Gaijin's website](https://warthunder.com/en) or [Steam](https://store.steampowered.com/app/236390/War_Thunder/), and a release of [Klensy](https://github.com/klensy/wt-tools/commits?author=klensy)'s **[WT Tools](https://github.com/klensy/wt-tools)**. Paths to both are inquired at the start of **WTPR**. Additionally, one might need to install a runtime version of [.NET Framework 4.7.2](https://dotnet.microsoft.com/download/dotnet-framework/net472).

### Workflow

At the start **WTPR** scans the **War Thunder** client for its current version. With every new patch **WT Tools** are used to unpack data stored with the client and convert it into JSON and CSV. **WTPR** deserializes that data into entities and stores them in an SQLite database (a new database for every patch). From that point **WTPR** uses only the database unless it detects a new **War Thunder** version.
### Application modes

### Randomisation criteria

The following criteria order is used (combinations producing empty presets are meant to be minimized, except for the case of setting too narrow battle rating preferences):
- Enabled vehicles.
- Enabled countries.
- Enabled vehicle classes.
- Enabled branches.
- Enabled nations.
- Enabled battle ratings.
Releases come packaged with BAT files that run the app in different modes using a set of statrup arguments:
- Mode 1: default (no arguments) - every start up-to-date game files are unpacked and deserialised. It's the second fastest mode.
- Mode 2: (-!w): game files already unpacked (in the temp folder) are deserialised. No new data is being pulled from the game. It's the fastest mode.
- Mode 3: (-dbw): same as mode 1, but also an SQLite database is generated. It's the third fastest mode, same as mode 1 if an up-to-date database is already generated.
- Mode 4: (-!w -!r -dbr -dbw): every start up-to-date game files are unpacked and deserialised from which an SQLite database is generated. If an up-to-date database is already generated, it's loaded instead. It's the second slowest mode, same as mode 5 if an up-to-date database is already generated while same as mode 3 if it isn't.
- Mode 5: (-!w -!r -dbr): the most recently generated SQLite database is read. It's the slowest mode.

Preset compositions are based on whether the main selected branch involves combined battles and which branches are enabled (except helicopters in Realistic or Simulator Battles where they require spawn points primarily earned by ground vehicles).
### User settings

### Randomisation algorithms
The following algorithms can be chosen from:
- Top-down (by category). Randomly selects toggled filter categories (branch, nation, battle rating) before selecting available vehicles.
- Bottom-up (by vehicle). Randomly selects the main vehicle from those enabled by filters, building presets around it.
*Client.Wpf.Settings.xml* stores user preferences. While it can be edited manually, it shouldn't be necessary to do so.

### GUI tips

- Hovering over game mode, vehicle class, nation, and country icons shows clarification.
- Numbers on buttons to the right of icons indicate that there are filters attached to the context menu (RMB) - the left number is the amount of toggled on items and the right show how many there are in total.
- Hovering over game mode, vehicle class, nation, and country icons shows clarifications.
- Battle ratings can be adjusted either by clicking arrows or scrolling with the mouse wheel.
- Hovering over a vehicle in the research tree highlights the one required to unlock said vehicle.
- Hovering over a vehicle in the research tree highlights the required vehicle.
- Hovering over a vehicle in a preset highlights the former in the research tree.
- Clicking a vehicle in the preset opens the research tree tab it's on (if necessary) and scrolls it to bring the vehicle into view.
- Clicking a vehicle in the research tree toggles it on/off which affects whether it's used in randomisation.
- Presets need to be scrapped (recycle icon) before research trees are unlocked for free browsing.
- The right button on the preset panel switches between the primary and secondary generated presets if there are enough vehicles.

### Startup arguments:
### Updating to new releases

- "-j" forces the app to work with data deserialised from JSON directly. Doesn't affect whether SQLite databases are generated or not.
- "-!d" prevents the app from generating SQLite databases for game versions. Automatically engages "-j" if the latter isn't being used.
New releases are shipped ready-to-go. The previous release should be deleted prior to extracting release files.

### User settings
If you want to keep user preferences from the previous release, backup and copy *Client.Wpf.Settings.xml* from the previous release to the folder with the new release. Applicable settings would be carried over, use the backup to restore individual settings in case of conflicts.

*Client.Wpf.Settings.xml* stores user preferences. While it can be edited manually, it shouldn't be necessary to do so.
You also can copy over any SQLite databases generated with the previous version of the client, but compatibility with newer versions of the app is not guaranteed.

### Updating to new releases
### Randomisation criteria

New releases are shipped ready-to-go. The previous release should be deleted prior to extracting release files.
The following criteria order is used (combinations producing empty presets are meant to be minimised, except for the case of setting too narrow battle rating preferences):
- Enabled vehicles
- Enabled branches.
- Enabled branch tags (e.g. naval aircraft). At the moment branch tags are directly derived from those found in unittags.blkx. There are plans to expand those based on available vehicle and weapon data.
- Enabled vehicle classes.
- Enabled vehicle subclasses.
- Enabled nations.
- Enabled countries.
- Enabled ranks.
- Enabled battle ratings.
- Enabled vehicles (individually).

If you want to keep user preferences from the previous release, backup and copy *Client.Wpf.Settings.xml* from the previous release to the folder with the new release. Applicable settings would be carried over, use the backup to restore individual settings in case of conflicts.
Preset compositions are based on whether the main selected branch involves combined battles and which branches are enabled (except helicopters in Realistic or Simulator Battles where they require spawn points primarily earned by ground vehicles).

### Randomisation algorithms

The following algorithms can be chosen from:
- Top-down (by category). Applies minor filters and randomly selects from toggled on major filter categories (branch, nation, battle rating) before selecting available vehicles.
- Bottom-up (by vehicle). Randomly selects the main vehicle from those enabled by filters, building presets around it.

### Road map

#### Pre-Alpha releases (reached)
- Setting up the framework.
- Prototyping.
- Visualisation of reseach trees with available vehicles.
- ~~Setting up the framework.~~
- ~~Prototyping.~~
- ~~Visualisation of reseach trees with available vehicles.~~

#### Alpha releases (reached)
- Baseline randomisation.
- ~~Baseline randomisation.~~

#### Beta releases
- Extended randomisation: toggles for nations, countries (Australia, post-war Germany, Israel, etc.), branches, battle ratings, vehicle sub-types, individual vehicles, etc.
- Extended vehicle information: what is seen on vehicle cards in-game, and beyond.
#### Beta releases (reached)
- ~~Extended randomisation: toggles for nations, countries (Australia, post-war Germany, Israel, etc.), branches, battle ratings, ranks, vehicle sub-types, individual vehicles, etc.~~
- Display of more vehicle information: what is seen on vehicle cards in-game, and beyond.
- Filter expansion based on previously unused data (weapon types, calibers, payloads, reload times, etc.).
- Aggregation of vehicle data.
- Improved presentation.

#### Production releases
- Visualisation of data changes between patches.
- Visualisation of data changes between patches.

### Game file unpacker

Releases come packaged with a tool that automates calls to Klensy's WT Tools for a one-button solution of unpacking available game data and cleaning up afterward. The tool requires three startup arguments: the path to War Thunder, the path to Klensy's WT Tools, and the output path. There are example BAT files in the package that show how to call it.

0 comments on commit a8fe7bc

Please # to comment.