Archived

This topic is now archived and is closed to further replies.

Ingenu

RPG NPC AI, Scheduling and Needs...

Recommended Posts

Hey!
Maybe we should make a petition to get Origin to release some of the Ultima source code? Like from 7 or 8 or something.
They might release it or at least some of it if there are enough people wanting it...

Samah


"...the grave is no bar to my call..." - The Horn Of Valere

Share this post


Link to post
Share on other sites
I know the more the industry is growing the lesser amount of work is done on each game.

It''s really bad

I don''t think it''s a good idea to see someone else code, I think it''s best to think about it with a blink mind to be more open minded.

With a previous code available we might spend way too much time trying to understand it, and to modify it...


IMHO.

-* So many things to do, so little time to spend. *-

Share this post


Link to post
Share on other sites
Anyway, as far as I remember, NPC realism in the Ultima series was not that good : it only involved NPCs moving from place to place according to a schedule and fleeing/helping in case of fight.

We want to do something better (tm).

Be reading you,
YA

Share this post


Link to post
Share on other sites
Just a reminder to everybody who reads this, that the Emailing list that you all REALLY WANT to join is NPCAI!!! To Join, simply email NPCAI-subscribe@egroups.com or simply visit the site http://www.egroups.comm/group/NPCAI/. We now BOAST 15 Members, and I am sure our discussions will be coming to a point any time soon . See ya there!


-Chris Bennett ("Insanity" of Dwarfsoft)

Check our site:
http://www.crosswinds.net/~dwarfsoft/
Check out our NPC AI Mailing List :
http://www.egroups.com/group/NPCAI/
made due to popular demand here at GDNet :)

Share this post


Link to post
Share on other sites
True NPCs in most Ultimas were simple -- all but Ultima 7. Have you ever used the cheat menu and modified NPC attributes? There were maybe 3 dozen different attributes/states. It was neat to set the "loiter" flag off and turn the "baking" flag on. Then turn the "fly" flag on and watch them bake on the roof. That to me is pretty sophisticated, espeically because it could be modified on the fly without recompiling.

Share this post


Link to post
Share on other sites
I really enjoy reading your thoughts about NPC AI and now i just want to direct your attention to the following:
at Gamasutra i read a REALLY interesting article from Wright and Marshall:

More AI in less Processor Time: ''Egocentric'' AI
www.gamasutra.com/features/20000619/wright_01.htm

This article treats the actual implementation of AI running on Playstation II. Besides there are REALLY
interesting ways of implementing a need-based dynamic (e.g. behaviour-set, perception-set)

The time i was reading this article i also read about Transmeta''s Crusoe (www.transmeta.com), which is a new
kind of processor. (i think Linus was involved developing this one)
There is a nifty thing about Crusoe: machine-code is interpreted by processor-intern software.
Now imagine what a power a Process-Manager for AI would have, if (almost) beeing in the processor itself...

I really would like to have some response, but if you don''t care about Crusoe, at least read the article mentioned above.
It''s really worth reading it!!!!

Slavomir

----------------------------------------------------------------------
Today is Setting Orange, the 54th day of Confusion in the YOLD 3166
----------------------------------------------------------------------
473-"Hey, wake up, they''re coming... For Heaven''s sake, WAKE UP!"

(From the Canonical List of Famous Last Words)
----------------------------------------------------------------------

Share this post


Link to post
Share on other sites
Is there any place to get a free demo of ULtima 7 or 8?

I''d like to check it out....

"The road of excess leads to the palace of wisdom." --William Blake

"The road of excess also just ends up making me tired because I'm too lazy" --Nazrix

Share this post


Link to post
Share on other sites
Yes, altman, i know. That was the first i thought about Crusoe, too. It would be nice to have a java-native CPU. I just wanted to direct your attention towards this article and the implementation. Such a Process-Manager would be a really reusable thingy if programmed properly. And it is the right way to implement this schedule-need system of ingenu and dwarfsoft and....

Slavomir

Share this post


Link to post
Share on other sites
I''ll take another look but I''m affraid it is a little bit too low-level for what we are trying to do on the NPCAI list. I mean it handles frames ! And unless I am mistaken, frames have to be handled at processor-level (or at virtual processor-level, if in a VM) ! In other word, just as written in the article, this is about writing an operating system. Hence my question : are there not already written real-time OS which can be used for AI ? I''m thinking eCos and Real-time Java because I know no other real-time OS.

I forwarded the URL to the list, and if you''re not there already your heartily invited to join us - especially if you have ideas on how to implement this.

Now, as for being the "right way"... you''re probably completely right. Without fancy time-management procedures, some agent migt end up eating all CPU-time without even being prioritized, or even locking up the system.

Be reading you,
YA

Share this post


Link to post
Share on other sites
I''ve got sort of an idea...
Why don''t we try and develop some sort of real-time world where NPCs can interact (doesn''t have to have super 3d graphics, just needs to be practical) and then people on the NPCAI mailing list can write NPC classes that simulate real-life people. It might help us to design some realistic NPCs....

Samah


"...the grave is no bar to my call..." - The Horn Of Valere

Share this post


Link to post
Share on other sites
I am slowly working on this myself, a simple isometric engine. I have been a little bit consumed through time recently and as such have falen behind. Anyways, Graphics is not what we are after, we are after a cool NPCAI model . I really should consider getting a bit more sleep and less game playing .


-Chris Bennett ("Insanity" of Dwarfsoft)

Check our site:
http://www.crosswinds.net/~dwarfsoft/
Check out our NPC AI Mailing List :
http://www.egroups.com/group/NPCAI/
made due to popular demand here at GDNet :)

Share this post


Link to post
Share on other sites
Reading this thread and thinking a bit, I''ve written up a little article about a subset of these ideas, namely Need driven stuff.

I made another post under a different topic name (still figuring this system out a bit, sorry) outlining some things. It was after I wrote the post that I opened up word and started to put something consolidated together.

Any new insights which come up here that I think are appropriate to the system, as well as my own, I will put in, and I''ll tag

The system looks like it may be walking down an AL research type thing rather than a NPC AI road, but we''ll see how many cycles the bitch winds up eating...

As stated in the article, I reckon we use the AI system to build a tribe of hunter-gatherers and prehistoric cows in a sparse prarie (sp?) to get the fundamentals right.

Something else, the Environment system will be no small feat, if you think about the number of things you can _do_ in the world, and what effects it all had on other people. In addition to that, there''s fun stuff like weather.

This is incomplete at best, it was written up in a couple of hours before I went to bed. But it will grow! Most of the stuff there now is new-ish rather than stuff from the thread, I''ll get that in soon. (And I''ll put some comments saying so somehow)

Note also that I do have _my_ own "grand vision" of this, which may or may not be the same as your one. Like I said before, this may not be suited for a game AI. But I''m more interested in AIs than games personally, so that''s not a biggie to me.

Anyway, here''s the url:
http://www.totallydigital.co.nz/rpg/ai1.html

PS - Sorry for the shitty HTML, it''s exported from MS Word.

Sam
Space Cadet''s DJ Random, Thinker, and Geek at heart.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
"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

Share this post


Link to post
Share on other sites
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. *-

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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. *-

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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!


Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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!

Share this post


Link to post
Share on other sites