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

Allow tuv to be set to 0. #11896

Merged
merged 2 commits into from
Aug 29, 2023
Merged

Allow tuv to be set to 0. #11896

merged 2 commits into from
Aug 29, 2023

Conversation

WCSumpton
Copy link
Contributor

@WCSumpton WCSumpton commented Aug 21, 2023

This change allows tuv to be set to 0 and be used for calculations. Also, a check was added for the proper values.

Change Summary & Additional Notes

tuv default setting is -1. There was no check for proper values. And when the tuv is calculated, the check was for greater than '0'. Please see here, for the discussion with @Cernelius.

Note: PoS2 should be updated, showing the proper values.

Cheers...

CHANGE|Allows a zero (0) value to be valid when using the "tuv" option for unitAttachment.

This change allows tuv to be set to 0 and be used for calculations. Also a check was add for the proper values.
@asvitkine
Copy link
Contributor

Thanks!

Can you add a release note message per the instructions here?
https://github.com/triplea-game/triplea/blob/master/docs/development/reference/pr-release-notes.md

Also, it would be helpful to describe what this effects exactly.
From the linked thread, I guess the goal is to have the engine really treat the TUV as 0 and not try to calculate it like it does when it's not provided? (Does this just affect the player table display for information purposes or something else too?)

@Cernelius
Copy link
Contributor

Also, it would be helpful to describe what this effects exactly. From the linked thread, I guess the goal is to have the engine really treat the TUV as 0 and not try to calculate it like it does when it's not provided? (Does this just affect the player table display for information purposes or something else too?)

Beside the AI (which I assume should be influenced in its choices by seeing the unit as having the specified value, depending on how the AI works), I believe that the only not merely informative application is for testing options requiring a minimum TUV destruction to return true in conditions (or objectives).

@WCSumpton
Copy link
Contributor Author

Also, it would be helpful to describe what this effects exactly.
From the linked thread, I guess the goal is to have the engine really treat the TUV as 0 and not try to calculate it like it does when it's not provided? (Does this just affect the player table display for information purposes or something else too?)

That is correct, this will allow a TUV value to be set to 0, and calculation are done when set to less then 0. Now a value of 100, will not be calculated. A value of 0, -1 (default) and -100 will be calculated, but are all valid values for TUV. So this introduces a GameParseException (Error Check) with a message explaining the proper values. This value is also used in destroyedTUV, and is also used by the AI when calculating battles and purchases.

@WCSumpton
Copy link
Contributor Author

CHANGE|Allows a zero (0) value to be valid when using the "tuv" option for unitAttachment.

@WCSumpton
Copy link
Contributor Author

As to the suggestion that a negative value be allowed. That would also be possible, but I feel that further discussion is needed about how this would affect other places that TUV is used.

@asvitkine asvitkine merged commit 7281b74 into triplea-game:master Aug 29, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants