Closed Binero closed 2 years ago
If I understand your request correctly a simple "limit" config setting per reward would suffice. Let's say the playtimeneeded is set to 60,60,60 and loop set to true and limit set to 1:day, the player would be able to claim that reward every hour, 3 times a day. Let's say playtimeneeded is set to 60, loop to true and limit to 5:hours, the player would be able to claim a reward after 1 hour of playtime every 5 hours. Now let's say in the first example the loop was set to false, the player would be able to claim a reward every hour, 3 times a day, but only for that day. Do you think that's correct and what you're looking for?
My questions:
I think your method of doing things might also work, but although it sounds nice in English I am unsure how you're thinking it'll work.
When does the counter start to count? Once the first reward is claimed, once the player starts earning playtime towards that reward or once all rewards in that limit are claimed?
The counter would go +1 every time a reward track is completed, and -1 one TracksResetAfter
after each +1.
What happens (in the first example) if a player is half way through the last claim (30 minutes left for the 3rd claim in that day) and the limit is exceeded and it should reset the loop. Would the next reward be in 30 minutes or would it also reset that time to 1 hour?
Well the limit cannot exceed 30 minutes through a claim. The count only goes up when a reward track is completed.
Is the limit counting playtime or also offline time?
For my use case, TracksResetAfter
counts actual time, regardless of online/AFK/offline status.
In very rough pseudo-code, how I imagine the algorithm would work:
while (rewardTrack.counter < rewardTrack.maxLoops && player.isOnline())
rewardTrack.increaseTimePlayed(); // gives rewards when a claim has been reached
// a reward track is complete when all claims in PlaytimeNeeded have been claimed
if (rewardTrack.completed)
rewardTrack.counter += 1;
queueEventAfter(rewardTrack.tracksResetAfter, { rewardTrack.counter -= 1 })
As an additional example:
PlaytimeNeeded: 30,30
Loop: true
MaxLoops: 2
TrackResetsAfter: 4h
Then the timeline:
Ah so I didn't really 100% get you there. I was more so thinking like this:
Config:
PlaytimeNeeded: 30,30
Loop: true
Limit: 4h
Timeline:
¹Counting starts when player logs in (count playtime) ²Counting starts when player claims first reward (count playtime) ³Counting starts when player has claimed all rewards (count playtime)
Alternate timeline:
²Counting starts when player claims first reward (count playtime). ³Counting starts when player claims first reward (count overall time).
How can the player claim the first reward two times in a row? Surely the second reward would have to be claimed first, then the cooldown would have to expire, before they can claim the first reward again?
Maybe another mechanism which is simpler yet satisfies the same use case, is to have the counter go +1 every time a reward track (i.e. all claims) has been completed, and reset the counter every day at a fixed time, for instance midnight.
The numbering is for different use cases so they are different rewards, you cannot claim the first reward twice in a row without claiming the second one first + have the counter reset.
I see now, my original suggestion is closest to your (3), although with the caveat that players can complete the track multiple times before the cooldown applies.
In retrospect, it might genuinely be easier to just have a counter that resets on a fixed time every day. This is easy to explain, easy to configure, and generally manages to serve the same use-case.
Then the counter goes up every time a reward track (all rewards) is complete, until it maxes out. Then players cannot start progress on a new reward track until the timer resets at midnight.
Isn't that the same as all my use cases without the fixed time tho? So better?
You know what, I'll make you a private jar with this feature and send it over so you can test and see if you like it.
Isn't that the same as all my use cases without the fixed time tho? So better?
The issue with (my understanding) of your suggestion is that if we configure it like this, that is, every 24 hours they can get three hourly rewards, if they get two claims done on day one, they can't get three rewards on day two any more, since they will complete the track after the first reward and initiate the cooldown.
PlaytimeNeeded: 60, 60, 60
Loop: true
Limit: 24h
Similarly if we say the counter starts after they start progress on the track, that means they can get nothing done on the first day, but 6 rewards on the second.
How I see it is, player logs on, plays for an hour, claims reward, has 24 hours to claim other 2 rewards. Yes it would mean the time he can claim rewards would always shift but it's always 24 hours from the first reward he claims.
Unfortunately is out of the scope of this plugin and won't be implemented.
The specific use case I am targetting is where players receive rewards every hour, for up to three hours per day.
Every time players finish a reward track, their amount of track completions increases by one. Then 24 hours after they completed the track, it subtracts by 1 again. While their current count of track completion is equal to the maximum, they cannot progress on a track any more.
Example backwards-compatible config:
Example not-backwards compatible config: