I want to implement some sort of "random" feel into my current AI and I need some help on executing logic n% of time. For example, I want my to follow the best path 80% of the time otherwise choose a random node to follow 20% of the time.
Any advice on how to execute logic n% of time possibly using the device time in a clever way?
srand(DeviceTime);
int percent = rand() % 100 + 1; //this generates a number between 1 and 100, without the +1 its just between 0 and 99
if (percent <= 80)
{
//choose best pass
}
else
//take random pass
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.