At the recently held Cocos 2014 Developer Conference (Autumn), Mr. Yu Zhiqiang, Intel Software Technology Manager who is responsible for the research and development of the Web engine and the promotion and enhancement of the H5 standard, accepted media interviews at the conference on issues that developers are most concerned about. Q: Can you tell us about some of the collaborations between the engine and Cocos? Yu Zhiqiang: Let's start with the game field. The running logic of the game is divided into several levels. The top is the game program itself, and the bottom is the game engine. If it is a web program, there is another layer below, called the web engine, which supports the support of HTML5 related specifications and running support. Crosswalk belongs to the web engine layer. From top to bottom, developers use HTML5 to develop games at the top, and then the game engine API, including general game logic encapsulation, audio, video, graphics, etc., and then the web engine is below to support various tags in H5 (such as DOM/CSS/WebGL/etc.) and Javascript code that require the support of the web engine. Finally, the corresponding driver in the operating system, as well as the hardware chip (CPU/GPU/etc.), are integrated together. Cocos engine has several series, such as Cocos2d-x (c++), Cocos2d-x JS Binding, Cocos2d-html5, etc. We have a strong complementary relationship with Cocos2d-html5. When the game needs to use the more advanced and complete HTML5 functions, the web engine is needed to support it. The current situation is that the existing web engines (existing browsers and Webview components) have their own shortcomings in the functions and performance of H5. Our web engine-Crosswalk is to solve this problem, providing relatively complete H5 support and better performance, while constantly optimizing and enhancing. In terms of cooperation with Cocos, we will also make targeted optimizations for games, especially for scenarios that use Cocos2d-Html5 API. The game still has some characteristics, and we will optimize the engine for these characteristics. When a user plays a game, the whole process actually requires the cooperation of software and hardware. Nowadays, hardware is developing rapidly with each passing day. For example, single instruction multiple data parallel instructions (SIMD), hardware multi-core, etc. How to make these capabilities available to Web developers is also an area that Web engines need to solve. We have made some expansions in this regard, and hope that through cooperation with Cocos, HTML5 game developers can not only use a wide range of H5 functions, but also make full use of hardware features and targeted optimizations. Many HTML5 game engines on the market now only use a subset of HTML5. We hope to see a full set to develop more exquisite and powerful HTML5 games. We hope to solve these problems. Q: Do you mean that if I am a developer and want to develop an H5 game, I must use this engine? Yu Zhiqiang: HTML5 itself includes many functions and many APIs (DOM/CSS/WebAudio/WebGL/WebRTC/GamePad/etc.). The H5 game engines currently on the market (including Cocos2D-js) only include a subset of H5 (mainly graphics). If a game only uses a small part of the API and does not involve DOM/CSS/other H5 APIs, etc., it does not need a Web engine and can be directly transferred to the following (usually through a simplified Javascript engine plus some Javascript Binding APIs). If you want to use the rich HTML5 functions, a complete Web engine is unavoidable and you must use a Web engine. For example, if we compare a complete game to a car, there are sports cars and regular cars. The engine is the determining factor in how fast and how well a car runs. In the H5 field, the Web engine is equivalent to the engine in the car. Q: What is Cocos equivalent to? Yu Zhiqiang: The Cocos2d-JS module can be considered a subset, and to some extent, it can also be said to be the engine of this HTML5 subset. If you want to use the full set of HTML5 functions, you must have a web engine to support it. If you only choose a subset, that is another route, and many H5 functions are equivalent to being lost. So when we cooperate with customers, we say that many H5 games are now based on subsets, and everyone runs them based on subsets, but H5 has many rich standard APIs and many easy-to-use HTML5 software libraries. If you want to run these completely and very well, you need a web engine like Crosswalk to support them. Q: I have talked to some developers and many of them told me that the performance of H5 is completely incomparable to NativeApp, so they may not be very optimistic about this area. Yu Zhiqiang: This is a good question, and it is also a problem we want to try our best to solve. Intuitively speaking, H5 has an additional middle layer compared to native applications, which reduces performance. At the same time, it is relatively insufficient from the API point of view, but the Web engine and the corresponding HTML5 framework are evolving and developing very quickly, and this gap is constantly narrowing. Performance requires more effort. For example, in the field of games, especially complex games, there are some very classic examples, such as 1,000 sprites moving on the screen in various forms at the same time, and particle systems to achieve various effects, such as the animation effect of smoke bombs. In these cases, it is difficult for the current Web engine to achieve a similar experience to native applications. For example, the Chrome kernel is relatively advanced in the H5 engine, but the processing speed of the above two examples is less than half of that of native applications. Corresponding test cases are provided in Cocos. We have optimized the game for this situation, and have made some deep integration with the relevant code in the Cocos engine. After making targeted optimizations in our engine, the preliminary experimental results are: for the example of 1,000 sprites, the performance can be improved by 50%. Of course, it is 20%-30% slower than the native program (C++), but it is already quite close; for the example of the particle system (smoke effect), it can basically achieve the same performance as the native program. We have more optimizations in progress. For special products such as games, we combine game engines and Web engines to do some full-stack optimization, and there are still many opportunities to do here. The performance difference currently exists, but it does not mean that this thing cannot be overcome. And according to the current test results, we are confident that through targeted optimization, the performance of the Web engine will be further improved and capable of supporting heavy games. . On the other hand, Intel has a strong technical accumulation in chips, system performance optimization, and parallel processing. Now, mobile phone CPUs are often released with 4 or 8 cores, and GPUs are even more multi-core. CPUs also have parallel processing capabilities similar to SIMD (single instruction multiple data). These capabilities are basically not used in the H5 game field. We are adding some support to the Web engine, which can combine 4 cores, 8 cores or dozens of cores and SIMD capabilities to further improve performance. This is another advantage of ours. The Web is now catching up very obviously. We did something some time ago. Tencent has a web front-end team (AlloyTeam) that made an open source graphics processing library. This is developed based on H5, and can easily use HTML5 to implement some graphics processing, such as rough effects/wood carving effects. The performance is OK on desktops, but it takes 4 or 5 seconds on mobile terminals. Some complex processing (such as wood carving effects) even takes 40 or 50 seconds. Such performance cannot be used on mobile terminals at all. After we used parallel technology to optimize, we can achieve 2-20 times performance improvement on Crosswalk. The original wood carving effect took more than 40 seconds to complete, but after optimization, it only takes about 2 seconds. Moreover, such optimization is implemented at the engine and Javascript library level, which is relatively transparent to developers. The upper-level HTML5 program can experience the performance improvement without modification. It is very simple for developers. We can see that some things that seem impossible to achieve with HTML5 have suddenly become possible after these optimizations. I believe there will be many opportunities in this area. If you have listened to the speeches this morning, you can feel that web-based development is slowly rising. Through the combination of software and hardware, and through continuous innovation and promotion in the field of web engines, I believe HTML5 can do a lot of things, and I hope to show you more examples when the time comes. We also hope to have more cooperation with game engines and game developers. Web languages are very flexible, which makes it difficult to write efficient programs. They need more optimization. If you see a game with poor performance, the problem may occur at many levels. It may be that the Javascript is not well written. If you don’t have a good understanding of the Web engine, it is easy to be fooled. It may also be that the game engine is not efficient enough, or it may be a performance problem of the Web engine. Through optimization at different levels, we will gradually get a big improvement, and we will do more and more things. I hope to work with everyone to promote HTML5 forward. Cocos 2014 Developer Conference (Autumn) is the ninth conference of Cocos Developer Platform, and the theme of the autumn conference is "Great or nothing". Chukong Technology will officially release the "Cocos Developer Platform" at the conference and announce strategic cooperation with several international giants. As the highlight of this conference, Cocos Developer Platform will integrate the developer ecosystem. The Cocos Engine workflow can provide developers with a full set of products and services required in the process of "creativity → game launch → revenue increase", including important strategic products such as Changsi Advertising Platform, Cocos Play, AnySDK, etc. |
<<: Providing more convenience and resources for developers Amazon strongly supports Cocos Engine
>>: Introducing the Android Emulator for Visual Studio
In your hometown Should we eat dumplings or gluti...
Many years ago, when I was a new copywriter, Once...
As a good friend of mankind, chickens are of grea...
Products and operations are inseparable, and good...
It is no longer news that the Ministry of Industr...
Currently, the latest official version of the iOS...
Style Overview Presentation location 1: Baidu APP...
iOS14.7 and iPadOS14.7 were originally planned to...
【Longtou Taishan】"Longtou Daily Limit Code C...
On January 17, 1966, the J-7 fighter jet independ...
Today we are going to talk about paying a high pr...
After the launch of iQiyi Ultra HD Box and TCL iQ...
Content is the core at all times. But a good cont...
People in society are divided into different leve...
gossip “Reheating rice can cause cancer!” White r...