GameFramework framework-packaging, construction, and more knowledge points

 

table of Contents

1. Single-player game version packaging (no server, no hot update)

1. Turn off the editor resource mode

 2. The resource mode is Package

3. Pack AB package

4. Find the corresponding packaging target system (Android) file under Package and copy it to StreamingAssets

5. Transfer PlayerSetting to the Android platform (if you are on other platforms, the AB file above needs to go to the corresponding Package/platform/ and copy it to StreamingAssets), then build the Build and run it on the emulator or real machine.

6. You will find that there is an error, which is caused by PlayerShit, the aircraft prefab. Reason: Mesh Collider does not support the use of convert mode for meshes with too many vertices, and prompts you to reduce the surface of the mesh.

7. After reducing player_ship_collider, you must repackage it once and copy its content to StreamingAssets again. (Be careful not to copy in the wrong place)

2. Online game construction (*hot update)

1. Cancel the Editor Resource Mode

2. Change to Updated mode resource loading

3. Make AB package

4. Configure server related files

5. Configure the client

Solve the purple problem


1. Single-player game version packaging (no server, no hot update)

1. Turn off the editor resource mode

 2. The resource mode is Package

3. Pack AB package

Select an Output directory and put it outside the Assets directory.

The Output Directory is used to specify the output directory of the result of the build process (for manual input, remember to press the Enter key^_^). Please ensure that you have access to this directory and have sufficient disk space.

  • Working Path: The working directory when Unity generates AssetBundle.
  • Output Package Path: The directory where the files generated in the stand-alone mode are located. If the game is a stand-alone game, copy the files from the corresponding platform in this directory to StreamingAssets and then build the App.
  • Output FullPath: The directory where the complete file package generated in the update mode is located. If the game is an online game, this directory should be uploaded to the resource server after the generation is completed for players to download.
  • Output Packed Path: is the directory where the files generated in the update mode are located. If the game is an online game, copy the files in this directory to StreamingAssets and then build the App after the generation is complete. Whether an AssetBundle will be generated to the Output Packed Path depends on whether the AssetBundle is marked as Packed in the AssetBundle editing tool

4. Find the corresponding packaging target system (Android) file under Package and copy it to StreamingAssets

5. Transfer PlayerSetting to the Android platform (if you are on other platforms, the AB file above needs to go to the corresponding Package/platform/ and copy it to StreamingAssets), then build the Build and run it on the emulator or real machine.

6. You will find that there is an error, which is caused by PlayerShit, the aircraft prefab. Reason: Mesh Collider does not support the use of convert mode for meshes with too many vertices, and prompts you to reduce the surface of the mesh.

7. After reducing player_ship_collider, you must repackage it once and copy its content to StreamingAssets again. (Be careful not to copy in the wrong place)

2. Online game construction (*hot update)

1. Cancel the Editor Resource Mode

2. Change to Updated mode resource loading

3

3. Make AB package

4. Configure server related files

Server I use HFS, find the folder above, and then add it to the server

Create a new version.txt file on the desktop and enter the content:

{
"ForceUpdateGame": false,
"LatestGameVersion": "0.1.0",
"InternalGameVersion": 1,
"InternalResourceVersion": 6,
"UpdatePrefixUri": "http://localhost/Windows",
"VersionListLength": 7158,
"VersionListHashCode": 1950701509,
"VersionListZipLength": 2648,
"VersionListZipHashCode": 915433963,
"END_OF_JSON":""
}

The key name of this file is the attribute name of the VersionInfo class of the GF framework. There is a one-to-one correspondence, and different versions may be different.

ForceUpdateGame corresponds to whether to force the entire package to be updated, the default is false if it is not the entire package. The whole package update is actually just a function to jump to the specified url, so that players can download it from the official website. How to set this url will be discussed later.

LatestGameVersion

InternalGameVersion This may be an internal version. I haven't read it for the time being. It is tentatively set to 1.

InternalResourceVersion   (PS: The version number that has been incremented by +1 here, the actual current package is 6)

UpdatePrefixUri

"VersionListLength": 7158,
"VersionListHashCode": 1950701509,
"VersionListZipLength": 2648,
"VersionListZipHashCode": 915433963,

Fill in accordingly, for example, the hash code corresponds to VersionListHashCode, and the content of [...] does not need to be filled in.

"END_OF_JSON":"" Don't worry about this stuff, I don't know what it is, the default is just fine.

Put the created version.txt in the HFS root directory of the server, and the server configuration is complete.

5. Configure the client

Find the BuildInfo.txt file in the project. The value of the key below is the version.txt address of the server. The 10.0.0.2 you see above is my local temporary IP, but I don’t know how to use this IP, so I’ll change it. Become localhost to specify.

The key is to configure CheckVersionUrl. Others such as WindowsAppUrl are the whole package update URL that jumps to the window when the whole package is updated. The other is the same (here I am free to make a haha)

This is done! Haha~

6. Run the game directly, you can see the following effects~

 

Solve the purple problem

The purple color is because the shader of the material is not normally packaged and loaded into the environment.

For example, the background turns purple, find the shader of the background Backgound object

Need to add Unlit/Texture to the Always Included Shaders list

Then go to pack and test and discover new problems! That's right, all built-in shaders must be set to Always Included Shaders to be normal!

In the end, these 3 shaders have to be added roughly to solve the problem I have seen

If you need to package the Android package to a real machine or emulator for testing, you need a public network server IP, set the HFS IP to the public network IP, and at the same time, change the relevant url, such as changing the above series of localhost to the public network IP That's it. I don't plan this part of the content for the time being, so I can try it myself.

Guess you like

Origin blog.csdn.net/qq_39574690/article/details/109234506