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

Add decay-time, recovery-time, and owned-decay-time #864

Merged
merged 3 commits into from
May 19, 2021

Conversation

mrcookieunderscore13
Copy link
Contributor

@mrcookieunderscore13 mrcookieunderscore13 commented May 8, 2021

Addresses #803

Edit: below is outdated, check comment for up-to-date description
I added decay-time, recovery-time, and owned-decay-time attributes to control points. All of these attributes are in units of time. So, for example, if recover-time="5s", assuming a captured point that is 50% uncaptured, it will take 2.5 seconds to recover to fully captured. 99% uncaptured will take ~5s.

Another thing to note is that if an equal number of defenders and attackers(non-dominating team) are standing on the point, the point will decay/recover/owned-decay.

Signed-off-by: mrcookie

Copy link
Member

@Pablete1234 Pablete1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When implementing recovery & decay, incremental has to be mutually-exclusive with them, and code-wise incremental needs to go away, since it's equivalent to instant decay & recovery.

Visit http://docs.oc.tc/modules/control_points for the 1.9+ PGM documentation about how to properly havee incremental, recovery & decay attributes play together:

There's also the parsing code from 1.9+ PGM regarding this topic: https://github.com/OvercastNetwork/ProjectAres/blob/master/PGM/src/main/java/tc/oc/pgm/controlpoint/ControlPointParser.java#L80
Also the dominate code for reference: https://github.com/OvercastNetwork/ProjectAres/blob/master/PGM/src/main/java/tc/oc/pgm/controlpoint/ControlPoint.java#L383

…GM. Changed everything from units of time to rate.

Signed-off-by: mrcookie <[email protected]>
@mrcookieunderscore13
Copy link
Contributor Author

mrcookieunderscore13 commented May 11, 2021

Everything was changed to rates rather than units of time. Also, the functionality was changed to mimic that of 1.9 PGM. Here is a quick run-down of what each attribute defines:

recovery-rate: Point recovers to its current state. Applies when the point owner is dominant or when a non-capturing team is dominant. A team must be dominant for this to take effect.

decay-rate: Point "decays" to its current state. Applies when nobody is dominating the point (zero players on point or lead = 0)

owned-decay-rate: Point decays from captured to neutral. Applies when nobody is dominating the point, same as decay.

owned-decay-rate takes precedent over decay-rate. So, if both have defined values and nobody is dominating the point, the point will decay towards neutral rather than "decaying" towards fully captured.

Also, here is an explanation of what rate implies: if time to capture is 10 seconds, and the owned-decay-rate is 2, then it will decay to neutral in 5 seconds.

Also worth noting, most of the code here was not my own, I copied a lot of it from the 1.9 PGM codebase with some minor adjustments.

Copy link
Member

@Pablete1234 Pablete1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's looking pretty good, make sure you test this with multiple existing maps as well as modified xmls to test the new features and make sure they all both work as intended, and fit the needs of the original issue

Signed-off-by: mrcookie <[email protected]>
@mrcookieunderscore13
Copy link
Contributor Author

Update: just added Pablo's changes, and tested on lots of cp maps. Existing maps work correctly and the new features work correctly as well 😄.

Copy link
Member

@Electroid Electroid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tracking this down and working with Pablo, looks ready to roll! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants