iampythagoras / ffxiv-combat-simulator Goto Github PK
View Code? Open in Web Editor NEWEnvironment in which the simulation of FF14 combat (with multiple people) is possible.
License: MIT License
Environment in which the simulation of FF14 combat (with multiple people) is possible.
License: MIT License
The definition for BloodRequirement
, reproduced below, seems from my understanding of the code to let players use Bloodspiller, Quietus, and Living Shadow even when Player.Blood < 50
, since it always return (True, -1)
.
def BloodRequirement(Player, Spell):
if Player.DeliriumStacks > 0 and (Spell.id == Bloodspiller.id or Spell.id == Quietus.id):
Spell.BloodCost = 0
Player.DeliriumStacks -= 1
return True, -1
elif Player.Blood >= 50:
Player.Blood -= 50
return True, -1
return True, -1
I think that TBNRequirement
and EdgeShadowRequirement
are similar in that they return (True, -1)
even when you have insufficient mana.
Piggybacking off #15 a little bit, I'd like to suggest a json file for submitting stats and actions for a team. I don't have a defined format in my head, but maybe something like:
{
"BLM": { // friendly name
"job": "Black Mage",
"stats": {
"MainStat": 2945, // etc
},
"opener": [
"SharpCast", // etc
]
},
// other jobs to sim at the same time here
}
I think this would remove 90% of the editing requirements for main.py
, which would be helpful โ and it could be rolled into cli work; perhaps something like ffxivcombatsim simulate --party /path/to/party.json
?
Hi. First of all, nice Project. I'm the creator of the BLM sheets, and a bunch of other sheets as well.
You say here in your code that https://github.com/IAmPythagoras/FFXIVPPSCalculator/blob/39d2d534f727257432ee6594fcc8fd50857f5b01/Fight.py#L105
This is obviously true in the general sense. Binom limits in poisson which limits in a normal distribution. This is only true though for several million samples. From your documentation, n is the number of spells in a sequence, which is far far below that number.
I doubt I need to illustrate the issue but let's do it anyway
This is the distribution of a long BLM rotation with a few thousand samples.
here for a few 100k samples
and for a few millions. We see the limit here for millions of iterations of a long sequence of spells.
Now for comparison the sequence F4 F4 F4 F1 F4 F4 swift F4
:
As you can see here, even with millions of samples, this looks far from normal. (The Graphs were made by Nemekh several years ago, many thanks for that again).
Imo the approach of making distributions in this project is completely backwards: You assume a mean value, then assume a distribution and calculate sigma and thus graph the spread. Instead you should just monte carlo it. Array and calculate each individual damage event (not the mean! The real event, Factoring in crit chance and buffs etc) and make a histogram from that. Then Calculate a sigma based on this data.
You might ask "why are you not doing that in your cheats then?" Because I can't. I don't calculate indivisual damage events. I calculate essentially a single hit with potency of my pps value. Without individual hits I need to do some tricks to make it work. You don't have this issue so it would be way better to just do it better.
To make life easier for CLI, I'd like to implement argparse and write a frontend to the current main.py
and tui.py
. I don't have the whole idea of how to do it yet, but perhaps something like:
ffxivcsim tui # launches tui
ffxivcsim simulate fflogs ${fflogs_id} --client-id=1234 --client-secret=abcd # alternatively get client id and client secret out of a config file somewhere
If you can lay out how you want the command line to perform, I can mock it out while I'm doing other things.
It might be a good idea to commit a license. I would suggest MIT or Apache, but it's important โ without the license, it's technically a gray area to use your code since it might be implicitly considered to be a standard copyright with all rights reserved.
Checking with mypy .
yields a lot of warnings:
hosakaii:FFXIVPPSCalculator king$ mypy .
Jobs/Tank/Tank_Spell.py:1: error: Cannot find implementation or library stub for module named "Jobs.Base_Spell"
Jobs/Tank/Tank_Spell.py:2: error: Cannot find implementation or library stub for module named "Jobs.Melee.Melee_Spell"
Jobs/Tank/Tank_Player.py:1: error: Cannot find implementation or library stub for module named "Jobs.Base_Player"
Jobs/Tank/Warrior/Warrior_Spell.py:5: error: Cannot find implementation or library stub for module named "Jobs.Base_Spell"
[---->8----]
SimulationInput.py:58: error: Cannot find implementation or library stub for module named "Jobs.Melee.Dragoon.Dragoon_Player"
SimulationInput.py:59: error: Cannot find implementation or library stub for module named "Jobs.Melee.Reaper.Reaper_Player"
SimulationInput.py:60: error: Cannot find implementation or library stub for module named "Jobs.Melee.Monk.Monk_Player"
Found 274 errors in 54 files (checked 57 source files)
Some of this can be fixed by restructuring the code to look more like a module; other parts can be fixed by adding typing to it. Typing isn't the end-all be-all solution, but being able to have autocomplete in tools that suggest it (along with immediate feedback like "this is the wrong type") can speed development time and reduce errors.
I personally use python 3.10, which (if you do the same) would mean some better typing support and also supports structural pattern matching (which you could pretty immediately use as a case statement in some of the code I've glanced through to clean up some things).
I'd suggest putting the supported version in a .python-version
file so tools like pyenv
can take immediate advantage of it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.