A CLI tool to help you figure out how to beautify honors in the Guild War event.
Project description
Granblue Fantasy - Beautify Honors
A CLI tool to help you figure out how to beautify honors in the Guild War event. (古戦場の貢献度調整)
Read this in other languages: English, 中文.
Table of contents
Prerequisites
Please read at least one of these well-written tutorials to known how to get the exact honors.
System requirements
- Python 3.7+
How to install
It is recommended to use pipx to install this tool because the application will be installed into an isolated and clean environment.
pipx install gbf-beautify-honors
However, you still can use pip to install this cli.
pip install gbf-beautify-honors
How to use
- Solo the NM Bosses until the difference between your current honors and expected honors is roughly greater than one million. An appropriate gap is a good start because there may be a greater chance of finding a good way to achieve the goal.
- Run the cli tool in interactive mode or direct mode. Help page is simply shown below:
$ gbf-beautify-honors --help
Usage: gbf-beautify-honors [OPTIONS]
Options:
--current INTEGER Your current honors [required]
--expected INTEGER Your expected honors [required]
--config PATH Custom config path
--help Show this message and exit.
Interactive mode example
$ gbf-beautify-honors
Your current honors : 1398542611
Your expected honors: 1400000000
Custom config path []:
Direct mode example
gbf-beautify-honors --current=1398542611 --expected=1400000000
Examples
Next, we will use some examples to explain how to use this tool, and how to adjust the configuration file.
Case 1: There is a solution
$ gbf-beautify-honors
Your current honors : 1398542611
Your expected honors: 1400000000
Custom config path []:
╒═══════════════════════════════════════╤═════════╤═════════════════╕
│ Action │ Honor │ Optimal Times │
╞═══════════════════════════════════════╪═════════╪═════════════════╡
│ Eyeball VH (0 button) │ 8000 │ 1 │
├───────────────────────────────────────┼─────────┼─────────────────┤
│ Meat Beast VH (0 button) │ 21400 │ 4 │
├───────────────────────────────────────┼─────────┼─────────────────┤
│ Meat Beast EX (0 button) │ 50578 │ 3 │
├───────────────────────────────────────┼─────────┼─────────────────┤
│ Meat Beast EX+ (0 button) │ 80800 │ 10 │
├───────────────────────────────────────┼─────────┼─────────────────┤
│ Meat Beast EX+ (1 summon) │ 80810 │ 5 │
├───────────────────────────────────────┼─────────┼─────────────────┤
│ Join raid and only use Break Assassin │ 1 │ 5 │
╘═══════════════════════════════════════╧═════════╧═════════════════╛
Please note that there may be multiple solutions to the same input and there is currently no guarantee of consistent results. Another possibility is shown below:
$ gbf-beautify-honors
Your current honors : 1398542611
Your expected honors: 1400000000
Custom config path []:
╒═══════════════════════════════════════╤═════════╤═════════════════╕
│ Action │ Honor │ Optimal Times │
╞═══════════════════════════════════════╪═════════╪═════════════════╡
│ Eyeball H (0 button) │ 6000 │ 3 │
├───────────────────────────────────────┼─────────┼─────────────────┤
│ Eyeball VH (0 button) │ 8000 │ 3 │
├───────────────────────────────────────┼─────────┼─────────────────┤
│ Meat Beast VH (0 button) │ 21400 │ 1 │
├───────────────────────────────────────┼─────────┼─────────────────┤
│ Meat Beast EX (0 button) │ 50578 │ 2 │
├───────────────────────────────────────┼─────────┼─────────────────┤
│ Meat Beast EX+ (0 button) │ 80800 │ 13 │
├───────────────────────────────────────┼─────────┼─────────────────┤
│ Meat Beast EX+ (1 summon) │ 80810 │ 3 │
├───────────────────────────────────────┼─────────┼─────────────────┤
│ Join raid and only use Break Assassin │ 1 │ 3 │
╘═══════════════════════════════════════╧═════════╧═════════════════╛
Case 2: There is no solution
Basically, there is always a solution because we can join raid and only use Break Assassin to get exactly 1 honor. However, this is usually an unrealistic approach, so the default config makes some constraints on the maximum time on each type of battle. This leads to the fact that sometimes it is not possible to find a solution.
$ gbf-beautify-honors
Your current honors : 1399999900
Your expected honors: 1400000000
Custom config path []:
There is no solution to achieve the expected honors. Please relax the constraints and try again.
To solve this problem, we can use custom config to relax the constraints to find a solution.
- Download the example config.json.
- Modify the
max_acceptable_times
of the action "Join raid and only use Break Assassin" to100
. - Re-run the script with custom config.
$ gbf-beautify-honors
Your current honors : 1399999900
Your expected honors: 1400000000
Custom config path []: config.json
╒═══════════════════════════════════════╤═════════╤═════════════════╕
│ Action │ Honor │ Optimal Times │
╞═══════════════════════════════════════╪═════════╪═════════════════╡
│ Join raid and only use Break Assassin │ 1 │ 100 │
╘═══════════════════════════════════════╧═════════╧═════════════════╛
The configuration is flexible and you can try to modify different values in it, re-run the script and see if there is a solution. You can also add self-defined action into the config.json as long as you know you can get the exact honor value from this action, e.g. you can add this object into the actions list,
{
"name": "Some custom action for demo",
"honor": 11,
"max_acceptable_times": 10
}
Re-run the script, it just works!
$ gbf-beautify-honors
Your current honors : 1399999900
Your expected honors: 1400000000
Custom config path []: config.json
╒═══════════════════════════════════════╤═════════╤═════════════════╕
│ Action │ Honor │ Optimal Times │
╞═══════════════════════════════════════╪═════════╪═════════════════╡
│ Join raid and only use Break Assassin │ 1 │ 1 │
├───────────────────────────────────────┼─────────┼─────────────────┤
│ Some custom action for demo │ 11 │ 9 │
╘═══════════════════════════════════════╧═════════╧═════════════════╛
How it works
We can formulate this problem as an integer programming problem and solve it using the OR-Tools
Is this case, we use an integer variable hi to represent the exact honor earned from battle i
(i
can be Eyeball N
, Meat Beast EX+
, ...).
And use another integer variable ni to represent the number of battles we need to fight for the battle i
.
We want to get exact honors with minimum number of battles (more efficient), so the corresponding integer programming problem is:
Additionally, we can add additional constraints to the integer variable ni to limit the maximum number of each battle. e.g.,
How to develop
Setup
Use poetry
to setup dev environment.
poetry install
poetry shell
Use pre-commit
hook to check coding style.
pre-commit install -t commit-msg -t pre-commit
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file gbf-beautify-honors-0.1.3.tar.gz
.
File metadata
- Download URL: gbf-beautify-honors-0.1.3.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.12 Linux/5.13.0-1022-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a438f89b2a6c3bd1a9f913f13ea3fc37dc6b4027c94d26960fb7f6eafb8c8f3 |
|
MD5 | 3a52c2cf8433c87972d4590f658d8fa8 |
|
BLAKE2b-256 | 9a4b8ad091c30713c4e599abcb1d51bd6a7af47df3a4cae5ac53a69300f92783 |
File details
Details for the file gbf_beautify_honors-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: gbf_beautify_honors-0.1.3-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.12 Linux/5.13.0-1022-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e02556af938c9f93f1402af3c7a32ea9ccf0b8f7be64c282e9fcc7b85451a252 |
|
MD5 | 63959aabcefde6ccfdb73ef5394e329e |
|
BLAKE2b-256 | 50bec6b48cc2e730e1640b4d1def04c23177400c6e8e4d539d9bffb726c07f13 |