Jump to content

AutoIt Chess


monoceres
 Share

Recommended Posts

Hi!

This is a project I've been working on for quite some time and I'm happy to finally being able to release something that almost works as a complete chess game.

Features:

- A working PvP mode that detects both Check, Checkmate and Stalemate.

- Game engine written completely in C++ for maximum speed.

- Clean looking GDI+ Graphics

- In game assistance that help you see where you can move your piece.

- Animated menus and info screens

- High scores

ToDo:

- Bot (Need more testing of the game play so there is no weird bugs that undermine the bot before I can start working on it)

- Rotation of board when players switch turns.

- Castling

- Better looking info when winning/draw occurs

- Optimize for better speed

- An icon (have any?)

Screenies:

Posted Image Posted Image Posted Image Posted Image

Download:

autoit_chess.zip

IMPORTANT!

If you cannot move the pieces or get an subscript error that means that the Game Engine couldn't be initialized, please download the VC++ 2008 Redist to install the libraries necessary for the game to function correctly.

Have fun! :)

Edited by monoceres

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

Just tried, I`m impressed, looks very nice and work fine.

I like very much About from your menu. I like the effect of letters to move the mouse.

Very good script. :)

Thanks Andreik, I've spent quite some time on this so your kind words means a lot :)

Yeah, I like the about too, I was actually surprised how well it followed the mouse when I first tried running it. Thought it would look jaggy at first. Also check out High Scores, there's a pretty decent looking fire there o:)

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

Looks nice!

Chess Icons

Thanks!

Unfortunately I cannot use any of those icons since they look like shit when enlarged ;)

Immaculate! Just wow. Can't wait for the next release.

:def: ~Immaculate~

3. free from fault or flaw; free from errors

I'm overwhelmed, and also I've gotten a new word in my vocabulary :)

I'm going to start working on the bot as soon as I get some free time :) Just be sure to hunt for bugs in the current version o:)

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

Hey,

I have to say it looks realy nice!

I think i found a bug, I clicked High scores, and it starts loading the high scores gui (like in your img) but when its almost done (which takes about a full sec.) it starts drawing the background darkgrey from top to bottom and then again with a different grey and so on....

AutoIt 3.2.12.1

Windows XP sp2

Edited by Robjong
Link to comment
Share on other sites

Hey again,

Ok, so now i tried to play it, just clicked a white pawn and got pwned tongue.gif

White Pawn selected
C:\PathTo\AutoIt Chess.au3 (975) : ==> Subscript used with non-Array variable.:
Return $call[0]
Return $call^ ERROR

changed to following code (line 969)

Func CanPieceMoveThere($PieceIndex, $Column, $Row)
    $struct = GetStructFromPieces()
    $call = DllCall($hDll, "int:cdecl", "CheckPieceMove", "ptr", DllStructGetPtr($struct), "int", $PieceIndex, "int", $Column, "int", $Row)
   
   
    Return $call[0]

   
    Return False
EndFunc   ;==>CanPieceMoveThere

It fixed the error but i can't play the game, keep getting the '!Move forbidden' message, think its something with the dll or dllcall.

The dll is in the right place (unpacked it again to make sure it wasnt corrupt)

Edited by Robjong
Link to comment
Share on other sites

and again,

so i tried the following (line 969):

Func CanPieceMoveThere($PieceIndex, $Column, $Row)
    $struct = GetStructFromPieces()
    $call = DllCall($hDll, "int:cdecl", "CheckPieceMove", "ptr", DllStructGetPtr($struct), "int", $PieceIndex, "int", $Column, "int", $Row)
    ConsoleWrite("CALL: " & $call & " (" & VarGetType($call) & ")" & @CRLF)
    If Not IsArray($call) Then Return SetError(1, 0, 0)
    _ArrayDisplay($call)
    Return $call[0]
EndFunc   ;==>CanPieceMoveThere

i got the following output in the scite console:

White Pawn selected
CALL: 0 (Int32)
CALL: 0 (Int32)
CALL: 0 (Int32)
CALL: 0 (Int32)
CALL: 0 (Int32)
CALL: 0 (Int32)
CALL: 0 (Int32)
!Move forbidden
White Pawn selected
CALL: 0 (Int32)
CALL: 0 (Int32)
CALL: 0 (Int32)
CALL: 0 (Int32)
!Move forbidden

Hope you can fix it, the game looks very prommosing :)

Link to comment
Share on other sites

(ok, i feel stupid now, overlooked the IMPORTANT part :))

Ok , so i installed the VC++ 2008 Redist, no effect, still can't move any pieces.

BTW: high scores showed correctly once (out of +- 30 views)

Edited by Robjong
Link to comment
Share on other sites

Restart PC after install?

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Hey,

I have to say it looks realy nice!

I think i found a bug, I clicked High scores, and it starts loading the high scores gui (like in your img) but when its almost done (which takes about a full sec.) it starts drawing the background darkgrey from top to bottom and then again with a different grey and so on....

AutoIt 3.2.12.1

Windows XP sp2

I know exactly why this is happening so I will fix it in the next version (using an additional buffer).

@monoceres

Try this icons. It`s only white pieces but is easy to make black pieces from white pieces.

Hope you like.

DOWNLOAD

Thanks, the icon is only instead for the AutoIt logo so I really only need one. WHich one do you think is best? I really like the rook/castle :)

(ok, i feel stupid now, overlooked the IMPORTANT part o:) )

Ok , so i installed the VC++ 2008 Redist, no effect, still can't move any pieces.

Can you please run this exe? If it doesn't run something went wrong with the VC++ install.

:)

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...