Advanced game AI

I’m releasing a commercial survival game on Steam and the whole “hook” of the game is that there’s an AI NPC driven eco-system with combat and the AI looking for food and water and NPCS will react to your moral decisions. (like if you kill an innocent person and take all their food, then the prices in the shops will go up.) There’s only one problem.

I don’t really know how to do all that.

I have some idea of how I would do it in my head but I’m still not too sure.

What I want in the end is:

-Some Innocent NPCS that run around the map looking for food and water that you can kill and they will drop some food or maybe sometimes water

-Some hostile NPCS that run around the map with guns looking for people to kill (they will kill other NPCS too)

Please when answering, try to get your point across in a simple manner. Thank you!

Game AI is a very complex topic and the implementation can be very different for every game, don’t expect anyone to give you an in-depth explanation here how to do it.

Some AI examples included with GDevelop, take a look at those and I am certain you can find some tutorial videos too.

In general I recommend to get familiar with the following topics in order to implement AI:

  1. Pathfinding
    Pathfinding behavior - GDevelop documentation
  2. Linked objects
    Linked Objects - GDevelop documentation
  3. Object variables
    Object variables - GDevelop documentation
  4. Math, Variable and Behavior expressions
    Variables: Expressions reference - GDevelop documentation
    Math: Expressions reference - GDevelop documentation
    Pathfinding: Expressions reference - GDevelop documentation
    Obstacles: Expressions reference - GDevelop documentation