Strategy games and Gaming Algorithms

April 1, 2008

Strategy games and Gaming Algorithms

Strategy games and Gaming Algorithms.

Algorithms are one of the most important aspects of programming logic in general.
Intelligent or adaptive algorithms form a new genre in the history of algorithms.
When you write any sequence of steps of how a program logic will flow, that becomes an algorithm and when u separate out the decision making from the technical components of a program, add feedback features to them and make the decision maker reason himself, that becomes an intelligent algorithm.
Intelligent algorithms are finding one of their greatest applications in games.

The legacy games ported to PCs like card games and chess do require a good game algorithm to cover all possible cases of moves of a player.
To make the computer read the moves of a particular player and guess probable next moves, often-game programmers incorporate some intelligence using genetic programming or genetic algorithms.
It is basically starting the game knowing nothing about the gamer and as he plays through; his moves for different scenarios are noted.
Depending on the game, the programmers come up with a strategy to select moves that would close down the possible chances of good moves of the gamer.
In chess, it would be like for each game and for each move of the gamer, record the position of the pieces (rook or a pawn or the queen) present.
This means that for each piece, one needs to identify the locations the piece can travel in the next move made by the computer.
One needs to draw an interception space out of these and then one can find out the pieces of the gamer, which are falling in those intercepted spaces.
Next identify the space where the gamers’ pieces can move.
Under those circumstances note what move the gamer plays.
The options could be that the gamer takes out one of the computer’s pieces or himself moves one of his pieces to safety.
The game programmer marks each piece in that situation with an importance, depending on the availability of other pieces, the phase of the game (like a rook is very powerful in the end game, a bishop and a knight is very useful in a middle game.
Bishops can be also useful in end games, but knights with their weird twine like move are only lethal when the board is full of pieces and most of the freeways are blocked) and the current position of the piece.
Getting this numbering scheme ready, the computer notes under which matrix of numbers the gamer moved which piece, i.e. changes which pieces importance.
Now these values are collected through out and put into a random sampling and mating just like the genetic theory works.
Ultimately when the player has played some games, the computer has a fair idea as under which scenario the gamer would choose what kind of a move.
Well! Don’t feel lost, because you can cheat the computer if you know the kind of numbering scheme its using and adequately randomize your moves because these algorithms of finding genetic trait have a inherent weakness of localizing predictions, i e whatever matrix it is on the board, the computer thinks that your thinking is stereotype.
More random moves on your part would mean that the computer would take it longer to get to a prediction profile of yours and stereotype move d on you part will make it narrow down its search of possibilities of your move.
Now at that time you can come up with more innovative moves so as to frighten the computer.

These were some of the strategies used in PC games or you could call legacy games ported to PCs.
But people’s assumption when it comes to strategy games is something different because Age of Empires, Age of Mythology and Rise of Nations are some of our choices.
Here the gamer is not in the scene of the game.
He is like the invisible King or the God of all Gods.
He has an empire to build and expand.
He has to face nomadic tribes of different traits or heroes and Gods of a particular belief to extend his authority.
The strategy in these games comes from the fact that they are taken from historical perspectives and the gamer should get suited to it.
He should start feeling as a king of that age, trying to use maximum of his resources, plan cities, gold mines, and military training units.
He has to build a cavalry, train scouts men, create villagers, priests and build a university for scientific research.
All these take time and in that time you, the king, should have enough power to defend the kingdom or you could be blown out in stages.
You could advance to different ages or civilization modes depending on the wealth you have the amount of research you scholars have done in your universities, the amount of fire power you have etc.
It varies from game to game.
But the thing common to all these are that your strengths are your weaknesses.
If you build 5 universities it is liable that a cavalry from nowhere will be sent by some other king to destroy it.
The more you own, is you liability.
It is your boon too.
And there is one more thing that you need to keep in mind or rather study and get accustomed to is that different kings, chieftains and tribes have some specialties and some shortcomings.
Like a tribe could have extremely effective long bow men while they have a weaker life for horsemen while another civilization could have extremely effective knights but to train and own knights could be an expensive affair.
So you need to get accustomed to the various traits a game exposes.
And there lies the fun and to plan your regime accordingly is the strategy.
But if you trace back the strategy comes from embracing the different historical means of warfare, ways of living of different sects, their different beliefs etc.

So the gamer faces a challenge in either understanding the negatives and positives of a particular clan and plays “strategically” or he identifies the underlying mathematics of a legacy game and reevaluates his moves based on them.
That is what makes a good strategy gamer.