Hi
Anybody know of a tutorial on creating a chess game where the player plays against the computer?
Printable View
Hi
Anybody know of a tutorial on creating a chess game where the player plays against the computer?
It would be virtually impossible to create a half-decent chess AI in MMF2, and you'd pretty much have to script it in Lua or it would be ridiculously slow. Either way, it's the kind of thing people write entire books about.
You'd probably have more luck creating a GUI for existing UCI chess engines, but even that would be difficult - http://wbec-ridderkerk.nl/html/UCIProtocol.html
I'd strongly recommend you try something like Checkers or Backgammon first.
Thank you. You saved me a lot of time.
Let's not be to hasty. KlikDisc for Feb has a Chess Extension.
Marv
What's more it's very good extension with good AI, I played it several times and it's worthy opponent (I'm playing chess for 13 years now so I know what I'm saying).
WOW! Thanks nivram and Fanotherpg, you both saved my project from the trash pile.
I'll order the Feb Klikdisc and keep working on the project.
Thanks Again.
Adrian
I actually tried to make a chess program for the 20 event compo, but could only get it down to around 35ish. Its true that within MMF2's engine it would be particularly slow, but you can still create a perfectly playable chess on the level of older chess program's AIs. Scripting in lua could speed it up... considerably.
Programming it isn't actually very hard, its optimizing it that is. In the shortest essence, you're just writing a recursive algorithm that analyzes game board positions and weighs them against one another, on top of perhaps a few hardcoded reactions to known plays (ie the ruy lopez or whatever). But when you're looking at millions of states in just a few recursive depth, its a devil to work with
I'm glad you liked my extension, Fanotherpg.
MuddyMole is right, real AI for a game like Chess is hard even for experienced programmers. Typically you can build something that will make correct moves, but it won't be challenging to anybody that knows chess. This is why this object exists.
Mokhtar, thanks very much for your extension. It's a cool surprise to see a Chess AI integrated into MMF2 :D
I have one question.. I see the board is updated by destroying and creating all pieces with new configuration, that's right? I haven't had a deep look at the code yet but I'd like to know if it is possible to configure a piece moving to the place like battlechess 4000 etc.
I don't think it's updated by destroying and creating pieces. Note that the object only handles the logic, the visual representation is entirely up to you so you can do whatever you want there.