Some ideas on Artificial Intelligence

This is written by @Stradyvarious and @t1_hopscotch and @Rawrbear. See original post here.


Articificial intelligence/adaptive AI

Articifical intelligence is simulating learning from mistakes. This might include increasing the chance that favourable outcomes occur, or decreasing the chance that unfavourable outcomes happen.

An example of implementation – having an AI mimic or learn a player’s actions:

  • Give an AI bot the ability to jump, move left and right.
  • The more that the player jumps, we want the more likely that the AI will be set to jump. We can use a variable as a measure of how much the player jumps, and then use that to judge how much chance we should give that the AI will be likely to jump.
When player character jumps 
    increase "Jump" variable by 5

// Have the Jump variable decrease by 1 each second if it's above 0.
When "Jump" > 0
    decrease "Jump" variable by 1
    Wait 1 second


When "Jump" > 50
    // this shows the player likes to have their character jump a lot.
    have the AI chance of jumping when choosing an action be at more than 33%.

otherwise
    // The jump variable can actually be modified to be made however you'd like it to be. 
    // The smaller the number, the less jumpier the AI will be. 
    // This is useful to know if your player's jump is programmed to be slow or as as rapid in-game.
        // It's also possible to modify the wait time for a similar effect.

    // keep the amount of jumping for the AI to somewhere near random, like 33% since the player does not favour jumping as much out of the three actions

This will make the AI spend more time jumping in the air, similar to the player’s behavior.
This is just a small idea sample.

Lots of possibilities to do with AI making decisions and copying/learning the player’s behavior are possible.

Here is a project example of an AI learning from experience:

You can see more context of the discussion here :blush:
http://forum.gethopscotch.com/t/stradyvarious-coding-topic/35156/43

There is another forum topic here:

http://forum.gethopscotch.com/t/hopscotch-theory-enemy-ai-with-evolution/1808


Do you want to interact with an example of a computer ‘learning’?

###Last One Loses
Playing a game against a computer, in two options:

###Why can AI be handy?

For some problems you might not know all the solutions, or might not have the resources to determine a solution, there might not be a more efficient way to determine a solution or there might not even be a solution :frowning:

In which case, you try to determine what’s preferable and increase the chance of it happening.


Feel very free to edit, again, and move everything around and rephrase and things.

28 Likes

This is cool. :grin: I don’t get how the AI will jump more if the number is smaller, though.

3 Likes

Because it requires the player to jump less.

3 Likes

Very cool, @t1_hopscotch

3 Likes

I think so too… I will change that :slight_smile: Thanks for mentioning!

3 Likes

Very useful if only I could have remembered the stuff I learned on what to do

3 Likes

This is a really good topic!

3 Likes

Yes! I love artificial intelligence! I think this could also be in the math category as well. My dad’s company works on AI, and wow it’s amazing. AI is like magical mathematics and I love it

More on my dad’s company:
AYASDI is a pretty cool place. They create topology maps along with artificial intelligence. Their main focus is on healthcare and making it more efficient… (editing more things, I’ve got a Bio test…)

5 Likes

Just remembered these!

4 Likes
3 Likes