MOCHET [7] 
03.10.2019 15:40
 0просмотров 0 0

Cooldown - en

All of us know the situation - we play in tavern (Empire Capital, 1 deck) and drop/play a card. What we didn't know exactly is after how much turns the card will come again to us or to our enemy. Is there a minimal "cooldown" for a card? And is there also a maximal "cooldown"? Maybe after 100, 200 or even 400 turns the card will definitely come to us or our enemy.
Card tracking is very important during arcomage tournaments or during card games with high stake hence these are important questions which need to be answered.
I made several experiments and finally figured out the card-reappearance-mechanics. To make such experiments it was important to know how all the information is transfered between my computer and server. Every time you play or drop a card you send an information to server (request) where are the card ID, current turn and card position (on our hands) encoded. The game server receives our request and analyses it and finally the server sends us (to file: "arcomage.swf") the response, which contains a new card which we receive after our turn.
I used web debugging software fiddler to track the communication between my PC and server. During the experiments the web debugging software ran on my and my opponent's PC. Later the collected information was merged and  analysed with my scripts, which were written in R (statistical language R).
Side note: In arcomage we have 102 cards (ID: 0...101).

We have 3 possibilities:

1). 7 cards VS 7 cards
2). 7 cards VS 6 cards
3). 6 cards VS 6 cards

Example: I have 7 cards and my opponent has 6 cards. We use one of our cards:

I). First question:

What is the minimal card cooldown - after how much turns one of us could get this card again ?

II). Second question:

Is there an upper bound for such cooldown? So, is it possible that a used card won't reappear even after 200 turns?


I). Minimal cooldown:

1). (102 cards - (7+7))/2 = 88/2 = 44 -> minimal cooldown (both players have 7 cards) is: 44 turns.
3). (102 cards - (6+6))/2 = 90/2 = 45 -> minimal cooldown (both players have 6 cards) is: 45 turns.
Now we have an interesting case:
2). (102 cards - (6+7))/2 = 89/2 = 44.5 -> will the result be rounded up or down?
I made a long experiment (we just dropped cards for several hours) and figured out that the result will be rounded up, hence the minimal card-cooldown for  the second case is 45 turns.


II). Is there an upper bound for such cooldown?

Nope, bad news - such upper bound wasn't observed at all. In the first experiment several cards didn't reappear more than 200 turns. In the second experiment (where we played ~10 hours) were several cards which didn't reappear more than 400 turns.
But we have good news too :) - the probability of such "very long card-cooldown" is very very low.

Screenshot from first experiment

X: "How much turns the card didn't reappear?"
Y: "How often such statistical event was observed?"

Screenshot from second experiment (game lasted 10-12 hours)

X: "How much turns the card didn't reappear?"
Y: "How often such statistical event was observed?"



On both screenshots we can see that the card will almost cerntainly reappear after 45-150 turns. But there still exists a chance that this card could reappear only after 200...400...1000 turns, but such chance is extremly low.



I think that the mechanism could be realized (on the server) in the following way:

We have 2 lists: A and B. A is alist where the newly played/dropped card comes to, let's give an ID to this card: 42
A = [x,x,x,x, ..., 42], so we just append it at the end. This card will stay here for the next 44/45 turns (depends on amount of cards we have on hands). After each turn first element of array A will be taken and added to list B (on random position). Finally, after 44/45 turns our card (with ID:42) will be removed from the list A and added to the list B:
B_old =  [1,.....x, y,.....]
B_new = [1,.....x] + [42] + [y,.....]

B is another list, which works like a blackbox - we know only the size of this blackbox, but we don't know which element is on which position. Our game engine will take one random number between 1 and "length(blackbox)" (this is the size of the blackbox) and then choose one element (card) on this random position - it will be our new card which we will receive.

Возможность комментировать доступна после регистрации