Jump to content
  • Advertisement
Sign in to follow this  
Theodore Fuhringer

Emergent Gameplay in an RPG Game World - Thoughts?

This topic is 3580 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been thinking about this for a long time and I've decided to prototype some of these ideas to see how they work in reality. How would you handle this? What do you think of the following? How would you build an RPG gameworld that is truly dynamic? I'm not talking about simple NPC's with scripted schedules, I mean imagine a full-on world simulation running in the background behind your gameplay, developing the world, it's citizens, shifting economies, politics, etc. One approach I'd like to test is this. All NPC's and MOB's in the game are unscripted autonomous entities. During idle time the game loop cycles through checking all the entities states and updating their AI based on the current conditions. Entities have 3 "memories" 3 "directives" and 3 "needs". Each entity is "born" with memories of 1) Home: Where it eats and sleeps; 2) Stash: Where it keeps its belongings; 3) Who its friends (including family) are. Each entity is ascribed these directives; 1) Its Job [carpenter, wandering beast, robber]; 2) Its Primary Motivation [wealth, food, killing] 3) Its Group [Merchants, Necromancers, Canadians]. Each entity has needs; 1) Food; 2) Happiness [based on a formula job fulfillment + wealth + health + family etc.] 3) Stash [stored food, wealth, etc.] When a need is triggered, (eg. the Bear is hungry; Bob is sad because his wife died; Shemvit's stash is nearly empty of gold) the entity uses its stored "memories" and "directives" to try to satisfy it's need. When it can't satisfy it's need, a quest is generated Some quests are invisible. (eg. the Bear is hungry and can't find food near it's home so it goes after Bob's children.) Some quests are visible to the player (Bob is helpless from grief and wants the Bear killed. On completion, Bob will give the player something from his stash.) Some quests are not explicitly stated but evolve dynamically. (Shemvit steals Bob's stash while he's off chasing the Bear with you and if you want your reward you'll have to catch him.) On a larger scale, an entity with the job "Mayor" would have the responsibilty of building new buildings in his town. (Always kills me when a building gets destroyed in an RPG and no one fixes it or even notices it's gone.) The "Tax Collector" could make a circuit of the citizens collecting taxes, making himself a terrific target for bandits, which you could join... or kill. The "Preacher" would have the job of changing people's directives or improving their happiness, though sometimes his meddling will lead to problems that need to be solved (more quests!). Make sense? This is only one possible approach of several I've thought of but this one, I think, shows promise in that the "memories" are easily defined, being locations and labels of other entities. Each entity would need a list of "tasks" or functions it could try to satisfy it's current needs. I think some interesting situations might arise out of these dynamics. Thoughts? [Edited by - Theodore Fuhringer on September 26, 2008 2:09:25 PM]

Share this post


Link to post
Share on other sites
Advertisement
I'm working on something similar, so I'll raise two issues that I've come across:

1) How big is your world? If it's large, you probably won't be able to run every entity in the world in real time. So how will you handle things that are on the other side of the world?

2) Having realistic actions and needs makes it difficult to tweak your game. Balancing the game, or heck, just making a stable, functioning world is no mean feat.

I've been dreaming/designing such games for a very long time. Now that I finally have the time to try to implement one, it's starting to make sense why there are few if any games like this on the market. Oblivion was hyped with "Radiant AI", which was supposed to be something like you describe, but the released version had very little of that functionality remaining.

Share this post


Link to post
Share on other sites
I would find some friends and do a P&P campaign. Seriously, no simulation will even come close for the forseeable future.

Share this post


Link to post
Share on other sites
Quote:
Original post by drakostar1) How big is your world? If it's large, you probably won't be able to run every entity in the world in real time. So how will you handle things that are on the other side of the world?

2) Having realistic actions and needs makes it difficult to tweak your game. Balancing the game, or heck, just making a stable, functioning world is no mean feat.


You're right. Two ways to handle the first problem. If your game is real-time, keep your world small. Even with a modest world you'd have to run the AI of offscreen entities on a non real-time basis. If it takes two or three seconds for an entity to figure out what to do next, well, it's not a FPS, it doesn't matter.

In my first prototype I had planned to use a turn based system so it won't really be a problem in the beginning.

As for the second problem, I think the solution would be to give the entities their freedom and then run the simulation repeatedly. When problems emerge, simply restrict the entities, rather than give them new abilities. I believe nerfing works. Or (and this would suck but it would probably work) you could set conditional boundaries on the gameworld. (eg. if 90% of the NPC's in the world are irretrievably unhappy, reset their happiness to it's starting level.) These boundaries could act like brakes on the economy, the entities levels etc.

Share this post


Link to post
Share on other sites
I think this is an interesting attempt to break down such a simulation conceptually.

Some of your ideas I can imagine being quite helpful in designing a system like this.

But maybe the real difficulty still lies in exactly how (on a micro rather than macro level) a character will decide to act in order to fulfill its' needs, based on its' desires and motivations

Share this post


Link to post
Share on other sites
Quote:
Oblivion was hyped with "Radiant AI", which was supposed to be something like you describe, but the released version had very little of that functionality remaining.


One of the reasons they took it out was their druggie code would result in the drug addicts killing off the drug dealer before you could get to them, because they figured out the best way of getting their fix. :)

Drawbacks of a simplistic ethic system. From what I recall, Oblivion had a single value that determined how likely they would kill/attack/steal, but very little (or no) risk analysis. I think that you have to have that "wow, am I going to die doing this?" that prevents people (AI) from really doing the stupid things.

Share this post


Link to post
Share on other sites
Quote:
Original post by dmoonfire
I think that you have to have that "wow, am I going to die doing this?" that prevents people (AI) from really doing the stupid things.

Something that nearly all AI, from RPG to FPS to RTS, suffer from. It's exactly this that makes AI seem so mechanical.

The police in the GTA series are a good random example. RAM, SMASH, SHOOT, AND KILL HIM, our existence is otherwise meaningless. They remind me of Matrix agents.

Share this post


Link to post
Share on other sites
I really like the idea, but I think I like it as programmer or as a designer...more than as a game player. One has to consider how much all of this ai coding really effects the game play.

For example: how different will it seem to the player when Bob gets consistently hungry with about the same regularity, stops working at the blacksmith and then goes to the pub (or whatever) to eat. VS a schedule with a slight +- to the GetDinner time?

For the player there may be no visible differences short of the occasional interesting random coincidence, even though there is all this code chugging away in the background all the time. just a thought.

Share this post


Link to post
Share on other sites
I really like this idea as well. And I think it has a lot of potential to bring your world to life. If you can come up with a good way to generate text based on someone's memories, directives and needs, then suddenly you have dynamic character chat. You can actually ask someone what's going on and they'll tell you, not just give some pre-scripted text. Of course, the tricky part is getting it to write natural language that sounds decent...

This works into an idea I had for a rumor engine. You can keep the world running without tracking every entity in every city. Just abstract away everything with a LOD algorithm. The city you're in is fully driven for all entities. Neighboring cities abstract away most of the fluff, so only general conditions and notable persons are simulated. Any cities farther than that are treated as single entities. Whenever two entities interact (whether people or cities) they share information based on local interest in the event, relative importance of events, distance and time involved. An eye witness can give you much clearer information than some guy in the next town over. Add in a small amount of error in the accuracy of information and now you have conflicting rumors.

Share this post


Link to post
Share on other sites
I have a game idea that's vaguely along these lines that I'd like to work on once I've completed something a bit simpler.

Quote:
1) How big is your world? If it's large, you probably won't be able to run every entity in the world in real time. So how will you handle things that are on the other side of the world?
An alternative to keeping the world deliberately small is to dynamically bind and group entities that will have zero impact in the present gameplay.

You want them to evolve and continue with their lives, so instead of running every individual's AI, you could instead run a simpler "city ai" that redistributes wealth in expected ways once a day, runs realistic events through tables(% chance of a bear attack per year per nearby adult bear, etc), and selects random(with weighting potential) inhabitants for events.

Thus while you're on the other side of the world, things that would have been possible with consistant individual AI remain possible through tabled scripts. The player doesn't need to see the bear eat Bob's children if they're in a different country, but in both cases when the player returns we discover Bob grieving and hating bears. Or even dead from trying to avenge his children twenty-three days later(% chance of a miserable citizen seeking redress).

When the player's proximity requires unbinding the individuals, each individual determines its likely location at the given time, and continues on with their lives...and ideally, the player is none the wiser that they've just been unpacked. (as there's a good chance some dramatic changes have occured since their last visit).

Quote:
I really like the idea, but I think I like it as programmer or as a designer...more than as a game player. One has to consider how much all of this ai coding really effects the game play.

For example: how different will it seem to the player when Bob gets consistently hungry with about the same regularity, stops working at the blacksmith and then goes to the pub (or whatever) to eat. VS a schedule with a slight +- to the GetDinner time?

For the player there may be no visible differences short of the occasional interesting random coincidence, even though there is all this code chugging away in the background all the time. just a thought.


I'd say the biggest bonus to gameplay comes with replayability. Say a player's first game occurs as above. The second time they play, Bob's children are eaten by bears shortly after meeting him, he sinks into depression and stops blacksmithing, prefering instead the life of a hermit. Or he drinks himself to death. Or he rouses five of his friends to help hunt the bear, and the six of them never ever return to the village*.

Point being, if you can change what drives or motivates an NPC, and that change is dependent largely on chance, your dynamic gameworld becomes different with every playthrough. To use the Oblivion example, you aren't doing the same scripted quests with each character. Voice acting would need to be sacrificed, but personally I'd be happy to make that exchange.

(( *Or, with procedurally-generated content, the second time the player starts a new game, there is no Bob, the smithy is on the other side of the village and manned by a young man called Jack, and there aren't any bears for a hundred miles. But that has more to do with generation, although worth mentioning because a dynamic world/AI would flourish more readily here than a scheduled/scripted one ))

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!