Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit rupie and other resource quantities #623

Open
SapiensAnatis opened this issue Jan 24, 2024 · 1 comment
Open

Limit rupie and other resource quantities #623

SapiensAnatis opened this issue Jan 24, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@SapiensAnatis
Copy link
Owner

Context
In the original game, most resources had a cap which was based on base10 digits, such as 9,999,999,999 (9.9 billion) for rupies.

Currently, our limits to these values are only based on the underlying data type, so in the example of rupies, it will be long.MaxValue or 9,223,372,036,854,775,808. The behaviour when exceeding this is undefined -- most likely it would overflow to -long.MaxValue which is undesirable.

Also worth noting is that some interfaces can behave unexpectedly when exceeding the cap even slightly -- for instance, collecting Halidom income with over 9.9 billion rupies owned visually sets your rupies to 9,999,999,999 until you exit the castle.

The feature request
Resource caps should be implemented in Dawnshard for all applicable resources. Resources that exceed the cap must be handled appropriately based on the behaviour from the original game - I suspect that means either discarding them or sending them to the gift box on a case by case basis.

@SapiensAnatis SapiensAnatis added enhancement New feature or request good first issue Good for newcomers labels Jan 24, 2024
@SapiensAnatis
Copy link
Owner Author

Note to any contributors: the high level approach here at least for rupies would be to:

  1. Separate out rupies from GenericRewardHandler and create CoinRewardHandler (coin being the internal msgpack name, which we generally prefer to match in code)
  2. Implement any custom cap logic here. It may be necessary to update calls to RewardService to handle a 'capped' result.
  3. Repeat as necessary for other entity types that should be capped. Off the top of my head: mana, materials, honey, were all subject to caps. There are almost certainly others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant