Skip to main content
GameDev.net gamedev.net
🔒 Locked

AI for NPC

Started by davoodm93 Aug 28, 2015 at 6:31 AM 29 replies 14.8k views
Original Post
davoodm93
davoodm93

Hello

I'm starting my MS this month and I want to work on AI for NPCs, but I don't know how and where to start or what tools do I need to learn, I'd really appreciate if anyone can give me some advice biggrin.png

Thanks a lot smile.png

Ashaman73
Ashaman73

Some topics (google them):

- moving in a game world: navigation mesh, waypoints, pathfinding (A star/A*)

- decision making: eg. behavior trees

- steering in a game world (avoiding obstancle on the path, moving in a group): steering behavior

- general AI programming: usage of scripting

- reacting to the environment: scanning the surrounding, triggering agents

Keep away from:

- neural networks (commonly not really useful for game AI)

- genetic algorthm (either not really useful for game AI)

PS: visit the GDC vault and check out all the presentations of AI to get an idea about what is needed and what to avoid ;-)

davoodm93
davoodm93

Thanks, earlier I wanted to work on learning NPCs, but I read in this forum that they're almost not used in games, so what can I work on in this field?

Also, should I learn to work with engines like Unity?

Ashaman73
Ashaman73




Thanks, earlier I wanted to work on learning NPCs

Hmm... are we talking about the same thing ? I mean NonPlayerCharacter...




Also, should I learn to work with engines like Unity?

It could be an easy way to represent your work (check out Unreal4 too), thought you don't need fancy art. A few moving boxes to represent a crowd AI is better than to spend days to get an animated character into your engine. Test it out, but remember that you want to show off AI and not a game.

davoodm93
davoodm93

yes, I mean NPCs that can learn by that.

thanks again smile.png

IADaveMark
IADaveMark

If you haven't worked with AI before, don't expect to be up and running in days, weeks, or even months. It is a very complicated area. Which does beg the question... why would you chose to start your MS on something that you readily admit you have no knowledge of? A better question would probably be, "why do you want to work on learning AI? What is it you hope to accomplish, prove, solve, improve, etc?"

Be that as it may, there are many billions of reasons why learning AI is not used in games (at least not a lot). A simple search through this forum will provide you with spirited commentary on the subject. However, you do not even want to delve into the topic of learning AI until you know how to make static, authored AI. That's somewhat like saying, "I don't know how to do arithmetic but I heard that differential calculus was cool... how do I start with differential calculus?"

That said, there is a book list stickied at the top of this forum. That will get you started with the basics.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit<
Ravyne
Ravyne

Unless you plan on doing something very novel, I'm not really aware of any game-style AI that would be even slightly interesting as a master's thesis. Game AIs and classical AIs are different beasts. AIs that learn to play games are a different matter, but doesn't sound like what you're doing.

Have you met with your adviser yet to discuss your thesis proposal?

throw table_exception("(? ???)? ? ???");
davoodm93
davoodm93

If you haven't worked with AI before, don't expect to be up and running in days, weeks, or even months. It is a very complicated area. Which does beg the question... why would you chose to start your MS on something that you readily admit you have no knowledge of? A better question would probably be, "why do you want to work on learning AI? What is it you hope to accomplish, prove, solve, improve, etc?"

Be that as it may, there are many billions of reasons why learning AI is not used in games (at least not a lot). A simple search through this forum will provide you with spirited commentary on the subject. However, you do not even want to delve into the topic of learning AI until you know how to make static, authored AI. That's somewhat like saying, "I don't know how to do arithmetic but I heard that differential calculus was cool... how do I start with differential calculus?"

That said, there is a book list stickied at the top of this forum. That will get you started with the basics.


Thanks,

I've worked with AI before, but I read that game AI is different from academic AI. I had searched in game AI topics and I like AI for NPC the most, but I don't know where to start or even what to work on exactly. I thinks that's because my information is outspread about these.

Also, Should I start with "Artificial Intelligence for Games" or "Programming game AI by example" or other book? I'm familiar with basics like architectures or algorithms. (except for steering behaviours).

Thanks again

Unless you plan on doing something very novel, I'm not really aware of any game-style AI that would be even slightly interesting as a master's thesis. Game AIs and classical AIs are different beasts. AIs that learn to play games are a different matter, but doesn't sound like what you're doing.

Have you met with your adviser yet to discuss your thesis proposal?


Thanks,

no, I haven't met my adviser yet (I'll visit him this week), also in our university no one has worked game AI, and that's scary! sad.png

--
sorry for my bad english
IADaveMark
IADaveMark

Both of those books are good, but in different ways. Mat Buckland's "... by Example" book is going to give you a better understanding of things you will use directly in game AI. (Same with Millington's.)

The techniques that are going to give you the most mileage in game AI are:

  • State Machines
  • Behavior Trees
  • A* Pathfinding
  • Steering
  • Utility systems

Other things such as influence maps, etc. will augment that, but they aren't as necessary.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit<
davoodm93
davoodm93

Both of those books are good, but in different ways. Mat Buckland's "... by Example" book is going to give you a better understanding of things you will use directly in game AI. (Same with Millington's.)

The techniques that are going to give you the most mileage in game AI are:

  • State Machines
  • Behavior Trees
  • A* Pathfinding
  • Steering
  • Utility systems

Other things such as influence maps, etc. will augment that, but they aren't as necessary.

Thanks again, I'll start by this book.

wodinoneeye
wodinoneeye

Add some basic knowledge of 'planners'. The utility of that is for more complex NPC tasks that have multiple solutions in a more complex environment and for which decisions have to be made prioritizing what to do when/where (and handling tasks that get interrupted/retried/abandoneded or reactions to a changing situation).

Its higher level AI built ontop of the more basic mechanisms/methods

--------------------------------------------[size="1"]Ratings are Opinion, not Fact
Alberth
Alberth
no, I haven't met my adviser yet (I'll visit him this week), also in our university no one has worked game AI, and that's scary!

From a game perspective, you only need "something reasonably behaving", and "looking good". If that can be done with eg a hard-coded solution, that'd be fine.

From an academic perspective, a hard-coded solution is not relevant (unless you have a scientific method to derive that solution!). Also "looking good" is probably less relevant. On the other hand, the fundamental approach that you use is probably much more relevant.

Your goal is not to make an AI/NPC. Your goal is to find and describe a novel solution to the AI/NPC creation problem. You illustrate it with an example AI/NPC to show it actually works. There is a subtle yet important shift in focus here!

davoodm93
davoodm93

Add some basic knowledge of 'planners'. The utility of that is for more complex NPC tasks that have multiple solutions in a more complex environment and for which decisions have to be made prioritizing what to do when/where (and handling tasks that get interrupted/retried/abandoneded or reactions to a changing situation).

Its higher level AI built ontop of the more basic mechanisms/methods

Thank you smile.png I'll look into that.

no, I haven't met my adviser yet (I'll visit him this week), also in our university no one has worked game AI, and that's scary!

From a game perspective, you only need "something reasonably behaving", and "looking good". If that can be done with eg a hard-coded solution, that'd be fine.

From an academic perspective, a hard-coded solution is not relevant (unless you have a scientific method to derive that solution!). Also "looking good" is probably less relevant. On the other hand, the fundamental approach that you use is probably much more relevant.

Your goal is not to make an AI/NPC. Your goal is to find and describe a novel solution to the AI/NPC creation problem. You illustrate it with an example AI/NPC to show it actually works. There is a subtle yet important shift in focus here!

WOW, I didn't know that wacko.png

Also, if I want to apply for a good university for phD in future, my work must be more scientific? (I wanted to apply for MS, but I stayed here because of some reasons).

Thank you biggrin.png

Alberth
Alberth

It all a matter of pleasing the public.

If you make a game (especially commercially), you have to please the players. Most players are not at home with AI techniques, depending on the AI character and the game, they may even hardly notice its existance. So the main goal is to make something that doesn't stand out as "it acts weird".

If you write a thesis, the public is your supervisor. His/her interest is in the science that you use to solve the problem. If it looks good, that's nice too, but likely not the main thing you are graded on (but you should of course discuss this with your supervisor, if only to avoid nasty surprises!)

Now if you look at AI techniques as listed here, you're looking at solutions in the game case, as everybody in this forum does "games" in one way or another.

Those techniques are designed to work in the practical cases that you encounter for your average game. Those techniques are "use any means you can to show the player what he expects". If the shortest way is "cheating", eg by hard-coding a solution, great! Problem solved, let's move on to the next item on the todo list.

The scientific approach is not about getting to the end of the todo list before the deadline or about fooling players enough that they buy it. It's about investigating the proper way (which can mean lots of different things, ask your supervisor) to create an AI.

Edit: So the things listed here in the topic are definitely interesting to study, it gives you a wider view of the topic, which is never bad. You may even find a way to combine the scientific solution, and a technique listed here, who knows!

As for steps in the future, not sure. The topic and the solution is probably just one of the things they will look at. You as person is just as important is my guess, if not more (but I don't know for sure).

davoodm93
davoodm93

It all a matter of pleasing the public...

Thank you so much for advice smile.png

wodinoneeye
wodinoneeye

"or about fooling players enough that they buy it"

But consider the definition of the Turing Test ...

--------------------------------------------[size="1"]Ratings are Opinion, not Fact
IADaveMark
IADaveMark

Add some basic knowledge of 'planners'.

Thanks, W... knew I forgot something.

Also, read my article that I wrote for GDMag a while back. It's on my web site now.

http://intrinsicalgorithm.com/IAonAI/2012/11/ai-architectures-a-culinary-guide-gdmag-article/

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit<
wodinoneeye
wodinoneeye

Another aspect that you might want to touch on is 'uncertainty', as in how an AI can be made to handle imperfect/incomplete data or unpredictable behaviors in the environment. The basic tools like planners and pathfinding searches become trivial compared to trying to build the judgement and metrics used to figure when something (in a specific environment) is good enough (instead of mathematically optimal).

This part of AI is where it becomes magnitudes harder (extending into 'learning' if it is done while the game is running, versus being preformulated).

--------------------------------------------[size="1"]Ratings are Opinion, not Fact
davoodm93
davoodm93

Another aspect that you might want to touch on is 'uncertainty', as in how an AI can be made to handle imperfect/incomplete data or unpredictable behaviors in the environment. The basic tools like planners and pathfinding searches become trivial compared to trying to build the judgement and metrics used to figure when something (in a specific environment) is good enough (instead of mathematically optimal).

This part of AI is where it becomes magnitudes harder (extending into 'learning' if it is done while the game is running, versus being preformulated).

Thanks you :)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.