310 likes | 418 Views
AI in RPGs. Topics. History of RPGs Problems with large worlds Problems with faction reputations Problems with scripted AI Summary Problems with what games teach us (if there is time). History. Stem from role plays such as improv comedy, war re-enactments
E N D
Topics • History of RPGs • Problems with large worlds • Problems with faction reputations • Problems with scripted AI • Summary • Problems with what games teach us (if there is time)
History • Stem from role plays such as improv comedy, war re-enactments • Migrated to a table top game, such as Dungeons and Dragons – obligatory video http://www.youtube.com/watch?v=XHdXG2gV01k • With advent of early computing, the games moved into the computer/console world, but lost the multiplayer element • With the internet, the social aspect has returned, but the dungeon master is nowhere to be found
Early Examples • Text based games on Unix systems • Evolved to projects like Ultima, with richer graphics and interface improvements • RPGs as we know them borrow a lot from Ultima III and Dungeon Master (both 1987)
Common Elements • Story driven gameplay • Character development and customization • Multiple character party • Top down view • Combat system which abstracts concrete details
Combat Systems • Turn Based • Most console rpgs • Some variation in what can be done in a turn (Tactics) • Ex: Final Fantasy • Real Time • Most computer rpgs • Still abstract away the “skill” of combat – leave it to strategy • Some variants, especially in consoles (Secret of Mana, Mario RPG)
Expansive Worlds • Early games not small due to lack of creativity – just resources • Cartridge capacity • Simplified AI • Current games are expected to be large and behave realistic, but is this an option?
You Must Gather Your Party Before Venturing Fourth • CPU time limited • AI focused on “master area” • Players must stay together
Taking a Page from the GPU • Relate processing effort to the distance away from player
Continuous Distance Function • CPU time directly proportional to the distance to the nearest player character • Mathematically elegant • Not too efficient
Trimming the Fat • LOD1, 2, 3 perform full pathfinding • LOD4 hops tile to tile • LOD5 teleports to destination • Do we even need them to walk? Perform damage calculations?
Reputations in MMOGs • Used to simulate intelligent factions • Can be increased decreased, with a ripple effect • Provide non-linear gameply (have to choose sides) • Global and instant – is this realistic?
Where to put the events? • Could assign a copy to each NPC that was present • Waste of space • Solution – keep a master list • Only keep most severe events • Delete events no longer referenced • Have NPCs forget over time
Working with Events • After an action, an EventAnnouncer adds the event to the master list • The announcer continues to broadcast the event to NPCs in a certain radius • NPCs may share events with each other, provided they are on speaking terms
Updating Events • Each NPC tries to find if the event is new to them • We may already know of a more serious event, so we already have enough hate • We may need to replace less serious events with this one • An event can be committed by ‘unknown’; should we remember it?
Declarative AI Design • Currently Imperative design is most common • It allows things to be scripted precisely, like a movie scene • Behavior is brittle outside of intended environment • This takes time/money to develop, and games are growing in size
Imperative Design • Well known and used in the community • Allows for quick, simple scripts to address issues, much like band-aids. • Fits well with the typical scenario of a map with objects and actions
Another Reason: Player Interaction with AI • Players discovering new ways of interacting with the NPCs or world systems • Players interacting with other players via markets and trading • Players creating new objects or services in the world via modding or UI add-ons • Players pushing the world rules system, including its AI
Solution: Goals • Dictate NPC behavior based on constraints and goals • Constraints are the intrinsic rules of the game / map • Goals are typical behaviors that we previously had to solve ourselves and hardcode the solution for the NPC
Example • “I want the assassin to leap out of the shadows from here and run over there, then to twist left and fire his gun.” • VS • Sun-tzu said in The Art of War that there are six types of ground: accessible, entangling, stalemated, narrow, steep, and expansive. If the enemy is unprepared on entangling ground, advance and defeat him.
Usage in Age of Empires • Building rules • Resource gathering rules • Attack rules • Winning rules • Diplomatic rules • Research rules • Evacuation rules
A Typical Rule from AoE // Rule to sell excess resources (defrule (wood-amount > 1500) (or (food-ammount < 1600) (or (gold-amount < 1200) (stone-amount < 650))) (can-sell-commodity wood) => (chat-local-to-self “excess wood”) (release-escrow wood) (sell-commodity wood))
Benefits • Allows a uniform approach to dictating behavior (no more band aids) • Allows for more flexibility when it comes to learning algorithms • Will react to player behaviors not envisioned by the programmer • Development time not linearly related to the size of the game
Summary – Full Circle • Games well defined before computers • Porting to computers removed social aspect • The internet brought it back • All that’s left is to improve the dungeon master.
Bonus – What Games Really Teach • Chess • Appears to be about war, it has knights, castles etc • Really about controlling space, predicting opponent • GTA • Appears to be about shooting pedestrians and cops • Really about exploration and freedom • WoW – exploration and role playing? http://www.gamasutra.com/features/20060222/sirlin_01.shtml
What WoW Really Teaches • Investing a lot of time into something is more valuable than actual skill • You “deserve it more” if you put in more time • Very relevant to the Honor System • Completely opposite in real life • Group is better than solo • Much better rewards for performing mundane tasks along with 39 other people than individual skill • Prevents exploration and exploitation of engine with soft rules (Larry Lessig disapproves -.-) • Uses TOS to ban behaviors otherwise allowable in game • As Comp Scis, we know this is never an option in the real world http://www.gamasutra.com/features/20060222/sirlin_01.shtml