Top Mud Sites Forum Return to
Go Back   Top Mud Sites Forum > Mud Development and Administration > Advanced MUD Concepts
Click here to Register

Thread Tools
Old 01-25-2003, 02:06 PM   #1
New Member
Join Date: Apr 2002
Location: California
Posts: 15
Lodes is on a distinguished road
Send a message via AIM to Lodes


 Muds often do not have any good Artificial Intelligence. The only interaction with npc's and players are through some extremely simple scripts. I do believe it is also why a lot of muds that require rp, like Mushes and such, do not create npc's but player assume they are around. My mud is required to have npc's and thus I would like to get some ideas into making the interaction much better.

 I was thinking that there could two (or even three if you take a middle) to approach the problem. The first approach would be to create a much more advanced scripting system where the problem of AI would rest in the builder's hands. To make npc's much more interactive we need a way for them to remember and thus I would propose that builders could create their own kind of little database with scripting, by storing some important information. Then another mob in another area or the same area or even the same mob, could fetch that information from the database, and give an appropriate response. The major flaws I see from this approach are that it is an extreme amount of work for the builder, and still has a lot of limits.

 Another approach might be to give each npc's some sort of occupation, and each would try go to specified rooms and maybe have some sort of scripted text so that they can interact with other npc's but yet this doesn't solve how they can interact with the player. But yet, we have to remember that not the entire world interacts with you. Like if you are walking down the street, maybe the most interaction you have is say hi, once in a while.

  So all you'd have to do is only make some mobs remember, and make them all have some sort of occupation. One could just be there to walk the streets, another one could be a waiter, who can remember you if you come back enough and maybe give you a free drink (thanks to saving what happens in a text file).

  I am sorry, but I had a hard time expressing my ideas. But how could AI be approached in a particular zone. (Like not AI from mobs that create their own cities, but AI from a city that already exists and that will probably never grow or shrink to any detectable proportions.)

Thank you,
Lodes is offline   Reply With Quote
Old 01-25-2003, 02:49 PM   #2
Senior Member
Join Date: Oct 2002
Posts: 310
shadowfyr will become famous soon enough
I would have to say that 'true' interaction isn't going to be possible without something on the scale of the CYC project that attempted to teach an AI the basic building blocks of human logic, i.e. stuff like red is a color, but can alos be a name, etc. Last I heard they had gotten it up to around a 4 year old level of intelligence and responses, but such a system is not practical. Your best bet for interactivity is something like an Eliza or Alice bot design. They can remember things, give some scripted responses, but can also learn new ones to some extent. I haven't a clue how they do so though and unless you are on a forced RP mud, you run into the issue of them learning things that don't mesh with what is going on in the game. It might be easier to do somthing like the old ultima games did and have them respond to a set number of enquiries.

Making them more 'real' by giving them things to do would help believability as well, though only if they really did things. In most games NPCs have set scheduals, set paths to follow and you can predict with 100% certainty where they will be at a particular time. The real world, especially the medieval one, doesn't work that way. One possible solution is to take a page out of The Sims AI design and give each NPC a set of condition counters that involve the desire to do certain things. You also give them a threshold level for these things. The idea is that over time they build up a need to do one of these things that will become great enough that they will perform that act, rather than some other. For instance if an object on a PC or another NPC is sufficiently valuable, the NPC could try to steal it, buy it or beat you up and take it, depending on the settings you used. But the same NPC would ignore you if you had a less valuable item. Of course if you have different races then they may act differently as well. If a fight breaks out, humans and the like may stop to watch, others may retreat to someplace safe until it is over, some would take advantage of the onlookers distraction and still others might try to join in, etc.

The only major problem I have seen with such a design is that the mud would need to have some sort of local and global proximity capability. For such a system to worm the NPCs don't need to know that the Roasted Boar tavern is two rooms north, just that there is some place to buy food or drink within two rooms from where they are and in what direction. Having thought the system through a bit, this is something that creates potential problems. If it could be set up right, then in theory an NPC could have a limited range, like any area they have never been into (including underground tunnels that they don't 'know&#39, as well as a distance on a main world map. So if they where led out of town somehow and got more than 5 squares from the town entrance they would become lost and if they wandered the wrong way, they would get even more lost.

This really be interesting if you had some old man that kept wandering out of his village and due to poor memory (only knowing where he was 50% of the time) he ended up in the Caverns of Doom babbling about how, "I don't remember the tavern being this far away and it seems to be getting really dark." lol And of course some would know the roads between places (and how far it is to the next town), but get last a mere 2-3 squares off to the side of such a road.

The key issue is 'proximity' in all these cases and how you define such on a mud where rooms have no real physical position. Stuff like getting lost outside the village or in the towns sewers because someone left a drain open would probably be much easier to deal with. One possibility would be to have a 'map' of the links that the NPC can refer to. If they haven't been in some place, then the map would lack a reference to that NPC and they would be lost. The world map would basically allow the roads and 1-2 spaces to the sides of them to be 'any NPC' areas, but ignore all but special types (rangers, etc.) when adding new ones. Towns could do the opposite, making a ranger or druid uncomfortable due to the town 'forgetting' that the ranger had been there before. They would have to wander through it looking for taverns and things each time they went back in. This would require that the area designer make such a link map though, which complicates things, but it is the only thing I have been able to come up with. Letting the NPC build their own map as some have done is counter productive, since you can't place restrictions on what they remember as easilly and every mob would need its own 'map' to figure out where it was going.
shadowfyr is offline   Reply With Quote
Old 01-25-2003, 03:31 PM   #3
Join Date: Aug 2002
Posts: 153
OnyxFlame is on a distinguished road

Wow, cool ideas. I wish I knew how to CODE them.

On a slightly different tangent, here's some ideas we had for FB's monsters although it never got anywhere.

Our critters were supposed to gain levels or skills just like the PC's. They'd wander around killing whatever they viewed as "food" and avoiding whatever they thought was "dangerous". There'd be variables for how they acted around their own species, i.e. pack behavior, helping out a straggler, ignoring them, etc. And of course what to do when threatened, and how they viewed other critters and PC races. Of course all this would probably have been hard to code and take up too much space but it was a neat idea anyway.

In our conception, a band of goblins could spontaneously decide to attack a village, rather than us having to tell them to in order to give the inhabitants a little excitement. This would probably be accomplished if the village's "food" or "valuable stuff" rating was higher than it's "danger" rating. Likewise, an NPC could over time get other NPC's or monsters to like him enough that they could go try to take over a castle from whoever owned it, be they PC's or NPC's. Although our idea for army battles may or may not have worked out very well in terms of AI for this kind of action, heh.

I think if you're going to do a Sims approach, you should account for not only what they want, but what they fear, and what would trigger them to get violent. Once you do that, voila! You can have Joe the NPC who's wandering towards the tavern to get a mug of ale, when suddenly he sees Fred the PC trying to rob a passing old woman. Joe the NPC is outraged and attacks Fred, but after a few minutes it's obvious that Fred is more than a match for Joe, and Joe runs off to nurse his wounds in privacy. Meanwhile the old woman, who didn't notice the theft attempt, is scared by the open violence and shouts for some guards.

Now THAT would make an interesting mud.
OnyxFlame is offline   Reply With Quote
Old 02-22-2003, 08:09 PM   #4
New Member
Join Date: Feb 2003
Posts: 29
xanes is on a distinguished road
Very clever ideas about fear and want.

There must be simple (fast) ways to evaulate risk/reward because unlike the real-world's parallel processing in everybodies head, the MUD has one central brain.  

Level ranges would suffice in most situations to determine combat risk.  Some amout of unique detail would also be required.  For instance, Joe the NPC would only be venturing to the pub because his alcohol requirement had inched above his stationary thresh-hold.  I.e. he decided it was worth it to pop in for a pint.

Now, as is so often the question, we wonder how much detail to we want? Will eating and sleeping be sufficient to power a dynamic world?  Would mating be worth implementing?  Offspring?  There's no end to the "realistic world wish-list", is there?  

Well, I'm rambling and not really making any new points, so I'll get about my business:

While catch-alls are fine for generic mobs "citizen" "field-mouse" etc., some serious scripting would be required for every mob with any kind of AI.

As for Eliza and the other NLP bots, I haven't seen a way to make them do anything but add flimsy phony atmosphere that completely decays if you step outside their lexical analysers.  And RP is hard enough to enforce w/o completely banning colloquialism.

Well, that's all I can think to say.

-Xanes -=- Lone Programmer WinterMUTE
xanes is offline   Reply With Quote
Old 02-23-2003, 11:48 AM   #5
Join Date: Aug 2002
Posts: 153
OnyxFlame is on a distinguished road

Well, there's several other "wants" I can think of right off hand that'd work well. Given, most of them rely heavily on concepts included in the MUD I play, but some of them could be used anywhere.

