当前位置:网站首页>Hot change scheme and dynamic update strategy of mobile game
Hot change scheme and dynamic update strategy of mobile game
2022-04-23 07:42:00 【0zien0】
The contents that need to be handled more for heat treatment by patching are as follows :
1. Most of the game's code logic uses lua or JS And other scripting languages .( Scripting language is convenient for reloading after hot change )
2. A comparison file is generated every time resources are packaged . The document contains full resources ( Resource name 、MD5 value 、 Subcontract No ) Etc , The actual content depends on the needs of the project itself .
3. Modify the directory path of priority files when running the game . You need to read the files in the download file directory first ( because APK or IOS The included resources will be repeated with the downloaded resources )
4. After downloading , The previously loaded content needs to be re reload.
Download the form of patch package :
1. Compress the files to be updated into a compressed package , Download the compressed package in the game and decompress it into the download directory .
When generating a compressed package , Pick out the updated contents through the reference documents , Then, the patch package is generated by centralized compression .
advantage : Generate compressed package , After the resources are compressed, the amount of resources downloaded will be smaller , And compressed into a package , The download speed is also relatively fast , It's not that error prone .
shortcoming : If the game is on now 10 A version of the patch package , For new players , As soon as you download the complete package, you must download it from the first patch package to the tenth patch package , Even if it 10 There are a lot of duplicate resources in a patch package ( For example, every time a patch is updated, a graph will be updated ). If the next package doesn't come out for a long time , For new players , Maybe the total number of patch packages is much larger than the whole package itself .
2. Upload all the resources of the latest version to the server , Players need to download which resources, they can directly download the corresponding resources from the server to the download directory .
Put the reference document in APK(IPA) in , Download the latest version of the reference file from the server when it needs to be updated , Then compare it with the current version of the file , You can know which resources you need to download , Then download from the server one by one .
advantage : Even if I do now 100 A version of the patch , Don't worry about the content of the patch in the middle , Directly compare the reference file of my current version with the reference file in the server , You can download the required resources , And the resources with the same name will directly download the latest resources instead of the intermediate version . More flexible .
shortcoming : Even if this patch only updates one image , You still need to upload all the resources of the whole game to the server . The download speed of scattered files is not as fast as that of compressed packages, and the resources are not compressed .
There are three ways to download resources :
1. Resources downloaded before entering the game .
This is the most common way to download , Start the game to detect the version number , See if you need an update , If necessary, update it before entering the game .
2. In the game , Players manually click to download updates .
This is in the form of subcontracting , Do not download subcontracted , The first package will support you to play most functions , However, some functions with a large amount of resources may need to be downloaded and subcontracted before they can be played . If there is subcontracting , You can make the first package smaller . Whether it's appstore still google There are restrictions on the size of inclusions , And when promoting, according to different promotion strategies , There may also be small inclusions, which will be better popularized .
3. Dynamically update resources , That is to download the corresponding resource when you use it .
Generally, we use , Show temporary resources first ( For example, a moving picture of a circle indicates that it is downloading ), After the official resources are downloaded, they will be replaced with official resources .
In fact, it's like the previous page tour , When you open the interface, you can download resources one by one and display them . This way looks the most advanced, but it is actually the most troublesome . Each method entry for loading resources has to write the download processing logic , And the processing logic is different according to the needs of different places .( The purpose is to add the download code without changing the source code ).
If you need to do this dynamic download resource very carefully, you have to change the source code ( My project is done well , Just put forward the need to do this dynamic download scheme , A new project can start by designing a framework ). For example, some places will process the downloaded resources , Then you must wait until the resource download is completed before performing subsequent operations .
版权声明
本文为[0zien0]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230623293687.html
边栏推荐
- 公共依赖模块common的处理
- [牛客练习赛68]牛牛的粉丝(矩阵快速幂之循环矩阵优化)
- Failed to install Tui editor, quick solution
- 学习笔记6-几种深度学习卷积神经网络的总结
- 页面实时显示当前时间
- Processing of common dependency module
- 莫比乌斯反演
- 如何判断点是否在多边形内(包含复杂多边形或者多边形数量很多的情况)
- Solutions to common problems in visualization (VII) solutions to drawing scale setting
- The difference and application of VR, AR and MR, as well as some implementation principles of AR technology
猜你喜欢
随机推荐
Failed to install Tui editor, quick solution
菜菜的刷题日记 | 238.除自身以外数组的乘积
keytool: command not found
OpenGL超级宝典初步配置(freeglut、glew、gltools、glut)
SAP RFC_CVI_EI_INBOUND_MAIN BP主数据创建示例(仅演示客户)
保洁阿姨都能看懂的中国剩余定理和扩展中国剩余定理
[牛客练习赛68]牛牛的粉丝(矩阵快速幂之循环矩阵优化)
刨根问底---cocos2d源码的理解与分析
SAP 导出Excel文件打开显示:“xxx“的文件格式和扩展名不匹配。文件可能已损坏或不安全。除非您信任其来源,否则请勿打开。是否仍要打开它?
数论之拓展欧几里得
积性函数前缀和——杜教筛
Mysql的存储引擎
Discussion on arrow function of ES6
简单易懂的子集dp
安装配置淘宝镜像npm(cnpm)
快速下载vscode的方法
[hdu6833]A Very Easy Math Problem(莫比乌斯反演)
莫比乌斯反演
ESP32学习-GPIO的使用与配置
2.限定查询





![[Educational Codeforces Round 80] 解题报告](/img/54/2fd298ddce3cd3e28a8fe42b3b8a42.png)

![[COCI]Lampice (二分+树分治+字符串哈希)](/img/7b/fe2a45d960a6d3eb7dc25200304adc.png)

