GameServer icon indicating copy to clipboard operation
GameServer copied to clipboard

Handle buffs using priority queue

Open danil179 opened this issue 4 years ago • 6 comments

Remove timers and use proper tick system to handle the buffs using priority queue of duration and order. This will assure efficient & correct handling of buffs.

danil179 avatar Oct 13 '19 04:10 danil179

Resolved via #954

lzardy avatar Feb 20 '20 03:02 lzardy

@microsoftv It wasn't resolved, as buffs don't use priority queue yet.

danil179 avatar Feb 20 '20 05:02 danil179

What do you mean by priority queue then? As far as I can see I handle buffs by duration and order. Oldest buff has the lowest index.

lzardy avatar Feb 20 '20 12:02 lzardy

@microsoftv https://en.wikipedia.org/wiki/Priority_queue The running times are much better with this data structure (no iteration)

danil179 avatar Feb 21 '20 01:02 danil179

Remove timers and use proper tick system to handle the buffs using priority queue of duration and order. This will assure efficient & correct handling of buffs.

@danil179 Should we realy use Buff.Duration for that or rather implement a Buff.Priority which defaults to Buff.Duration ? This way we could overwrite the priority easily if needed.

superewald avatar Sep 08 '20 21:09 superewald

@superewald I think that there are cases when 2 buffs start in the same time and then we want priority. So it is good to have a field Buff.Priority. Currently, let's just copy the duration, and later we will add the another 2nd number (so it will be like vector2 with specific comparison) that decides these cases.

danil179 avatar Sep 09 '20 12:09 danil179