Page 1 of 1

Simplified checkers (AI)

Posted: Tue Dec 02, 2008 3:24 am
by MarauderIIC
So in case you're wondering why you haven't heard from me in news posts or heard of my work in the Adventures in Game Development videos lately, it is because I have spent the last month or so programming this checkers game here (that and my job). I think I included all the necessary dependencies. Hopefully everything is right 'cause I'm all tired here.
Zip is here http://www.mediafire.com/file/znntjijjh ... eckers.zip
The write-up (not in zip) is here http://www.mediafire.com/file/xhjrjm1tt5m/checkers.doc msword format 7 pgs single-spaced and shouldnt be hard to understand

You may get some sort of 'application configuration is incorrect' error. Let me know so I know if I should bother to try and compile with g++ or use MSVS redistribute-stuff-the-right-way mode, or something. Only one person has to post that.

Edit: Source is here (below): http://elysianshadows.com/phpBB3/viewto ... 563#p28563

Re: Checkers

Posted: Tue Dec 02, 2008 8:35 am
by Falco Girgis
Great, can't download that attachment at work. I'll play around with it when I come home tonight. :)

Re: Checkers

Posted: Tue Dec 02, 2008 9:25 am
by MarauderIIC
Oh yeah, the version I sent you is slightly dumber than the version posted here. Also for those who didn't know it's simplified checkers (per assignment), once a player gets a king, that player wins.

Re: Simplified checkers (AI)

Posted: Thu Dec 04, 2008 10:57 am
by MarauderIIC
I guess I should mention that this implements artificial intelligence via alpha-beta search (aka alpha beta pruning).

Edit: Executable is here (OP): http://elysianshadows.com/phpBB3/viewto ... 296#p28296
Source (except for the SDL files) is attached. You'll need SDL, SDL_image, and SDL_ttf in order to compile it. Source may not totally correspond to the executable but it should since I think all I took out were my comments.

http://www.libsdl.org/download-1.2.php
http://www.libsdl.org/projects/SDL_image/
http://www.libsdl.org/projects/SDL_ttf/

Edit: Uploaded fixed source, depth should now be able to be infinite w/o crashing your machine, but behavior is not tested yet.

Re: Simplified checkers (AI)

Posted: Thu Dec 04, 2008 11:01 am
by Falco Girgis
There is an executable there, right? I still plan on playing/screwing with it. I just have a final today. =(

Re: Simplified checkers (AI)

Posted: Thu Dec 04, 2008 11:05 am
by MarauderIIC
Executable in OP.

Re: Simplified checkers (AI)

Posted: Tue Dec 16, 2008 2:43 pm
by dandymcgee
That's pretty sweet Marauder. It's good fun actually, haha I got owned on 7 though and 10 froze my CPU :P. It's more fun to not enter -1 for player at all and just have the computer play itself lol.

Re: Simplified checkers (AI)

Posted: Tue Dec 16, 2008 4:03 pm
by MarauderIIC
I updated this a while ago so the memory handling is correct, but I haven't posted it yet. It allows infinite depth d:

Re: Simplified checkers (AI)

Posted: Wed Dec 17, 2008 12:26 am
by sparda
Pretty tight man, I like it a lot. I've been messing around with it and seems to run well; no crashes. I got my ass whooped though, as I have not played this game in ages (not set -1). I haven't looked in depth at all the code, so I was curious as to why you commented out the entire system::init function definition.

It's interesting to see how this relates to what I'm also doing in school, BTW.

For instance, a while ago (before all these goddamn finals that I have right now) I had to write a proggie that treated the 8x8 Chess board as a undirected connected simple graph, where all inner nodes/vertices were to be considered strongly-regular and squares were represented by these very nodes/vertices. The main (and only) objective was this: given a specific set of chess pieces already aligned on a hypothetical board (this would be set by the program initiation), you were to use the queen's current position to find the best possible next move using, specifically, a backtracking algorithm. Other problems included: using a brute-force algorithm to prove that the peterson graph has no Hamiltonian circuit, a computational solution for the knight's tour, and also the 8-queen's puzzle. Pretty cool stuff, I'd say.

I'll take a read at the design documentation and give you some constructive criticism if you'd like.

Re: Simplified checkers (AI)

Posted: Wed Dec 17, 2008 9:02 pm
by eatcomics
sparda wrote:Pretty tight man, I like it a lot. I've been messing around with it and seems to run well; no crashes. I got my ass whooped though, as I have not played this game in ages (not set -1). I haven't looked in depth at all the code, so I was curious as to why you commented out the entire system::init function definition.

It's interesting to see how this relates to what I'm also doing in school, BTW.

For instance, a while ago (before all these goddamn finals that I have right now) I had to write a proggie that treated the 8x8 Chess board as a undirected connected simple graph, where all inner nodes/vertices were to be considered strongly-regular and squares were represented by these very nodes/vertices. The main (and only) objective was this: given a specific set of chess pieces already aligned on a hypothetical board (this would be set by the program initiation), you were to use the queen's current position to find the best possible next move using, specifically, a backtracking algorithm. Other problems included: using a brute-force algorithm to prove that the peterson graph has no Hamiltonian circuit, a computational solution for the knight's tour, and also the 8-queen's puzzle. Pretty cool stuff, I'd say.

I'll take a read at the design documentation and give you some constructive criticism if you'd like.
funny how that stuff works out huh? :shock2:

Re: Simplified checkers (AI)

Posted: Thu Dec 18, 2008 12:22 am
by MarauderIIC
Updated source ( http://elysianshadows.com/phpBB3/viewto ... 563#p28563 )
sparda wrote:Pretty tight man, I like it a lot.
Thanks.
I was curious as to why you commented out the entire system::init function definition.
There's a couple I commented out =) I refactored that part, I think, out to some part of Renderer.
use the queen's current position to find the best possible next move using, specifically, a backtracking algorithm. Other problems included: using a brute-force algorithm to prove that the peterson graph has no Hamiltonian circuit, a computational solution for the knight's tour, and also the 8-queen's puzzle. Pretty cool stuff, I'd say.
I had to look up most of the terms but then I remembered them from my algorithm design class =) Yeah, neat stuff. We focused a lot on prepositional logic modeling in my AI class, and modeled n-queens :)
I'll take a read at the design documentation and give you some constructive criticism if you'd like.
It's more of a report for the professor. You can if you want to, doesn't make any difference anymore, though (got a 94 in the class).