Page 2 of 5

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Posted: Fri Mar 28, 2014 4:32 pm
by phenri
Ok, nevermind
go movetime 5000
p4wn_loader.js:626: Uncaught TypeError: Cannot read property 'findmove' of undefined
go depth 2
p4wn_loader.js:626: Uncaught TypeError: Cannot read property 'findmove' of undefined
go infinite
p4wn_loader.js:626: Uncaught TypeError: Cannot read property 'findmove' of undefined
uci
id name p4wn, AKA 5k chess
id author Douglas Bagnall, ported to JSUCI by Edmund Moshammer
uciok
isready
readyok
position fen rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
engine.js:31380: Uncaught TypeError: Cannot read property 'board' of undefined
go depth 3
p4wn_loader.js:626: Uncaught TypeError: Cannot read property 'findmove' of undefined
Edit: I missed ucinewgame
Its fine now

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Posted: Fri Mar 28, 2014 4:38 pm
by Edmund
phenri wrote:Ok, nevermind
go movetime 5000
p4wn_loader.js:626: Uncaught TypeError: Cannot read property 'findmove' of undefined
go depth 2
p4wn_loader.js:626: Uncaught TypeError: Cannot read property 'findmove' of undefined
go infinite
p4wn_loader.js:626: Uncaught TypeError: Cannot read property 'findmove' of undefined
uci
id name p4wn, AKA 5k chess
id author Douglas Bagnall, ported to JSUCI by Edmund Moshammer
uciok
isready
readyok
position fen rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
engine.js:31380: Uncaught TypeError: Cannot read property 'board' of undefined
go depth 3
p4wn_loader.js:626: Uncaught TypeError: Cannot read property 'findmove' of undefined
p4wn requires the

Code: Select all

ucinewgame
command before sending position and go commands

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Posted: Fri Mar 28, 2014 4:51 pm
by Adam Hair
Thanks, Edmund! I look forward to trying this tool out.

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Posted: Fri Mar 28, 2014 5:47 pm
by Edmund
phenri wrote:Edit: I missed ucinewgame
Its fine now
Brilliant, I am glad it is working as expected. Thanks for testing!

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Posted: Fri Mar 28, 2014 6:43 pm
by phenri
I just tried to launch stockfish.js and apparently it is not so universal as that.

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Posted: Fri Mar 28, 2014 9:23 pm
by op12no2
Hi Edmund,

Fantastic. I've been playing around with a Javascript engine recently and being able to use a standard UI would be great. I actually started off with similar intentions to your interface but got seduced by the engine.

Lozza uses the JSON web worker interface to do an analysis of N ply with a timeout option.

http://op12no2.me/toys/lozza/lozza.js

Primitive test UI here that runs some perft tests then does a 10 play analysis of the home position and BK positions 1-4.

http://op12no2.me/toys/lozza/test.htm

I will definitely try your interface...

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Posted: Fri Mar 28, 2014 11:57 pm
by Edmund
phenri wrote:I just tried to launch stockfish.js and apparently it is not so universal as that.
Interesting. I invested some time trying to find out why it is not running, but without success. This autogenerated source is not very debug friendly. It might be that one of the node.js malloc functions gets blocked by V8, but I am not certain.

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Posted: Sat Mar 29, 2014 12:22 am
by Edmund
op12no2 wrote:Hi Edmund,

Fantastic. I've been playing around with a Javascript engine recently and being able to use a standard UI would be great. I actually started off with similar intentions to your interface but got seduced by the engine.

Lozza uses the JSON web worker interface to do an analysis of N ply with a timeout option.

http://op12no2.me/toys/lozza/lozza.js

Primitive test UI here that runs some perft tests then does a 10 play analysis of the home position and BK positions 1-4.

http://op12no2.me/toys/lozza/test.htm

I will definitely try your interface...
Hey Colin,
I just head a look at your source. It looks very well organized. Connecting it to uci should be straight forward. It is missing an algebraic move parser and would have to change the way of output, but the rest looks suited perfectly. Please let me know if you encounter any dificulties.
All the best
Edmund

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Posted: Sat Mar 29, 2014 12:57 am
by op12no2
Edmund wrote: I just head a look at your source. It looks very well organized. Connecting it to uci should be straight forward. It is missing an algebraic move parser and would have to change the way of output, but the rest looks suited perfectly. Please let me know if you encounter any dificulties.
All the best
Edmund
Great, thanks for checking it out and the tips. I'll look up the UCI protocol - never done anything with it. Looking forward to getting this going in my Hiarcs UI.

Re: JSUCI 1.0 - connect javascript chess engines to UCI

Posted: Mon Mar 31, 2014 1:56 pm
by op12no2
Woo! I have Lozza working in Arena (well in principle anyway).

I was going to spawn a sub-worker with Lozza in it on UCI GO, so I could easily kill it on UCI STOP, but V8 doesn't seem to like a worker starting another one.

NB: Can't currently use Hiarcs UI because it says your exe is 'not a valid engine' - I'll post in the Hiarcs forum to find out what it required for 'validity'.

This is fab Edmund; thank you so much...