Jump to content

View more

Image of the Day

#ld38 #screenshotsaturday Mimosa Fizz action gif #2 https://t.co/TUzdppvfUL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

Sign up now

RPG NPC AI, Scheduling and Needs...

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
56 replies to this topic

#41 Anonymous Poster_Anonymous Poster_*   Guests   


Posted 24 November 2000 - 07:02 PM

"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.


#42 Ingenu   Members   


Posted 25 November 2000 - 01:05 AM

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. *-

#43 C-Junkie   Members   


Posted 27 November 2000 - 10:36 AM

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.

#44 Ingenu   Members   


Posted 27 November 2000 - 09:22 PM

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. *-

#45 C-Junkie   Members   


Posted 28 November 2000 - 09:42 AM

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)

#46 ArtemisX   Members   


Posted 28 November 2000 - 10:02 AM

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

#47 Ingenu   Members   


Posted 28 November 2000 - 10:02 PM

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.

#48 GalaxyQuest   Members   


Posted 04 December 2000 - 07:38 AM

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!

#49 Ingenu   Members   


Posted 04 December 2000 - 09:52 PM

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...

#50 Anonymous Poster_Anonymous Poster_*   Guests   


Posted 06 December 2000 - 05:40 AM

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:

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.


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!

#51 Kylotan   Moderators   


Posted 06 December 2000 - 12:24 PM

I must agree with one of the recent posts that, when I last looked at the NPCAI project (a month or two ago, I concede), it looked like people were piling on ideas, adding complexity, without really having a clear idea of how it would be implemented. I mean, I know the idea is to design first, implement later, but I think the problem is this: the project was set up to write games with ''better'' (loose adjective, I know) AI than current games, yet on the other hand, current games don''t have AI this good because it is very difficult to do so. The project aims to succeed where many highly paid professionals have so far failed. There are a billion and one ideas, some ideas about the meta implementation, but not much detail. Sometimes you just bite off more than you can chew. And sometimes you run the risk of implementing a simple thing in an overcomplicated way. For example, you can -simulate- market fluctuations just by multiplying 3 or 4 sine waves together. The result is great and ''realistic'', even though the implementation involved ''cheating''.

I can''t help but feel this kind of problem requires more of an iterative approach: write a good general AI, then try extending it. The project (as I last saw it) was trying to be everything to everyone by starting at too low a level, and looked more like a sociology paper with UML than a serious proposition for programming better computer games. Couldn''t it be useful to try and program something similar to the Ultima 7 system detailed above, except moving it a little more towards a needs-based system?

Feel free to correct me: it''s been a while since I had the time to check up on the project.

#52 Nazrix   Members   


Posted 06 December 2000 - 03:49 PM

I can see where you are coming from, Kylotan. I can''t say I''ve been keeping up w/ their AI project really well. It did seem like they were coming up w/ some nice solid code though, so I have faith.

It does seem that AI is something that is sometimes better to build from the simpler and then just keep making it "smarter". That may not work w/ things like graphics engines, but for AI I think it seems to work better.

"All you touch and all you see is all your life will ever be --Pink Floyd
Quidquid latine dictum sit, altum viditur.
Need help? Well, go FAQ yourself.

Click here to see my current project.

#53 Ingenu   Members   


Posted 06 December 2000 - 09:45 PM

Thanks Nazrix

First step: Brainstorming, get all ideas, talk about them, look at how they fit into one another and discard the less good ones

Second step: Design the system. retrieve all ideas and describe by words how it works, try a few examples to see what can go wrong, where and why, and redesign until it seems to work.

Third step: Begin to code, clear up all what have been done, redefine classes and choose how it''ll work, and why.
Code it without ANY optimisation so it must be easy to understand.

Fourth step: Test a first sample/beta implementation to make sure everything is going the way you want, and to find problems.
Solve them, redesign the code if necessary.

Fifth step: finish the coding and test the final implementation.

At various steps, we are looking at what we want, how easy we want it to be, and how we can make everything as we like.

We are at the end of step two, beginning of step 3.
And you know MS is a big firm with hundreds of professionnal and billion dollars but they produce Windows, while Linux is made by amateurs/non paid professionnal and it''s... Linux :p

#54 Merrick   Members   


Posted 10 December 2000 - 10:29 PM

Speaking of Ultima code, here is a link to the source of an unfinished RPG by one of the guys that wrote Ultima 8. It's at http://www.geocities.com/mind_phuq/ultrpg.zip

Of special interest are the NPC.c and NPC.h files in the GAME sub-directory. It's not finished, but shows how the Ultima guys set their stuff out.

Edited by - morfe on December 11, 2000 5:30:46 AM

#55 Merrick   Members   


Posted 17 December 2000 - 05:08 PM

Subject : Ultima 7 & 7.5 Schedule Structure
Author : Byun DongHo (cpascal@soback.kornet.nm.kr)
Last Modified : Jul 13, 1996

I''m sorry I''m not good at writing in English. I hope you to understand the followings.

===[ Think as Header ]===

Offset Length Description
------ -------- ---------------------------------------------------
00H 4 256 in Ultima 7 & 7.5. NPC num.
(Next header item size(byte) is affected by this.)
04H NUM*2 Same as the SUM of each NPC''s schedule amount.
(Because NUM is 256 in Ultima 7 & 7.5,
the size is 512 bytes in Ultima 7 & 7.5. )

===[ Think as Body ]===

Each schedule size(byte) is 4 byte.

| | | +------ SuperChunk Number
| | +--------- Y coordinate in the SuperChunk.
| +------------ X coordinate in the SuperChunk.
+--------------- Schedule number & Match time.

You can see the real X, Y location in cheat mode.
SuperChunk Number = (Real-Y / 256) * 12 + (Real-X / 256)
X = (Real-X % 256)
Y = (Real-Y % 256)
*. ''%'' is the same keyword as in C.
You can get them(SuperChunk Number, X, Y) easily by hex.

The followings are about Schedule number & Match time byte.
7 6 5 4 3 2 1 0 Bit
| | | | | | | | |
[============] [======]
Schedule num Match time
( 5 bit ) ( 3 bit )

Match time: 000= 0 AM, 100= 0 PM
001= 3 AM, 101= 3 PM
010= 6 AM, 110= 6 PM
011= 9 AM, 111= 9 PM
Schedule num:
0= Combat 9= Hound 18= Bake 27= Duel
1= Hor. Pace 10= Stand 19= Sew 28= Preach
2= Ver. Pace 11= Loiter 20= Shy 29= Patrol
3= Talk 12= Wander 21= Lab 30= Desk Work
4= Dance 13= Blacksmith 22= Thief 31= Follow Avt
5= Eat 14= Sleep 23= Waiter
6= Farm 15= Wait 24= Special
7= Tend Shop 16= Major Sit 25= Kid Games
8= Miner 17= Graze 26= Eat at Inn

Avatar has no schedule. And each NPC must have 1 schedule at least. Surely 8 is max amount for one NPC.

#56 Kylotan   Moderators   


Posted 20 December 2000 - 08:33 AM

Any chance of posting the URL where the above information came from?

#57 Merrick   Members   


Posted 20 December 2000 - 09:28 AM

URL? Newsgroup : comp.ai.games

The message was posted by Byun DongHo (cpascal@soback.kornet.nm.kr), but in 1996

NPCs will be inherited from the basic Entity class. They will be fully independent, and carry out their own lives oblivious to the world around them ... that is, until you set them on fire ...

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.