Have actor perform action based on probability

Hello everyone.

I would like for an actor to perform an action based on probability. For instance if the actor has a 33% chance of going right rather than left. How can I randomize this action based on that percentage.

My first thought is creating a probability table based on left or right. Create a set number of columns for each percentage, the. Create 100 rows with left or right entered in each cell.

For example.... if the column percentage is 75% then 75 of the 100 columns would read left instead of right. Then I would create a behavior based on a random selection of that column/row and what lever is returned the actor will act.

Is there any easier way to do such a thing?

Comments

Sign In or Register to comment.