- Joined
- Feb 28, 2025
- Messages
- 11
Hey there,
I'm currently working on my Assistance System for a Moba-Typed Map. The Assistance systems out there doesn't fit my needs so i began to code one myself.
I managed to fulfill all my needs and coded it bugless. The only thing I'm questioning is about my Indexing.
For you to understand I'll explain how my System works:
First of all there are only 10 playing Players. 5 playing Players for each Force (Force 1, Force 2).
Player 1 (Bot), Player 2, Player 3, Player 4, Player 5, Player 6 belongs to Force 1
and the rest to Force 2.
Now my indexing looks like this:
If Player 1 attacks Player 8 => Index = 18
If Player 1 attacks Player 9 => Index = 19
If Player 1 attacks Player 10 => Index = 110
If Player 1 attacks Player 11 => Index = 111
If Player 1 attacks Player 12 => Index = 112
If Player 2 attacks Player 8 => Index = 28
...
Now for this indexing method a problem appears:
If Player 11 attacks Player 2 => Index = 112
Its the same Index as for Player 1 attacks Player 12. So they share the same Timer.
I managed to fix it, through giving Player 11 a Custom Player Number 14. But this solution isn't quite beautiful.
So back to topic: this means every Player can have 5 maximum Timer.
Why I indexed it like this?
Because I need a unique Number depending to the DamageSource and the DamageTarget.
So after a hero or unit damages an enemy hero, which was damaged before from the same player the specific Timer just refreshes.
An simply Indexing wouldn't work for my special usecase. When I always count Index +1, I would have to many Timers but the Timers should be limited to 5 for each Player.
So my question is: Do you know a better Indexing for this Usecase?
I'm currently working on my Assistance System for a Moba-Typed Map. The Assistance systems out there doesn't fit my needs so i began to code one myself.
I managed to fulfill all my needs and coded it bugless. The only thing I'm questioning is about my Indexing.
For you to understand I'll explain how my System works:
First of all there are only 10 playing Players. 5 playing Players for each Force (Force 1, Force 2).
Player 1 (Bot), Player 2, Player 3, Player 4, Player 5, Player 6 belongs to Force 1
and the rest to Force 2.
Now my indexing looks like this:
If Player 1 attacks Player 8 => Index = 18
If Player 1 attacks Player 9 => Index = 19
If Player 1 attacks Player 10 => Index = 110
If Player 1 attacks Player 11 => Index = 111
If Player 1 attacks Player 12 => Index = 112
If Player 2 attacks Player 8 => Index = 28
...
Now for this indexing method a problem appears:
If Player 11 attacks Player 2 => Index = 112
Its the same Index as for Player 1 attacks Player 12. So they share the same Timer.
I managed to fix it, through giving Player 11 a Custom Player Number 14. But this solution isn't quite beautiful.
So back to topic: this means every Player can have 5 maximum Timer.
Why I indexed it like this?
Because I need a unique Number depending to the DamageSource and the DamageTarget.
So after a hero or unit damages an enemy hero, which was damaged before from the same player the specific Timer just refreshes.
An simply Indexing wouldn't work for my special usecase. When I always count Index +1, I would have to many Timers but the Timers should be limited to 5 for each Player.
So my question is: Do you know a better Indexing for this Usecase?