Tim Sweeney解释为何Unreal Engine 4全面转向C++

翻译:

前三代Unreal引擎都包含了一个脚本沙盒语言——UnrealScript,他提供了一个简单的GamePlay编程方式,从而避免用户使用复杂的c++语言。

对于新手程序员们,使用脚本编程的方式是好的。但是最终脚本成了引擎发展的阻碍。Unreal引擎在不断发展,我们也在不断的使用,实践。直到2011年,我们决定使用纯C++架构,这样做原因大致如下:

1.作为一个引擎,随着社区不断的成长,将原生C++功能导出为脚本功能的需求越来越大,如果要做出一个完整的沙盒功能的脚本,最终导致整个引擎变得很复杂,庞大。

2.随着脚本接口的进一步扩展,(此处待续)

3.开发者希望发挥原始的C++特性的优势,最终导致他们在脚本世界和代码世界切来切去,浪费了大量的时间,简直是地狱。

4.开发者需要整体的驾驭代码行为,但是很快发现,脚本调试工具和C++调试工具是独立的和不兼容的。他们发现,如果不跟踪C++程序,发现脚本的错误有时没有意义,反之也是这样。

正是这些原因,Epic最终决定使用纯C++。这样的话带来很多方便的地方,UnrealEngine4作为一个统一的可调试的引擎,可以让开发者从C++与脚本交互的地狱中解脱出来,并且让程序员可以学习,修改和扩展。这样还带来一个好处,让游戏的效率提高,并且可以容易的集成其他c++中间件。

并不是说C++是一个很理想的游戏编程语言。比起UnrealScript,C#,JavaScript,它有很多的复杂性,危险性。但反过来换一种方式说,C++更加强大。

通过小心使用c++复杂的地方,你的编写游戏程序时将感觉几乎没有限制。你可以调试整个底层代码,修改他们,甚至和操作系统层,高级第三方库进行打交道。



原文:

The first three generations of the Unreal Engine included a sandboxed scripting language, UnrealScript, which provided a simple interface for gameplay programming that was shielded from the complexity of the C++ engine.

The scripting approach is very welcoming to new programmers, but eventually it breaks down and becomes an obstacle to innovation and shipping. We experienced this over time as the Unreal Engine grew until finally, in 2011, we moved to a pure C++ architecture. The causative factors were both pervasive and general:

1.As an engine and its community grows, there is increasing pressure to expose more of the its native C++ features to the scripting environment. What starts out as a sandbox full of toys eventually grows into a desert of complexity and duplication.

2.As the script interface expands, there is a seemingly exponential increase in the cost and complexity of its interoperability or "interop" layer where C++ and script code communicate through a multi-language interface for calling functions and marshaling data. Interop becomes very tricky for advanced data types such as containers where standard scripting-language idioms differ greatly in representation and semantics from their templated C++ counterparts.

3.Developers seeking to take advantage of the engine‘s native C++ features end up dividing their code unnaturally between the script world and the C++ world, with significant development time lost in this Interop Hell.

4.Developers need to look at program behavior holistically, but quickly find that script debugging tools and C++ debugging tools are separate and incompatible. Seeing where script code had gone wrong is of little value if you can‘t trace the C++ that code led to it, and vice-versa.

It is these reasons, ultimately, that led to Epic‘s move to pure C++. And the benefits are numerous: UE4 is a unified and fully-debuggable code base, freed from Interop Hell and totally open to programmers to study, modify, and extend. There are side-benefits, too, such as increased performance in gameplay code, and ease of integrating other middleware written in C++.

Building Unreal Engine 4 as a unified C++ codebase has been very freeing, giving engine and gameplay programmers enormous flexibility to write code without unnecessary interop barriers.

This isn‘t to say that C++ is the ideal language for simple gameplay code. It is more complex and more dangerous than UnrealScript, C#, and JavaScript. But that is another way of saying that it‘s more powerful.

By making peace with complexity and writing code in C++, there is absolutely no limit to what you can accomplish, whether it involves debugging your entire codebase in-context, interfacing to low-level engine systems, modifying them, or talking to the operating system or advanced third-party libraries.

时间: 2024-07-29 23:53:06

Tim Sweeney解释为何Unreal Engine 4全面转向C++的相关文章

【Tim Sweeney】Why C++ for Unreal 4?

The first three generations of the Unreal Engine included a sandboxed scripting language, UnrealScript, which provided a simple interface for gameplay programming that was shielded from the complexity of the C++ engine.The scripting approach is very

从Unreal Engine 3到Unreal Engine 4

