Commit Graph

188 Commits

Author SHA1 Message Date
Jeremy Saklad 0b1ed974c1
feat(data): Add Glim-Encrusted Carapace
This shiny new torso costs 3,000 Stuiver, which is a new currency that
has also been added to the list of costs.
2024-04-22 08:31:47 -05:00
Jeremy Saklad ca7e4c7fc0
style(data): Sort torsos by style value 2024-04-22 08:09:33 -05:00
Jeremy Saklad 7f8c9f7c32
feat(solver): Update Counter-church value of Holy Relics of St. Fiacre
Holy Relics have been nerfed, with different values for each torso type.
The new values don't follow an obvious formula, unfortunately, so they
have to be hard-coded for each Torso Style value.

This will need to be maintained going forward if new Torso Styles become
possible.
2024-03-08 13:14:26 -06:00
Jeremy Saklad a2956a773a
feat(data): Update Torso Style of Segmented Ribcage
Segmented Ribcages have been nerfed to reduce the amount of
Counter-Church Theology they grant.
2024-02-23 09:08:40 -06:00
Jeremy Saklad 8848c129db
chore: Update OR-Tools to 9.8 2024-02-23 07:37:41 -06:00
Jeremy Saklad 0bd31f4f91
chore: Update OR-Tools to 9.5 2023-03-14 07:40:21 -05:00
Jeremy Saklad b85440e3cd
feat(buyer): Add spider fascination for Diplomat
This fascination works in the same manner as the other declaration-based
fascinations.
2022-11-29 10:17:18 -06:00
Jeremy Saklad c665b13ad6
chore: Add .mailmap
This is used to canonicalize commits made with an old email address.
2022-11-14 12:09:46 -06:00
Jeremy Saklad e8d8013ca6
feat(costs): Add source for Obsidian Chitin Tails
Due to the amount of variables at play, the actual cost may be slightly
higher with poor luck. This will be adjusted if it becomes an issue.
2022-09-09 07:35:38 -05:00
Jeremy Saklad 0646b73bf1
feat(costs): Change source of Thorned Ribcages
Calling in Favours: Hell is a much better source than hunting
Terror-Birds.
2022-09-09 07:30:06 -05:00
Jeremy Saklad 69b778254b
feat(costs): Correct cost of Knotted Humeri
Knotted Humeri were less useful in the past, so setting their cost to
zero reflected the tendency to have an overabundance of them. They've
become more practical over time, however, so the cost now assumes you go
out of your way for them.
2022-09-09 07:29:59 -05:00
Jeremy Saklad c4e1c5a322
feat(costs): Change source of Flourishing Ribcages
You can now get two Flourishing Ribcages at a time by calling in Rubbery
Man favours at Jericho Locks.
2022-08-23 08:01:47 -05:00
Jeremy Saklad 0c2a1a0515
fix: Correct segmented ribcage cost
When using a Segmented Ribcage as a tail, the cost in Nevercold Brass is
calculated before the additional segment is taken into account.
2022-08-22 18:21:52 -05:00
Jeremy Saklad d6178ba241
feat: Update cost of Segmented Ribcage
Segmented Ribcages are now obtainable from Port Cecil.

Since the byproduct of the carousel that produces them is
disproportionately large, it has been factored into the cost.
2022-08-15 19:12:06 -05:00
Jeremy Saklad 1bf13a0900
feat: Update cost of Fossilised Forelimbs
Fossilised Forelimbs now cost 85 Hinterland Scrip from Anning and
Daughters, which makes Palaeontological Discoveries a better source.
2022-08-11 16:03:40 -05:00
Jeremy Saklad 92e734d5d2
feat: Implement support for Segmented Ribcage
Segmented Ribcages may be used in several unique ways, including a
special scaling cost that necessitated the bulk of the code changes.
2022-06-03 20:00:09 -05:00
Jeremy Saklad bb21eccca8
feat: Add Segmented Ribcage to appendages
Segmented Ribcages can be used to add more limb slots, but carry a
variety of unusual requirements. In addition to a scaling cost in
Nevercold Brass, they require an unfilled tail slot when applied.

It may be prudent to clean up the partial sum formula using helper
methods in the future, as it currently requires a considerable number of
intermediate terms.

