Unity online game development survival guide-steam City

Source: Internet
Author: User
Tags using git
Posted by Amy on 2013.03.07

Text/Wang Nan (Mengjia online game producer)

Some time ago, the discussion about whether unity is suitable for domestic mobile game/online game entrepreneurial teams was very popular. This article talks about the development process of steam city and whether the domestic online game team should choose the unity engine, and how to solve the main problems encountered when using unity to develop online games.

Steam city in Xiamen Mengjia

Steam City is the first work of Xiamen Mengjia network. It uses the steam pengkefeng 3D real-time combat MMORPG browser game produced by the Unity engine. The game has a fantastic industrial age, rich racial, professional, and skill systems, high-quality pictures and special effects that are not inferior to the client games, and a variety of copy challenges and PVP activities; finally, all of these users can enjoy the short download time directly in the browser. Steam city is listed by famous media including Forbes, massively, and Zam as one of the most anticipated MMORPG games in 2013. It has already signed contracts with several overseas publishers, it covers all English-speaking countries, Eastern Europe, Turkey and the Middle East. The Turkish version was officially started for public testing on July 15, March 1 (Beijing time.

Official Chinese website: www.mengjiagames.com

The reason why the Mengjia team chose the unity engine was similar to that of most teams. It quickly developed prototypes, a large number of existing built-in functions and middleware, and supported displaying high-quality 3D Game images in browsers. During several years of development, the team gradually realized that using unity to develop MMO web games needed to overcome too many problems and traps. Fortunately, we finally overcome most of the problems. The city of steam is about to begin public beta outside China. Next we will discuss in depth what technical issues should be solved and how to build a team to complete a high-quality unity web game MMO.

Please note that we will not discuss how to use unity to create standalone games, because unity standalone games or mobile games with social networking functions have too many success examples, many developers also show through their own experience that small teams use unity to create lightweight standalone or social games without too much obstacle (Game list can view the official website: http://unity3d.com/gallery/made-with-unity/game-list), below we are still with multiple people online, the background and MMORPG with massive data processing are required as examples. Although mengmeng has been developing browser-based games until now, many of these technical topics are also applicable to the multi-Staff game project.

Technology from traditional browser games to Next Generation

Although unity has been around for more than seven years, it has maintained a relatively advanced design concept since its birth, including its primary selling point: provides developers with browser-based high-quality 3D Game solutions. Unity features fast prototyping for independent developers and low-cost cross-platform release. In recent years, it has integrated more high-end commercial middleware and next-generation rendering technologies. Using unity can now develop games with almost the same quality as those developed using the next generation engines Unreal Engine and cryengine. Unity is also selected by more and more AAA studios to develop cross-platform host games.

This means that unity is very powerful. That's right, but it doesn't mean that the team chooses unity for granted. A major feature of commercial engines is compatibility. They must be suitable for a variety of different project and team needs. As a next generation engine, they also include a large number of advanced technologies for image, animation, and resource management. For the startup team, although unity has gained a lot of functions that can quickly take effect, how can we choose between these functions and the degree of understanding and mining of engine technology, will have a decisive impact on the fate of the project.

Although unity has always been known for its ease of use, rapid prototype, and rapid integration of multiple middleware Products, as the project scale and complexity increase, soon, the development team will enter a vacuum area that cannot be covered by various online standalone game tutorials, and the domestic online game technology sharing environment is relatively weak. At this time, in some key technical difficulties, the startup team will have a lot of trouble. From quick prototyping to solving technical difficulties in large-scale projects, it is usually a dangerous transition that prevents many teams from correctly estimating costs. This is also the reason why many projects using unity do not use self-developed engines or older engines. Self-developed engines must develop their own functions, and the old engine functions are relatively limited. Therefore, plans for content and function scale are generally not too arrogant; the engine like unity, including official and Community propaganda, gives people a free lunch that is readily available everywhere. Instead, it will make the team's plans more radical and lack of understanding of difficulties.

In the following article, we will analyze these risks and solutions one by one, hoping to provide warnings to experienced teams and prepare ideas for solving problems in advance.

Content Scale and Version Control

The developer's experience in different types and scale of projects has largely created a view on the polarization of "whether unity is suitable for mobile or web games entrepreneurial teams. Single-host game developers, such as Temple Run and undead killer games, and single-host games such as CSR racing with multiplayer combat modes, even if the team is very small and uses unity development, there will be no major problems. These standalone games are very suitable for playing the advantages of Unity games that are quickly formed, and functions such as inner purchase and social networking can be quickly implemented using ready-made middleware.

When using unity to create online games with massive amounts of content, the team encountered the first problem: they could not put all the game content into a unity project. On the one hand, after the number of resource files reaches a certain level, every time you start the project import process, you can make a pot of tea. Dozens of other teams share a project, there are also great risks in terms of version control and data security. Any operation error may paralyze the entire project; at last, developers with different divisions of labor have to deal with project data and workflow differences. Sharing the same project will greatly reduce production efficiency.

Steam city uses many unity projects to provide customized data scopes, tools, and processes for different departments and groups. 3D role art projects only use role data (fbx-> prefab) and related preview and packaging tools. Scene art uses different projects to manage different scenarios; client programmers use major client projects. After their code is run, they can read the data uploaded by other developers to the server to run the game. Most developers can use the client that compiles executable files to test the resources and design data uploaded to the test server at any time, this not only ensures that everyone can work in their own fields most efficiently, but also ensures that the content they produce can be tested in the game version at any time.

How can we implement Version Control for so many projects? Our solution is to use gitlab as a unified management platform and each project as a separate git repository (repository ). The biggest advantage of using git is the version management of the client project, where multiple programmers submit code at any time, using git allows them to manage the test code and stable code through different branches. We use the master branch as a stable version to merge the individual test branches submitted and tested by each programmer. The entire team uses the executable client to compile and create with the master branch, it ensures the speed of new function development and the stability of the main version.

Another advantage is the use of submodule. Through the submodule function of git, we can share a core underlying code and some tool code in different projects, in this way, game engines and tools are not updated for each project. As the most advanced distributed version control system, git is extremely difficult to master. The domestic online game team does not have to use git as a version control system even for the Program Department. Mengjia ensures that the entire team uses Git as the daily version control system. Despite the high efforts, but return is definitely worth something.

Data processing and tool development

In recent discussions, many people think that one of the shortcomings of unity is that code-driven engines cannot handle large volumes of data, this impression may be related to the official and community's vigorous promotion and dependency on the monobehavior class that is super convenient to run and can be put in any job. In fact, in addition to monobehavior in unity, there are also custom classes using. Net standards, which can be used to flexibly unify the Data Type scriptableobject, as well as a variety of editor scripts and Data Processing interfaces that you can't think. In addition to monobehavior, all other data processing methods require developers to go to the unity official forum and the extensive programming Q & A site such as stackoverflow for in-depth data mining. Through searching on the official forum, we can find a lot of discussions on online games using Unity's large data volume. However, such an engine has not yet formed a large-scale knowledge sharing community in China, some Chinese unity forums that have been around for a long time also lack discussion about online game projects, so the impression is that unity is not good at this.

In fact, unity processes various data types (XML, JSON, SQL) with ready-made interfaces (Open Source Code provided and shared by users ), the "steam City" planning team can easily convert the Data configuration in Excel format into XML and then import unity through the editor script. At last, the client only needs to read and process the imported scriptableobject, and some frequently changed data can be directly read at runtime using the XML format, reducing the frequency of updating the client.

When talking about the editor script used for data processing, we must discuss the issue of tool chain development. For any large project, development tools are crucial. Unity features excellent scalability in the editor itself. Therefore, the tool chain we use includes two parts: Editor scripts and external tools, it is used to process the data required by the client and server respectively. For example, the task logic and dialog editor directly edit the database, so we use the external editing tool created by VC. All tools, including checkpoints, resource import, texture merge, and NPC role packaging, to process resource data used by unity are made using unity scripts, you can use menu commands to quickly complete resource pipeline operations and editing.

An online game with a large amount of data needs to invest a lot in tool development and maintenance. With steam city, the efficiency of other development and resource production departments has been significantly improved. In addition, by continuously improving tool availability and adding a large number of pre-checks on user operations, data errors caused by Operation errors can be effectively reduced, improving the stability of the game version.

Prototype fragmentation and integrated testing environment

As mentioned above, the monobehavior class that can drive everything in Unity provides great convenience for prototype development. However, as an online game project, all functions and resources must be tested in the actual online game running environment. How can we balance prototype development and real-world networking testing in the Unity online games project? The prototype of basic functions in the early stage of the project, including animation systems, image rendering, and role replacement, can be directly created as a single-host prototype. Use the script to implement the basic functions, add the editor script and GUI script to add supporting tools for the test, and then hand over to the resource production department to add resources in the game.

Because the underground city, task, and combat systems involve a lot of communication with the server, you must use a unit test file configuration that supports the simplest client <-> server architecture if you need to test. The archive is the scriptableobject that defines all the test content data (or where to find the data. Includes the account, role information, test scenario, task or skill configuration you use to test. In steam City, where the main city and the underground city are the game content carriers, we have also created a large number of test environments using underground city or main city scenarios as tasks and new function production. The test environment is prepared by art or planning, then handed over to the Program Department for code testing, and then handed over to QA for testing the just-completed function.

The powerful prototype production capability of unity is mainly reflected in the initial stage of the project. Once the client server architecture is formed, you can run the game in a stable server environment, the development team should focus more on how to quickly add and test new content on the actual server. Steam city has three groups of test servers used to test code, resources, and web interfaces. In addition, for task planners and level designers who need to frequently update and adjust data, they will use servers built on personal computers to prevent data updates from interfering with others' tests.

Dynamic download and read

For web games, if you cannot quickly start or minimize the download wait time, the advantages over client games do not exist. All the art resources in steam city are split into very small parts, so that users can dynamically combine as needed when running the game once they download it, this greatly reduces the repeated download rate of resources. During the creation of the underground city, the tool will be used for serilization. During the game, each underground city only needs to download an XML form, then, the desired parts are automatically searched for from the "resource parts" that the user has downloaded and dynamically assembled. Users who have experienced steam city can find that the reading of any underground city will not exceed several seconds.

Next, let's talk about the use of asset bundle, a major signboard of Unity web games. Asset bundle is a resource package that can be downloaded by user stream. It can contain files in any unity project. To achieve dynamic download, most resources in the game must be packaged into asset bundle for use. In the development process of steam city, we have created a packaging tool in the Unity editor for most resource producers, you only need to select the corresponding menu command to automatically package and upload it to the test server. In future projects, we hope to adopt resource. by combining load () and asset bundle, the client can read the original resource files separately to facilitate debugging, after the test is passed, you can switch to asset bundle to ensure that the dynamic download of the game runs normally. There are still a lot of creative usage of asset bundle. You can refer to the related lectures on unite2012 on the official website.

Technical-oriented team building

As mentioned above, the huge increase in the project scale and complexity of unity from standalone to online games can be said that for most teams in China, using unity to create online games poses certain risks and challenges. To put it simply, for stand-alone games, Unity does have a lot of "free value-added" options to quickly build projects and improve product functions, but at the level of online games or larger projects, if there is no high requirement on the quality of the project, and there is no good team technical atmosphere and construction ideas, the free reward and paid technical construction cost of unity are actually not worth the candle.

If you read this article and are still steadfast in using unity, you can look at the following suggestions on how to build the applicable Technical Team of Unity.

However, as an online game project, all functions and resources must be tested in the actual online game running environment. How can we balance prototype development and real-world networking testing in the Unity online games project? The prototype of basic functions in the early stage of the project, including animation systems, image rendering, and role replacement, can be directly created as a single-host prototype. Use the script to implement the basic functions, add the editor script and GUI script to add supporting tools for the test, and then hand over to the resource production department to add resources in the game.

First, it is necessary for the team project owner and technical backbone to focus on the information officially released by unity and Community Technology hot discussions. For example, since unity4, you can use dynamic fonts and shadows on mobile games. These messages were published before and after the Unite last summer, A team that has been paying attention to new unity technologies can plan features for the project in advance. In addition, a large number of valuable official and developer lectures on the Unite can also make up for blank areas not covered in many official tutorials and manuals, this is exactly what the online gaming team in China urgently needs (such as asset bundle usage lectures and network basic lectures ). Another very important knowledge base is unity's official forum (http://forum.unity3d.com) and Q & A community (http://answers.unity3d.com), both community sites by official technicians and active

Unity users provide content and maintenance. With Google search, you can find answers to any technical difficulties on these community websites, there will also be various practical case solutions (because the person who asks questions may have the same problems as you ). Of course, the use of these official communities must have good English reading ability, which requires the quality of the technical team. The domestic unity community and information site is also doing better, which like the unity holy code (http://game.ceeger.com/forum/) and unity tutorial manual series (http://www.unitymanual.com/) is a good resource entry, we recommend that you use these Chinese websites as an index to extend your knowledge acquisition channels to foreign websites.

Second, the Unity project should form a regular cycle from prototype code to structured refactoring. Unity has a fast prototype and many ready-made solutions. In the case of a tight development cycle, developers can easily add quickly completed functions, and finally make the project structure bloated, when the content is extended to a certain extent, the bottleneck of adding new functions will be encountered. That is to say, if there is no periodic reconstruction, the cost of adding new functions or adjusting the original functions after the project functions are extended to a certain extent will multiply. Too frequent refactoring will affect the project progress. To grasp this degree, we should carefully arrange it according to the team structure.

Thirdly, large unity projects are very suitable for planning a complete tool chain from the early stage. Different tools are customized based on the skills and usage habits of Different developers. For individual developers, unity has a large number of middleware to meet the needs of users of different technical levels. The online game team can also use the same idea To improve efficiency. We should try to avoid the use of Unity only by programmers. Art and resource production are limited to the production environment of other external tools. In addition, the function expansion and improvement of the tool chain is a long-term dynamic process. It is normal to change the tool requirements according to the status of the project at different stages. It is recommended that the team arrange enough manual development tools from the very beginning and treat tool maintenance and requirement collection as part of the daily workflow.

After4.0Future features

Some suggestions from the applicable Technical Team of Unity.

However, as an online game project, all functions and resources must be tested in the actual online game running environment. How can we balance prototype development and real-world networking testing in the Unity online games project? The prototype of basic functions in the early stage of the project, including animation systems, image rendering, and role replacement, can be directly created as a single-host prototype. Use the script to implement the basic functions, add the editor script and GUI script to add supporting tools for the test, and then hand over to the resource production department to add resources in the game.

I have discussed some experiences and suggestions before. Finally, I will talk about the functions that developers of Mengjia are waiting for after unity4.0. We hope to provide it to other developers as a reference for technical evaluation. We also hope that unity China will be able to see and help improve it.

First, unity4 began to fully enter the era of mecanim using retargetable (redirection) animation technology and graphic animation state machine. Retargetable animation is a huge boon to the gaming industry. It can be used to create a set of animations for different skeleton and skin models, which is incredibly attractive for project production. However, this feature cannot be used for dynamic loading of browser games so far, because animations referenced by clip do not support any dynamic reading, it can be said that this is the biggest obstacle to the full upgrade of the mecanim animation System for web games. In the era of unity3.x, steam city has developed a custom script FSM (Finite State Machine) as an animation control system, although we have been able to use mecanim's avatar in unity4 to run the animation redirection in the local prototype, the animation system has not been officially changed in the game since it cannot be dynamically read and loaded, sorry.

Second, unity4 said that the New GUI system will jump the ticket indefinitely. GUI development is a great challenge and workload for any project, the GUI of steam city uses the built-in GUI system of unity and a self-developed design tool. High efficiency has been achieved in GUI Design and image production, but the amount of code modification is too large in the era of GUI function adjustment. Although many people have switched to a third-party middleware solution after the official New GUI system jumps, as a tool development team with high requirements for project scalability, you still want to get the official solution for customization, rather than relying on a third-party plug-in that may stop maintenance at any time. As unity4.0 is currently pending in the GUI system, we are also forced to experience a halt in the optimization of the supporting GUI system. I hope this system will be settled!

Third, the timeline feature never comes to an end, and worse, Unity does not seem to have maintained its previous animation view. The complete new animation system mecanim is added to unity4. However, for some simple ui or special effect animations, developers often hope to adjust and make the animation quickly in unity. The efficiency of the animation view decreases in unity4, And the animation curve of the Child object is displayed in a strange way. However, timeline, which has more functions, has not seen any updates since its debut at unite2012. Mecanim is a professional system dedicated to processing skeleton animation, motion capturing, animation layering and fusion, but an editor with timeline and key frames is useful for any game project, I personally think that the Unity Team should not ignore this requirement.

Script to add supporting tools for the test, and then hand over to the resource production department to add resources in the game.

Conclusion

Creating online games or mobile games with online functions is an arduous project. Unity makes everything on the surface look better and easier, however, it is undeniable that the widely successful unity project is dominated by relatively simple mobile games. There is still too little knowledge and information for developers to refer to in online game production. From the very beginning, the Mengjia team worked together to create various puzzles for unity online games. Today, we finally have a high-quality browser game "steam City" to be launched. We hope that the experience we have summarized here can help our friends in the domestic industry. Our solutions also have many shortcomings. We hope Chinese developers can share more with us, promote the exchange of unity and online game development technologies! The localized Chinese version of steam City is also in progress, and we are expected to meet you in the summer!

Unity online game development survival guide-steam City

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.