gisim
See wiki for detailed explanation and instructions.
For support/feedback/suggestions, please join the Discord server. (Be warned, I'm the only one in it)
Getting started
Download the latest development release here
Unzip the file to a directory of your choosing. Double click on gisim.exe
and that should open up http://localhost:8081
in your browser (or you can go there manually after running the executable). Note that while there is a Mac build, because it's not signed you need to allow it in the security preferences after attempting to run it once. Double clicking on a Mac also executes it not in the downloaded folder but in some isolated environment so you will not see any of the premade config files.
On the left of the interface you will find a list of preloaded config files that you can use to run the simulation with. Start by clicking on any of the preloaded config and then click the Run button. For more details on how to write a config file, visit the wiki.
Run options
There are two modes for running the sim, average mode and single mode. Average mode runs a profile through many many iterations (default 5000) to arrive at an average dps figure. This is necessary as there are many random events each simulation (crits, procs, etc...). However, because of the number of simulations ran, there is no detailed step by step log. Instead, you can run the sim in single mode which will have the option of producing detailed step by step log.
Duration vs HP
If HP is set to a number greater than 0, the simulation will run in HP mode. Under this mode, the simulation will "fight" a target dummy with the specified amount of HP. The simulation stops once the HP is depleted. Note that the dummy does not drop any particles. This mode is useful when simulating any character/weapons/artifacts that have specific procs/effects depending on target HP.
If HP is set to 0, then the simulation with run for a set duration as specified in the duration field.
Log options
Under single mode, you have additional logging options. No seed will force the sim to always use the same seed for random. This will guarantee every sim will produce the exact same result (useful for debugging). Otherwise each simulation run may be different due to the random nature of things (crit, procs, etc..).
Log level specify the level of log to produce. Currently only debug level provides any sort of log.
Log options allows you to show or hide specifc types of logs. If unsure, leave the defaults ticked.
A command line tool is also provided undeer cmd/gisim
. However no binary is provided. You will need to install Go and then run with go run main.go
. Accepted arguments are as follows
flag |
acceptable |
info |
d |
debug info warn |
level out log output, defaults to warn |
p |
whatever.txt |
config file to use; defaults to config.txt |
s |
any number |
number representing seconds to run sim for, defaults to 600 |
o |
any string |
log file to write to; if blank no log. defaults to no log |
hp |
any number |
force sim to run in hp mode instead; default runs in time mode. if in hp mode sim will run until the specified damage has been reached |
caller |
true/false |
whether or not print caller function in debug log |
a |
true/false |
run the same simulation multiple times to calculate avg dps; default false |
i |
any number |
how many iterations to run if running sim multiple times |
w |
any number |
number of workers (think threads) to run if running simulation multiple times |
comp |
whatever.txt |
run multiple config files in avg dps mode. this parameter should specify a file to read where each line in the file is the path to one config file |
show |
see log options below |
show only the specified log flags, cannot be used together with hide |
hide |
see log options below |
hide the specified log flags (show all the rest), cannot be used together with show |
You can also access these arguments via go run main.go -h
Some examples are as follows:
This command will run the simulation for 20 second and write debug level log to out.log
go run main.go -d=debug -s=20 -o=out.log
This command will run the simulation for 60 second and write info level log to your terminal
go run main.go -d=info -s=60
This command will run the simulation for 60 second using the config file at the specified path
go run main.go -d=info -s=60 -p=config/xl-xq-bt-fish.txt
Multiple iteration mode
Note that when a
is true, the sim will not output any log file as it is running the same simulation multiple times. There will only be an onscreen print out that looks similar to the following:
go run ./main.go -a=true -i=20000
Progress: 0.10.20.30.40.50.60.70.80.90...done
Simulation done; 20000 iterations resulted in average dps of 12257 over 120 seconds (min: 9731.72, max: 14639.93, stddev: 714.05)
log options
The following are accepted flags to show
and hide
options, separate by comma.
options |
description |
procs |
not currently used |
damage |
show damage events (short, no details) |
hurt |
show player/shield taking damage events |
calc |
show detailed damage calcs |
reaction |
show reaction details such as element applied, resulting element, etc... |
snapshot |
show snapshot events i.e. how stats are calculated before supplied to damage calc |
status |
not currently used |
action |
actions as executed by sim |
queue |
actions that are queued to sim. different action as this is shows the sim figuring out which action from action list to queue next |
energy |
energy event such as particles |
character |
character specific logs as recorded by each character |
enemey |
currently this is just resistance debuff events |
hook |
when hooks are added or removed |
sim |
general sim debug |
artifact |
artifact specific debug log |
weapon |
weapon specific debug log |
For example go run main.go -d=debug -show=damage -o=out.log
will only show damage related logs and save to out.log
. Note that -d=debug
flag must be present as otherwise there will be no output (sim doesn't log anything to info as of yet)
Multiple options can be specified as long as they are comma separated -show=damage,reaction
how you can contribute
The following are some ways you can contribute, listed in order of most time consuming/to least:
- Come up with benchmark config files i.e. for this given config file, the expected dps should be xxx. Help reconcile difference. (These benchmarks can then be used as "unit" tests as new code gets implemented to make sure nothing breaks)
- Taking over a character's implementation in terms of gathering all necessary frame counts and detailed testing of the character including (no coding required):
- comparing sim damage line by line vs actual in game
- making sure elemental applications are applying the correct gauge at the correct time
- test different combos and making sure interaction behaves as expected
- test different weapon + artifacts used by the character and make sure interaction behaves as expected
- Running your own character setup in the sim and compare output. Provide feedback on any discrepancy
- Generally playing around with the sim, providing any sort of feedback/feature request/etc...
These are just some ideas. Any bug fixes/pull requests etc... are always welcome.
cpu profiling
CPU profilling is enabled by default for optimization purposes. If you wish to check it out, run go tool pprof -pdf cpu.pprof >| file.pdf
after running the sim (best run the sim for a longer period of time to generate useful cpu profile)
credits
- Special thanks to Yukarix#6534 and Aluminum#5462 for finding 90% of the bugs; and Terrapin#8603 for his crazy comps
- Most of the % data: https://genshin.honeyhunterworld.com/
- Tons of discussions on KeqingMain (to be added up with ppl's discord tags at some point)
- Most if not all the frame data came from https://library.keqingmains.com
- All the folks at KQM that helped out with testing (to add)