itertools.repeat is now being used to perform exponentiation, rather
than repeating terms directly.
2022-06-03 19:54:34 -05:00
Jeremy Saklad b4319464a1
feat: Add Segmented Ribcage to skulls
This skull is unique for requiring a specific torso style, and for
adding additional limb slots.
2022-06-03 19:54:34 -05:00
Jeremy Saklad 7193c29a5f
feat: Add Segmented Ribcage to torsos 2022-06-03 19:54:34 -05:00
Jeremy Saklad 5075e773ee
feat: Add Segmented Ribcage to costs
The Segmented Ribcage has no known source outside a specific Whitsun
egg, much like the Obsidian Chitin Tail. As such, it has been given a
placeholder price that prevents it from being used normally.
2022-06-03 19:54:21 -05:00
Jeremy Saklad 0757dc3275
fix: Include effects of skulls when adding joints
The cost of adding joints is dependent on the current amount, which may
be affected by both the torso and skulls.

The new implementation still ignores the effects of other Appendage
actions, since joints may be added before doing anything else. This may
warrant revisiting in the future.
2022-05-26 08:12:34 -06:00
Jeremy Saklad aa6a294d55
feat: Add segment property to actions
This is used to track the number of segments in a skeleton, which
is affected by a new bone.
2022-05-26 06:55:02 -06:00
Jeremy Saklad 57a2e9ce36
fix: Restore default number of workers
OR-Tools 9.3 no longer seems to use more than one worker by default, so
this parameter is once again set by the script.

The parameter has also been changed from num_search_workers to
num_workers internally, though the former is mapped to the latter.
2022-04-19 10:02:03 -05:00
Jeremy Saklad a074b44b87
Fix regression in help output
Argument parsing seems to intermittently choke on --help if a default
value for verbosity is not explicitly supplied.
2022-04-11 14:59:16 -05:00
Jeremy Saklad 0f254d837d
Remove extraneous line in Pipfile 2022-04-11 14:11:15 -05:00
Jeremy Saklad 8cb2ba5676
Update OR-Tools to 9.3
Despite being a minor version, OR-Tools 9.3 has breaking changes to
CP-SAT in the form of renamed methods.
2022-04-11 13:38:25 -05:00
Jeremy Saklad 497e052ad7
Fix regression in intermediate variables
Reusing non-constant integer variables was causing constraints to
propagate in unintended ways, resulting in incorrect restrictions on the
solver's output.

This should not be an issue for constants, as they are already
restricted to one value.
2022-02-15 09:55:55 -06:00
Jeremy Saklad 0a7de36807
Create intermediate integer variables for non-constants
Reusing an intermediate variable causes constraints on the intermediate
to be applied to the original, which can have unintended consequences.
2022-02-15 09:51:25 -06:00
Jeremy Saklad 551363b9b7
Replace unnecessary variables with lambdas
Variables that are only used in one line lend undue complexity to code.
Using a one-shot lambda makes the use of a declaration much more
obvious.
2022-01-02 17:57:53 -06:00
Jeremy Saklad 15317f6298
Avoid extraneous intermediate variables
Intermediate variables should not be necessary if the equivalent
expression is a constant or a variable with the same bounds.

This change reduces the total number of variables in the model.

The documentation of BoneMarketModel.NewIntermediateIntVar has been
tweaked to allow for any number of constraints.
2022-01-02 17:28:58 -06:00
Jeremy Saklad 40e34bb43c
Update OR-Tools to 9.2
The new version of OR-Tools does not necessitate major changes, but has
some performance improvements and support for Python 3.10.

On a related note, Python 3.10 is now required.
2022-01-02 15:07:28 -06:00
Jeremy Saklad f934861f55
Add gitignore file
Pipfile.lock is ignored because it won't work between different
platforms if the dependency requirements diverge.

Python compilation products are ignored, as they are derived directly
from Python source files.
2021-11-25 10:08:39 -06:00
Jeremy Saklad c6ae446fa0
Add leg fascination to Diplomat
This fascination works similarly to the skull-based fascination.
2021-11-02 15:26:08 -05:00
Jeremy Saklad 69cbaeeb48
Remove unnecessary model hints
These hints don't actually improve performance in practice, so they have
no reason to remain.
2021-10-28 00:20:30 -05:00
Jeremy Saklad 6e4a3a0117
Add amphibian fascination for Diplomat
This fascination works similarly to other declaration-based fascinations.
2021-10-28 00:19:39 -05:00
Jeremy Saklad 39df88eedd
Refactor complex buyers
Buyer requirements now use helper methods and control flow to increase
readability and compactness.

The main benefit of this is no longer having to declare intermediate
variables.
2021-10-19 22:20:02 -05:00
Jeremy Saklad e211becb30
Add type hints to helper functions
For the sake of maintainability, it is very important the parameters and
results of the helper functions are spelled out explicitly.

