Arimaa Forum (http://arimaa.com/arimaa/forum/cgi/YaBB.cgi)
Arimaa >> Site Discussion >> Bug: timed out though 1sec is left
(Message started by: Boo on Mar 10th, 2012, 3:56am)

Title: Bug: timed out though 1sec is left
Post by Boo on Mar 10th, 2012, 3:56am
http://www.image-share.com/ijpg-1341-270.html

Title: Re: Bug: timed out though 1sec is left
Post by tharkun on Mar 13th, 2012, 3:04pm
On a related note, I am also interested in how the clock times work. In the last few days I've lost on time no fewer than 8 times against bot_Lucy (incidentally the same bot against which Boo noticed the bug he reported above). Obviously some of them were caused by my inability to find a decent move in the position, but still it was a bit much and in some cases I was mystified how I managed to run out of time (e.g. here (http://www.arimaa.com/arimaa/games/jsShowGame.cgi?gid=219749&s=w)).

I started paying more attention to the clock and noticed that sometimes there is a huge lag. Occassionally I the time between the moment I press "Send" and the moment my clock stops moving is no less than eight seconds. Obviously this makes it quite difficult to play at blitz (15 seconds per move). Is this a problem on my end? My internet connection is pretty fast and it does not feel slower than normal.

Title: Re: Bug: timed out though 1sec is left
Post by Swynndla on Mar 13th, 2012, 8:58pm
I'm having problems where an opponent of Lucy genuinely runs out of time and should lose, but when the server checks to see if Lucy is present, the server doesn't see Lucy and marks the game as "abandoned".  Lucy is currently running on my home pc in New Zealand, and so I'm putting it down to my internet connection (and being a long way away from the server).  Once Lucy is on the gameroom server that issue with likely disappear (although I still don't know why the human-losing-on-time-even-though-there-is-one-second-left issue is happening, but that issue may disappear also, especially if you're not seeing it happen on other bots in the gameroom?).

When I play Lucy in through the gameroom (but is actually running on my local pc), I submit a move, but often I'll see the clocks still ticking down for 6 seconds or so, only for the time to be back-tracked (or most of it?).

Title: Re: Bug: timed out though 1sec is left
Post by Jugular on Apr 5th, 2012, 11:27pm
The way the client deals with time is pretty annoying in my experience. I've played on KGS and it took them a while to sort out the time issues but it is now excellent. If anyone is still putting time into client development it may be worth getting in contact with William from KGS about how to solve these issues.

Title: Re: Bug: timed out though 1sec is left
Post by omar on Apr 7th, 2012, 1:17pm
It is very easy to lose on time when you have only 1 sec left, or sometimes even a few seconds. To give you an idea of what needs to happen between click the 'Send' button and the move registering on the server.

1. Client checks to see if the move is valid, if not it warns you. The time for this is usually constant and quite negligible.
2. Client attempts to create a HTTP connection to the server. The time for this to happen could vary quite a bit depending on Internet traffic between you and the server. If you're using wifi, a weak connection could also increase this time.
3. Once the TCP socket connection is established the client sends the move. The time for this also varies similar to #2.
4. Once the server receives the move a bunch of perl code needs to be compiled and run to verify and process the move. Depending on the server load, the time for this could also vary.

Ideally you would to use a dedicated socket connection so the #2 could be skipped. Also the server code to process the move should be in a pre-compiled language like Java, C, Golang, or Cobra so that the compilation step in #4 can be skipped. Finally you would want the client to include the time when the 'Send' button was clicked along with the move so that even the delay caused by #1, #3 and #4 can be subtracted out.

I never really set out to build a gameroom for Arimaa. Initially it was only going to be a site with static web pages to present the rules of the game and the challenge. But shortly before releasing the site I thought it would be good to have a place where people could try out the game.

I've often thought about doing a complete rewrite of the game server and game client, but it's a big project and needs a big stretch of time. I've even thought of doing it as an open source project, but leading such a project would also take significant time. So, we've just been kicking along with the initial code I wrote back in 2002 and kept adding to. Computers and networks have managed to get faster and faster so that we are able to get by with it. But it is definitely far from being ideal.

I do worry though that as we try to get more players introduced to Arimaa, the bad experience they have using this old code will be associated with the game itself and our efforts will be wasted.

If there is someone interested in leading an open source project to build a new game server and client, I would definitely support you with coding effort and promotion of the project on the Arimaa site. If it is done in a modular way it could be used for other games as well.

Title: Re: Bug: timed out though 1sec is left
Post by hyperpape on Apr 7th, 2012, 9:55pm
Isn't trusting the time that the client sends a bad idea for the same reason that most client-side validation is a bad idea? Can't the perl script have access to the time that the server received the communication, and use that, plus a small ( < 1 sec) fudge factor, based on how the data typically spends in transit?



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