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

Wrong random formula for rewards #77

Open
Pyrdacor opened this issue Nov 7, 2022 · 2 comments
Open

Wrong random formula for rewards #77

Pyrdacor opened this issue Nov 7, 2022 · 2 comments
Assignees
Labels
1.20 enhancement New feature or request game Issues related to the Amiga game
Milestone

Comments

@Pyrdacor
Copy link
Owner

Pyrdacor commented Nov 7, 2022

The reward event is used to grant all kind of stuff like attribute or skill increasements, LP/SP refill, etc. A common use case are the wishing wells which grant attributes to the whole party.

Now there is a random flag for those events. If it is unset, you just get the given value. However if it is set, you should get a random value in the range 1 to the given value. At least this is how similar potions work and which is very logical.

The original code however just calculates a value in the range 0 to "given value minus 1". So in contrast to potion effects (which are implemented by special spells), there is not 1 added to the bonus value. This might lead to situations where a reward has no effect at all.

It could be on purpose but I highly doubt it. A reward should always be noticable and in general the value given as the reward value should be the max value you can get.

I adjusted it in Ambermoon Advanced and it is this way in the remake from the beginning. Still worth a fix in the original as well imho. Wishing wells will then grant 1 to 5 points for an attribute instead of 0 to 4. Potions already grant 1 to 5.

@Pyrdacor Pyrdacor self-assigned this Nov 7, 2022
@Pyrdacor Pyrdacor added the enhancement New feature or request label Nov 7, 2022
@a1exh
Copy link

a1exh commented Nov 7, 2022

I am not familiar with the rewards mechanism in Ambermoon but I do know that rewards in other games are often misused to cheat?

Making rewards in Ambermoon do nothing might have been done because someone found a way to cheat during testing and there was no time fix the code so instead they effectively turned it off?

You know the game better than anyone, is there any way to apply a reward multiple times to gain an unfair advantage?

@Pyrdacor
Copy link
Owner Author

Pyrdacor commented Nov 7, 2022

No. Unless you duplicate items like wishing coins though savegame manipulation.

I think the mentioned issue is not related to the things you mentioned. This is no "do nothing" reward. If you provide a value and don't use randomness, you will get exactly that number. For example 5 points in strength. The error only happens if random comes to play. Instead of a random value up to the given value, you will get a random value to the given value minus one and it can happen that you even get 0 points. Potions use almost the same formula but they add 1 in the end to have 1 to 5 instead of 0 to 4.

In pseudo code it is:

int value = rand() mod 5

And potions add 1 to this.

@Pyrdacor Pyrdacor added this to the Release 1.18 milestone Feb 17, 2023
@Pyrdacor Pyrdacor added 1.18 game Issues related to the Amiga game labels Mar 24, 2023
@Pyrdacor Pyrdacor added 1.19 and removed 1.18 labels Apr 17, 2023
@Pyrdacor Pyrdacor modified the milestones: Release 1.18, Release 1.19 Apr 25, 2023
@Pyrdacor Pyrdacor added 1.20 and removed 1.19 labels Jul 20, 2023
@Pyrdacor Pyrdacor modified the milestones: Release 1.19, Release 1.20 Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.20 enhancement New feature or request game Issues related to the Amiga game
Projects
None yet
Development

No branches or pull requests

2 participants