MikoChess 0.1. - Design Study

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Post Reply
miko93
Posts: 54
Joined: Sat Nov 12, 2005 5:24 pm
Location: Regensburg, Germany
Contact:

MikoChess 0.1. - Design Study

Post by miko93 »

MikoChess 0.1 - Offline Chessgame Design Study


Well, yet another one of my studies to learn about irrlicht and things.

This time, it is a chess frontend in 3D. Still rather weak, but already playable.

When starting work on this, I planned to do all the computer player's movement calculation by my own.
This turned out to be a rather difficult task, though (chess engine writing, anyone? ;-P ). So, I looked out for some code that could help me.

Surprisingly (for me), there are quite a few "chess engines" out there, ready to be utilized by a graphical frontend.
Finally, I chose "Abrok 5.0". It is invoked by MikoChess as a different process. Data exchange happens by using the UCI protocol ("Universal Chess Interface").

The game runs windowed (fixed size) only. And human player is white color only.
The possible and allowed moves of each token are calculated by the frontend, then submitted to the chess engine. Only a short time is given to the engine to calculate a move (therefore, the strength of it is weak by now). Then, the result is transfered back to the frontend and executed.

Some pics here:

The starting position
Image

White king under attack (debug window and moves history window active)
Image

Uops, I lost another game...
Image


The game itself (Windows exe, compiled with VC 2003)
http://www.mikoweb.eu/tmp/MikoChess_0.1.zip (about 1 MB)

// edit: added msvcrt.dll to the zip, hoping to prevent the problem pointed out below
Last edited by miko93 on Sun Oct 15, 2006 11:44 am, edited 1 time in total.
"Yessir, I'll be happy to make these unnecessary changes to this irrelevant document." (Dilbert)
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Awesome! Let's see how good (or hopefully not too good) your AI is! I installed an old chess game i had on my pc (it was made for Win 3.1 but runs on XP :D ) and the AI whooped my bum on even the easiest setting, but when i was younger i could beat it! I think that could be cos of the faster computer, somehow it's made the AI faster!

EDIT: *should learn to read the entire post before making comments :oops: *

EDIT2: Looks pretty cool, only visual problems i had were that it was sometimes hard to see which pieces were which, maybe some higher quality models/texturing/better lighting? Also animating the pieces when they move would be a nice addition. Well done tho :D
Image Image Image
3ddev
Posts: 169
Joined: Tue Sep 19, 2006 6:51 am
Contact:

Problems- maybe you didn't include the Visual C++ dll?

Post by 3ddev »

Those pictures look great. I tried running the app but the window just disappears. I think you may not have included the Visual C++ Runtime DLL with the program. When Visual C++ installs, the dll is copied into your WIN32 folder and so the program would work fine. However, I don't have Visual C++( I use Dev-C++ ) and so please make sure you include this in your next release. Also, make sure that it is the correct dll (i.e. Visual C++ Runtime 6.1) I may be totally wrong about this, but the Irrlicht dll is only 1.3x megs so it appears the program was compiled under Visual C++.

Otherwise, your game looks great. I am glad to see there is now a chess game for Irrlicht. I hope you continue working on it! :D

3ddev
miko93
Posts: 54
Joined: Sat Nov 12, 2005 5:24 pm
Location: Regensburg, Germany
Contact:

Post by miko93 »

JP, 3ddev, thank you for your comments.

JP: Using dependency walker, I realized that a missing msvcrt.dll could be the problem. Thanks for pointing me to that. As other apps (like google earth, as I see) do just ship this one with their exe, I do so now, too. Hoping that will fix the problem.

3ddev: Yeah, color style and lighting is reather weak (other things are too, I know :twisted: ). I'll get in touch with my ol' friend Milkshape again, learning about texture mappings. Already tried to add dynamic shadows to the scene, too. Although this is damn easy with Irrlicht, it had massive impact on the fps (from >200 down to 40 on my machine). So, I skipped that for now.

Again, thanks for your comments.
"Yessir, I'll be happy to make these unnecessary changes to this irrelevant document." (Dilbert)
3ddev
Posts: 169
Joined: Tue Sep 19, 2006 6:51 am
Contact:

Idea about ai!

Post by 3ddev »

As JP mentioned, a faster computer meant a more difficult ai. The chess engine you are using allows for a certain amount of time for processing the next ai moves. That means, faster computer and the same amount of time means more difficult ai. That may be ok for some computers, but between a pentium I and IV there would be a massive difference. I suggest using a while loop to process instructions and allowing for so many "cycles." 50 cycles for beginner level, 100 for average, and 150 for advanced( as an example ) Just include a variable and increment for each loop until it reaches max and then terminate the loop. Then use the last choice for the ai move. It would be easy to add to the ai. The while loop would take up a lot of memory, but you could forego a timer. It would be a much better overall ai I think. I hope you like this idea!:lol:
3ddev
Post Reply