Jump to content

  • Log In with Google      Sign In   
  • Create Account

Calling all IT Pros from Canada and Australia.. we need your help! Support our site by taking a quick sponsored surveyand win a chance at a $50 Amazon gift card. Click here to get started!


Chess Question... Pawn to Queen!


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
45 replies to this topic

#1 Moondoggy   Members   -  Reputation: 122

Like
Likes
Like

Posted 18 June 2003 - 03:38 AM

I think this is an AI specific question, but I will ask it anyway. (feel free to move the post if it is in the wrong forum) I just want to know: if in a game of chess when you reach the other side of the board with a pawn, is there any specific situation or reason why you would not want to turn the pawn into a queen but another piece? I want to know because in my program I don’t want to bother with asking the player what piece they want to change into, (more code!) but instead always change into a queen. Just not sure if this is a good thing to do, I guess it will not be ''perfect'' chess then but I can live with that.... The only thing I can think of is; a situation where changing a pawn into a knight would grant check-mate. (Because the knight has moves that are not accessible by the queen) but wouldn''t this situation be EXTREMLY rare??? Thanks for any help or ideas you can give.

Sponsor:

#2 Tron3k   Members   -  Reputation: 660

Like
Likes
Like

Posted 18 June 2003 - 03:41 AM

How about a situation where turning it into queen creates an automatic stalemate? In that case, you would turn it into something else.

#3 Sneftel   Senior Moderators   -  Reputation: 1781

Like
Likes
Like

Posted 18 June 2003 - 03:41 AM

Extremely rare..... but how would you feel, as a person playing the game, if you suddenly came up with this amazing brainstorm on how you could checkmate your opponent, with a little-utilized feature of the game, only to find out that the programmer hadn''t bothered to implement all the rules, leaving you in a suck-ass position?

Implement the choosing.


How appropriate. You fight like a cow.

#4 afterburn   Members   -  Reputation: 124

Like
Likes
Like

Posted 18 June 2003 - 03:43 AM

While playing chess I used traded a pawn for a rook to get a checkmate. because I had a queen and another rook. It blocked him from moving to the side to hide from the queen.

#5 Moondoggy   Members   -  Reputation: 122

Like
Likes
Like

Posted 18 June 2003 - 03:49 AM

Sneftel - that is what I am asking, is there some really good reason for not choosing a queen, like afterburn said "he traded a pawn for a rook to get checkmate" surely checkmate could then have been achieved with a queen instead of a rook as she has all the moves a rook has and more.

Ton3k - Ah yes another situation like the knight one I explained, would this not also be VERY VERY rare?

I think I have made my decision anyway, I don’t think I will bother asking for a choice, I have weighed up the alternates and the amount of code I would have to sacrifice would be too much, I will definitely add it to my "added extra" list. That way after I have finished the game I can maybe add it later once I am satisfied with the code.

Cheers for the input.
__________________________
Moondoggy

[edited by - Moondoggy on June 18, 2003 10:50:42 AM]

#6 CyberSlag5k   Members   -  Reputation: 514

Like
Likes
Like

Posted 18 June 2003 - 03:56 AM

I agree, implement the choice. It won''t take that long and even though most people would automatically want a queen, if it''s not there it will most likely be missed. Cutting corners is never wise.

--He who laughs last, thinks slowest.

#7 fup   Members   -  Reputation: 463

Like
Likes
Like

Posted 18 June 2003 - 04:09 AM

"I think I have made my decision anyway, I don’t think I will bother asking for a choice, I have weighed up the alternates and the amount of code I would have to sacrifice would be too much"

That''s only going to make you unhappy in the long run. We know that, and if you search deep within your soul, you really know that too

I don''t see why it would take loads more code to implement anyway. (but then, I''ve never written a chess engine)





My Website: ai-junkie.com My Book: AI Techniques for Game Programming



#8 dagarach   Members   -  Reputation: 169

Like
Likes
Like

Posted 18 June 2003 - 05:56 AM

It can''t take much more time to implement it as a choice for the user.

It may take more time to include it in the heuristics for the AI, but then you can just not allow the computer to promote (because it doesn''t know how)

I suppose you also have to tell the AI that it has to watch out for unorthodox promotions by the player, but that would still be better as a hole in the AI rather than a hole in the game.

#9 RPGeezus   Members   -  Reputation: 216

Like
Likes
Like

Posted 18 June 2003 - 06:45 AM

There are situations where choosing the queen may be bad. Both have been covered.

A queen may force a stalemate, or a knight may be required to access a specific square. I've seen this in a chess puzzle once, but am not good enough at chess to recognize this in an actual game.

In my own Chess program I force promotions to Queen, mainley because I was burned out by the time I had added all of the bells and whistles to speed up the search.

If the only people who will play your game are your friends and family, force them to queens. They probably won't care, and your search will run faster (less moves to deal with).

Either way, it sounds like you've got an engine running, so congrats!

Will

[edited by - RPGeezus on June 18, 2003 1:56:53 PM]

