Computer VS Human?

How do you make a computer controlled player. For example in a fight game or a goalkeeper that tries to save a ball coming at him.

Comments

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    Well the general concept is called Artificial Intelligence (AI), but it would be different for each kind of game. The AI in a fighting game would be much different than the AI of a goalkeeper, or the AI of a race car in a driving game.

    I can't offer any specifics I'm afraid but maybe some others can.
  • FajlajpFajlajp Member Posts: 666
    Thanks @jamie_c
    I'm searching specific for an AI for a fighting game.
    Does anybody know how to make an AI for a fighting that control the "monster" to attack, defense and move?
  • TheGabfatherTheGabfather Member Posts: 633
    edited March 2013
    If you want to make a simple AI that is beatable (not perfect), if it were up to me it would eventually boil down to mostly randomizing through the possible actions it is capable of doing (okay maybe you can mix in some prioritization Rules when presented certain situations, for intelligence).

    Say a monster can Move Left, Move Right, Throw a Fireball at Player, Block.
    Of course you can cycle through these actions but that'd make it a mindless and confused monster. So use a Rule that every so often checks either for the position of the player, the monster, or both + whatever else might be happening (is the player so many pixels/percent of the screen away from the monster, etc). Then randomize the Monster's action, or do another more specific checking.
    E.g. Check for Player's location > Player is to the Left of Monster > Randomize between Moving to Player's Location at X Speed or Cast Fireball at Player, etc.

    Keep in mind that the more Rules you have going on, especially if they are nested, could slow down either the game itself, or the decision-making of your Actor - so optimize whenever you can.

    That's a pretty basic explanation of the traditional simple AI concept used widely in games, and I'm sure there are other people here who can help you better, especially with the specifics. Hope it piqued your interest enough to explore what you can do with GS, though! Nothing beats genuine interest + self discovery + a little bit of YouTube :) Good luck!
  • FajlajpFajlajp Member Posts: 666
    That helps me alot. Like you said in the ending, i've search all over youtube and forums. The only part that I didn't was that I already could all this. I thought that it should be much harder but it wasn't. Thank you so much @TheGabfather for making me understand :)
  • FajlajpFajlajp Member Posts: 666
    That's exactly what I'm searching for :)
    Could you send me a pm with how you controlled the boss, please @uptimistik
  • ChakkuChakku Member Posts: 1,513
    edited March 2013
    @uptimistik
    Nice AI! :)

    Chakku
Sign In or Register to comment.