Combat practice. Frank the NPC has all these weapons and nothing to do with him, so he decides he wants to spar. So he wanders towards the nearest person (PC or NPC) and asks them to spar. (Of course this would require other NPC's to be able to respond to this.) If they say yes, a fight ensues until one or the other decides they have better things to do. If they say no, then Frank wanders around until he either finds someone else to spar or finds something else he'd rather do.
(Of course the way DM works, Frank wouldn't be able to change his combat allocs unless they did some SERIOUS tweaking, so there's only so much he could learn anyway. But it might work for other less complicated systems.)

Crafting practice. It'd be too much of a pain in the ass for every NPC who wanted to craft to go grow a crop of flax or piddle around in the mine, so here's my idea. They look in nearby shops for materials needed for their practice, and if the stuff isn't there, they wander around telling every passing PC what they want and how much they're willing to pay for it. Of course once they get it, nothing's stopping some other PC from stealing their stuff, or killing them.

And of course some would want to buy clothes or armor or weapons, in which case they'd use the same method as wanting materials to craft with.

Thief type NPC's could wander around trying to rob people, sneak through town, etc. Mage NPC's I'm not quite sure how they'd work, at least with DM's setup, because I don't think our magic system could be scripted into an NPC very well, but with other setups you might see random mage NPC's practicing or going to buy reagents or blowing stuff up.

The main problem I see with highly developed NPC's in a skill-based MUD is this: how much do they know? Do they know that you have to craft x before you're good enough to craft y? Do they know that this room is too bright for them to hide in and some PC is gonna kill them if they see them? You could probably code in knowledge of all the difficulties of stuff they're likely to experience, but then all the PC's would have to do is watch the NPC's wander around doing stuff in order to figure out the most efficient way to do it.

So it looks like I've run into a wall. Not because my ideas have no merit or can't be coded, but because players in general will do anything they can to get ahead, even when they're not supposed to be doing so. A good lot of them won't look at all these NPC's running around acting just like PC's and say wow cool. They'll just think hmmm I bet he has money and kill them.

Which may be a good part of the reason that these aren't common features on MUDs.
OnyxFlame is offline   Reply With Quote
Old 02-23-2003, 12:05 PM   #6
Join Date: Apr 2002
Location: Milwaukee, WI
Posts: 147
Eagleon is on a distinguished road
Send a message via ICQ to Eagleon Send a message via Yahoo to Eagleon
How about making NPCs, hrm, difficult to kill? This relies on the idea that PCs and NPCs are the same, just with people or computers behind them. Make them just as hard to defeat as a player of the same skill.

Maybe have NPCs the same type of object as PCs somehow. Would make a demon possesion spell (or something similar) a snap to code.
Eagleon is offline   Reply With Quote
Old 02-23-2003, 12:14 PM   #7
Join Date: Aug 2002
Posts: 153
OnyxFlame is on a distinguished road

I don't like the idea of making EVERY npc some uber-warrior just because it's an npc and players like to kill it. Sure you can have a wide range of skill levels, and every now and then an npc will beat the crap outta some unsuspecting player who wants its money. But you gotta have the occasional wimpy npc otherwise any realism gained by adding all these nifty tweaks is immediately lost. And maybe all these npc's won't be fighters anyway. Some of them may be mages with no defense (albeit a really great firebolt).

No matter what you do, some players will still have the h&s mentality (which is good if it's actually a h&s mud but not so good otherwise) and attack it just because it's there. Of course on DM we have enough uber-warrior npc's that anyone who plays for any length of time knows that indiscriminately attacking them is a good way to have a really short life.
OnyxFlame is offline   Reply With Quote
Old 03-10-2003, 04:00 PM   #8
New Member
Join Date: Feb 2003
Location: California, US
Posts: 5
Lindahl is on a distinguished road
I suggest using a needs-based AI approach, utilizing Maslow's heirarchy of needs:
Self-Actualization - sense of indentity, strive for uniqueness, self-fulfillment, etc.
Esteem - positive attention
Social - acceptance
Security - safe environment
Physiological - physical health

Dump the needs into these heirarchy levels, prioritizing the needs in each category. We then define a minimum level of satisfaction for each need. As we travel through the list of needs for one level of a heiarchy, we attempt to satisfy all needs that have not met this level of satisfaction. If all needs located in a particular level of Maslow's heirarchy have been satisfied, we move up to the next level. The final level, self-actualization, never has a minimum level of satisfaction, and thus, if the NPC has all it's needs met, it strives for self-actualization, which would be finding a sense of identity (i.e. striving to understand the world, acquiring knowledge, interpretting the world through expressive concepts, think cultural anthropology here).

Next, we pull out the needs that we need to satisfy and breakdown these needs into simpler needs, until we reach a accessible level of detail. By accessible, I mean something that the AI can interpret and execute on.

We allow for specialization of three major properties of needs-based AI:
1) breakdown of complex needs
2) satisfaction for simple needs
3) minimum satisfaction levels of needs

The specialization can be done by applying specific species, personality-type and even individual soft or hard code.

For example, an artist personality may have low minimum satisfaction levels, thus explaining why the particular artist personality has such a strong need for self-fulfillment, or interpretation of the world.

You could even have each NPC have a set of generated personality traits, and have needs specialization code pertaining to each personality trait. A need's specifications are derived from a composition of all specifications for that particular need expressed by each personality trait.

For example, an aggressive NPC may have a low satisfaction for social needs, and a high satisfaction level of security needs. But an aggressive artist would have an incredibly low satisfaction for social needs, a normal level of security needs, and a low level for all other needs, making him strongly adamant in his needs based from the self-fulfillment level in Maslow's heirarchy.

Brian Lindahl
Development Director
The Cathyle Project
Lindahl is offline   Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 04:51 PM.

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Style based on a design by Essilor
Copyright Top Mud 2014