• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
ashish123

UCI based chess Engine : Some questions.

9 posts in this topic

I have coded a chess engine in C# which has no sophisticated features.

I have just done with mate detection and some crude static evaluation.

I am trying to make it UCI compatible, but then I am facing a question as to why the protocol returns the list of moves rather than the fen of the new position.

 

I mean the list of moves will take more time to execute and the space required is also more than equivalent FEN string.

Can any one help me with this?

 

 

 

0

Share this post


Link to post
Share on other sites

First of all, the protocol allows both possibilities. What Paradigm Shifter says is true, but after an irreversible move (i.e., a pawn move or a capture) is played, the GUI could send the FEN for the position after the last such move and then the list of moves from that point. However, many GUIs choose to send the whole list of moves every time. Presumably this is done for simplicity. Although it might be suboptimal, it's not a problem in practice.

0

Share this post


Link to post
Share on other sites

Hi all, Thanks for replying.

 

I faced this question as I programmed by Engine to setup board via FEN and not by move input.

I don't really keep track of game specs like castling and enpassant squares on move by move basis, but rather break the fen and adjust all parameters accordingly.

 

I am using Arena as GUI. Is there any setting where in I can just tweak it to send me the FEN instead of moves, but then again I wouldn't be able to keep track of 3-repetition draws.

 

If I go with the move approach, then I have to convert the physical move to logical 64 bit-bit-board move, adjust all the flags and so on.

So is this worth or is there anything else which I am missing.

0

Share this post


Link to post
Share on other sites

Converting the move in algebraic notation to whatever data structure you use for moves shouldn't be too hard and you should definitely do it. You should also be able to keep track of castling, the en-passant square and how many moves have happened since the last irreversible move, because otherwise you can't implement the rules of the game correctly.

0

Share this post


Link to post
Share on other sites

Hi alvaro, thanks for replying.

I implemented the move logic without considering 3 move repetitions which is going to be my next priority.

 

Here is a game that it played at maxDepth 5 without any sophistication not even killers or anything of that sort, plain alpha beta with very crude static evaluation.

it took about 15 secs to make a move on an average.

 

Here is the first game where it played with white.
1. d4 e6 2. e4 Nc6 3. Nc3 Bb4 4. Nf3 Nf6 5. e5 Ne4 6. Bd2 Nxd2 7. Qxd2 O-O
8. Bb5 d5 9. Bxc6 bxc6 10. O-O-O Bb7 11. Rhe1 a5 12. g4 f6 13. g5 fxe5 14.
Nxe5 Bd6 15. a3 g6 16. f4 a4 17. h3 Qe7 18. h4 Qg7 19. Qe3 Rfe8 20. Ng4 Kf8
21. Kb1 Re7 22. Qf2 Qh8 23. Qf3 Qg7 24. Qf2 Qh8 25. Qf3 Qg7 26. Qf2 {3-fold
repetition} 1/2-1/2
 
Here is the second game, playing with black.
 
1. g3 d5 2. Nf3 e6 3. Nc3 d4 4. Nb5 Nc6 5. e3 e5 6. exd4 exd4 7. c3 Bg4 8.
Qe2+ Be7 9. Nbxd4 Nxd4 10. cxd4 c6 11. Bg2 Bxf3 12. Bxf3 Qxd4 13. Qe3 O-O-O
14. Qxd4 Rxd4 15. h4 Nf6 16. b3 Rhd8 17. a4 Bb4 18. Ra2 Rd3 19. Bd1 Ne4 20.
Bg4+ Kb8 21. Bf5 Re8 22. O-O Bc5 23. Kg2 Rxb3 24. Bxh7 g6 25. Re1 Bxf2 26.
Rxe4 Rxe4 27. Kxf2 Rd3 28. Bg8 f5 29. Bh7 Rc4 30. Ra1 Rg4 31. h5 Rgxg3 32.
hxg6 Rg4 33. Ke2 Rd5 34. a5 Re5+ 35. Kf3 Rd5 36. Bg8 Rd6 37. Bf7 a6 38. Ra3
Rg1 39. Rc3 Rd8 40. d3 Rf1+ 41. Kg2 Re1 42. Kf2 Rh1 43. Bf4+ Ka8 44. g7 Rh4
45. Bc7 Rc8 46. g8=Q Rh2+ 47. Bxh2 b6 48. Qxc8 {Arena Adjudication. Illegal
move!} 1-0
 

There was a time when I actually thought that my program was pressing the game, but then as it is clear from the game, I have messed up with some move making issues which as of now I would be checking.

 

 

0

Share this post


Link to post
Share on other sites

Look up "perft". It's the best way to find bugs in your move generation code and in your functions to make and undo moves.

0

Share this post


Link to post
Share on other sites

Thanks for replying.

Can you comment on the speed of  the engine when it take max 30 secs to play a move at 5 plys and further 5 plies at QSearch(Without MVV/LVA or any sorting).

I asked you this as I would like to know if I don't have anything terribly wrong going on.