Unreal Engine 4发布好长好长时间了,直到最近才有时间仔细去看一下. TimSweeney老大一句话"IF YOU LOVE SOMETHING, SET IT FREE",原来需要几十万授权金才能拿到的东西,就从$19,变成免费了,而且开源.作为一个国际顶尖的引擎,能走出这一步,对我等普通开发者真是福音啊.如此的牛X,再加上开源,相信Unreal Engine 4会火起来的,你看看最近E3上的产品展示也能感觉到.不过,Unreal的定位毕竟是"国际顶尖"

UNREAL ENGINE 4.12 正式发布!下载地址

UNREAL ENGINE 4.12 正式发布! 下载地址:https://www.unrealengine.com/ Alexander Paschall 在 June 1, 2016 |功能新闻社区 Share on Facebook Share on Twitter Share on Google+ Share on LinkedIn 此版本内含虚幻引擎 4 的数百个更新,以及 GitHub 虚幻引擎开发者社区提交的 106 项改良!特此对虚幻引擎 4.12 版本的贡献者们表达诚挚谢意:

【UNREAL ENGINE 游戏开发】开篇之UE4的BLUEPRINT(蓝图)与C++(新童鞋必看)

本站文章均为 李华明Himi 原创,转载务必在明显处注明: 转载自[黑米GameDev街区] 原文链接: http://www.himigame.com/unreal-engine-game/2164.html 首先Himi在这里解释下,为什么还是开篇- 原因主要有两点: 考虑到要写也要写点干货不是么?!但是由于官方文档写的真的够详细了,对于提到的基础知识我真的不想再赘述,因此希望各位新童鞋一定要先跟着文档动手过一遍!!!很重要!!!!!!!!!!! 另一方面,本想拿着UE4写点小项目练手,然后

【UNREAL ENGINE 游戏开发】开篇之为什么现在就要抱紧UE的大腿!(另附学习资料/交流群)

本站文章均为 李华明Himi 原创,转载务必在明显处注明: 转载自[黑米GameDev街区] 原文链接: http://www.himigame.com/unreal-engine-game/2129.html 自从开始自学Unreal Engine后,身边的朋友.群里的童鞋们都在问:Himi,为什么要转UE了?UE到底好在哪里?与U3D比优势到底在哪里?等各种问题.而且解释过的问题,等会还要再解释给没看到的童鞋们 - 所以Himi特意来写篇博文,统一解释UE对于我为什么会有这么大的诱惑力! 这

《精通Unreal Engine 3 卷1:3D游戏关卡设计》

内容简介: <精通Unreal Engine 3卷1:3D游戏关卡设计基础篇>是您认识并掌握最新最热门的游戏引擎(虚幻引擎3)的首选指南,无论您是初次接触mod制作的爱好者,还是职业的关卡设计人员,都能从本书中受益.本书中包含了读者想要学习的所有技能,这些技能可以帮助读者创建出在游戏机和复读机上运行的极其出色的新内容和游戏. <精通UnrealEngine3卷1:3D游戏关卡设计基础篇>的作者不仅仅是世界上最优秀的虚幻引擎游戏开发培训人员,他们甚至已经发布了<虚幻竞技场3:典

Unreal Engine 4 动态切割模型实现

Unreal Engine 4 动态切割模型实现 <合金装备:复仇>里面,有一个很有趣的设定,游戏里大部分的场景和物件都可以用主角的刀动态切割. UE4中的ProceduralMeshComponent这个组件可以很容易的就实现这种功能,下面介绍下实现的方法. 准备模型 首先我们准备一个模型. 我做了一个简单的圆柱体,用来测试.注意需要切割的地方,为了保证细节,多放点顶点. 为了能够动态切割,我们要勾选这个模型的Allow CPUAccess选项. 新建蓝图 新建一个Actor蓝图,为它添加两

游戏音频技术备忘 (四) Wwise Unreal Engine 集成代码浅析 (一)

在Engine\Plugins\Wwise\Source下为主要Wwise相关代码,AkAudio文件夹下为运行时相关代码,AudiokineticTools下为编辑器工具相关代码,AudiokineticTools.Build.cs为用于UnrealBuildTool的相应代码,与音频直接相关位于 AkAudio文件夹下. Unreal Engine提供若干宏来实现GC.序列化.网络等需求,譬如声明为UPROPERTY()的变量与UFUNCTION()的函数即可由引擎实现变量复制和远端调用 ,

游戏音频技术备忘 (三) 集成Wwise到Unreal Engine

当前受众较广的商业游戏引擎有 Unreal Engine.Unity.cocos2d-x等,在音频领域的第三方中间件则有Wwise.FMOD.Criware等,言多且烦,我们首先集成Wwise到 Unreal Engine 中去. 在https://github.com/EpicGames/UnrealEngine上可以抓取到Unreal Engine的源代码,前提条件是需要有一个 organization 加入EpicGames 的github账号,这就需要在https://www.unrea