test(balance): Add a script to test the balance of martial arts through input stimulations in game #1955
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Balance "Add script to tests the balance of martial arts"
Purpose of change
Is the AutoIt version of #1921.
The cpp version was a start but it didn't take into account some martial arts buffs. Also some combat techniques needed to be trigger manually (eg counter attacks). This wasn't ideal.
Also, I felt that the cpp tests couldn't be reliable until we had a way to compare them to some functional tests that just extract the damage done to monsters in-game (through the save file).
Describe the solution
Create a script that stimulate key inputs through the game, and extract the impact of those keys through the save file.
The script does support mods (that adds and/or modify weapons and/or martial arts)
A demo:
2022-10-04.18-20-44-1.mp4
Explanation:
(do the part below every ~36 times we tried to hit the monster)
At the end the average damage is calculated, and you get a markdown table that can be copy pasted as is.
Cf Additional context
Describe alternatives you've considered
Just create a POC and go back to cpp tests. But I wanted to see how far this concept could go.
Testing
I tested the script often through all its developpement
I also integrated many internal tests to see if everything is working properly each time the script is started:
I also got the script running for 16 hours straight without problem.
Additional context
Needs #1936 to work properly
The instructions to use the script yourself are in the script (for Linux users, you may manage to run it through WINE although I didn't test it)
This is an example of the formatted results you get without modifications (except keeping the top 3 weapons):
NEW TESTS STARTING AT - 04/10/2022 17:50:36
Fight cycle method: Wait then hit, Iterations: 80, Fight cycles: 3
STATS: 12, SKILLS: 5, M: Kevlar hulk
STATS: 18, SKILLS: 9, M: Kevlar hulk
STATS: 12, SKILLS: 5, M: zombie hulk
STATS: 18, SKILLS: 9, M: zombie hulk