Union type hints are being left until Python 3.10 is supported.
2021-10-16 17:17:56 -05:00
Jeremy Saklad 40246c4815
Remove BoneMarketModel.AddDivisionMultiplicationEquality
This function has been obsoleted by the ability to pass partial methods
as parameters to helper functions.

Use of this function has been replaced with partial methods accordingly.

In addition, the following code style has been applied: partial methods that
contain a nested partial method have the function arguments broken into
distinct lines. This means that the bottom partial method is formatted in the
same manner as a partial method without any nesting.
2021-10-16 15:11:12 -05:00
Jeremy Saklad 1175575c92
Remove BoneMarketModel.AddDivisionApproximateExponentiationEquality
This function has been obsoleted by the ability to pass partial methods
as parameters to helper functions.

Use of this function has been replaced with partial methods accordingly.
This has allowed some intermediate variables to be removed entirely,
allowing for further simplification.
2021-10-16 13:14:30 -05:00
Jeremy Saklad 6b9643041a
Overload BoneMarketModel.NewIntermediateIntVar
Intermediate integer variables can now be created for compatible partial
methods, which massively increases the expressiveness of each helper
function.

This change should allow the compound helper functions, such as
AddDivisionMultiplicationEquality, to be removed entirely. It will also
allow even the most complex buyers to avoid intermediate variables.
2021-10-16 13:04:31 -05:00
Jeremy Saklad fd8abb7501
Update Trifling Diplomat to use new formulae
The Trifling Diplomat fascinations that previously exhibited quasi-cubic
scaling have a new formula using the mean of amalgamy, antiquity, and
menace.

To eliminate unnecessary reptition, all fascinations have been
completely refactored and combined using the new helper methods and design patterns.

A comment has been added to mark The Trifling Diplomat's code, since it
is noticeably less readable than that of other refactored buyers.
2021-10-16 10:28:07 -05:00
Jeremy Saklad 9671190059
Add BoneMarketModel.AddDivisionApproximateExponentiationEquality
This method combines two common operations, avoiding the need for
intermediate variables at the call site.
2021-10-16 10:22:31 -05:00
Jeremy Saklad b5a047889d
Add menace fascination for Diplomat
This fascination scales quadratically with menace.
2021-10-15 21:39:41 -05:00
Jeremy Saklad 110f524f62
Update OR-Tools to v9.1
This update, despite ostensibly being a minor version, includes breaking
changes that must be accounted for.

Overflow is much more strictly checked, so the magnitude of certain
constants has been decreased.

CP-SAT's default number of workers has been changed to reflect the
default of this script. As such, the script no longer needs to change
that parameter unless a specific number of workers has been specified.

In light of the breaking changes, the OR-Tools version is now pinned at
9.1 instead of being permitted to use future minor versions.
2021-10-15 21:32:55 -05:00
Jeremy Saklad 5a3f4f6454
Refactor simpler buyers
Buyer requirements now use helper methods and control flow to increase
readability and compactness.

The main benefit of this is no longer having to declare intermediate variables directly.

This is a work-in-progress, as some buyers have complex formulae that
necessitate more work or additional helper methods to refactor.
2021-10-15 17:46:13 -05:00
Jeremy Saklad 77db9fef92
Clamp attributes to zero or more
Amalgamy, antiquity, menace, and implausibility are now clamped to be
non-negative. This simplifies a number of calculations, eliminates a few
insiduous calculation errors, and reflects the actual game.

This change impacts the output of the program, which previously showed
negative values even though they weren't actually possible.
2021-10-15 17:12:20 -05:00
Jeremy Saklad 1bf18fe8e1
Add BoneMarketModel.AddDivisionMultiplicationEquality
This method combines two common operations, avoiding the need for
intermediate variables at the call site.
2021-10-15 15:05:17 -05:00
Jeremy Saklad 46edfcb35b
Override CpModel.AddDivisionEquality
The overridden method supports enforcement literals using indirection.
2021-10-15 15:05:07 -05:00
Jeremy Saklad 06dd19bb45
Refactor declaration requirements
Declaration requirements now use helper methods and generator
expressions to increase readability and compactness.

Requirements are ordered and grouped by quantity.

The comments on declaration requirements have been removed, as the new
pattern is far easier to read.
2021-10-15 15:04:37 -05:00
Jeremy Saklad 6f0e0ac379
Add BoneMarketModel.AddIf method
This method allows a series of constraints to be applied all at once
using the same enforcement literal, which can substantially improve
readability and writability.
2021-10-15 15:04:37 -05:00