cocoscreator releases Douyin mini-game

Published to ByteDance Mini Game
ByteDance Mini Game is a new type of game that is developed based on ByteDance's full product matrix and does not require users to download.

The game submission, review and release process of mini-games, etc., need to comply with the requirements and standard procedures of the ByteDance official team. For specific information, please refer to the ByteDance Mini-Game Access Guide.

Preparations
Download the ByteDance developer tools and install them.

Refer to the ByteDance Mini Game Access Guide, and complete account registration, login, and application for a mini game on the ByteDance developer platform.

After the mini game application is approved, find the AppID in the development management -> development settings of the developer platform.

appid

Publishing process
Use Cocos Creator to open the project project to be published, and open the build and release panel from the menu bar -> project. Select ByteDance Mini Game in the publishing platform of the build publishing panel.

build

For the setting of general build options, please refer to the general build options. The specific build options for ByteDance mini games are as follows. For specific instructions, please refer to the content of the build options section below.

bytedance-options

Once the build options for the build release panel are set, click Build.
After the build is complete, click the folder icon button in the lower left corner of the build task to open the project release package, and you can see that the bytedance-mini-game (based on the specific build task name) folder has been generated in the default release path build directory. Contains the configuration files game.json and project.config.json of ByteDance mini game environment.

package

Use the ByteDance developer tool to open the bytedance-mini-game folder generated by the build, you can open the ByteDance mini game project and preview and debug the game content.

tool

Build option
Build option Description Field name (for command-line release)
After the initial scene subpackage is checked, the first scene and its related dependent resources will be built into the built-in Asset Bundle — start-scene under the release package directory assets. The asset loading speed of the initial scene. startSceneAssetBundle
device orientation Optional values ​​include Portrait and Landscape. When building, it will be written to the game.json file in the release package directory. orientation
AppID is a required item, the AppID of the ByteDance Mini Game will be written to the project.config.json file in the release package directory when building. appid
resource server address It is used to fill in the address where the resource is stored on the remote server. The developer needs to manually upload the remote folder under the release package directory to the resource server address filled in after the build. For details, please refer to Uploading resources to a remote server. remoteServerAddress
generates an open data domain project template for accessing an open data domain. For details, refer to Open Data Domain. buildOpenDataContextTemplate
Native PhysX physics system This item is used to set whether to use the PhysX physics system. For details, please refer to the content of the Native Physics section below. -
native physics
The ByteDance platform has been committed to providing developers with more powerful performance and basic capabilities. Douyin will provide PhysX native physical interfaces for mini games in v16.3 and later versions. And Creator has conducted in-depth cooperation with the ByteDance platform. In v3.2, the experimental function supports the use of the PhysX physical capabilities provided by the platform in ByteDance mini games, optimizing the physical computing performance, which is nearly 100% better than using Bullet physics. Performance improvements for:

compare performance

The premise of using native physics is that you need to set the physics system to PhysX physics system in the project -> project settings -> function tailoring in the main menu bar. Then open the build and release panel, select the ByteDance Mini Game as the release platform, and you can see the configuration options related to native physics as follows:

PhysX options

Build option Description Field name (for command-line publishing)
Do not package the built-in PhysX library If this option is checked, the built-in PhysX library file will not be packaged when building, which helps to reduce the package size, but PhysX cannot be used in some ByteDance's application platform runs, such as Douyin (iOS version) and developer tools.
If this option is not checked, Creator supports PhysX running on ByteDance's full application platform. physX.notPackPhysXLibs
enable multi-thread mode If checked, enable multi-thread mode. physX.multiThread
The number of sub-threads The number of sub-threads when multi-threading mode is enabled. physX.subThreadCount
Tolerance Error If this option is checked, the accuracy of multi-threaded mode will be lower than that of single-threaded. physX.epsilon
subpackage loading
subpackage loading, that is, split the game content into several packages according to certain rules, and only download the necessary packages when starting for the first time. This necessary package is called the main package. The package triggers the download of other subpackages, which can effectively reduce the time consumed for the first startup. If you want to use this function, you need to set up the subpackage of the mini game in Creator. After the setting is completed, it will be automatically subpackaged when building.

ByteDance mini games need a specific version to support the subpackage function. The version requirements of ByteDance products are as follows:

Product Android iOS
Douyin v13.6.0 v13.7.0
Toutiao v7.9.9 v7.9.8
Byte The version used by the developer tool should be greater than or equal to 2.0.6 and less than 3.0.0. The debugging base library requires 1.88.0 and above.

 

Note: If the version of the product does not support sub-package loading, the engine will load the sub-package as a normal Asset Bundle.

Currently, the mini-game subpackage size has the following restrictions:

The size of all sub-packages of the entire mini-game should not exceed 16 M.
The size of a single sub-package/main package should not exceed 4 M.
For details, please refer to the official documentation of loading ByteDance mini-game sub-packages

Resource management in the mini-game environment
ByteDance mini-games are similar to WeChat mini-games, both of which have package size restrictions, and additional resources exceeding 4MB must be downloaded through network requests.
When the package body is too large, you can configure the resource server address option in the build and release panel to upload the resource to a remote server. For details, please refer to Uploading resources to a remote server.

Guess you like

Origin blog.csdn.net/s178435865/article/details/127838607