Arimaa Forum (http://arimaa.com/arimaa/forum/cgi/YaBB.cgi)
Arimaa >> Site Discussion >> Time calculation Bug in V1 client ?
(Message started by: Tachyon on Oct 19th, 2008, 2:11am)

Title: Time calculation Bug in V1 client ?
Post by Tachyon on Oct 19th, 2008, 2:11am
I have noticed that when I am playing blitz games using the V1 client ... my time starts counting down when the opponent starts making his move ... which takes about 2 seconds ... so when I know what the opponent's move is I have already lost 2 seconds out of the 15 seconds allowed for my move. Surely the time should only start counting down once the opponent has completed his move ?

Title: Re: Time calculation Bug in V1 client ?
Post by Tachyon on Oct 21st, 2008, 1:43am
I have tried the V2 client and it seems to do this as well ??

Title: Re: Time calculation Bug in V1 client ?
Post by jdb on Oct 21st, 2008, 5:45am
I think this is due to lag over the internet. Your time starts when the server gets your opponent's move.

Title: Re: Time calculation Bug in V1 client ?
Post by RonWeasley on Oct 21st, 2008, 6:31am

on 10/21/08 at 05:45:12, jdb wrote:
I think this is due to lag over the internet. Your time starts when the server gets your opponent's move.


I think the part about time starts when the server gets the move is true.  The issue seems to be that after the server gets the move and starts your timer, it starts moving the pieces.  At normal speed, four steps can consume precious seconds before you see the new position.  Slower if there's a capture.

I think there's a movement speed knob you can set to make the pieces move faster.  Top speed is very fast.  I just looked and couldn't find it.  Help?

Title: Re: Time calculation Bug in V1 client ?
Post by Tachyon on Oct 21st, 2008, 2:59pm
I dont think the problem is caused by internet lag, it is caused by the time it takes to make a move.


I assume that the event sequence goes something like this :

1) Player makes move & Press send
2) Client sends move to server.
3) Server receives move, bot calculates next move
4) Server sends new move to client.
5) Client receives move from server & starts timer
6) Client makes move
7) Player can now move

If this is the case ... the problem lies with steps 5 and 6

Surely this should be

5) Client receives move from server & makes move
6) Client starts timer.

The principal should be ... a move is not made until the opponent knows what the move is. For humans the move is communicated via moving the pieces. So the move is not made until the pieces are in place.

The way it works now is like a player in chess being allowed to start his opponent's clock and then only make his move. This does not make sense

The way it currently works, human players effectively play blitz games with a 2 second handicap per move i.e. 13 secs vs bot 15 secs

It probably also effects games with other time settings but the effect increases dramaticaly with fast games.

Title: Re: Time calculation Bug in V1 client ?
Post by Fritzlein on Oct 21st, 2008, 4:31pm
I'm pretty sure that the game clock is kept server-side.  Therefore your clock is running during the transmission of the move to you, and during the display of the move, and during the time it takes for your move to get back to the server.  This is obviously unfair to people with slow Internet connections, and the time control must be padded for display and move entry.

On the other hand, to do something fair, the client rather than the server would have to determine the amount of time taken by a player's move, and communicate the time taken along with the move.  When the Internet chess servers instituted this policy, people quickly hacked into the client and reprogrammed it to report them as using less time than they actually used.

The chess servers' attempt to do the right thing resulted in a situation that was more fair among all trustworthy people, but which gave a huge advantage to a few time cheaters.

Title: Re: Time calculation Bug in V1 client ?
Post by Tachyon on Oct 21st, 2008, 9:18pm
This is not a lag issue. It is a event process issue. I have a pretty fast internet connection. Lag is surely involved but for most users it is negligible.

I have also carefully watched what the client does. It updates the client clock with the time it gets from the server THEN starts to make the moves. The internet communication is already completed and the time is still correct.

Now the client ( and server ) clock ticks on while the client is moving the pieces ... which take about 2 seconds.


The player is losing time because the server and client is running the clock while pieces are being moved.

The event process should be designed in a way which does not let the clock run while pieces are still being moved.

This is also very different from chess because arimaa allows up to 4 pieces to move per player move. This is what takes the time - chess would not have this problem. In theory we could solve the problem by moving al the pieces at once .. this would however create a usabilty problem since the player is going to lose time trying to figure out which pieces were moved.

Title: Re: Time calculation Bug in V1 client ?
Post by omar on Oct 21st, 2008, 9:41pm
Karl is right. The time is kept on the server. The client has no say in how much time was used to make the move. Early on I made the decision that at all times one or the other players clock must be running. That way if a game is set to finish in say 1 hour it will take exactly that much time and not run over due to network lag.

Animating the opponents move does take a few seconds, but its the same for both players; assuming they are both humans. Bots do have a bit of an advantage here since they don't need much time to see what move was made :-)

Title: Re: Time calculation Bug in V1 client ?
Post by Tachyon on Oct 21st, 2008, 9:51pm
Hi Omar ... I understand the reasoning. I do believe however that in Blitz or faster games against bots, the advantage is more that just a bit ... it is significant and can often be decisive in the game's result.

There must be a better and fair way to do this.

Title: Re: Time calculation Bug in V1 client ?
Post by omar on Oct 23rd, 2008, 6:33am
I can always add faster animation to the client. I've made a note to do that. I think I'll add two more faster levels. One that animates faster than the current fastest and one that instantly shows the next move without animation but makes a one step move sound.

Title: Re: Time calculation Bug in V1 client ?
Post by Tachyon on Oct 23rd, 2008, 2:01pm
Hi Omar ... A suggestion ... I dont know how much work this entails but a possible solution would be to move all the pieces at once and place a visible marker of sorts  with the last pieces that has been moved. That way the the player will immediately be able to identify which pieces were moved.

Title: Re: Time calculation Bug in V1 client ?
Post by omar on Oct 26th, 2008, 2:35pm
Thanks for the suggestion Tachyon I've made a note of it.



Arimaa Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.