Commit Graph

132 Commits

Author SHA1 Message Date
97aedc0895
Add __slots__ to data enumerations
These types still have a __dict__, since they inherit from Enum, but
using __slots__ for the inherited properties can still improve access
times.
2021-09-18 19:18:40 -05:00
50625cdc27
Add __slots__ to internal parser types
Dynamic properties are not used by these types, so using __slots__ is
slightly more efficient. Public inherited properties are also included.
2021-09-18 19:18:39 -05:00
21ea715dd1
Refactor Action as data class
Action is now a frozen data class.

All properties of Action now have type hints, and __slots__ are used
for properties without default values (that is, name).
2021-09-18 19:18:39 -05:00
79dd51c1c2
Add README section on ideal alternative to solver
While it may be intractable to solve, understanding the true nature of
the problem space can be helpful for informing design choices.
2021-09-18 11:48:11 -05:00
72506b2cff
Increase cost of Crustacean Pincer
Spear-fishing is difficult, and only available a fourth of the time.
2021-09-14 19:47:55 -05:00
f60b8b6f6f
Fix name of tail-skipping action
It is possible to skip tails while some are already present. The wiki
had the old name when this was added to the solver, but it has since
been corrected.
2021-09-11 17:05:36 -05:00
482333b263
Add Versioning section to README
This section outlines explicit conformance to Semantic Versioning 2.0.0,
and outlines the public API.

It also introduces a tag pattern for determining whether the solver
reflects the desired state of Fallen London.
2021-09-11 16:14:35 -05:00
3ff1b2fd46
Update quadratic buyers to reflect balance changes
The Investment-Minded Ambassador yields 80% of their former secondary
revenue, while the Tentacled Entrepreneur and Teller of Terrors yield
400% of theirs.
2021-09-11 15:11:01 -05:00
32531d2b58
Update Teller of Terrors
The Teller now pays quadruple their previous secondary revenue.
2021-09-11 13:03:05 -05:00
479bad798b
Update Tentacled Entrepreneur
The Entrepreneur now pays quadruple their previous secondary revenue.
2021-09-11 12:46:03 -05:00
e0b070d2eb
Update Investment-Minded Ambassador
The Ambassador now pays four-fifths of their previous secondary revenue.
2021-09-10 20:55:41 -05:00
8cc1ddc0b5
Decouple Zoological Mania's bonus from value
Zoological Mania's bonus is now saved upon skeleton declaration,
and used when calculating results rather than being added to value
directly.

Not all buyers benefit from the bonus, so this change better reflects
the actual game.

A crash caused by failing to specify Zoological Mania has been fixed.
2021-09-10 14:58:56 -05:00
0f7eb10da8
Implement menace scaling for Vake skulls
Vake skulls now have diminishing returns beyond the first skull.

Menace calculation has been reorganized to accomodate the change.

Vake skulls are no longer capped, as the new scaling has been fully
implemented.
2021-09-01 14:04:18 -05:00
ebd2c2fc48
Implement scaling implausibility for Vake skulls
Vake skulls now have scaling implausibility, which is calculated using a
partial sum formula.

Implausibility calculation has been reorganized to accomodate the
change.
2021-09-01 13:21:47 -05:00
5d7c972169
Implement scaling value for Vake skulls
Vake skulls now have diminishing returns beyond the first skull, which
are calculated using a partial sum formula similar to joint addition.

Value calculation has been reorganized to accomodate the change.
2021-09-01 12:03:53 -05:00
abd5139aad
Limit Vake skulls to 1 temporarily
Vake skulls are now nerfed when using more than one. Until the
diminishing returns are understood, this script will now use only 1 at
most.
2021-09-01 07:23:33 -05:00
f2a421afca
Correct Searing Enigma cost
Acquiring Searing Enigmas through Khan's Heart costs two Intercepted
Cablegrams, which must also be acquired through Khan's Heart.
2021-08-31 17:06:03 -05:00
57908feb50
Update cost for Searing Enigmas
Searing Enigmas can be obtained semi-reliably at Khan's Heart through
network expansion.
2021-08-24 07:27:54 -05:00
b2a98cbe15
Add reptile fascination for Diplomat
This fascination effectively requires a Reptile declaration, and scales
with all three skeleton attributes multiplied together.
2021-08-24 07:27:54 -05:00
404ec90876
Add LICENSE
This repository uses Apache License 2.0.
2021-08-15 16:49:06 -05:00
35663dd8d4
Add list option
This option lists enumeration identifiers, along with their string forms
for clarity's sake. This makes it much easier to blacklist things
without reading the source code.

A note about listing has been added to the Blacklisting section of the
README.

A dedicated action has been created for the list command.
2021-08-14 17:55:45 -05:00
3b1ca61104
Fix BlacklistAction bug
This bug would have caused an error if BlacklistAction were used with a
different nargs.