I ran perft suite as my unit test suite, had no findings.

I think I have messed up some where in make moves that come from GUI through UCI protocol. May be its missing some checks and other feature.

I would check on those by printing some display boards. 

0

Share this post


Link to post
Share on other sites

30 seconds for depth 5 is absurdly slow these days, but I don't see much point in looking at the performance before you have implemented some very basic improvements. MVV/LVA in quiescence search is particularly critical.

 

How many nodes per second is your engine searching? Some people count calls to make_move, some people count calls to the recursive search functions; either one will do.

0

Share this post


Link to post
Share on other sites
Thanks for the reply.
 
I setup this position r1bqkb1r/1p1p1ppp/p1n1p1n1/4P3/2B5/2N2N2/PP3PPP/R1BQR1K1 b kq - 0 9
 
In the first round, I didnot search in QSearch as the condition ply>=maxPly would fail and it wouldn't proceed with generation of Capture moves.
 
In the second round I added Qsearch with addition of 5 plys to search. So if at depth 5 it went to QSearch then it would search in Qsearch for 5+5 = 10 plys.
 
and got the following results on the first day and I also noted that my machine (Dell Studio Laptop was heated up pretty much).
 
Without QSearch.
[table]
[tr]
[td]Depth[/td]
[td]Nodes[/td]
[td]Time(msecs)[/td]
[td]kNodes/Sec[/td]
[/tr]
[tr]
[td]1[/td]
[td]36[/td]
[td]131[/td]
[td]0.27[/td]
[/tr]
[tr]
[td]2[/td]
[td]1757[/td]
[td]160[/td]
[td]10.98[/td]
[/tr]
[tr]
[td]3[/td]
[td]7689[/td]
[td]336[/td]
[td]22.88[/td]
[/tr]
[tr]
[td]4[/td]
[td]136953[/td]
[td]2743[/td]
[td]49.92[/td]
[/tr]
[tr]
[td]5[/td]
[td]604808[/td]
[td]17768[/td]
[td]34.039[/td]
[/tr]
[tr]
[td]6[/td]
[td]11339038[/td]
[td]207256[/td]
[td]54.71[/td]
[/tr]
[/table]
 
With QSearch
[table]
[tr]
[td]Depth[/td]
[td]Nodes[/td]
[td]Time(msecs)[/td]
[td]kNodes/Sec[/td]
[/tr]
[tr]
[td]1[/td]
[td]1087[/td]
[td]239[/td]
[td]4.54[/td]
[/tr]
[tr]
[td]2[/td]
[td]13289[/td]
[td]543[/td]
[td]24.47[/td]
[/tr]
[tr]
[td]3[/td]
[td]103435[/td]
[td]2864[/td]
[td]36.11[/td]
[/tr]
[tr]
[td]4[/td]
[td]1313863[/td]
[td]28137[/td]
[td]46.49[/td]
[/tr]
[tr]
[td]5[/td]
[td]7980765[/td]
[td]175669[/td]
[td]45.43[/td]
[/tr]
[tr]
[td]6[/td]
[td]57394529[/td]
[td]1266073[/td]
[td]45.33[/td]
[/tr]
[/table]
 
 
 
 
Here are the results after second day when laptop didn't heat up much.
Without QSearch.
[table]
[tr]
[td]Depth[/td]
[td]Nodes[/td]
[td]Time(msecs)[/td]
[td]kNodes/Sec[/td]
[/tr]
[tr]
[td]1[/td]
[td]36[/td]
[td]16[/td]
[td]2.25[/td]
[/tr]
[tr]
[td]2[/td]
[td]1757[/td]
[td]19[/td]
[td]92.47[/td]
[/tr]
[tr]
[td]3[/td]
[td]7689[/td]
[td]37[/td]
[td]207.81[/td]
[/tr]
[tr]
[td]4[/td]
[td]136953[/td]
[td]288[/td]
[td]475.53[/td]
[/tr]
[tr]
[td]5[/td]
[td]604808[/td]
[td]1742[/td]
[td]347.19[/td]
[/tr]
[/table]
 
With QSearch
[table]
[tr]
[td]Depth[/td]
[td]Nodes[/td]
[td]Time(msecs)[/td]
[td]kNodes/Sec[/td]
[/tr]
[tr]
[td]1[/td]
[td]1087[/td]
[td]17[/td]
[td]63.94[/td]
[/tr]
[tr]
[td]2[/td]
[td]13289[/td]
[td]43[/td]
[td]309.04[/td]
[/tr]
[tr]
[td]3[/td]
[td]103435[/td]
[td]242[/td]
[td]427.41[/td]
[/tr]
[tr]
[td]4[/td]
[td]1313863[/td]
[td]2715[/td]
[td]483.92[/td]
[/tr]
[tr]
[td]5[/td]
[td]7980765[/td]
[td]17249[/td]
[td]462.67[/td]
[/tr]
[/table]
 

I think this is a hardware + programming efficiency issue.

Please comment as to how can I improvise this.

Edited by ashish123
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0