Thursday, July 31, 2014

Storybricks AI In Depth

The Storybricks AI system, which is the backbone of EverQuest: Next's Emergent AI.

The following video from GameAIConf shows how Storybricks works through a few simple text based game interactions and is intended for an audience with a background in Game AI. We will be seeing the full scale application of this amazing technology in just a couple weeks at SOE Live when they show it off in the EverQuest: Next voxel world with 3d characters, and this presentation will be intended for players to understand. Go ahead and watch it if you are interested in the details behind the system, then come back for my discussion about what he didn't say here but has elsewhere and some implications of the system. Or just skip the video and I will try to give a summery of how it works.



First off, Storybricks is a Story Telling Engine which is designed to function on any type of game system. They call this being 'Game System Agnostic.' I don't just mean the classic PC vs Console debates either, I mean working for a text based game like shown in the video or a full graphics game, a single player horror or an MMO Shooter, Storybricks doesn't care what system you lay on top of it, it will happily function for any of them.

So what does it mean to be a Story Telling Engine? Basically, it takes the elements the designer has given it and constantly creates the story on the fly with the players choices. The designer need not plot out each new story and create separate content for every choice, they just design the elements and the players actions will cause new stories to unfold around them.

Parts of a Story Brick
In Storybricks these elements are called Universal Story Bricks and are utilized for everything. Every character is their own brick, every dramatic plot element is a brick (in the video he shows Winter from The Game of Thrones as a brick). If it makes sense to do so then organizations (such as the Houses of Capulet and Montague in Romeo & Juliet) can be their own bricks.

        Drives
Each brick can have its own Drives, these are the goals and desires that direct any action it has upon anything else. Those familiar with the EQN unvailing probably remember Dave Georgeson talking about making Orcs and 'releasing them into the world.' He mentioned some of their 'drives.' Orcs like roads that are traveled only a little bit. Orcs like to attack travelers. Orcs don't like Guards. Orcs don't like Cities. Orcs don't like getting beat up

        Changes
The next part of a Brick defines Changes that it can apply to other bricks. This can be anything from altering a mood, a change in faction reputation, granting traits, applying a buff effect, casting a spell, dealing damage. In our Orc example, there is a brick which constantly polls the game database for how often players travel the roads. If the travel is in the right range then the Road brick becomes attractive to the Orcs. A lone traveler's brick will tell the Orcs to attack.

        Parts
Parts seems a little miss named to me, but these define the limits to what the Changes are allowed to apply to. This ensures that each brick works together correctly with all the other bricks in the system.

        Exits
Actions which counter the drives of a brick trigger Exits, alternate paths that go to another brick, in some ways they are quite similar to Changes but is quite important for organizing when assembling a series of bricks to make the story. Exits are how you can foil the Orcs plans. Another brick would keep track of how often the Orcs are getting beat up so that the Orcs will leave the area if that gets too frequent. A nearby guard's brick will tell the Orc bricks to leave.

Interactive Stories
Ok, so that's what makes up the bricks of Storybricks, but how does this make an interactive story? Interactive Stories are about making meaningful choices. With so many bricks having conflicting Drives there should be plenty of room for dramatic tension and for opportunity costs. Each time a brick needs to make a choice several bricks with matching Changes and Parts are resented based on the brick's current Drives. Each time a choice is made it means that other choices are not made (which is the foundation of opportunity cost) and that inaction regarding other bricks can effect the choices they make.

Dynamic Ecosystem
Dave Georgeson, director of the EverQuest franchise, likes to refer to the interaction between bricks as a massive network of sumo wrestlers. They all push on each other and even a little difference in one push will have ripple effects through the whole system. Lets say a player doesn't like having the Orcs on that road but they aren't strong enough to kill the orcs themselves. So they go to a town and bribe a guard to travel the road. The Orcs don't like the guard on the road, so they leave. Now there is a 'power vacuum' in the area with the Orcs gone. Panthers come in to hunt the livestock in the area. The farmers are unable to produce food for the city because of the panthers. Time goes by without any of the players noticing (after all, it's a rarely traveled area) and the city doesn't ge their food. The city's food prices go up because of the shortage. NPCs in town are now desperate for aid from players. If the players don't help them they will be vulnerable to attack from other creatures and th town might be destroyed. This is only one of the many unintentional ramifications of the player bribing the guard to say nothing of what happens to the area were the Orcs ended up going.

Structured Stories
At times a designer will want to tell stories that are more structured. This largely comes down to designing the Drives, Changes, Parts (limits), and Exits of the main actor bricks so that they will eventually tell the right story as well as making sure the choice bricks made available are designed to fit those. It is also possible to select how dramatic the choices should be at any given time. This allows for having lulls for the player to recover from the stories climaxes, after all, you can't have the story running at full throttle the whole time or it will burn out the player and cheapen the climactic moments. Pacing is important for all stories, structured or dynamic.

Simplicity
In the video we saw a little bit of the code behind the bricks, and while I could tell you that it is really simple code we all know that most people would be completely unable to do anything if it requires typing things out in code. I know I hate coding myself. Which is why I am glad that in other videos from Storybricks we have seen that they are making a much easier way to make these things, so easy that you don't need to know anything about programming to make it work. Simply move the bricks around, connect them based on their shapes to make what you want and it will write the code to match. I still haven't seen the system for making those bricks and determining their shapes, but we are told that system will be easy to use as well. At the very least, in late April the stated that they had already programmed all of the possible 'basic wants, needs, desires, and emotions' which any characters in EQN would need. These basic drives should be made available to anyone using Storybricks and since it is Game System Agnostic it doesn't matter if you are making something totally different from EQN, these basic drives should still be fully applicable.

This system should revolutionize AI design, changing the face of the industry and the face of interactive storytelling in general. It will open the doors of crafting meaningful stories to a much larger pool of developers without costing a fortune to craft. I see AAA games and Indy games all taking advantage of this, and EQN is, as Dave said, "their show pony." It shouldn't be too much longer till we can start using this system in Landmark since Landmark is the toolset SOE is using to build EQN and they will need to start programming those NPCs soon.

I can't wait to see the presentation of Storybricks in EQN at SOE Live, only two weeks to go. In the future I will discuss in greater detail some of the implications of this system in EverQuest: Next and how it relates to the Four Holy Grails that Dave presented at SOE Live last year.

No comments:

Post a Comment