Rock, Paper, Scissors type game. AI?
![ShaneS429](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
I finally jumped into getting a Mac and am using GS for my first game I am building with a friend. We have 3-4 ideas fully written out and we plan on doing all of them but we figured we'd start with a simpler idea.
Without giving our game away, the basic idea behind our game takes a spin on rock paper scissors but not just 1 on 1. Right now we are only doing Player vs AI gameplay.
I am quickly learning gamesalad and have actually gotten through a lot of the building process in a few days.
What is troubling me is AI computer opponents. Because this is a rock, paper, scissors type game, each move can be beat by another move. How would I make a form of AI that could weigh the options? Should I even have complex AI? Since everything can be beaten by another thing, is a simple random choice for the AI going to be good enough?
I can't help but think in real rock, paper, scissors, most of the time people just randomly pick a move knowing that they can only beat one thing and get beaten by one thing. Maybe a random number generator of 1-3 for the AI is enough?
Any insight would be great!
Without giving our game away, the basic idea behind our game takes a spin on rock paper scissors but not just 1 on 1. Right now we are only doing Player vs AI gameplay.
I am quickly learning gamesalad and have actually gotten through a lot of the building process in a few days.
What is troubling me is AI computer opponents. Because this is a rock, paper, scissors type game, each move can be beat by another move. How would I make a form of AI that could weigh the options? Should I even have complex AI? Since everything can be beaten by another thing, is a simple random choice for the AI going to be good enough?
I can't help but think in real rock, paper, scissors, most of the time people just randomly pick a move knowing that they can only beat one thing and get beaten by one thing. Maybe a random number generator of 1-3 for the AI is enough?
Any insight would be great!
Comments
I guess when I think about it, if the computer's choice is always random, the user can't ever predict what they are going to do, and thus can't ever guarantee that their choice will be the right one.
I have no intention of having the player make a choice then having the AI read that choice and act accordingly. Where is the fun in that?
But yes, there's not really much AI to RPS. Maybe a system where you record previous moves and change the weighting of the randomness? (e.g. the more someone use a given move, the more likely it will happen next time, etc).
R (count)
P (count)
S (count)
Rp = 1 - (P+S) / (R+P+S) * 100
Pp = 1 - (S+R) / (R+P+S) * 100
Sp = 1 - (R+P) / (R+P+S) * 100
m = rand(1,100)
if (m < Rp) choose rock
if (m > Rp && m <= (Rp+Pp)) choose paper
if (m > (Rp + Pp) && m <= (Pp+Sp)) choose scissors
Or something like that.
I guess a completely random AI wont exactly be easy nor hard. The Player might end up being their worst enemy in my game.