how to add AI in games

i want to know that how i can add AI in my games. is there any other solution except "if" and "else"
Thank you

Comments

  • Hey Haseeb,
    Yep, there are other solutions. However, the nature of the solutions vary depending on what you want to accomplish. If you ask a more specific question, people will be better able to help (e.g., "How do I make the ghosts avoid me in Pac-man?").
    If you want an example of a different (but still simple) approach to AI, check out this article:

    http://www.sleepinggiantsoftware.com/FGJ/tutorials/tutorial_5/index.htm

    It will show you how to write several increasingly intelligent computer opponents for the game "Battleship". The final AI solution is very hard to beat, and makes all its decisions based on a mathematical assessment of previous hits and misses. It's a fairly short article, and doesn't require any super-duper programming knowledge (if you can add and subtract, you can write the algorithm).

    Good luck with your search.

    Kreitler



    : i want to know that how i can add AI in my games. is there any other solution except "if" and "else"
    : Thank you
    :

  • : Hey Haseeb,
    : Yep, there are other solutions. However, the nature of the solutions vary depending on what you want to accomplish. If you ask a more specific question, people will be better able to help (e.g., "How do I make the ghosts avoid me in Pac-man?").
    : If you want an example of a different (but still simple) approach to AI, check out this article:
    :
    : http://www.sleepinggiantsoftware.com/FGJ/tutorials/tutorial_5/index.htm
    :
    : It will show you how to write several increasingly intelligent computer opponents for the game "Battleship". The final AI solution is very hard to beat, and makes all its decisions based on a mathematical assessment of previous hits and misses. It's a fairly short article, and doesn't require any super-duper programming knowledge (if you can add and subtract, you can write the algorithm).
    :
    : Good luck with your search.
    :
    : Kreitler
    :
    :
    :
    : : i want to know that how i can add AI in my games. is there any other solution except "if" and "else"
    : : Thank you
    : :
    :
    :


    Some other statements for control, called 'conditionals/loops' are the 'for' statement, and 'while' statement.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories