Page 2 of 2

Re: Engine In Javascript

Posted: Tue Jul 23, 2013 5:57 pm
by bluefever
pgn4web wrote:Tried to play some other game at 10s per move, but in every game I sooner or later get to the point where the UI does not display a move from the engine anymore. However, if after a short while I hit the takeback button, a completely different position is shown. It looks as if at some point the UI stops updating the chessboard and the engine plays itself quickly.
I dont have an example because I could not reproduce the error systematically just by loading a given position, some historical preconditions seem required to trigger the fault.
Hi,

That's seems really odd. I'm playing cosntantly through 10s games at the moment to try and get the error, been going for 30mins now, not had it yet :roll:

Re: Engine In Javascript

Posted: Tue Jul 23, 2013 6:40 pm
by bluefever
pgn4web wrote:Tried to play some other game at 10s per move, but in every game I sooner or later get to the point where the UI does not display a move from the engine anymore. However, if after a short while I hit the takeback button, a completely different position is shown. It looks as if at some point the UI stops updating the chessboard and the engine plays itself quickly.
I dont have an example because I could not reproduce the error systematically just by loading a given position, some historical preconditions seem required to trigger the fault.
Found it :) (I hope)

It happens when the engine gets near positions with no pawns.

Should be fixed now!

Thanks again

Re: Engine In Javascript

Posted: Tue Jul 23, 2013 7:59 pm
by glinscott
Awesome job! Great to see another strong JS engine on the scene :).

I played them against each other at 2s a move, and Garbochess (http://forwardcoding.com/projects/ajaxchess/chess.html) barely prevailed, although it was a toss-up in the midgame for quite a while. My guess is that they are quite close in strength.


Re: Engine In Javascript

Posted: Tue Jul 23, 2013 10:10 pm
by bluefever
glinscott wrote:Awesome job! Great to see another strong JS engine on the scene :).

I played them against each other at 2s a move, and Garbochess (http://forwardcoding.com/projects/ajaxchess/chess.html) barely prevailed, although it was a toss-up in the midgame for quite a while. My guess is that they are quite close in strength.
Wow, your interface has a lot more features :)

I only did the GUI as a quick hack on top of the engine for the YouTube video series. Since then I've been adding features - I've grown quite fond of the project, it was my first JS program.

I MUST add the actual fen live you have, that is essential. ANd you even have the algebraic move notation. Argh!! :)

I think your engine is stronger though :)

Btw, I had a torrid time getting it to work in IE 9 and older. No const, no console, no typed Arrays..... terrible.

Re: Engine In Javascript

Posted: Tue Jul 23, 2013 10:13 pm
by bluefever
On thing I meant to ask, as I'm new to JS - do you have any tips on not blocking the GUI when the engine is thinking? I notice Garbochess does not. I couldn't find much info on doing this, apart from a webworker, which didn't seem right.

Thanks!

Re: Engine In Javascript

Posted: Wed Jul 24, 2013 3:17 pm
by bluefever
I found a small bug in GarboChess, nothing to do with the playing, but the UI. If I undo moves, it doesn't remove them from the movelist, and adds the new moves on 8-)

It's a great App, though. I added the "current FEN" also today :)

Re: Engine In Javascript

Posted: Fri Jul 26, 2013 6:11 am
by glinscott
Yeah, sadly, webworkers are the only way to go really. You can also process the search in chunks, but that basically requires writing an iterative search, which is not as fun.

Re: Engine In Javascript

Posted: Fri Jul 26, 2013 7:00 am
by bluefever
glinscott wrote:Yeah, sadly, webworkers are the only way to go really. You can also process the search in chunks, but that basically requires writing an iterative search, which is not as fun.
Yes, the search in chunks would be a PITA to program.

According to caniuse.com, IE 9 and older do not support webworkers, though :(

Thanks for the answer, I'll have a look into it today