RPG NPC AI, Scheduling and Needs...

Started by
55 comments, last by Ingenu 23 years, 4 months ago
"Don''t forget we''ll need to manage dozens to thousands of NPC with that system, so that must be fast and efficient."

You wouldn''t necessarily have to do it with every NPC. Obviously, that would be a nice challenge to program, but looking from a gameplay standpoint, would the character really care what the baker was doing on the other side of town while he''s out searching for the king''s daughter? You could set up a priority system; only the NPCs whose behaviors can be seen (or heard maybe) by the character, and all the NPC''s that are directly involved with the PC at the time need to be dealt with first, while those with a lower priority can be simplified. For example, if the baker''s actions aren''t crucial to the game (for the time being at least) he may just bake the bread without worrying about getting the ingredients first. That would allow for very sophisticated NPC actions with current technology, and the player would never know about the shortcuts being taken in the background if they were designed properly.

-Icculus
Advertisement
This has been discussed in the NPCAI list and will be implemented.

NPC gouping, Sector management and NPC prioritised are all planned.

Thanks for your interest in our project.

-* So many things to do, so little time to spend. *-
-* So many things to do, so little time to spend. *-
I haven''t checked out this forum in a while, and I see this idea is still here. Personally, I dont believe in it. ''Needs'' are basic instincts for the NPC to consider. a ''schedule'' is just what the NPC knows he should be doing. Its up to the NPC to decide whether or not he wants to do it now.

Show me an example of how a NPC could decide to skip work one day because he''s in a bad mood without using random numbers.
It''s up to you to do Design your NPC such as this is possible.
I mean there''s nothing in NPCAI that prevent this situation.

The NPC state/data are stored in the game engine.
If you introduce an Event : "I''m sick", and you write as a reaction "Stay in bed", and that no higher priority Need comes into play, then your NPC will stay at bed.
I do think that he''ll occasionnaly go to the toilet and eat, but maybe the creature don''t have to.

The Need will be suppressed by the rules you introduce into it.

It''s just a Designer problem, the system is perfectly capable of handling such a situation.

-* So many things to do, so little time to spend. *-
-* So many things to do, so little time to spend. *-
I said bad mood, not sick-but let''s get a bit mroe specific shall we?

how about, this guy had a run in with another person the previous day at his shop, and the other guy said he would come back the next day to pick up his order. but our shopkeeper doesn''t like this guy at all and doesn''t want to have to talk to him again. Given that, how would a needs system work?

I''m going to guess ahead of you here...if you decide on something like Disliked Persons Avoidance, then exactly how many priorities are you going to have in this queue to cover the many situations that can arise? 16 million? (a slight exaggeration)
As was previously stated, there was an idea about havin NPCs "get a call" so to speak, and they have to perform an event within a certain amount of time. Then it was mentioned that if they ran out of time, the event would force itself (i.e. screw the barber shop, I''ll just go to the bakery for no reason). There is one important thing to remember: the player most likely will not know what the NPC is thinking! So that means that this "forced event" wouldn''t be all that strange at all (although there are circumstances where it could be awkward).

Another possible solution to this problem is to have NPCs redevelop schedules as time progresses. This would be truly amazing for an MMORPG (although I really doubt possible with today''s technology, but who knows). Imagine starting up 3 servers, and letting them progress. With the NPCs semi-randomly recreating their schedules, no world would be anything alike!

Don''t ask me how to do it, it''s just an idea
Each NPC has an internal ''reputation'' to each known NPC.

First time a given NPC meet another, they both ''exchange'' their reputation level, or get a default one.
(Default level set by NPC, for example a carefull NPC will attribute a low default Reputation score to any given NPC he met)

This reputation system can be used in the scripts.

Also don''t forget that we don''t want to do TRUE AI since people with very high diplomas aren''t even capable of doing such a thing.
We just want to give the player the Illusion Of a Living world, people having activities, reacting to events,...

As mentionned you can ''force'' a given NPC action in your Game Engine.

Scheduling is a fallback system that should not be required after the initial launch of the system.
-* So many things to do, so little time to spend. *-
I have quickly gone over many of the ideas you guys at NPCAI bring up here and in the other posts in this ai forumn and they all are elements that will make the AI in the npc seem somewhat "realistic". Like others however, i do get a little concerned. You have added more and more to an already daunting project and yet you dont seemed concerned what-so-ever about it. Or maybe its in the npcai forumn you guys have(see bottom)

You have plenty of different structures to worrry about as is and yet you continually add "ideas" to an already complex problem: Scripting, npc memory, schedules, message handling between all sorts of structures, reputation, social structures, race and lets not forget the Basic algorithms for ai used now such as path finding, flocking, grouping,... then there is the big npc object structure: i havnt heard anything on that here either...

I really do find some of these talks helpful in understanding what ai should and could do but it would be helpful for me and to plenty of others to understand this more if i could here you guys maybe talk a little more about ..hmm..let me just pick one: npc object structure.

From my understanding of your discussions, the npc object structure will get pretty big. I mean its gonna have race, stats, MEMORY, reputation, status in the world, skills, etc, etc, etc... Could you go into ANY detail of the structure of an npc object so i can get a grasp of a npc object with AI in it?

(i have registered at npcai but i gave up since it looks pretty time consuming to go through each post trying to find info...do you guys have a website posting the more specific structures and design info of your development..it would be easier to look up stuff there then some message board)




aka John M.
Never give up. Never surrender!


We are still working on the design.
Anyway I can tell you that we have made it pretty ''easy'' to make, use and understand.
What you''re seeing as a giant task can be subdivided in little easy to handle task which puzzled together recreate the whole system.

I can''t be very specific for now, but as soon as we got a working thing, I''ll post a note to let you know.
Basically the NPC have access to Game data, and the Game engine to the NPCAI agents.
Vars... are stored where appropriate, and the whole system and main objects have been named and design, even if we don''t know all the objects functions, we know what we must include in each object.

More about NPCAI later...
-* So many things to do, so little time to spend. *-
I stumbled uppon this thread a little late, but have a few links to add that people may find rather interesting.

first is one at Gamasutra about the general state of current AI. There''s a real gem there though about basics of The Sims:
http://www.gamasutra.com/features/20001101/woodcock_01.htm

Basically they use an idea they''ve dubbed "Smart Terrain". When an NPC needs something(like food), it looks around the environment and the refrigerator advertises it has "food". The food then says it needs heating before it can be ate (to satisfy the NPC''s hunger). The microwave advertises it can heat food.

Combining that with perceptions could do amazing things. (Certain characters may not know that certain services are available by certain devices for specific goals).

Another neat project is called Brainiac Behavior Engine, by Twilight Minds. The basic idea is solution-fitting to NPC''s personality attributes. For instance if an NPC sees another with an item, and they like it a lot, they have a few choices of how they can get it. They could kill them for it, Threaten them, Try to steal it, or offer to buy it. Based on a character''s alignments and opinions, and they''re fondness of the other character, they can choose an appropriate solution.

http://www.twilightminds.com/bbe.html

I''ve played with it a little, and I like the approach a lot. The only problem is the way they''re engine is setup, it doesn''t lend itself to easily have dynamic values for some situations. I can''t think of any examples off hand (been a while since I was playing with it), but I remember needing certain variables assessed dynamically (Alignments of actions, I think).

Hope that''s all of some help!

This topic is closed to new replies.

Advertisement