Unity3d use of experience to summarize the advantages of

Source: Internet
Author: User
Tags inheritance lua object model

When the engine was developed in 09 with other small partners, Unity3d was first exposed. At the time, this component-based design structure was not understood. Feel that the split is too detailed, while affecting efficiency.

Today, Unity3d has become the preferred 3D engine for many teams. And with the release of Unity3d 4.3, native 2D support has also opened the eyes of the NPC. Although Unity3d's native 2D functionality still has a long way to go, it doesn't stop it from dominating the present.

In 2011 years, after the company's engine project stopped, my gaze turned to u3d, and after several struggles, I finally got a new understanding of the component-based object model. And now, this model has become my most respected model. Because it solves my entanglement in designing the engine object. And these entanglements, I was in the previous engine development, has been unable to gracefully solve.

First of all, let's talk about the benefits of u3d. May not be summed up well enough, if there is a shortage of places, it means that I did not experience.

Statement: In order not to disturb everyone's yaxing, so, here only to say its advantages, want to see the shortcomings of friends, please see this article of the sister article Unity3d use experience to summarize the shortcomings of the

One, customizable IDE environment

U3d the design of all in one, I've seen it in a code called the Divine Curse. Set all editors in all. Although the God-cursed editor is not free to expand, it is easy to use because it is the engine inside the company.  For example, when you suddenly want to edit a model's material in the scene, select the model, right-click, and pop up the material editor. U3d's component-like approach will make this relationship more compact. You can't even feel yourself using a material editor. You will feel that you are manipulating the model itself. Its material, its collider, its object structure, and so on.

Recall the beginning of the game industry, every day gnawing code. I thought the code was everything, and all the code that thought it was Bull X couldn't help reading. And over time, especially after the baptism of the project. Suddenly find out how important the editor is. On the first page of my tour, we made the animation editor, Scene editor, two weeks before starting. And it turns out that because these two humble editors make it easier to work behind us.

Therefore, a good engine must first have a fully functional editor.

Second, mono-based development scripts

C + + is undoubtedly the favorite of the graphics world, and no one wants to replace it with another language. Even the u3d is the same. However, the early use of the engine, written in C + +, was taken for granted as the development of the upper logic. There are also some, pure script-based patterns. Like Python,lua. The advantage of scripting is that lower coding costs (after careful study, I found that this is due to scripting language mentality and writing C + + mentality.) When writing C + +, always think of the code reuse, and in the script, a lot of time will think, this script is to serve this object, then I will follow the planning requirements to write it. I think this is also a lot of time, the meaning of scripting language exists.  Especially in the early engines, scripts are used to handle some critical event responses). And the well-known unreal engine and a torque with a name that has not been transferred, the whole set of development language. I think their purpose is to enable people to program in a more secure way, C + + carelessly, it will bring memory and efficiency problems.  The cost of its use, the cost of personnel is actually higher than other languages. Mono C # Js,boo's appearance, once again let everyone's eyes bright, originally, the engine can be this whole.

The bridging of Mono enables an efficient C + + graphics engine to be combined with a memory-safe language with GC. Not only reduces the security risks, but also makes it easier for you to write cross-platform code. At the same time, the reflection mechanism of this kind of language is more suitable for editor. Rather than some of the previous DIY languages and small languages like Lua, mono enables scripting to be debug, not simply print out.

Here, incidentally, the difference between the three languages

C # This is the most used language I've ever seen in a large project, and it's my favorite language. Because it is similar to C + +, it also has strict typing and grammar checking.

JS in helping some friends small things, the use of this language, because mono comes with the hint function, write up or quite handy. But it always gives me a feeling that I can't feel my head. and u3d to the JS, not strict JS, some grammar is not supported, and some grammar is very special.

BOO is completely unused and seems to have few people to use.

Third, component-based object systems

This is one of my favorite systems, I also use Irrlicht engine cottage over, the process of cottage, almost read its component reference manual, so I have a new understanding of the U3d engine component system. At the same time, the company's independent research and development of the engine, is also such a thought. Whether I am at work or amateur, I am affected by the component system. Slowly, like this kind of object pattern.

Prior to doing an RTS game project, reference to the famous Open source project 0.A.D code. It was just to find a plan for the Los and multi-unit collaborative pathfinding. But when it comes to its code, it finds its entire system, which is based on the component type. Once again, the component style has a good impression. And after careful deliberation. Back to the framework of the game where I have been insisting on the subsystem partitioning method. When I can't help but sigh, originally, oneself also has been in the component type. Only, my component, is the manager way, Mananger internal to the corresponding entity management,. For example, the backpack system is only responsible for player backpack data, backpack use, backpack-related functions.  Whether it is data storage or communication with the front-end, it is the backpack system itself in charge, the other modules do not need interference at all.  The component system in the U3D, the granularity is more careful .... This is for early entity systems like Ogre. It is simply that the object can be made up of sub-objects, which can be said to be a qualitative change.

The early engine, which is basically a succession of priority design, more time to consider the convenience of coding, and the direction of the engine is targeted. And when faced with some complicated situation, the code of inheritance is very troublesome. And, for a language like java,c#, it does not provide multiple inheritance capabilities. Therefore, the inherited programming, in the face of more and more extensive game demand. Seem powerless. Component is an aggregation-first encoding method, and its reusability and scalability are far greater than inheritance. The only thing that makes some C + + programmers uncomfortable is the overhead of too many variables and virtual function calls. But these, in the present, are not problems. The impact on the public's pace has long been not the cost of the language itself. More, is how to make our high-efficiency, high-quality to complete a game. So the component pattern has become inevitable. From the new version of the UE4 transformation, as well as the g3d, a foreign open-source Godot engine, we can see that we have a deep affection and acceptance of the module model.

Iv. What you see is what you receive

This can be said to be a favorite feature of many people, which is also the G3d group, asked the most of the characteristics of people, Zooey asked, g3d can be like u3d in the editor to preview the game effect AH.

U3d, in addition to being edited, runs as soon as possible, and can also be edited during the run to see the effect. Of course, the data that edits the object during the run will expire after it is stopped. (Note that modifications to file attributes are not invalidated.)

Five, code-driven development model

This mode allows us to quickly build a prototype. For Monobehaviour in u3d, it acts as a way of driving its target object. Therefore, you can assign the various abilities of your objects to different script components, and then hook them up according to the needs of the objects.

Six, multi-platform release

The platform supported by U3D is undoubtedly the most popular platform now. Meet the needs of most projects. Early engines, mostly PC and console. Support for WINDOWS,XBOX,PS2 is already very good. U3d's convenient multi-platform publishing feature also makes it one of the reasons for today's most cost-effective engines.

There are also many companies that are developing their own engines or modifying their previous PC engines to multiple platforms (ios+android majority). But this is not the u3d pace.

Seven, a good ecological circle

When I was using the company engine, I found that if I had a problem, I could only ask the company's old employees, or find another engine team for help. and u3d this biosphere, not two days a day can form. GOOGLE, Baidu, various forums, can easily find the problem that they want to solve. And for some experience problems, there are a lot of people to summarize. This allows the latter to quickly get started with the engine.

The emergence of Assetstore not only makes U3d's ecological circle more stable, but also offers many opportunities. You can make plug-in to sell online, earn some benefits, you can also buy other people's plug-in, as a use or reference. Sometimes, buying a few plugins can get you out of your current predicament quickly. One is to solve the problem of progress, one is to solve the problem of ideas. This is not the other engine that was previously available.

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.