The "verbose" argument no longer has a default specified. Instead, the
code that checks it supplies a default for itself.
2021-08-14 14:40:15 -05:00
4cf9e4f008
Add --no-verbose option
The action for "--verbose" has been changed to BooleanOptionalAction,
which adds a negative version that may be useful for overriding
configuration files.
2021-08-14 14:08:38 -05:00
cae8ac5055
Clarify nargs specifiers
Rather than using raw strings, nargs specifiers are now expressed in
terms of argparse's corresponding global variables.
2021-08-14 13:05:17 -05:00
45fb0d14e8
Update example invocation in README
The usage example now includes the blacklist argument, to better
indicate how it is meant to be used.
2021-08-14 12:14:40 -05:00
1275891b27
Tweak costs
Balmoral Woods costs now take achievable quantities of Time Remaining in
the Woods into account.

Volumes of Collated Research are now acquired using the Übergoat statue
at the Hurlers.

Trembling Amber is now acquired using the Rubbery Men opportunity card.
2021-08-13 12:14:18 -05:00
4034530ddb
Add support for configuration files
Configuration files allow common arguments like --shadowy-level and
--blacklist to be saved and referenced rather being typed out each time.

ArgumentParser has been subclassed to allow more freedom when parsing
configuration files.
2021-08-13 10:26:59 -05:00
be44c9c489
Add blacklist parameter to CLI
Blacklisting uses a dedicated action to parse arguments into enumeration
members.

Choices are not provided for this option, as it would utterly overwhelm
the help interface. This means that errors may not be as helpful,
however.

The README has been updated with a small section on blacklisting, how to
do it, and why you may wish to do it.

Options that were previously commented out are now enabled, since the
user can simply blacklist them instead.
2021-08-13 09:45:27 -05:00
dabf0ff4d7
Add blacklist parameter to solver
Enum members in this dictionary are disallowed by the solver.

The types that can be blacklisted have been added to __all__ in
solve.py.
2021-08-13 09:03:14 -05:00
cacb985be6
Fix Enum arguments that accept multiple values
EnumAction was erasing nargs before passing it to the superclass
initializer, which broke handling for arguments with consecutive values.

The help text for --desired-buyer has been updated to reflect that you
actually can specify multiple values with a single declaration now.
2021-08-13 08:27:23 -05:00
4ef31a9cca
Fix warm amber calculation
The cost was inaccurately multiplied by the number of joint additions
before.

Credit to 34Witches in the FBG Discord for diagnosing the problem.
2021-08-12 21:38:07 -05:00
90b769230b
Add skulls fascination for Diplomat
This fascination scales with all three skeleton attributes multiplied together.
2021-08-11 18:35:15 -05:00
fad2aa4158
Correct long form of exhaustion limit
The argument incorrectly used an underscore as a word separator. This
has been corrected.
2021-08-03 15:43:00 -05:00
84ad2c1455
Fix typos in README
Some of the CLI arguments in the example used underscores instead of dashes.
2021-08-03 15:38:41 -05:00
06df9e6304
Add amalgamy fascination for Diplomat
This fascination scales with the amount of amalgamy on the skeleton.
2021-08-03 15:34:37 -05:00
84c62aa3c6
Convert project to package
All scripts are now contained in a package named "bonemarketsolver".

The command-line interface has been moved to __main__.py.

The solver script has been moved to solve.py.

Relative module imports are now used where appropriate.

The invocation method of the CLI has changed: instead of running Python
itself, you can now use "pipenv run bone_market_solver".

The README has been updated to reflect the new usage method.
2021-08-03 14:48:42 -05:00
b0075ab519
Move remaining enumerations to different files
This makes it possible to split the central script up further.

Importing enum is no longer necessary for the central script, so it has
been removed.
2021-08-03 14:23:52 -05:00
a17135d85d
Move EnumAction to different file
This will make it easier to move main() in the future.
2021-08-03 13:54:36 -05:00
9cfed0f839
Specify interface and author for each module
Spelling out what is public in each module helps to futureproof the
project, and allows the main script to import the relevant names without
contravening best practices.

Buyer was missing from the main script's interface, despite being used
to call Solve. This has been fixed.
2021-08-03 12:53:25 -05:00
ed9cde4b01
Move Buyer to different file
Since the main script is no longer using Action directly, it is no
longer imported.
2021-08-03 12:43:41 -05:00
5aa070f989
Move Embellishment to different file 2021-08-03 12:38:31 -05:00
7f750f8dab
Move Declaration to different file 2021-08-03 12:31:20 -05:00
92109d5141
Move Adjustment to different file 2021-08-03 12:24:53 -05:00
66deeb50e7
Move Appendage to different file 2021-08-03 12:22:00 -05:00
cb11bf7c07
Move Skull to different file 2021-08-03 12:19:21 -05:00
ebbcf965cd
Move Torso to different file 2021-08-03 12:16:16 -05:00
ee71de9b8a
Move Action to different file
In order to move remaining enumerations into other files, dependencies
in this file need to be moved as well.

The folder is named "objects" because "types" is taken as a name.
2021-08-03 12:12:11 -05:00
27add1aa47
Move Cost enumeration to different file
Having a single extremely large file harms readability. To solve this
problem, the Cost enumeration is now in a distinct file.
2021-08-03 12:02:06 -05:00
f13497e9b8
Add README
This should make it easier for people to actually use the tool.
2021-08-03 11:33:35 -05:00
985414aeab
Add Windows-specific curses dependency
The curses module is not included with Python on Windows, and must be
installed as a package. The Pipfile has been updated to do this when run
on Windows.
2021-07-20 11:15:56 -05:00