当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
三种素数筛总结——(朴素筛,埃氏筛,线性筛)
内核性能分析总结
自定义View的流程总结学习
电镀废水除六价铬
STM32F407ZG PWM
氨氮的有效吸附材料
每日刷题(day01)——leetcode 53. 最大子数组和
动态规划、背包问题 6/26 116-120
在Unity中判断游戏物体是否在游戏屏幕范围之内
开源游戏服务器框架NoahGameFrame(NF)客户端环境搭建(三)
Unity中暂停、继续播放、杀死、正放、倒放Dotween动画
Easy to master Unity of eight prior to rendering
21天学习挑战赛--补种胡杨求最大连续胡杨数量
Unity中实现Animation Clip动画片段的倒播(该案例可以防止动画延迟)
内核映像文件格式
在Unity的Update中通过物体自身位置判断运动方向
51单片机室内环境甲醛PM2.5光照温度湿度检测及窗帘加湿消毒控制系统
分享一个专业TA的《Shader参考大全》
样条曲线(下)之插值问题(贝塞尔曲线、B样条和一般样条曲线插值)
21天学习挑战赛--图像物体的边界