#10 Moondoggy   Members   -  Reputation: 122

Like
Likes
Like

Posted 18 June 2003 - 07:07 AM

Yeah I have got an engine running sort of.

When I tell you it is in OpenGL some of you might understand why I dont want to implement the choice option.
Apart from the fact that I dont know how to implement it,(dialog box, text choice, mouse buttons, etc... ???) I think it would look very ugly to have a dialog box suddenly popup from my OpenGL program and ask the user for some input.

But thanks for your messages.

#11 Dave Hunt   Crossbones+   -  Reputation: 4021

Like
Likes
Like

Posted 18 June 2003 - 09:23 AM

You don''t need fancy dialogs and buttons. Just draw a picture of the available pieces and some text instructing the player to click on which one he wants to promote the pawn to. If you have a working engine, you already have code to handle piece selection, so this should be a piece of cake.


#12 owl   Banned   -  Reputation: 376

Like
Likes
Like

Posted 18 June 2003 - 12:21 PM

There could happend that to win the game in two moves you could need a horse instead of a queen... and logically, you will transform your pawn into a horse.

#13 Moondoggy   Members   -  Reputation: 122

Like
Likes
Like

Posted 18 June 2003 - 12:44 PM

Xaxa did you even read any of the other posts??

I now know the two situations where a piece other than the queen may be a desirable transform, but at ''the moment'' I have bigger priorities and issues that I need to resolve first.

Like I said before I have put it onto my "upgrade list" that I will attend to it after I am happy that I have made a suitable implementation of the whole game.


Oh and Dave Hunt, your solution seems the simplest I have come across so far but I still think it would look ugly and messy to just have pictures appear somewhere in the application window. You do know that it is a 3D application with moving camera and all, I can''t quite understand where in the window would be a good place to draw these pictures of the pieces that you state!

Later.
___________________________________
Moondoggy

#14 owl   Banned   -  Reputation: 376

Like
Likes
Like

Posted 18 June 2003 - 12:49 PM

quote:
Original post by Moondoggy
Xaxa did you even read any of the other posts??


nope

#15 Álvaro   Crossbones+   -  Reputation: 16519

Like
Likes
Like

Posted 18 June 2003 - 01:03 PM

There are several reasons why you should implement the choice.

If you don''t implement the choice, you don''t have the right to call your program a chess program. It''s something similar, but not chess. There are examples of positions where you need a knight (relatively frequent), a rook (much less frequent) or even a bishop (I don''t know if it has ever happened, but they can be built).

Chess problems are cool too, and they often exploit this type of rules. If you don''t implement the choice, you can''t use your program to study problems.

If your program enters a tournament, you would be disqualified if your opponent promotes to a rook and your program doesn''t allow it.

Of course, my program is mostly text-based and runs under MS-DOS, so I guess we have very different priorities.

#16 Cedric   Members   -  Reputation: 158

Like
Likes
Like

Posted 18 June 2003 - 02:37 PM

The BattleChess AI once took a knight to checkmate, and I was impressed. Since it considers multiple choices, it adds branches to the decision tree.

Cédric

[edited by - cedricl on June 18, 2003 9:37:34 PM]

#17 Dave Hunt   Crossbones+   -  Reputation: 4021

Like
Likes
Like

Posted 18 June 2003 - 04:41 PM

I pictured a frame with maybe a semi-transparent background being drawn over the current view. Then, the instructions and available pieces drawn inside this frame. Once the player chooses the piece, the frame goes away and you''re off to the races.


#18 Plasmadog   Members   -  Reputation: 205

Like
Likes
Like

Posted 18 June 2003 - 04:58 PM

quote:
Original post by Moondoggy
Oh and Dave Hunt, your solution seems the simplest I have come across so far but I still think it would look ugly and messy to just have pictures appear somewhere in the application window. You do know that it is a 3D application with moving camera and all, I can''t quite understand where in the window would be a good place to draw these pictures of the pieces that you state!



So don''t use pictures, use the models that you already have. Show both the queen and the knight models floating side by side above the board. Alternatively, show a queen in place on the promotion square, and swap it for the knight model once a second or so (maybe with a cool morphing effect). Either way, you click on the appropriate model to complete the move.

#19 Moondoggy   Members   -  Reputation: 122

Like
Likes
Like

Posted 18 June 2003 - 08:12 PM

quote:
Original post by Plasmadog
Alternatively, show a queen in place on the promotion square, and swap it for the knight model once a second or so (maybe with a cool morphing effect). Either way, you click on the appropriate model to complete the move.



ohhhhhhh I like that idea...


#20 Nikoko   Members   -  Reputation: 122

Like
Likes
Like

Posted 21 June 2003 - 01:35 AM

I participed at many chess tournaments, and like some people answer you, you must let the player make his choice.

For example, it is crucial to promote his pawn in knight because if the position is "locked", only a piece which can jump the pawns wall can make troubles to the opponent. Or simply, the player have to make chess to counter the mat and so ....

well, you have no choice, let the choice ...




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS