Skip to main content
GameDev.net gamedev.net
🔒 Locked

Chess Question... Pawn to Queen!

Started by Moondoggy Jun 18, 2003 at 9:38 AM 44 replies 12k views
Original Post
Moondoggy
Moondoggy
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.
Tron3k
Tron3k
How about a situation where turning it into queen creates an automatic stalemate? In that case, you would turn it into something else.
“[The clergy] believe that any portion of power confided to me, will be exerted in opposition to their schemes. And they believe rightly: for I have sworn upon the altar of God, eternal hostility against every form of tyranny over the mind of man” - Thomas Jefferson
Sneftel
Sneftel
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.
afterburn
afterburn
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.
--What are you nutz?I have nothing to say to your unevolved little brain. The more I say gives you more weapons to ask stupid questions.
Moondoggy
Moondoggy
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]
CyberSlag5k
CyberSlag5k
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.
Without order nothing can exist - without chaos nothing can evolve.
fup
fup
"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

dagarach
dagarach
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.
RPGeezus
RPGeezus
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]
Moondoggy
Moondoggy
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.
Dave Hunt
Dave Hunt
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.
owl
owl
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.
[size="2"]I like the Walrus best.
Moondoggy
Moondoggy
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
owl
owl
quote:
Original post by Moondoggy
Xaxa did you even read any of the other posts??


nope
[size="2"]I like the Walrus best.
alvaro
alvaro
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.
Cedric
Cedric
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]
Dave Hunt
Dave Hunt
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.
Plasmadog
Plasmadog
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.
You are not the one beautiful and unique snowflake who, unlike the rest of us, doesn't have to go through the tedious and difficult process of science in order to establish the truth. You're as foolable as anyone else. And since you have taken no precautions to avoid fooling yourself, the self-evident fact that countless millions of humans before you have also fooled themselves leads me to the parsimonious belief that you have too.--Daniel Rutter
Moondoggy
Moondoggy
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...
Nikoko
Nikoko
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 ...
/ ------------------------ The n00b++ ------------------------ /

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.