C Board  

Go Back   C Board > General Programming Boards > Game Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 01-23-2009, 05:52 AM   #1
Registered User
 
Join Date: Apr 2007
Location: india->tamil nadu
Posts: 18
Exclamation creating an AI engine for a simple game

hya friends,
i have created a number based game called 'numfun'. it is a very
simple game of course. firstly ther is a buffer array 4x4(level 1).



1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 *



the 16th square is blank represented by a *. i use another array 4x4,
in which all the numbers have jumbled positions say



1 4 8 6
7 3 10 14
* 11 9 2
12 5 13 15



the user has to move numbers into the empty '*' location and finally
approach the positions of buffer array.

the game works perfectly fine, but the thing is i am trying to upgrade it with an AI engine. i have few idea for construction of the AI
engine and i need some help.

thanks in advance..
__________________
--------------------------------------------------------------------
"Quotes don't make a man great- deeds do..."
cyb3r is offline   Reply With Quote
Old 01-26-2009, 01:19 PM   #2
Registered User
 
Join Date: Jan 2009
Posts: 2
tips

You can use something like this one.
states are game states. llike the grid you want to solve
operations look like state operation(state ) and are for example "rook goes to e,3" ...
Code:
 
data structures {
    states already solved
    states to be solved
}
code {
  add first state to to be solved  // EDIT: the one you want to solve

  until to be solved != empty
        pop first
                apply each operation // get new state
                       if solution // you have to know how to recognize solution
                           done and done ;)    
                       if not in already solved
                                add to already solved
                                add to to be solved
}
Also make it little dumb and slow. Supersmart AI is frustrating & boring.

Last edited by hribek; 01-26-2009 at 01:21 PM. Reason: forgot about something
hribek is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for coder: Simple C++ Client / Server game kocho Projects and Job Recruitment 1 02-04-2006 02:34 PM
Game Engine Link Prob swgh Game Programming 2 01-26-2006 12:14 AM
Simple driving game Bubba Game Programming 6 07-06-2004 09:34 AM
Help with a simple game jjj93421 Game Programming 1 03-28-2004 03:52 PM
Resource ICONs gbaker Windows Programming 4 12-15-2003 07:18 AM


All times are GMT -6. The time now is 01:21 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22