finishing the game

starcraft

Well-known member
Joined
Jun 29, 2003
Messages
167
Location
Poway CA
i am almost done with my first game, so to say, all i have left to do is the manual labor. BUT i just relized that my game is not a net game so it wouldnt work. I am building a 2 in one chess/checks game. And i dont know how to make the computer play along with you... i guess you could call it AI. How do i go about making it?
 
Theres no easy answer to that. AI is a very very complicated task. For my end-of-year project in QuickBASIC I made a 2 player chess game, and that was very hard even without a computer player. Having AI would have made it incredibly hard.

To design chess AI that is half-decent, you need to understand the senarios completely; what moves take precedence, when the consequences down the road will be. Very advanced stuff.

They managed even to make a chess AI that beat Gary Kasparov, but only in 2 of 7 games or something, and that was an IBM super computer that a team of skilled logicians and chess players worked at creating.

Checkers wont be so hard, but AI of any kind will be a big challenge. I suggest you do some searching of Google, and some intensive reading.
 
To addition of what Volte said, I would very strongly recommend that you yourself are god at chess before even attempting to create an AI. Its hard to be good in chess :D ;) .
I sguuest you play online with some people, I like visiting games.yahoo.com when I want to play chess online :).
 
hmmmmm never thought of it that way..... um in that case ill modify what i have to make a single player game. right now im using mutants drawing code for my board
Code:
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
        Dim X As Integer
        Dim y As Integer
        For X = 0 To 360 Step 90
            For y = 0 To 360 Step 90
                e.Graphics.FillRectangle(New SolidBrush(Color.Black), X, y, 45, 45)
            Next
        Next
        For X = 45 To 315 Step 90
            For y = 0 To 360 Step 90
                e.Graphics.FillRectangle(New SolidBrush(Color.Red), X, y, 45, 45)
            Next
        Next
        For X = 45 To 315 Step 90
            For y = 45 To 315 Step 90
                e.Graphics.FillRectangle(New SolidBrush(Color.Black), X, y, 45, 45)
            Next
        Next
        For X = 0 To 360 Step 90
            For y = 45 To 315 Step 90
                e.Graphics.FillRectangle(New SolidBrush(Color.Red), X, y, 45, 45)
            Next
        Next
    End Sub
how do i modify that code to make a disign like this:
| . . .
| . . . . .
| . . . . . . .
| . . . . . . .
| . . . . . . .
| . . . . .
| . . .
Each of those dots are a 45x45 colored square. Just like the code mutant gave me just i dont to block a few drawings. I hope i explained it to some degree of understanding :D
PS- THe board is bigger than that this thing wont show all of it for some reason. What u see, reflect the same thing on the other side of the line but without the 3 large rows just the 5 high and the 3 high:mad: sorry
 
Last edited by a moderator:
There are tutorials on www.gamedev.net (or www.flipcode.com, one of the two) about building a chess AI. You dont really have to know much about chess.. you just build a tree of all possible moves and pick the move that has the shortest road to victory.

Of course, the hard part is pruning the tree so you can decide on a move within a certain time limit (dont want your player waiting days for the pcs move :) ). If I recall correctly the techniques are called min-max with alpha-beta pruning (its been years so thats probably not right).

Hmm.. quick google search gives these:

http://www.digichess.gr/articles/minmax.html

http://www.seanet.com/~brucemo/topics/alphabeta.htm

Hope that helps.

Pete
 
Originally posted by Matt
do you have any idea how to use a graphic as an object and move it over the checkerboard???

You would have to keep track of the coordinates at which the graphics have to be and then draw it everytime it moves at the specified coordinates.
 
ok, great site. im still going over them. but i also need help for after i finish this checkers game ( im only doing checkers for experience ). i wanna do something like Dungeon Siege. if i could get some help i would be all too appreciative
 
Hmm.. for something like Dungeon Siege you probably want to look at this site: http://www.truevision3d.com. Its a 3d engine compatible with .net that is free for non-commercial use (although you have to have a little "Truevision" banner in one corner, but full shareware licensing is quite cheap (for a 3d engine).

Please note that I have no affiliation with that group (so this isnt some cheap plug ;) ).

Pete
 
Ive been examining Dungeon Siege and am only just beggining to understand the theory and logic of the engine despite owning the game for more than 6 months. It is a massive game. You can get ideas on how it works from the Map Making tutorials at www.dungeonsiege.com but if youre going to do it, youll need to understand Inheritance to manage the game objects, Dungeon Siege is like a mini-version of Windows, it uses a message loop engine to send game messages (such as Activate, UserClick, EnterActiveMapArea, etc) to game objects, each game object has a handle similar to a Windows hWnd, its extremely complicated.

If you try, youll want to know Direct3D just about inside out as well as DirectInput and DirectSound3D. The general abilities of the .Net framework and all of its classes as well as a good understanding of how Windows works and managing massive amounts of data without using up the RAM and paging file. If you make a 2D version then you shouldnt have too much difficulty but the game worlds are likely to much smaller and simpler, youll probably also want experience in running applications based on data in files(Allows dynamic addition of game objects) and using scripts to prevent hard coding the mechanics.
 
Wowzers

Wow StarCraft, that is cool code! All I had to do was copy and paste, hit the play button, and I saw the beatiful squares :D . I love it when I find code that easy lol. I hate it when I find code, and I get darn errors!
 
ThePentiumGuy: At the top of the features page "The TV3D Engines are supported in .NET (C#, VB.NET and some other .NET-supported languages), in VB5/6 and in Delphi". There are loads of samples in both c# and VB.

The VC++6 support is only a wrapper as far as I can tell.

Pete
 
Ive been examining Dungeon Siege and am only just beggining to understand the theory and logic of the engine despite owning the game for more than 6 months. It is a massive game. You can get ideas on how it works from the Map Making tutorials at www.dungeonsiege.com but if youre going to do it, youll need to understand Inheritance to manage the game objects, Dungeon Siege is like a mini-version of Windows, it uses a message loop engine to send game messages (such as Activate, UserClick, EnterActiveMapArea, etc) to game objects, each game object has a handle similar to a Windows hWnd, its extremely complicated.

Interesting. Very interesting.
 
Back
Top