Y
Y
Yaroslav Ivashkevich2019-12-09 14:37:38
Programming languages
Yaroslav Ivashkevich, 2019-12-09 14:37:38

What are the tools for developing NPC behavior?

What tools (languages, frameworks, libraries) are there to describe the attributes, rules of behavior and interaction of non-player characters (NPCs)? Including reaction rules for individual units and their interaction in groups.
Studying the engines of logic games, and considering the decades of development of various games and role-playing systems, this question arose. Surely someone has already figured out the issue and implemented tools for developing the logic of behavior (reactions and strategies) of non-player characters in various games. I think there are mechanics where the player must interact with the NPC according to the same rules as the non-player characters themselves.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dollar, 2019-12-09
@Laraan

And there are no ready-made solutions and there cannot be, because they depend on the mechanics in your game.
That is, you need to take the state machine as a basis, or even better , the behavior tree , because. it is better for complex logic, and then bring your own logic there.
For example, on what basis can NPCs unite? In Prison Architect, they form gangs based on skin color . Is there color and racism in your game? Most likely not, so you will have a different, unique criterion.
That is, you write some kind of function like getTheBestNpcToMakeFriendsWith(), which takes into account various NPC parameters and environmental properties specific to your game, and then use this function in the behavior tree to switch to one or another branch.
And socialization can be spread across the decision tree itself. And each branch will have its own getBestNpcAround() function for any purpose (make friends, fight, etc.).
And it's not over yet. The behavior will still have to be balanced in order to look authentic and be interesting to play. After all, gamedev is an art. Therefore, the coefficients within this function will have to be selected, tried different ones, and in general, change and improve the function itself, and the tree too, until the NPCs behave the way you want. It would be strange to find a ready-made solution for this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question