当前位置:网站首页>How is C# hot update better than Lua?
How is C# hot update better than Lua?
2022-08-10 06:14:00 【Youmeng Maker】
How is C# hot update better than Lua?
Hello everyone!In the last issue of sharing, I gave you some popular science, why does the game need hot updates?In short: a hot update can download only part of the update content without re-downloading
Load the entire game APP to enhance the player's experience.
But due to the limitations of the mobile operating system, especially the limitations of Apple IOS.Mobile operating systems usually cannot directly support hot updates, so we need to find a way to bypass this limitation.
So what exactly do we do as game developers?
There are two options here:
- Use traditional Lua-based hot update scheme
- Using a C sharp-based hot change solution
Let's talk about the first one first, if we adopt a new Lua-based hot update scheme.So whether you are using an IOS-based Apple phone or an Android phone
In order to bypass the restriction, you must first convert the program code you need to hot update into the corresponding Lua language script, and then the virtual machine is responsible for executing the script.
There are three disadvantages of using this method for heating:
Developers need to learn Lua, another development language besides C#.
In order for the development company to recruit developers who understand both the C sharp language used by the unity engine and the Lua language, the recruitment cost is greatly increased.
In order to bypass this limitation, a Lua virtual machine is added to execute Lua scripts during development, which adds a layer of conversion overhead from Unity's C# scripts to Lua scripts, so theoretically, using LuaThe execution efficiency of scripting to run program code is impossible to be higher than directly executing C# program in Unity engine.
It would be different if we used C sharp:
First, you don't need to learn a new programming language
Secondly, since the Android system does not restrict the execution of hot update code, we can use C# to reflect the hot update on the Android system.Since the Android system does not have the overhead of switching from the engine layer to the script layer, the Android code can obtain the same efficiency as directly executing the unity C# script;
Third, for the iOS system, a C#-based script hot update solution can be used, which is called ILRuntime.The development efficiency of ILRuntime is higher;
Fourth, the ILRuntime hot update solution is the hot update solution on the iOS system officially promoted by unity, so it will receive more support from the unity official in the future, and the development will be faster.
So how do we choose between Lua and C#?
Does Lua have no competitive advantage at all?We say that's not the case either.
Because Lua has developed for a long time, the accumulation of Lua will be more abundant.
As for ILRuntime, as long as we learn its development framework, we can use it in the project, and the efficiency of development and debugging is much more convenient than Lua.
So for developers, it is the best choice to learn both script hotfixing solutions at the same time.This can help you quickly improve your workplace competitiveness.Since hot update is a very important skill in game development, by learning these two hot update schemes, you can also be promoted from an ordinary developer to the main process of a game company faster, and lead a team to develop projects.
Since Lua is already a hot update solution under maintenance, we won't go into details.
How to learn ILRuntime?
First of all, we need to deeply understand and master the design of hot update architecture based on ILRuntime, as well as the two-way interaction between ILRuntime hot update script and unity native script.This can be mastered by analyzing the source code of
ILRuntime.
Secondly, due to the deviation in our understanding, we may encounter some so-called pits when we use ILRuntime for the first time.So how to avoid stepping on the pit?Here we need to learn some experience in using ILRuntime.
Thirdly, we said earlier that ILRuntime can achieve efficient development and debugging, including dual-mode support for reflective hotfixes and script hotfixes, so how do we create an efficient development workflow?
This requires us to really master this by studying commercial projects, not just looking at some demo-level toy code.
Today's good, today's sharing is here, and finally welcome everyone to pay attention to our "Unity Full Stack Development Master", Lua, ILRuntime double repair~
For more learning resources, please add QQ: 1517069595 to obtain (/enterprise-level performance optimization/hot update/Shader special effects/server/commercial project combat/weekly live broadcast/one-to-one guidance)
The full video can be clicked on the link of station B: https://www.bilibili.com/video/BV1k54y1n7Rp
边栏推荐
猜你喜欢
随机推荐
解析树字符串并输出中序遍历
优化Mysql运行OrderBy性能
STM32单片机OLED俄罗斯方块单片机小游戏
样条曲线(下)之插值问题(贝塞尔曲线、B样条和一般样条曲线插值)
Flutter Package 插件开发
内核性能分析总结
接口自动化2.0
详解样条曲线(上)(包含贝塞尔曲线)
KDE框架介绍
Unity的GetComponentsInChildren1、2、3
markdown类图学习
C#热更新比Lua好在哪里?
过大数组导致爆栈的解决方法记录(堆栈)
溶液中重金属去除
21天学习挑战赛--分班
手把手教你改内核源码--sysfs虚拟文件系统2
Unity对象池实现
通过配置CubeMX的TIMER的PWM初始化实现硬件PWM呼吸灯闪烁
51单片机营养液自动配置搅拌系统TDS浓度采集自动加水加营养液
STM32单片机手机APP蓝牙高亮RGB彩灯控制板任意颜色亮度调光