不要错过这一款基于机器学习的冒险游戏

作者:eastecho
2019-12-17
25 18 3

有钱,在某种程度上好像可以为所欲为……

那么,一般人只能在游戏中为所欲为。不过这个也是打了折扣的,基本上很难玩到一款让人真正自由行动的游戏,“高自由度”想来都是相对而言,少见有突破性的高自由度游戏。

但最近火得一塌糊涂的 AI Dungeon 由于是基于机器学习,所以给我们带来了前所未有的自由度,这次几乎真的可以在游戏中“为所欲为”了。(我们一直希望能见到机器学习在游戏中的大规模使用,这款 AI Dungeon 终于让我们见到了可能。

我在这里会简要介绍一下 AI Dungeon 2,并且展示一下我是如何在幻想游戏中将想要攻击我的红龙击败并且缩小,然后又在僵尸横行的末世里靠卖土豆发了横财……

呃……哈哈!

AI Dungeon 2

文字冒险游戏是电子游戏早期的产物,游戏基于全文本不说,玩家还要费力的输入固定的词组来推进,比如“GO WEST”,“PICK UP AXE”等,知名的比如 Zork 系列,看起来简陋,但是可是早期游戏的形态,吸引了无数的玩家。随着时间推移,技术的发展,它们早已退出历史舞台。不过今天,文字冒险游戏在全新的技术核心加持下,又回来了!

AI Dungeon 2 是世界上首款真正意义上 AI 生成的虚拟世界文字冒险游戏(严格说并不是第一款,之前也有一代,更早有 Façade)。它使用了名为 GPT-2 的 1.5G 自然语言生成模型来生成故事和世界。所以它可以无限生成世界,那里有着无尽的世界和新事物可以去探索。玩家可以根据自己的意愿做出任何行为,而不受游戏开发者的想象力所限制。

跟其它现有的游戏不同,即便自由度最高的游戏,也还是局限在游戏开发者的想像范围内,只不过有更多更复杂的状态和相互作用算法。而在 AI Dungeon 2 中,游戏背后是一个基于 AI 的 Dungeon Master,它会根据玩家的输入对世界做出调整,来响应玩家。

于是,这就给玩家带来一个天马行空、无所不能的自由世界。你所想到的,输入进去,这个故事就会按照你的想法去延展,限制你的只有你的想象力,这简直有点儿细思极恐。

如何玩 AI Dungeon 2

AI Dungeon 2 是基于 OpenAI 搭建的,开发者 Nick Walton 开始是将其放在 Google Colab 上免费托管,之前是可以直接在线玩,无需任何安装。

但是随着媒体报道掀起热潮以及众多玩家涌入,免费的 GPU 配额早已经不够使用,目前每个用户每月大约需要 $1 美金的开销,而现在每天访问已经超过 7 万人,因此 Nick Walton 只能将游戏从 Colab 拿下。

不过,Nick Walton 现在已经开放了 Patreon 帐号接受捐助,以便能够在今后将这个服务运行下去。

对动手能力强的玩家,他同时也提供了在本地跑这款游戏的方法,只要你的机器性能可以,那么完全可以在自己本地跑起来。

具体怎么运行您可以参考这个链接:运行说明

下面展示一下几个试玩经历,以便让您更好的了解这款游戏:

几则试玩记录

这几个试玩过程都是在我的一台老的 iMac 上跑的,启动一次非常慢,进入游戏后每次交互都要等半分钟左右,所以还是很消耗系统性能的。不过倒也不像官方要求那样必须要 NVIDIA 卡加 CUDA 以及大内存,跑起来很容易。需要注意的是要切换到合适的 Python 版本,比如 3.6.x,版本太高也不让跑。

AI 每次计算都吃掉大量 CPU

游戏启动后你会见到如下的画面:

然后可以做一些选择,比如故事类型,你想要扮演的角色,名字等,很简单的信息:

接下来,游戏就开始了。


我的第一次中规中矩的尝试:

Generating story...

You are Nova, a wizard living in the kingdom of Larion. You have a staff and a spellbook. You finish your long journey and finally arrive at the ruin you've been looking for. You look around and see that it's not much different than when you left it years ago. There is one difference though; there are several skeletons wandering about the place
> cast fireball to them

You cast a fireball at the skeleton army. It hits the first skeleton and sends him flying into another skeleton. The next skeleton falls on top of the last one, crushing him under his own weight. The skeletons begin to panic and run away from the ruined city
> grab one of the skeletons

You grab the nearest skeleton and throw him at the other skeletons. He crashes through the wall of the city and lands on the ground. The rest of the skeletons follow suit and soon you have all killed every single one of them. They aren't even moving anymore.
 
> Sing a victory song and dance

You finish off your dinner by singing a victory song and dancing around. You then go back home where you tell your parents that you won against the Skeletons. Your mother is very happy for you

上面就是这次记录的文字信息,带有 “>”的就是我的输入。

故事大概是这样:我是一个名叫 Nova 的法师,历尽千辛万苦到达了一处废墟,它看上去和我多年之前离开时没什么两样,但是多了一堆骷髅在那里游荡。

然后我向它们发射了火球,还抓起来一个骷髅,我本来想做点儿什么来着,但是 AI 让我把它扔向其它骷髅,然后干净利索的消灭了全部骷髅。

我随后唱歌跳舞来庆贺自己的胜利。然后 AI 就让我回到家里,告诉父母我打败了骷髅兵,妈妈感到非常高兴。

中规中矩哈?但是并不太违和,只是剧情发展好快……不过我还可以接着冒险下去,只要不 Game Over 我就能一直玩下去。其实就算 Game Over 你也可以说自己还没有死,游戏还能继续。


一次乱搞的尝试:

我退出去又来了一次,这次还是法师,名字改了叫做 Indie Nova。

这一次我发现自己站在一个大石头墙面前,但是有着一个画着法师形象的小门。

游戏过程记录

这部分内容的文本版
请点击后再查看

You are Indie Nova, a wizard living in the kingdom of Larion. You have a staff and a spellbook. You finish your long journey and finally arrive at the ruin you've been looking for. You look around and see that it's not much different than when you left it. The walls are made of stone, but they aren't very high. There is a small door on the side with a picture of a wizard on it
> burn the small door

The door is burning up and you decide to put out the fire before you get burned. You start to walk over to the door and then suddenly something catches your foot. It hurts like **** and you fall down. You quickly stand back up and try to figure out what happened
> a dragon

You hear a loud roar from behind you and turn around only to find yourself face to face with a large red dragon. He looks at you and lets out a roar of his own
> paint the red dragon green

You think about it for a moment and decide that this would be a good time to change the dragon's color to green. You run forward and slap him across the head. The dragon lets out another roar and flies away
> cast ice spell to the dragon     

You run forward and throw a ball of frost at the dragon. The dragon doesn't even flinch as he continues flying off into the distance. You continue running after the dragon and catch up to him. You grab his leg and pull hard but he manages to shake you off
> take out your gun from your pocket

You point your gun at the dragon and shoot him in the chest. The dragon falls to the ground dead instantly. You look at the dragon corpse and realize that you just killed a dragon. You feel a sense of accomplishment and happiness. You don't know why though
> shrink the dragon 

You go back to the dragon corpse and begin shrinking it. You do this several times until you can barely see the dragon anymore. Finally you stop and toss the shrunken dragon on the ground. You pick up the sword and shield and leave the dragon's body behind
> open ipad and write a journal about the dragon

You write a journal entry about the dragon. You explain how you had to kill him because he was killing people and destroying the forest. You also mention that you will need to come back here later to retrieve the dragon bones. You finish writing the journal entry and close it
> changge my name to Dragon Slaughter

You decide to change your name to Dragon Slaughter. You still remember when you were called "Indie" and thought it was funny. Now you are going to call yourself that again
> go to the citadel

You go to the citadel and ask the guard if there is anything you can read in the journal. He tells you that the journal has been destroyed by some other adventurers. You wonder where they came from since they didn't seem to want to read the journal

这一次我做的事情比较复杂。首先我没有去开门,而是尝试用火烧掉门。系统反应没问题,门烧起来了,然后在我准备进去的时候,突然有东西抓住了我的脚,还挺疼。我赶紧回过头看看是什么在抓我。

这时我敲入了:“a dragon”,系统很正确的返回了接下来的故事:果然,一条红色的龙在我面前咆哮。

这时候我开始胡来了,不是与龙战斗,而是:“paint the red dragon green”,我想把它涂成绿色……

系统做出了反馈,它说我是打算把龙涂成绿色,不过在准备这么做的时候,龙飞走了。我紧接着向龙发出冰咒语,想要冻住它,结果居然无效!

没办法了,我掏出了我的枪……是的,我是带枪的法师……给了龙一枪!结果一下子就给打死了……AI 对我是持枪法师这个设定完全没意见……

龙死了,我想了想,敲入了“shrink the dragon”,然后这条龙就被我缩小了,小到几乎看不见。我本来是打算把龙装兜里,不过系统讲的剧情是我把缩小的龙扔了,然后离开了战场。

好吧,既然能有枪,我还想要别的。于是我掏出 iPad,写了一篇关于这只龙的日记。随后我将自己的名字改为 Dragon Slaughter,然后向城镇走去。对于我这些奇怪的行为,AI 也没有什么意见。

到了城镇,AI 居然安排了我去问城镇的守卫哪里能看到关于城镇的日志!前后文有了奇妙的延续,我是一个多喜欢日志的法师啊!

守卫告诉我说,可惜了,有帮冒险者把日志给毁掉了。然后:“You wonder where they came from since they didn't seem to want to read the journal”,哈哈哈哈。

这是个不错的冒险经历,可以保存下来以后继续,有趣。


僵尸时代的商人:

我又一次开始新游戏,这一次选择了僵尸背景,我的身份是一位科学家:Indie gamer。

系统推荐的是 Fantasy 设定,这部分设定会比较完善,其它的包括侦探故事什么的都不是很完善,所以结果也就不会那么理想,但是还是可以玩儿的。

游戏过程记录

这部分内容这部分内容的文本版
请点击后再查看

You are Indie Gamer, a scientist  trying to survive in a world filled with infected zombies everywhere. You have a backpack and a solar powered tablet. You pound your fist on the table, angry that you still haven't found the cure to the infection. You turn to your assistant and say 
> "grow some potatoes"

The assistant looks at you confused. He then turns back to his work. The next day he comes over and says "I think I know what we need to grow".
> "what?"

He says "a bunch of potatoes".
You look at him blankly for a moment, before saying "What do you mean? What kind of potato?"
He starts to explain 
> do some research

You read up on growing potatoes online. It seems that they like the dark places, so you decide to put them in a basement where there is less light. This makes sense, since it will be easier to feed them
> sell potatoes to others

You go to a local market and buy a few dozen potatoes. You sell them for $1 each. You make about $20 from selling one potato.
> open a potato store

You go to a nearby city and get a business license. You set up shop in an abandoned building and start selling your potatoes for $2 each. You make about $30 from selling one potato.
> raise the price from $2 each to $1000 each

You increase the price to $2000 per pound. You make about $100,000 from selling one pound of potatoes.
> open potato chain store worldwide 

You continue raising prices until you reach $10,000 per pound. You make about $200 million from selling one pound of potatoes.
> make potatoes store puclic company to NASDAQ

You start making potato products available to the public on the internet. You make about $3 billion from this venture.

游戏开始,我是一名科学家,正在为还没有找到克制僵尸的疫苗而生气,然后我转过头对我的助手说:……

这时需要我输入了,我想了想决定把剧情带偏,于是说:“grow some potatoes”,种点儿土豆吧。

这时候系统的故事游戏不太流畅。助手对我的话表现得比较困惑,转身回去工作了,然后第二天又跑来告诉我说他知道该种什么了。我一脸懵逼问他是什么,结果他也说是种土豆……这里有些乱套。

然后我就开始研究下怎么种土豆。AI 系统居然说我在网上查找相关信息,好吧,僵尸时代也可以上网的,那我应该能做更多事情。

于是故事开始走样了,我们不仅种了土豆,而且还开始卖土豆。“sell potatoes to others

结果土豆卖得很不错,我卖掉一个就能赚 $20 美金!乐得我,赶紧开了一家土豆店。“open a potato store

商店的生意也很火爆,于是我黑心的将 $2 一个的价格升到了 $1000,结果生意还是很好啊!!!

我心肠已黑,试图在世界范围内开办土豆连锁店,结果系统没理我,可能是没学到这方面知识。我接着有试着将我的土豆商店公开上市到 NASDAQ,系统也没正确理解,但是它帮我在互联网上公开销售土豆,也算是可以了。

在退出之前,我虽然没有做成一家土豆上市公司,但是我却通过网络销售获得了 30 亿美金的收入,也算可以了……这可是在僵尸横行的时代!!


怎么样?看了上面这些,觉得有趣不?该您自己尝试一下了,相信您肯定能玩出无尽的花样来。

新时代开启了

看了上面几个简单的例子,相信您一定已经了解到这款游戏会有多么“疯狂”,多么的与众不同。

在 Reddit 上,可以看到全世界玩家分享的自己玩出来的神奇故事,天马行空!

/r/AIDungeon

去看看

这款游戏显然具有比较重要的历史意义,它可以说是第一款广为普通玩家认知的 AI 驱动游戏,很有可能是 AI 游戏兴起的代表者。

虽然 AI Dungeon 2 目前的演示性强于实际的游戏性,游戏 AI 永远是围绕着玩家来展开,想尽办法满足玩家设定的情境,而且没有一个长期稳定的主线。但在 2019 年这个时间节点,我们或许真的可以说,见证了一个新时代的帷幕正在慢慢拉开。相信之后,我们会见到更多有趣的 AI 游戏出现,未来的游戏一定是超乎我们想象的。

近期点赞的会员

 分享这篇文章

eastecho 

从前的边城浪子,现在的路人乙 

您可能还会对这些文章感兴趣

参与此文章的讨论

  1. DoggyFC 2019-12-17

    我电脑跑不出来,哭了

  2. Metak 2019-12-17

    > "为什么我的游戏崩溃了?"
    虽然玩家可以输入任意的指令,但是频繁的超展开会使得模型更容易crash,另外频繁save也十分必要。
    >
    摸清楚模型的调性之后,我就在合适的时候不输入任何内容,让模型自主发挥,这样我得到了一个很棒的爱情故事,并获得了第一个CONGRATS YOU WIN。
    > "我从没遇到过YOU WIN"
    是的这游戏居然有WIN。模型似乎会根据故事的内容来生成获胜条件。不过游戏中却有很多莫名其妙的GAME OVER。

    最近由 Metak 修改于:2020-06-18 12:20:41
  3. MaxAlex 2019-12-27

    用Colab可以跑,拉满 25G RAM 再启动 Tesla T4 GPU 硬件加速就行了,玩起来还挺有意思的。

您需要登录或者注册后才能发表评论

登录/注册