Artificial Inteligence

0 favourites
  • 10 posts
  • Hello All,

    Im currently trying to create a 2D fighting Engine (similar to Street Fighter) and would love to hear some ideas regarding how to aproach the AI

    My intention is that the "CPU" is able to learn fighting Padrons and adapt to human player capabilities.

    Im wondering if anyone has already tried to create some "Inteligent life" in construct2, i was thinking maybe it would be an interesting project to try an analise some Event sheets in order to maybe build a General but flexible Pluggin.

    Any ideas?

  • My intention is that the "CPU" is able to learn fighting Padrons and adapt to human player capabilities.

    Interesting... Are you familiar with machine learning?

    BTW, "Inteligent life" might be different with machine learning. "Inteligent life" could be created by some fsm(finite state machine).

  • Yes im aware of the concept and that would be the direction to go i suppose.

    But im worried of the amount of data that would be stored and the requirement to sort it to be usable.

    maybe Repetition recording of Input in certain conditions would be one feature that could help to shortcut the amount of data required to store.

    On a fighting game it would already take the dificulty to a "next level".

    We have the Playtomic pluggin available i was wondering in what extend that can be used to record Input and behaviour data.

    Im quite open to sugestions, but it would be interesting to have something on this level to enable some more realistic computer AI.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It seems to have two questions:

    1. store data.

    C2 has webstorage to save string into browser. Or FileSaver plugin can save data into a file.

    2. logic about machine learning.

    Since you already has a "plutronic" plugin for this purpose. The only thing is to export string (or a binary) data out.

  • I meant "Playtomic" sorry my mistake, its a pluggin available at the Plugin section that could help achieving the 2 step.

  • First, I don't want to sound pessimistic, but making a 2D fighting game is super hard, there's a lot of timing issues to do right and I don't talk about animation.

    That said, making the computer adapt to your playing style. Hmmm how could this be done?

    What is a playing style? A sequence of input that appears more often than other?

    Maybe we don't need to go that far as to register input sequences but then register the prefered moves?

    If we tackle the question from another angle, what is a good fighting game player? In my opinion it's a matter of timing. Doing the proper attack at the proper time, or doing the proper defense or counter.

    So let say you managed to register the moves and you have a graph of what moves appear most often. What should the computer do?

    When the player launch an attack doing a weighted random picking on possible defense or counter moves ?

    And then when the computer choose (?) to attack, he will do a weighted random picking on each possible attack based on the defenses or counter the player does rarely ?

    Ok why not. On the paper that seems doable. Now what kind of game would it be. It would be a game where, if you vary your attack the most you have better chances to win?

    So the player will have to memorise what attack he already used and use others to keep the weighted random balance the more even possible. Or maybe volontarily making the same move over and over to the risk of being heavily countered and then switch to something else?

    I wonder if it would be that fun. Maybe yes. Anyway, I'm really curious to see the result. I'm interested in IA adaptation so I hope you'll succeed (:

  • Yann

    These are "machine learning". It need to design some kinds of experiments to find "patterns". I think it's not easily, not only how to design the experiments, but also the computing complex -- it might be some matrix multiplications.

  • I don't think it has to be too complex mathematically, and if you figure how to space apart feedback, it might be doable with a neural network. I had considered making a neural network plugin for CC at one point and there were libraries for it for C++. I wouldn't be surprised if there are JS neural network libraries as well. It's not a magic automatic solution where you tell it to learn to fight and you're done. You'd have to study and experiment to find adequate starting weights for the nodes, how many inputs, etc, but I think that's the simplest approach to memorizing arbitrary patterns.

    Fourier transforms are also supposed to be useful for the simplification and generalization of patterns, but you'd probably need to design alot more of the AI than for the neural network, and Fourier transforms really are computationally expensive.

    Unless you're very interested in AI theory and want to do this for the sake of doing it, it'd be much easier to make fake learning. Program a stupidly hard AI that knows how to counter and dodge everything, and proper timing for effective attacks. Then dumb it down at the beginning of a round or game. Each time the player jump kicks, it increases the probability the AI player will "learn" that it's coming, and begin applying it's jumpkick counterattack behavior, randomizing timing, and mistakes will make it feel more natural. I believe this is how it's done in most fighting games. Even this approach would be timeconsuming, and it's probably the simplest of the three, but not impossible. Just know programming fun AI, even conventional AI will most likely be a long process.

  • Yeah sorting does play a big role in it, whether it be objects or conditions we could use some tools to make that easier, for each ordered, bubble sort, etc.

  • A while ago I found an article on Code Project about a Connect Four game that "learns".

    codeproject.com/Articles/7787/Learning-Connect-Four

    Obviously it's not the same game or writen in the same language, but I thought it might help.

    Program a stupidly hard AI that knows how to counter and dodge everything, and proper timing for effective attacks. Then dumb it down at the beginning of a round or game.

    I made a Tic-Tac-Toe AI in a similar way. If it finds two in a row of your tile, it will block it. If it finds two in a row of its tile, it will win. Otherwise it will chose a random place. I dumbed it down by having it chose a random place sometimes.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)