anything AI-ish?

This is a discussion on anything AI-ish? within the Game Programming forums, part of the General Programming Boards category; does ANYONE use anything resembling a choice making thingie in any game they've made? im making a chess game, and ...

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    25

    anything AI-ish?

    does ANYONE use anything resembling a choice making thingie in any game they've made? im making a chess game, and i posted a tread erlier. this is different. i want to find other methods that work, so i can use them, as my method is'nt working.

  2. #2
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    I've done it. Do you have a more specific question? Have you searched google for Chess AI algorithms? What have you tried?

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    580
    If you want something that's *really* into AI, look at the tutorials on this website that talks about Perceptrons. It's sort of like a neural network.

    Also look for neural networks, fuzzy logic, and thresholds.

    Now, this stuff isn't actually that hard to understand if you actually read about it (otherwise the term 'neural network' sounds a bit intimidating, but it really isn't all that hard to understand...honest).


    If you use fuzzy logic and thresholds (which is basically what is talked about on the perceptron tutorial on this website) you can basically 'evolve' the AI by changing the threshold values. For example, each chess player has to consider X number of variables:

    X1 + X2 + X3 etc

    each of these 'variables' is typically things like 'how close am I to other pieces', or 'how much do I need to get from here to there' etc. Then, each 'variable' is weighted, based on either a method you choose, or some series of weights that has been evolved over time (the tutorial on this site tells how to change weights). The actual output behavior (in this case the chess board movement) depends on the output values of the sum of the weight multiplied with each variable and the threshold of the entity doing the 'thinking' in this case the chess piece.

    that's a basic rudimentary way of getting started with neural networks and fuzzy logic. It's cool stuff but kind of confusing when you just start out.

    the perceptron thing:
    http://www.cprogramming.com/tutorial/AI/perceptron.html

    the chess tutorial on this site:
    http://www.cprogramming.com/tutorial...sboardrep.html

    EDIT:
    I actually think that the neural network thing and fuzzy logic thing might be a bit overkill for something that is ultimately just rule based.
    Last edited by Darkness; 01-30-2005 at 02:31 PM.
    See you in 13

  4. #4
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    Most games use a state machine architecture. Fire up some mission editors for well known video games and you will see what I mean. The only reason the AI even looks half-intelligent is because the level editor was careful in how they used the AI.

    Most games have a very long way to go before we get decent AI - barring Firaxis games as I think they have some of the best AI out there.

    But most of it is based on states like this:

    1. Green - object continues patrol path - not alerted
    2. Yellow - object may stop and look around - alerted but not in offensive mode
    3. Red - object is firing at player - alerted and in offensive mode.

    From here you normally set AI traits in the editor like:

    * - Blind
    * - Indestructable
    * - Deaf
    * - Will fire prone
    * - Will only fire standing up
    * - Fire timer (how long will object fire at player once alerted)
    *- Patrolling (object will not fire at player until they reach waypoint)
    *- Gurading (object will not run too far from patrol area - usfeul for buildings)

    If the level editor uses theses values randomly then it looks like you have a bunch of guys who act differently...when in reality they are all pretty much following the same algos.

    Novalogic has a very good scripting language that allows you to specify stuff like this:

    if past(5) and never() then
    SSN2SSN(1,2)
    GtoWP(7,1)
    endif

    This essentially says if 5 seconds have past since mission started and this event has never happened before, move object with ID of 1 to object with ID of 2. Move group 7 to waypoint 1.

    So your scripts actually control the game AI more than AI algos. Now if object 2 is a vehicle then your AI code in the game should say....drive the vehicle. That is not controlled by the level editor...or it could be...your choice.

    Scripts and AI go hand in hand.

  5. #5
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    Check out the contest board. There is a thread for a connect 4 tournament and all the entries are posted. If should give you a decent look at minimax trees with alpha beta pruning.

  6. #6
    Registered User
    Join Date
    Aug 2002
    Location
    Hermosa Beach, CA
    Posts
    446
    Also for chess you may want to do a google search for "bitboards", since this one of the normal ways to implement the move generation.
    The crows maintain that a single crow could destroy the heavens. Doubtless this is so. But it proves nothing against the heavens, for the heavens signify simply: the impossibility of crows.

  7. #7
    Registered User
    Join Date
    Jan 2005
    Posts
    25
    THANK YOU!!! sorry, internet's been down for a while. anyways, specificly, somthing like this:

    Code:
    if(world[x-1][y]==1){
    a=1;
    }
    then a swich/case statement to decide where it goes like : case 2 x-1...

  8. #8
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    What are you intending us to use that code for? Has your question been answered?

  9. #9
    Registered User
    Join Date
    Jan 2005
    Posts
    25
    im using it for a chess-like game more like fire emblem or advance wars.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple space combat AI
    By VirtualAce in forum Game Programming
    Replies: 5
    Last Post: 01-05-2009, 11:54 PM
  2. chess ai contest
    By Raven Arkadon in forum Contests Board
    Replies: 7
    Last Post: 07-09-2005, 06:38 AM
  3. AI Contest Proposal
    By MadCow257 in forum Contests Board
    Replies: 4
    Last Post: 03-13-2005, 02:27 PM
  4. Game Design Topic #1 - AI Behavior
    By TechWins in forum Game Programming
    Replies: 13
    Last Post: 10-11-2002, 10:35 AM
  5. Technique of all board-like games?
    By Nutshell in forum Game Programming
    Replies: 28
    Last Post: 04-24-2002, 08:19 AM

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