Skip to content
This repository has been archived by the owner on Oct 21, 2023. It is now read-only.

mod: detach upkeep duration from reward duration #1217

Merged
merged 6 commits into from
Aug 7, 2023
Merged

mod: detach upkeep duration from reward duration #1217

merged 6 commits into from
Aug 7, 2023

Conversation

Muparadzi
Copy link
Contributor

@Muparadzi Muparadzi commented Aug 1, 2023

I believe DTV upkeep should be the same as other servers, where it is only influenced by the duration of the round. As the reward system rewards players based on a duration, a workaround for DTV was implemented which also influenced the upkeep. Players' upkeep was influenced by the number of players & the round they are on. This made it difficult for them to understand & plan expenses when playing DTV.

This PR adds a durationUpkeep field to enable DTV upkeep to match other servers. It is likely that rewards will need to be reduced prior to release due to this change.

@verdie-g
Copy link
Owner

verdie-g commented Aug 1, 2023

I guess that would work. I'll look for the details later. @namidaka any opinion on this?

@namidaka
Copy link
Collaborator

namidaka commented Aug 1, 2023

To me duration should always be equal to duration between ticks. Tinkering with it seems hacky and error prone to me. I'd rather have this
image
So the x1 multiplier always gives the same xp in all modes (except dtv for the moment ) and the you can tweak goldMultiplier and upkeepMultiplier. You could have a mode with very low gold (0.1) and 0 upkeep. Or both set at 0.2

@Muparadzi
Copy link
Contributor Author

The problem is that we only want the upkeep to be determined by the duration. Whereas gold reward will be defined for each wave, seperate from its duration, otherwise players have no incetive to clear waves quickly.

@namidaka
Copy link
Collaborator

namidaka commented Aug 1, 2023

The problem is that we only want the upkeep to be determined by the duration. Whereas gold reward will be defined for each wave, seperate from its duration, otherwise players have no incetive to clear waves quickly.

This would be a change in upkeep philosophy as it would make the even breakpoint dependent on team performance.
What's the argument for having gold dependent only on wave instead of having xp dependent on wave , and gold dependent on duration?

@Muparadzi
Copy link
Contributor Author

I think it is fair to reward the players with XP & gold determined by their ability to get through x amount of waves. Having a duration based reward defeats the purpose of clearing those waves, and I think it is important to reward both XP & gold in the same manner for this case.

That said, I'm only looking to charge upkeep based on time rather than scaling together with the reward.

@namidaka
Copy link
Collaborator

namidaka commented Aug 1, 2023

I think it is fair to reward the players with XP & gold determined by their ability to get through x amount of waves. Having a duration based reward defeats the purpose of clearing those waves, and I think it is important to reward both XP & gold in the same manner for this case.

That said, I'm only looking to charge upkeep based on time rather than scaling together with the reward.

Then for that purpose it's fine.

Copy link
Owner

@verdie-g verdie-g left a comment

Choose a reason for hiding this comment

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

I'll have a look to the details tomorrow

/// <param name="defenderMultiplierGain">Multiplier to add to the defenders. Can be negative.</param>
/// <param name="attackerMultiplierGain">Multiplier to add to the attackers. Can be negative.</param>
/// <param name="valourTeamSide">Team to give valour to.</param>
/// <param name="constantMultiplier">Multiplier that should be given to everyone disregarding any other parameters.</param>
/// <param name="updateUserStats">True if score and rating should be saved.</param>
public async Task UpdateCrpgUsersAsync(
float durationRewarded,
float durationUpkeep,
Copy link
Owner

Choose a reason for hiding this comment

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

What do you think of making this null by default and use durationRewarded if it's null? That way you don't need to change the other game modes.

Suggested change
float durationUpkeep,
float? durationUpkeep = null,

@@ -23,6 +23,7 @@ internal class CrpgDtvServer : MissionMultiplayerGameModeBase
private bool _waveStarted;
private MissionTimer? _waveStartTimer;
private MissionTimer? _endGameTimer;
private MissionTimer? _roundTimer;
Copy link
Owner

Choose a reason for hiding this comment

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

I don't think you need a MissionTimer here but just a MissionTime.

Suggested change
private MissionTimer? _roundTimer;
private MissionTime _currentRoundStartTime;

@Muparadzi Muparadzi requested a review from verdie-g August 3, 2023 08:49
@@ -191,11 +193,13 @@ private void CheckForWaveEnd()
{
bool viscountDead = !Mission.DefenderTeam.HasBots;
bool defendersDepleted = Mission.DefenderTeam.ActiveAgents.Count == (viscountDead ? 0 : 1);
float roundDuration = _currentRoundStartTime != null ? _currentRoundStartTime.ElapsedSeconds : 0;
Copy link
Owner

Choose a reason for hiding this comment

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

I think MissionTime is a struct so the null check is redundant

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've removed the null check

@verdie-g verdie-g merged commit b7bbbfe into verdie-g:master Aug 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants