Tim Sweeney explains why Unreal Engine 4 has turned all the way to C + +

Source: Internet
Author: User

Translation:

The former three-generation Unreal engine contains a script sandbox language--unrealscript, which provides a simple way to gameplay programming to prevent users from using complex C + + languages.

For novice programmers, scripting is a good way to do it. But eventually the script became an obstacle to engine development. Unreal Engine is constantly developing, we are also constantly using, practice. Until 2011, we decided to use a pure C + + architecture, for the following reasons:

1. As an engine, as the community continues to grow, the need to export native C + + functionality as a scripting feature is growing, and if a full sandbox script is to be made, the whole engine will eventually become complex and huge.

2. With further expansion of the scripting interface (to be continued here)

3. Developers want to play the advantages of the original C + + features, ultimately leading them in the scripting World and the code world cut to cut, waste a lot of time, it is hell.

4. Developers need overall control of code behavior, but soon found that the script debugging tools and C + + debugging tools are independent and incompatible. They found that if the C + + program was not tracked, it was sometimes meaningless to find the script error, and vice versa.

For these reasons, epic finally decided to use pure C + +. This brings a lot of convenience, UnrealEngine4, as a unified, debug engine that frees developers from the hell of C + + scripting, and allows programmers to learn, modify, and expand. This also brings a benefit that increases the efficiency of the game and makes it easy to integrate other C + + middleware.

Not that C + + is an ideal programming language for games. It has a lot of complexity and danger than unrealscript,c#,javascript. But in a different way, C + + is more powerful.

By carefully using C + + complex places, you will feel almost unlimited when writing game programs. You can debug the entire underlying code, modify them, and even interact with the operating system layer, advanced third-party libraries.

Original:

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

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

1.As an engine and its community grows, there are increasing pressure to expose more of the the IT native C + + features to the Scripting environment. What starts off 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 interoperab Ility or "interop" layer where C + + and script code communicate through a multi-language interface for calling functions an d Marshaling Data. Interop becomes very tricky for advanced data types such as containers where standard scripting-language idioms differ GRE Atly 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, script debugging tools and C + + debugging Tools is 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, which led to Epic's move to pure C + +. And the benefits is Numerous:ue4 is a unified and Fully-debuggable code base, freed from Interop Hell and totally open t O Programmers to study, modify, and extend. There is side-benefits, too, such as increased performance in gameplay code, and ease of integrating other middleware WRI Tten 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's another the saying that it's more powerful.

By making peace with complexity and writing code in C + +, there is absolutely no limit to what 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.

Tim Sweeney explains why Unreal Engine 4 has turned all the way to C + +

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.