由Ken Hartsook、Alexander Zook、Sauvik Das和Mark Riedl所著的《Toward Supporting Stories with Procedurally Generated Game World》这篇论文，该文描述了Game Forge这一概念。Game Forge可以是一个能够围绕现成叙事结构设计一个RPG世界的系统——甚至还会将玩家所追求的玩法考虑入列。它包括如何生成与故事相匹配的世界，以及适用于所有题材游戏开发者都会感兴趣的工具适配性等观点。
这可以引导世界生成器理解如何在宫殿旁生成一个沼泽。玩家模型则可添加玩家希望在不同地点间穿行时的所需时间（游戏邦注：例如，有些玩家可能会喜欢战斗和探索元素，而其他玩家则喜欢体验故事内容）。像故事设置等则取决于设计师的决定——它可以像问卷调查表一样简单，也可以是根本不同用户群体设计多个版本的游戏。例如“Super Roguelike VI:Casual Edition”这种版本可能就没有那么多与敌人战斗的内容，因为你瞄准的是特定的休闲玩家群体。
这个过程中的一个关键是如何从你已经拥有的最高分例子中生成新内容。在Game Forge案例中，我们评估了自己的游戏世界设计集合之后，希望了解如何从这些“母”世界设计中生成新集合。Game Forge可以通过随机交换节点的环境类型，或者通过随机从现成设计中添加和删除节点而复制单个世界设计。或者集合两个世界设计，创造一个新的世界设计。可以通过选择一个世界岛屿和桥梁的子图，并将其联结到其他设计的互补子图来实现这一点。
最后，Game Forge需要游戏世界中的故事道具和人物，之后再执行游戏脚本。关键道具和NPC布局需要故事作为引导，将它们置于首次出现在故事中的地点。这些NPC以及偶然角色可能适合出现于特定区域（例如，城堡守卫），它们就会执行与Game Forge一开始生成的每个故事线索相关的游戏脚本。Game Forge能够将脚本分配给合适的NPC，甚至根本不同事件重要装饰游戏场所。当你返回城堡时会经历一个“围攻”事件，它看卢来不同于你踏上旅程离开城堡时的情况。这一切都会植入Game Forge，意味着只需要输入故事所描述的各个事件或脚本序列，而不是更多引导。
The Saturday Paper – A World Just For You
Which is more important – story or setting? In some games, particularly RPGs, it feels almost impossible to separate one from the other. Setting dictates the where, the when and the how of the game. But the story has demands of its own – the order in which things must happen, and what it is the player will be experiencing. Is it possible to include procedural generation in this process without upsetting the balance? This week on The Saturday Paper, a world generator that understands stories – and can adapt to both the designer’s and the player’s preferences.
We’re reading Toward Supporting Stories with Procedurally Generated Game Worlds by Ken Hartsook, Alexander Zook, Sauvik Das and Mark Riedl. The paper describes Game Forge, a system that can be given a narrative structure and will design an RPG world to suit it – even taking into account what kind of gameplay the player is after. It has some interesting ideas about how to generate worlds that suit stories, and the adaptive nature of the tool is something that developers of all genres, from roguelikes to casual games, will be interested in.
Game Forge starts off with a story template expressed as a list of story events – whether it’s human-authored or autogenerated – that states key information like the people involved in the event and where the event takes place. Here’s a simplified example from the paper:
kill(paladin, witch, graveyard)
drop(witch, jewel, graveyard)
take(paladin, jewel, graveyard)
gain-trust(paladin, king, jewel, palace)
In order to start generating a world for this story, Game Forge needs two other bits of information: a designer-specified location model that helps it create worlds that make some kind of sense; and a player model that describes what this player wants from the game. The designer model is useful because it adds context to location names like ‘castle’. Here’s an example from the paper:
This gives the world generator guidance on how likely a swamp is to occur next to a palace (in this case, not likely at all). The player model, which Game Forge could theoretically work without, adds in information like how much time the player wants to spend travelling between locations (some players might enjoy the combat and exploring, while others just want to experience a narrative, for instance). Like the story layout, how this is gained is up to the designer – it could be as simple as a questionnaire the player gets given, or you could make versions of the game for demographics you define yourself. “Super Roguelike VI: Casual Edition” maybe has less enemy encounters because you fed it a particular player model. There’s more information on exactly what kind of metrics they use in the player model in the paper itself.
The worlds themselves are then generated using computational evolution. If you want to know more about evolution as a process, I wrote a little post about it here and put up some simple sample code on GitHub. I want to mention two parts of the evolutionary process here, though: how Game Forge represents its game worlds, and how it evaluates them.
For Game Forge, worlds are represented using the idea of islands and bridges. Islands are places where game events happen, like the Castle location in our example story above. Bridges are the game spaces between islands, which the player travels between and may encounter battles or side quests within. A game world is a collection of these islands with appropriate bridges connecting them. I like this separation of fixed and variable gameplay – it lets the worlds vary in their layout easily, and gives lots of scope for extra procedural generation to happen in the gaps. Here’s a picture of several worlds generated by the software, where you can see the variation in the length of the bridge sections, or how branching and diverse the paths are:
Evaluating a world design uses the player and design models we talked about earlier. The design model evaluates things like which bridge and island types are placed next to each other (worlds that break those rules score lower than worlds that don’t) while the player model scores the world for how well it suits the player preferences – how much exploration do they like? If they like a lot, then paths with lots of branching and travelling get better evaluations. This combined score is used to drive evolution by evaluating a bunch of possible world designs, and selecting the highest-scoring ones to generate a new set.
Crucial to evolution is how to generate new things from the highest-scoring examples you already have. In the case of Game Forge, once we’ve evaluated our set of game world designs, we want to know how to generate a new set from these ‘parent’ world designs. Game Forge can mutate a single world design by randomly swapping the environment type of a node, or by randomly adding and deleting nodes from a given design. Or, given two world designs, it can breed them together to create a new world design. It does this by selecting a subgraph of one world’s islands and bridges, and connecting it to a complementary subgraph from the other design.
Once the world design is complete there are just a few tasks left. First, Game Forge actually lays out the individual world areas using some template layouts that describe the distribution of game elements. A castle area, for instance, uses a guide for distributing houses and castle towers in a pattern that looks sensible, whereas a forest can afford to be more haphazard in the placement of trees and rocks.
Finally, Game Forge needs to place story items and people in the world, and then execute the game’s script. Placement of key items and NPCs uses the story as a guide, placing them wherever they first appear in the narrative. These NPCs, as well as incidental characters that may be appropriate for a given location (castle guards, for instance), will act out the game’s script that is attached to each line of the generated story we gave to Game Forge at the beginning of the process. Game Forge is able to assign the script to appropriate NPCs, and even able to redecorate game locations according to different events. When you return to the Castle that is experiencing a ‘siege’ event, it looks different to how it was when you left to go out on your adventure. All of this is built into Game Forge, meaning it needs no further guidance than to have each event or scripted sequence described in the input story.
Although this paper focuses on RPG worlds, the idea of representing key location as nodes and having links between them is a nice representation for lots of things: story beats in a first-person shooter, big puzzle rooms in a platform game, or even major encounters in an MMO. The balance between “I need this to happen” and “I need something in-between here” is one that crops up a lot in certain game genres. When it happens, the idea of letting your game vary in those in-between bits is really appealing. While I’m not crazy about the idea of personally adapted games, I do like the idea of variable flavour. It reminds me of a previous post where we talked about procedural generators with personality.
When you look at some of the heaviest hitters in the modern games industry, we often see either an abundance of procedural generation or an incredibly slick story and setting (The Last Of Us has been all my friends could talk about lately). Finding dependable ways to tie these things together could be big for a number of genres. Game Forge offers one possible route to doing so.（source：esbyangelina）