Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

NPC AI Framework - is this even possible?

soggie

Educated
Joined
Aug 20, 2009
Messages
688
Location
Tyr
The goal of the NPC AI framework is to provide a general guideline to designing believable behavior of the NPC that reflects the consequences of choices the player makes through the game. Let's take an example and break it down, as usual.

Tycho chats up with the player in the bar, knowing that he is a stranger in town and could do some errands befitting a stranger. He talks to him about a job with nice pay, after finding out that the player is a person who is willing to overstep the boundaries of law for personal gain.

  1. Tycho recognition check: does not recognize player
  2. Tycho moral compass check: player is chaotic neutral (for example)

He then "suggests" the player "remove" a particular NPC named Nancy, who he claims to be disrupting his business. Once Nancy is gone, the player can come back and collect the money. The condition is, the player must keep this a secret, and make the death look like an accident.

  1. Tycho quest marker: quest initiated

The player then proceeds to Nancy's and observes the NPC's schedules for a while. He notices that Nancy often climbs down an abandoned well to pray in the bottom of the well, and schemes that a slight knock will cause the walls of the well tumbling down, crushing Nancy underneath.

The player casually walks up to the well and pushes the rocks in, and returns to Tycho for payment. Tycho tells the player to wait a few days to see if the job was done according to requirements.

The next morning, and NPC notices the well being broken and investigates. The NPC discovers Nancy's body, and reports it to the Sheriff. The Sheriff comes and take a look, and then realizes that it is not an accident but a murder. He alerts the entire town to the murder and begin questioning suspects.

  1. Townsperson recognition check: does not recognize well
  2. Townsperson script trigger upon foreign data: investigate data
  3. Townsperson discovery check: well is destroyed
  4. Townsperson destruction check: ignore well (low priority)
  5. Townsperson discovery check: Nancy's dead body
  6. Townsperson destruction check: report death (high priority)
  7. Sheriff reaction check: death investigation (high priority)
  8. Sheriff discovery check: well destruction is not natural
  9. Sheriff reaction check: alert for murder in town (high priority)
  10. Sheriff detective check: check NPC schedules
  11. Sheriff detective check: no NPCs passed by
  12. Sheriff memory check: player (stranger) is in town
  13. Sheriff script trigger: murder dialog script with player

The sheriff proceeds to investigate all NPCs that happen to pass by that area, and finds nothing. Then he remembers that the player is in town, who is a shady stranger and proceeds to question the player.

Is this a nice way to create emergent behavior? Take for an instance the player kills an NPC. Nobody knows of the murder, right? After a few days, other NPCs tagged as the dead NPC's friend's will notice his disappearance and will investigate, eventually triggering the sheriff's investigation script.

If the player leaves town before the news got out, he might be spared from the questioning, but the information bit would have been flagged and next time when he returns the sheriff will seek him out and have a world with him.

Would this be a good way to inject life into the game world? Will this be too much to handle?
 

JarlFrank

I like Thief THIS much
Patron
Joined
Jan 4, 2007
Messages
33,157
Location
KA.DINGIR.RA.KI
Steve gets a Kidney but I don't even get a tag.
Too complicated for our project, man.
A simplified version of this would be quite nice, though, maybe with "local reputations" (stranger, well-known do-gooder, well-known villain) and without the NPC questioning other NPCs routine. For some quests you can add the ability to frame an NPC for a deed you do, but we don't need a special AI for all that.
 

soggie

Educated
Joined
Aug 20, 2009
Messages
688
Location
Tyr
The idea is to make it so that information about crimes would propagate in a realistic manner. For example, if the player murders a person in the town, leaves the house and locks the door, he should be able to leave town in time without being suspected for the murder. Similarly, the emergent behavior would force the player to be more creative when it comes to committing crimes.

For example, if the player is seen by another NPC in the murdered NPC's house, he would become a suspect. This means that the player would need to sneak into the house unseen first, or else even if the murder is successful the PC would still be suspected.
 

shihonage

Subscribe to my OnlyFans
Patron
Joined
Jan 10, 2008
Messages
7,163
Location
location, location
Bubbles In Memoria
A lot of these things seem nice in theory but when it comes to gameplay, either:

a) fall apart/are easily breakable/exploitable/fail to control passability in intended fashion
b) require a disproportionate amount of work compared to other parts of the game (of which there are many)

Not to be a wet towel or anything.
 

JarlFrank

I like Thief THIS much
Patron
Joined
Jan 4, 2007
Messages
33,157
Location
KA.DINGIR.RA.KI
Steve gets a Kidney but I don't even get a tag.
Tycho moral compass check: player is chaotic neutral (for example)

Another problem I found: how will Tycho find that out? Will he see that our player has a jew nose and because all jews are evil, he'll know you're evil? I doubt that facial expressions could show your alignment.
Or are you wearing a shirt that says "CHAOTIC NEUTRAL" and you put on a new shirt when your alignment changes?
Or have you got your alignment tattooed on your forehead/chest/ass/cock or something, so everyone can see it?

Only way I can imagine it is that he judges you by your introductory dialogue choices, but even there it can't be fully accurate and you can try to appear differently than you are.
 

hanssolo

Educated
Joined
Apr 28, 2010
Messages
863
alignment is an incredibly retarded concept, unless you can make it an integral component of setting (like if you're an abishai or something). Avoid at all cost.
 

soggie

Educated
Joined
Aug 20, 2009
Messages
688
Location
Tyr
hanssolo said:
alignment is an incredibly retarded concept, unless you can make it an integral component of setting (like if you're an abishai or something). Avoid at all cost.

Actually there's no alignment in my design. I was just using it to clarify the example.

And yes, I think alignment is a retarded concept too. People change depending on situations.
 

Kaucukovnik

Cipher
Joined
Mar 26, 2009
Messages
488
Alignment could work if it had two layers. One traditional, how does the game world (or part of it) perceive the player character - let's say reputation. Plus some "inner" alignment, based on intentions - we can call it karma.

An average NPC would be using just your reputation in reaction checks, because that's all the information available. The more perceptive ones, or those you communicate more often with, could calculate with your karma too. If you didn't account for the intentions and used only hard facts, you would achieve NPCs with cold logic in the style of mr.Spock.

Of course, you could lie to the game, and become, for example, a cold-blooded killer immune to truth detectors, psionics and mind-reading magic, because the game doesn't have any other choice than trust your input. Exploiting such a system would be incredibly easy. So easy it would be pointless, the only way to meaningfully play the game would be being honest and giving accurate information about your character's intentions and motives.

Anyways, most "good" characters ever played in the Baldur's Gate series were just those who picked the "expected right choices", not "properly" roleplayed good-doers.

The real problem would be, in my opinion, to encourage a different mindset. We are used to games being a challenge to overcome, to win over all the obstacles.
But this theoretical framework would allow for the player to be the measure of success. At birth, nobody gives us any "main quest" for our life and the same could work for player characters in such a game.
You don't need to have a big house with swimming pool and two BMWs like your neighbor to feel successful, and your Lone Wanderer doesn't have to stop the Enclave like his - something like that.

Doesn't make story-driven RPGs obsolete, just allows for a totally different gameplay.
 

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom