未登录,请登录后再发表信息
最新评论 (0)
播放视频

游戏开发背后的故事

The stuff no one tells you about game development

Hi! My name’s Mark and I am making a video game about magnets.
Hi!我是Mark 我正在制作一款关于磁铁的电子游戏
So, one of my goals with this series
我这个系列的目标之一是
is to show you a true, transparent, and unvarnished look
从一个真实 透明和不加修饰的视角
at what it takes to make your very own video game.
来看自己制作电子游戏时需要什么
And part of that means I can’t just show you the stuff that’s fun and exciting
也就是说 我不能只向你展示有趣的 令人兴奋的东西
and makes for good video footage,
以及如何制作好的视频片段
like prototyping game mechanics, designing levels,
比如游戏机制原型设计 关卡设计
or doing surprise demo drops.
或者做惊喜演示
And, as it turns out, there’s a lot of stuff in game development
而且事实证明 游戏开发过程中有很多东西
that just isn’t very glamorous.
并不那么迷人
Stuff like menus, the heads-up display, saving and loading data,
比如菜单 抬头显示 保存和加载数据
supporting different controller types, syncing options,
不同类型的手柄支持 同步选项
tracking progress, doing level transitions, and more.
跟踪进度 进行关卡转换等等
This is stuff that doesn’t really get shown in dev diaries and documentaries
这些东西不会展示在开发日志和纪录片中
because, in truth, it’s very dry.
因为 老实说 它们非常枯燥
But someone’s got to make this stuff.
但是总得有人来聊聊这些事
And in this game… that someone is…
而在这个游戏中……那个人……
well it’s me, isn’t it?
好吧 不就是我吗?
[Music playing]
[音乐播放中]
Okay, so last time on this series
那么上次在这个系列中
I completely overhauled my character controller.
我彻底改造了我的角色控制器
And part of that meant giving the player some options
这在一定程度上意味着给玩家一些选择
about how the character works:
选择如何使用角色:
like letting you change from holding the button to aim,
比如 允许把长按按钮调整瞄准
to toggling it on and off.
改成一键切换打开或关闭
Or letting the player remap all of the keys and controller buttons.
或是允许玩家重置所有按键和控制器按钮
Or letting the player change the colour of the magnet.
允许玩家改变磁铁的颜色
And this was all well and good for a throwaway test level.
对于一次性测试关卡来说 这一切都很好办
But if I want these options to work across an entire game,
但是如果我想让这些选项在整个游戏中都生效
I’m going to need to find some way to sync these options from level to level,
我需要找到一些方法来同步各个关卡的选项
let the player save and load these options from their hard drive,
让玩家从硬盘里保存和加载这些选项
and provide some kind of UI to let the player set these… settings.
并提供某种用户界面让玩家调整这些设置
And so after a bit of fiddling around, here’s what I came up with:
所以经过一番摆弄之后 这是我想出来的办法:
When you first load the level to the title screen,
当你第一次加载关卡到标题画面时
I spawn in an options manager.
我会生成一个选项管理器
This is an invisible game object with a bunch of scripts
它是一个附带一堆脚本的隐形游戏对象
to track the player’s options
可以跟踪玩家的设置
and save and load those options to the hard drive.
并在硬盘里保存和加载这些选项
And the object is tagged “Don’t Destroy On Load”,
这个对象会被标记为“加载时请勿清除”
which means when the player starts the game,
这意味着当玩家开始游戏时
the title screen is deleted from memory
标题画面会被从内存中删除
and replaced with a level,
并被关卡画面替换
but, the options manager hangs around like a bad fart.
而选项管理器则不会受这个影响
And because it’s still there in memory,
因为它仍旧保留在内存中
the new level can find the options manager
新的关卡就能找到选项管理器
and essentially… ask it questions.
并且基本上……会向它提问
Like the character can say
比如角色会问
“should I have low sensitivity aiming right now?”
“我现在应该用低灵敏度瞄准吗?”
And the magnet can say “what colour am I supposed to be?”
磁铁会问 “我应该是什么颜色?”
And this panel can ask “should I have accessibility symbols on right now?”
这个面板会问 “我现在应该有辅助选项的符号吗?”
What I’ve essentially done here is decouple the metalevel game logic
我在这里所做的基本上是将元级游戏逻辑
from the moment to moment level design.
从即时关卡设计中解耦
Which might seem kind of obvious in retrospect,
事后看来 这似乎是显而易见的
but I definitely didn’t have this during the MVP.
不过在我的MVP里 绝对没有这个
There, every level had its own duplicated version of the code
在MVP系统中 每个关卡都有一份重复的私有代码
for saving and loading progress, transitioning between levels,
来负责保存加载进度和切换关卡
and there was even a duplicated version
甚至在游戏的每关中
of the pause menu in every level in the game.
还有一份重复的暂停菜单
It was wildly inefficient, it made testing levels slow,
这种方式极其低效 拖慢了测试关卡
it added all this extra junk to my hierarchy,
给我的层级系统增加了所有这些额外的垃圾
it made it difficult to change any of these options,
使得更改任何选项都变得十分困难
and it was hard to track stuff between levels.
而且很难在关卡之间跟踪内容
This new system is much, much smarter.
这个新系统要聪明得多
So I decided to create a bunch more of these invisible managers.
所以我决定创建更多这样的隐形管理器
Now, you can send a level name to the transition manager
现在只要给过渡管理器发送一个关卡名称
and it will wipe away the current level and wipe into the new level.
就能抹去当前关卡并载入新关卡
That’s paired nicely with the music manager
这与音乐管理器配合得很好
which takes the non-existent soundtrack
音乐管理器搭载了目前还没有的音轨
and fades out and in with the level load.
并随着关卡加载淡出和淡入
There’s also the HUD manager which draws stuff on top of the screen,
还有在屏幕顶部绘制内容的抬头显示管理器
like these tutorial prompts and these context sensitive button icons
比如这些教程提示和场景触发的按键图标
which, yes, do change if you change your controller.
如果你改变控制器 这些图标就会改变
And I made a UI manager to hold the pause menu and the options menu.
我还创建了个用户界面管理器来保存暂停菜单和选项菜单
Which, yes, is hideously ugly right now.
没错 现在是丑得可怕
I’m just focused on the functionality. I’ll make it pretty in the future.
现在我只注重功能性 将来我会提高它的颜值
Just like sound design, UI design is a future mark problem.
就像声音设计一样 用户界面设计也是一个未来的基本问题
And, yes, I realise that future mark problems
而且 我意识到未来的基本问题
are starting to stack up a bit.
开始有点堆积了
But there was one more manager I wanted to build.
但是我还想要再创建一个管理器
So, back in the MVP,
于是回到MVP里 游戏是从第一关开始
the game moves from level one
游戏是从第一关开始
to level two to level three and so on.
接下来到第二关 第三关 以此类推
And I’m not sure if such a linear progression of levels
我不确定这样线性的关卡推进
is the best for a puzzle game.
是不是最适合解谜游戏
Sure, some puzzle games do have this like Portal and Inside.
当然 有些解谜游戏确实是这样的 比如《传送门》和《Inside》
But others, like Braid, Stephen’s Sausage Roll,
但是另一些 像是《时空幻境》《史蒂芬的香肠卷》
and Baba Is You, have a more open-ended structure.
以及《Baba Is You》则具有更开放的关卡结构
You can skip levels, play puzzles out of order,
你可以跳过关卡 乱序解谜
and come back later to puzzles you skipped in the past.
然后稍后再回来解你之前跳过的谜题
And I kind of like this.
我有点喜欢这样的玩法
I’m not keen on giving the player a big brick wall
我不想仅仅因为玩家被其中某个谜题难住
just because they got stumped on one of the puzzles.
就牢牢框住他们
So I wanted to build a non-linear level structure into my game,
所以我想在游戏中构建一个非线性关卡结构
and here’s how I did it.
以下是我的设计
In each level the goal is to find and collect a key,
每个关卡的目标是找到并收集一把钥匙
and I have a new progression manager
我做了一个新的进度管理器
that has a list of all the keys in the game
它拥有游戏里所有钥匙的列表
and it ticks them off when you find one,
你每找到一个 它都会记录下来
and it saves that data to the hard drive.
并把数据保存到硬盘里
I built a really simple hub level with doors
我建立了一个简单的枢纽关卡
that go between the different puzzles
它有几个通向谜题的门
and a special door at the end
最后有一扇特殊的门
that is only unlocked after the player has a certain number of keys.
只有当玩家收集了一定数量的钥匙后 它才能解锁
A number that I can very easily change
我可以在调整游戏平衡时
as I tweak the balance of the game.
很容易地改变这个数量
And speaking of tweaking and balancing
说到调整和平衡
I wanted to make it really easy on myself
我希望能够基于
to change the order of the levels based on players feedback
玩家对谜题相对难度的反馈
about the relative difficulty of the puzzles.
来轻松地改变关卡的顺序
So the whole system is essentially routed through
所以整个系统实质上是
the level’s file name.
通过关卡文件名来检索的
The levels are named something like 01 Lift 02,
关卡的名称类似于01 Lift 02
with the first two characters denoting which hub the level belongs to,
前两个字符表示关卡属于哪个枢纽
and the last two characters denoting which key is found in that level.
最后两个字符则表示 在该关卡找到的钥匙
And then all of the relevant systems just read the level name
这样所有相关的系统就能通过读取关卡名称
and pull out the strings they need,
并找到所需的字符串
to find out where the level belongs.
来找出关卡所属的位置
And this means I can change the order of the levels
这就意味着 我只需要重命名文件
just by renaming the files, which is super efficient.
就能更改关卡的顺序 这超级高效
And while we’re on this efficiency kick, let’s talk about tools.
当我们聊到效率提升时 也来说一说工具吧
So another thing I found in my MVP was
我在MVP中发现的另一件事就是
that it was really kind of frustrating
构建关卡的过程真的有点令人沮丧
to build and especially iterate on level designs.
特别是迭代关卡设计
Like let me give you an example:
比如 我给你举个例子:
if I want to take this electromagnet and make it a bit shorter
如果我想把这个电磁铁弄短一点
and change it to be red,
并将其改变为红色
I need to resize the area effector,
我需要调整区域效应器的大小
resize the visual for the beam,
调整光束的视觉效果
move the particle system and reduce its lifetime,
移动粒子系统并缩短显示时长
change the particle colours, change the beam’s colour,
修改粒子的颜色 修改光束的颜色
change the sprite’s colour, change the magnet’s layer,
修改精灵图的颜色 修改磁铁的图层
change the buffer zone’s tag,
修改缓冲区的标签
and change the area effector’s collider mask.
再更改区域效应器的碰撞体蒙版
And now imagine doing this for pretty much every mechanic in the game
现在想象一下 只是为了把某个东西向上移动一格
just because you want to move something one tile up
或者你想在开始关卡时把门打开而不是关上
or you want to start the level with a door open rather than closed.
就得对游戏中几乎所有的机制做这些修改
And what I came to realise is that Unity, is a tool for making games,
我开始意识到Unity是一个制作游戏的工具
but it’s not a tool for making my game – because that’s on me.
但它不是用来制作我的游戏的工具——因为我需要亲力亲为
I have to put in place the tools and systems
我需要制作一套
that will allow me to generate content for my specific game.
能让我为自己的特定游戏生成内容的工具和系统
And so with that in mind,
考虑到这一点
the new version of the electromagnetic panel
新版的电磁铁面板
has a simple slider in the inspector for the height,
在检查器中有一个简单的滑块用于高度设置
and as I move this slider up and down
当我上下移动这个滑块时
it’s automatically updating all of those variables I talked about earlier.
它会自动更新我之前谈到的所有变量
Same for these buttons to change it from red to blue, or on to off.
这些按钮也一样 它们负责把它由红变蓝 或是由开到关
Basically, if there’s something in my game that I want to change a lot
基本上 我的游戏里但凡有我想调整的东西
and the process of doing it is just a rote sequence of steps,
而且调整的过程只需要很机械的步骤的话
I might as well build a simple script
我都构建了一个可以
that can do it all in a single button press.
一键完成所有操作的简单脚本
And so I updated more and more of the stuff from my MVP
于是我从我的MVP里更新了越来越多的东西
to be more easy and efficient to use.
使其更容易和有效地使用
Like this moving box: I now use Unity’s Gizmos
比如这个移动的盒子:我用了Unity的Gizmos工具
to show me exactly where the box will move from and to,
向我准确地展示它的运动始末
and the path it will take.
以及它将进行的轨迹方向
I also set up a dedicated window just for my prefab game mechanics
我还为我的预制游戏机制建立了一个专用的窗口
so I can drag and drop them into the scene
这样我就可以把它们直接拖放到场景里
like I’m playing Super Magnet Maker.
就像在玩“超级磁铁制造”一样
Oh, and another thing that annoyed me in the MVP was Unity Events.
哦 还有一件在MVP中让我困扰的事是Unity的事件
Not the events themselves, they are amazing.
我困扰的不是事件本身 它们很棒
They basically work like this:
它们的基本工作原理是:
in, say, the code for this green button,
在这个绿色按钮的代码中
I can say when the button is pressed just “invoke a Unity Event”.
我可以设置按下按钮时就“调用某个Unity事件”
And then, back in the editor,
然后 回到编辑器中
in the inspector I have a really simple field
我在监视器中创建了一个非常简单的信息组
where I can just drag in any object from the scene
我可以从场景中拖入任何对象
and have it run basically any function on it.
并让它能运行基本上任何函数
So, now, when I press the green button
所以现在 当我按下绿色按钮时
it turns off the electromagnetic panel.
就会关掉电磁铁面板
Really powerful stuff for a puzzle game.
对于解密游戏来说 这真的是个很强大的功能
But it’s a bit frustrating
但必须在层级中
that I have to find the relevant thing in the hierarchy.
找到相关的对象 就搞的我很头大了
It would be super amazing if I just had a Photoshop-style pipette
如果能有一个Photoshop式的选取器
to click on the object in the scene.
单击场景中的对象就能选择 那就太棒了
And so I abused my internet fame
所以 我就滥用了下我的网络名气
to get someone much smarter than me
找了个比我聪明得多的大佬
to just build that exact thing I described,
来构建我所描述的那个确切的选取器
and it is amazing, and I use it all the time.
这个工具太棒了 我一直都在使用
There’s a link to the GitHub page for this Unity Asset
这个Unity Asset的GitHub页面的链接
in the description for this video.
已经放在这个视频的简介里了
So now that I’ve built a bunch of tools
那么现在我已经创建了一堆工具
that should hopefully make it easier and more efficient to design puzzles,
希望能让设计谜题变得更容易 更高效
I decided I might as well test it by building a puzzle.
我决定不妨做个谜题来测试它
And, yeah, it was a lot more efficient.
结果确实 效率提高很多
But there were still a few annoyances and bottlenecks to the process,
但还是有几个过程中的麻烦和问题
so I fixed them and tested it again by building another level.
于是我修复了它们 又做了另一个测试关卡
And then another level
然后 又一关
. And another level, before realising something…
再一关 直到我意识到……
I now have a whole fleet of system level managers working in the background.
我现在有一整套系统级管理器在后台运行
I have this whole hub structure built.
我已经构建了一整个枢纽结构
And I’ve made four or five brand new puzzles.
我还做了四五个全新的谜题
Did I just accidentally make a video game? Whoops!
我是不是一不小心又完成了一个游戏?唉!
It’s funny, I genuinely wasn’t planning on making a new demo for my game,
有趣的是 我其实真的没打算为游戏制作新的DEMO
but I’ve got like 90 percent of one on my hard drive now.
但现在我的硬盘里已经有90%的新DEMO
I think it just goes to show how powerful it can be to have efficient tools.
可以见得这些高效工具有多么强大的作用
They can make building the game so fast and easy
它们使得构建游戏变得如此方便快捷
that you can build stuff without even realising it.
你甚至可以在无意识中做出一款成品
So I think it’s worth putting in a little bit of extra effort
所以我认为在过程开始的时候
and a bit of extra pain at the beginning of the process,
投入一点额外的努力和痛苦是值得的
because it will just save you so much time and effort and heartache
因为这将为你在游戏开发的主要部分
for the main part of the game’s development.
节省大量时间 精力和糟心体验
But whatever the case, this is awesome because, again, back in the MVP,
但不管怎样 这都太棒了 因为 再说一遍 回到我的MVP
there was a lot of feedback I needed to address,
我还需要解决很多反馈
stuff that people didn’t really like about the game.
关于这款游戏玩家不太喜欢的部分
Like the character feels incredibly crummy to control,
比如糟糕的角色控制手感
there’s lots of annoying inconsistencies in the visual language,
视觉语言上有许多烦人的矛盾之处
the mix between platforming and puzzles
平台和解谜的组合
had some players confused about how to play;
使一些玩家对于如何玩感到困惑
most of the puzzles fell short of that “aha!” eureka moment;
大多数谜题都没有令人“啊哈!”的顿悟时刻
many of the levels were messy and buggy
很多关卡都显得杂乱 满是BUG
and had you waiting around for cycles to reset;
迫使玩家等待漫长的循环周期来重置
and the game didn’t truly feel like
而且游戏并没有真正围绕着
it was built around this magnet mechanic.
磁铁机制构建的感觉
So this new DEMO, Untitled Magnet Game version 2.0,
所以这个新的游戏小样 Untitled Magnet Game 2.0版
is a chance for me to fix all of those problems
给了我一个解决所有问题的机会
and see what people think of the game now.
也让我期待人们现在对这款游戏的看法
And so I would love it if you could pop over to itch.io
如果你到itch.io上玩这个全新的惊喜小样
and play this brand new… surprise demo drop.
我将十分感谢
Yes, I had to do it.
是的 我决定发布这款游戏
It’s available to everyone, not just patrons.
它可供所有人下载 而不仅是我的观众
It works on PC and Mac,
它适用于PC和Mac
you can play it with keyboard and mouse,
你可以用键盘和鼠标玩
or with various different controllers.
或是使用各种手柄
Please give it a go
请试一试
and drop me some feedback either in the comments on this video or over on Itch.io.
并在视频评论里或在Itch.io上 给我一些反馈
And then I will come back discuss the new round of feedback
然后 我会回来讨论新的反馈
and see where I should take the game next.
看看我接下来应该如何推进游戏
Thank you so much for watching,
感谢您的收看
have fun with the game, and I’ll talk to you soon…
玩得开心 我很快就会回来……
Oh, before I go, the GMTK Game Jam is back for 2022.
哦 在结束之前 GMTK Game Jam 2022 回来了
It starts on July 15th,
它将在7月15号开始
so while you’re over on Itch.io
因此 如果你注册了Itch.io
just sign up for the Game Jam there as well.
不妨也在那里报名Game Jam吧
I’ll see you soon.
那么到时见

发表评论

译制信息
视频概述

在这期视频里,Mark不得不面对游戏开发过程中各种让人头疼的问题,那么最终效果会怎样呢?一起来看看吧

听录译者

收集自网络

翻译译者

linkin

审核员

审核员LR

视频来源

https://www.youtube.com/watch?v=iAxSqi5LBDM

相关推荐