Skip to main content
GameDev.net gamedev.net
🔒 Locked

RPG AI ideas that you would like to see in games?

Started by DvDmanDT Mar 29, 2007 at 3:36 PM 31 replies 8.5k views
Original Post
DvDmanDT
DvDmanDT
Inspired by a thread in "Game design" about what people would like to see in an rpg, I decided to open a thread about AI ideas you think could prove interesting. Feel free to post and comment on any AI releated ideas and/or visions you may have. I for one, enjoy mystery and investigations, so my current project has some focus on that. For this, I thought about a memory system for NPCs. I'm afraid it might eat resources, but I think it would be cool if AIs could remember if they see wierd things happend. If I go out and shoot someone, the other NPCs in the area could identify me, assuming they get a good look at me. If I dress up like someone else, and it's dark, they only get a blurry picture, that they can later on describe to the police (for example, "he had a red jacket and baseball cap, but I didn't get a look on his face"). The problem here is the implentation, but I think it is doable. I'm also thinking about stronger and weaker memories and things like that. Any comments? --- I'm also interested in the state and rule based system described in that other thread. To those who didn't read it, it's all about trying to cause chain reactions to events. The example given was (more or less) that if I kill a merchant on his way to the castle, they notice he never shows up, and send someone to check it out, and in the meanwhile, the citizens complain about the castle supplies being out of whatever the merchant was delivering. How deep and interesting do you think you could make these chain reactions in such a game?
JBourrie
JBourrie
An abosolutely bat-crazy idea, to start things off:

AI Storyteller - A series of events with multiple variables, and a "pacing manager" that ensures the story remains interesting throughout the game.

For example, the designer doesn't know which characters will join the players party. Moreso the designer doesn't know which characters will be the players favorite. But all of this information can be gathered by recording data about the players style (does he use this character alot? Does this character always get the best equipment first?).

The game decides it's time for a bloody battle (through some means, one of which I mentioned in the other thread), and needs a high-drama action. It checks the list of possible "High Drama Events" and picks "Players favorite sidekick injured". Use your imagination as to what could happen here.

