artificial intelligence with objective-c code : to make it work, it should do 3 things

StackOverflow https://stackoverflow.com/questions/13879938

  •  08-12-2021
  •  | 
  •  

Question

I know that an AI should do 3 things: 1.Collect Data. 2.Process Data. 3.Predict The NextData that will be collected.

I believe that i should use a dataBase to collect all the data.

In a game like (Tic Tac Toe, Chess, ... etc) on a iOS device, i would make it play against it self for 30 sec or so , and learn from its mistakes, but in a game like Prince of persia, Assassins i would learn (from) the player skills ( start with the first 3 min of playing where the skills of the player will be tested ), and then adapt the game to the player skills, so if the player is a dam good one the game will give allot of fun, but if the player is a beginner i will give some more exploring, and easy to kill "evil soldiers".

" Finally the question arrives" 1.Is this approach valid ? Or is there a better one ?

Was it helpful?

Solution 2

I really think it is what you as a developer wants. If you want an unbeatable AI your approach would be different then one of getting the most fun out of the game.

Adapting the ai skill by how well the player plays. I wouldn't say is an "AI" thing more of a way to code it for the most enjoyment for the player.

If it was truly AI then it'd be the best player the programmer could build. When I made AI what I'd do is build an initial AI and then build an AI that could beat that AI each version being a benchmark that had to be beaten. I don't think you want to go the route of the AI "learning" from it's mistakes as it would be a lot of overhead and a long learning curve. As the game developer you would probably have a pretty good idea how to make an AI that could beat out AI's that learn everything. That is just my opinion.

OTHER TIPS

Disclaimer: I spent over 2 years working on both Prince of Persia and Assassin's Creed, I am not legally allowed to tell you how these games are made, but I will try to give you general knowledge about game AI. Most games do not use learning as you described.

First, the language or the platform (or device) you target has nothing to do with the artificial intelligence tools you will be using.

Second, your two first examples, tic tac toe and chess are turn-based games, this is totally different than a real-time game. Also, both of these games work on a limited board with a somewhat limited search space. These games would be way more easily solved using other algorithms than learning (like minimax for example).

In the case of a real-time adventure game in 3D space like those you described, just even finding the context or input you will be feeding to your learning system will be hard... what elements are pertinent for the decision making: recent audio stimuli, visual stimuli, relativeness of these stimuli in space and time, surrounding enemies or allies, etc... Then, given the complexity of these world and what NPCs are allowed to do, how do you define the output of your learning algorithm? How does this output remain cohesive over subsequent queries?

Keep in mind that whatever changes you make to your game design will require rerunning the learning process and possibly the definition of the input and output.

You are better off going the standard route, use well known methods such as finite state machines, fuzzy state machines, behavior trees, planning, etc... You will have more control over the decision making and will actually be able to design your NPC behaviors, which you wouldn't be able to do with learning.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top