After this high drama battle we need a lull, a quieter segment of the game. Helping this character out is one possibility (find the healing spring, or whatever you like). However if the player just goes out into the countryside the game will limit the difficulty of events that happen (you're not going to get attacked by a dragon) for a short time. Eventually it's time for another climactic segment (based on a number of variables including time), so we check the event manager again and see what can possibly happen.

And so on...
Trapper Zoid
Trapper Zoid
Quote:
Original post by JBourrie
An abosolutely bat-crazy idea, to start things off:

Well, I wouldn't call it bat-crazy, not when I've got the same desire to see the same storytelling system in games [smile].

I've made several posts on this a year or two ago in this forum if you search for interactive storytelling or stories to get the full description of my wish for storytelling AI, however my ideas are pretty similar to yours; having an AI storytelling or "pacing manager" as you describe it decide what story based events to give the player based on their prior history of playing style.
DvDmanDT
DvDmanDT
What about days, nights and sleeping? Say we have 1000 NPCs in different map sectors, with no way whatsoever to keep them all in memory at once, and still want them to eat, sleep and well, do their duties, and you should be able to follow them 24/7 and expect them to do different things like those. I think this could allow for some crazy infiltration style quests.
JBourrie
JBourrie
Quote:
Original post by DvDmanDT
What about days, nights and sleeping? Say we have 1000 NPCs in different map sectors, with no way whatsoever to keep them all in memory at once

Why update NPCs that aren't in your map sector?

Zelda: Majoras Mask did alot of very interesting puzzles with a simple version of this, but there was no AI driving the characters, just a time-based script. But there were quite a few puzzles that required you to meet people at certain times of day.
guywithknife
guywithknife
Quote:
Original post by JBourrie
Why update NPCs that aren't in your map sector?

Well, in games like oblivion, it feels like sectors, other than the one you are currently in, are frozen in time (because they are). You want the world to feel alive, so you need to keep all map sectors updated and breathing at all times (obviosuly you only need to do high-level processing for the other map sectors, you dont need to simulate everything, because it will never be seen, but some sort of simulation should happen, IMHO, even when the player is not nearby).

Trapper Zoid
Trapper Zoid
Quote:
Original post by issch
Quote:
Original post by JBourrie
Why update NPCs that aren't in your map sector?

Well, in games like oblivion, it feels like sectors, other than the one you are currently in, are frozen in time (because they are). You want the world to feel alive, so you need to keep all map sectors updated and breathing at all times (obviosuly you only need to do high-level processing for the other map sectors, you dont need to simulate everything, because it will never be seen, but some sort of simulation should happen, IMHO, even when the player is not nearby).

As an alternative to keeping all sectors updated, you coul just update the sectors when needed. The player only really needs real-time updates to the sector that they're in. Once they travel to a new sector however, the game could perform whatever updates it needs to account for the changes in time. Say the player spends two days away from a sector and returns; the game could save the current state of the sector and keep a record of all events that could influence the sector in the rest of the world, and then perform it all in one update when the player heads back.

This way you can retrospectively change events in the past for whatever dramatic end you need without having to plan for it in real-time. If the player goes away from a sector of a year in game time, then maybe a new king has taken over, maybe monsters have overrun the sector, or maybe everything is just the same as it was; the storytelling AI can make a decision when the player returns rather than having to plan ahead and overthrow the kingdom while the player is away.

DvDmanDT
DvDmanDT
TZ: I was thinking about that, and it might very well be possible. Another solution is to always keep all characters in memory, and update the ones in the players current sector each or every other frame, and update the rest every second or something, and only update what really needs to be updated. Then you could perform a more full update when you enter their sector. Might turn out to use an insane amount of memory though.
JBourrie
JBourrie
@Trapper Zoid

That's exactly what I was thinking. The player just has to feel like something has been happening... to be real lazy you could randomly place them and it would seem different. Possibly wouldn't even be noticeable by the average player.
Dwiff
Dwiff
Hi, I don't really know much about AI but I'm trying to picture how this would work. I'm picturing an example where you have a butcher or a metal smith. Where normally you could just have scripts for them to go from one place to another to another given certain times of the day. For instance from home to work to the pub and home. Now if the bartender gets killed or the butchers food supplier gets killed this would upset the NPC's normal duties and you could just have an alternative script for what to do instead given certain circumstances. Is this kind of what you guys are talking about?

I think it would be pretty awesome to have a world that is producing stuff say people in the mines mining and bringing the material back to town where a metal worker refines and uses it. Or hunters or fisherman would be gathering their material and selling it in town. That way you could interupt any of those services and either try to profit from it, or use the materials for yourselves. Of course in order to prevent a character from just farming a particular resource this way countermeasures would have to be implemented, such as if you rob a gold mine once or twice the next time you show up it will be surrounded by guards who should be able to kill or at least severly weaken you. I can just imagine an MMO with this that if you didn't have countermeasures like that no services would ever be provided anywhere. Also reputation would be a big factor in what you could do with stolen supplies.
JBourrie
JBourrie
@Dwiff

That's pretty much what I'm talking about. Little simple rules and scripts, and the complexity comes from the interactions between these scripts.
Trapper Zoid
Trapper Zoid
Quote:
Original post by DvDmanDT
TZ: I was thinking about that, and it might very well be possible. Another solution is to always keep all characters in memory, and update the ones in the players current sector each or every other frame, and update the rest every second or something, and only update what really needs to be updated. Then you could perform a more full update when you enter their sector. Might turn out to use an insane amount of memory though.

You could do it that way, however in my view the approaches are best for different game worlds. If you are updating the sectors constantly, even at reduced time intervals for distant sectors, you're making a world-centred game. However if you only care about updating the sectors when they enter the player's zone on interaction, you can focus on a player-centred game.

Either approach can work, but it depends whether you want a world-centred "I'm a pawn in a much larger game that would keep going with out me" type of experience, or the player-centred "I'm the chosen hero who everything revolves around" alternative.

IADaveMark
IADaveMark
Hell, Ultima V, I think it was, had people in towns that had daily routines. You could find them at their shop, the pub, or even asleep. At certain times of the day, they would walk across town to go eat, come back to their shop, close up and head to their bedroom, etc. And that was... 1987?
Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit<
Orchaldir
Orchaldir
There are some pretty interesting mods for Oblivion. They make the ai so much better.

"NPC with Jobs": This mod gives NPCs real jobs and needs.

"Reneer's Guard Overhaul": If NPCs witness a crime by the player, the call the guards. If the player kills all witnesses and guards, he stops being a wanted criminal. Also implemets disguises.

"Thieves Arsenal": Adds the tools from the thief games. NPCs will react to corpses, unconscious npcs and put out lights.

They were all made with a limited editor and scripting language and show what is doable.

RPG AI ideas that you would like to see in games?

I would like to see nothing new or extrem, but the old polished. NPCs reacting to what I wear. A more complex dialouge system.
DvDmanDT
DvDmanDT
Again, I think memories are one of the greatest missing pieces in todays games. I think it could add sooo much. That and opinions.
guywithknife
guywithknife
Quote:
Original post by Trapper Zoid
As an alternative to keeping all sectors updated, you coul just update the sectors when needed. The player only really needs real-time updates to the sector that they're in. Once they travel to a new sector however, the game could perform whatever updates it needs to account for the changes in time.

Very true and probably what most people would do. This does, in my opinion, still have one problem though: AI controlled characters cannot travel between sectors. Of course, you could design around that - characters do not wonder between towns, except special characters (like merchants and such) which are handled seperately and updated more often that a general area, so I guess its not really a problem.
IADaveMark
IADaveMark
I haven't tried it, but from what I understand, Fable had the idea of rumors and news spreading between people. And, of course, they needed memories to facilitate that.
Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit<
wodinoneeye
wodinoneeye
Quote:
Original post by DvDmanDT
Inspired by a thread in "Game design" about what people would like to see in an rpg, I decided to open a thread about AI ideas you think could prove interesting. Feel free to post and comment on any AI releated ideas and/or visions you may have.





Better running away (when to run away and where -- smart running away where the enemy retreats to a rally point where it might join allies in a big enuf group to counterattack... To many enemies still stand and fight til they die. Having to hunt them makes better use of the terrain ($$$$) because the player has to move thru it slower.




--------------------------------------------[size="1"]Ratings are Opinion, not Fact
wodinoneeye
wodinoneeye
Quote:
Original post by Trapper Zoid
Quote:
Original post by issch
Quote:
Original post by JBourrie
Why update NPCs that aren't in your map sector?

Well, in games like oblivion, it feels like sectors, other than the one you are currently in, are frozen in time (because they are). You want the world to feel alive, so you need to keep all map sectors updated and breathing at all times (obviosuly you only need to do high-level processing for the other map sectors, you dont need to simulate everything, because it will never be seen, but some sort of simulation should happen, IMHO, even when the player is not nearby).

As an alternative to keeping all sectors updated, you coul just update the sectors when needed. The player only really needs real-time updates to the sector that they're in. Once they travel to a new sector however, the game could perform whatever updates it needs to account for the changes in time. Say the player spends two days away from a sector and returns; the game could save the current state of the sector and keep a record of all events that could influence the sector in the rest of the world, and then perform it all in one update when the player heads back.

This way you can retrospectively change events in the past for whatever dramatic end you need without having to plan for it in real-time. If the player goes away from a sector of a year in game time, then maybe a new king has taken over, maybe monsters have overrun the sector, or maybe everything is just the same as it was; the storytelling AI can make a decision when the player returns rather than having to plan ahead and overthrow the kingdom while the player is away.



Ive run into this as a problem in my simulation system's design -- how to break the behavior code into a 'Realized' mode (when near the player- full detail ) and an 'Abstract' (generalized) mode that would be run infrequently in the background. Overall ecomomies and patterns of strategic influence have to be kept running for a macroplot. When the player comes near the NPC objects have to transition to be reasonably placed and situated in relation to each other and involved in the appropriate activities. So actually its not just the two modes but also the transitions between them which complicated the scheme.

All objects need to interact equally (in detail) in the Abstract mode. The abstract actions taken by one have to be compatible with the reactions of all the others.

The intelligence with which they do it can vary. Different roles can have one NPC who is key to the plot and interacts with other key NPCs as well as plot prop objects (and must do so following their possibly unique behavior and agenda) and a nother role which is more generic and has a much more local scope (ie- the generic village blacksmith....) who's specific behavior is less important to the game and may mostly be just for ambiance.


The importance for my project is that I have a large world with the players being in only a tiny part of it (realized). At the same time I intend powerful planner/task based AI (consuming ALOT of memory and CPU processing) for the NPCs when active. Another aspect of the Abstract vs Realized modes design problem is how much of the AI data/tasks are retained in abstract. Are the abstract interactions detailed enough for incremental changes to take place (if the player steps away and then returns to see that progress was made) and subtle enough to not have too radical a change granularity --- BUT at the same time not require too much processing resources (it is a BIG map).

There are map spanning 'significant' NPCs who travel across the map and drive the macroplot. Their correct behavior is important to the game being realistic/logical. There are also alot of local NPCs who even if unique have a much smaller interaction scope. They can be largely generalized (Im using a template scheme to build them on demand) to save resources as the player may not visit large parts of the map and once visiting may never return (or conversely a player may revisit the same area over and over if they want to). The local NPCs ARE effected by the larger patterns that influence large parts of the map (faction influences/ extended economies, weather, diseases, etc...) and the templates are parameterized to take those factors into account.


Trying to rebuild/reconstitute everything JIT (just in time) was ruled out because alot of the influence patterns are accumulative (many many factors) including interactions with adjacent abstract objects.



--------------------------------------------[size="1"]Ratings are Opinion, not Fact
wodinoneeye
wodinoneeye
Quote:
Original post by Dwiff
Hi, I don't really know much about AI but I'm trying to picture how this would work. I'm picturing an example where you have a butcher or a metal smith. Where normally you could just have scripts for them to go from one place to another to another given certain times of the day. For instance from home to work to the pub and home. Now if the bartender gets killed or the butchers food supplier gets killed this would upset the NPC's normal duties and you could just have an alternative script for what to do instead given certain circumstances. Is this kind of what you guys are talking about?

.


You cant just have 'alternate' scripts because the combinatorics would explode and drive you to disaster.


The system Im using links behavior scripts to roles and skills instead of to individual NPCs/objects. Im using planning/tasks for the AI and a search is made of a solution space for each object based on its skills and the current situation. A solutions probability and risk/cost is validated/evaluated. You might have any NPC become the bartender (with poor skills that make him a very bad bartender) -- still if there is a payoff for that NPC it could be done under my system. Almost all NPCs inherit basic skills that make them at least capable of most roles at low efficiency (though the risks probably disuade them wanting to assume the role). Example -- the village blacksmith might be capable of doing major damage to an orc with his sledgehammer if he's backed into a corner
(otherwise running away is the 'more optimal' solution...)



--------------------------------------------[size="1"]Ratings are Opinion, not Fact

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.