How I built a game engine using MVI in Kotlin and avoided getting fired
The engine went from 7+k to just 400 lines of readable, linear, structured, performant, extensible code.
重點摘要
Loading time improved from ~20 seconds to just 1.75 seconds!
Crashed games fell from 8% to 0.01%!
Battery consumption during gameplay was reduced by orders of magnitude.
In this article, the author shares the journey of building a multiplatform game engine using MVI architecture in Kotlin. Faced with insane requirements from a customer, the team transitioned from a legacy engine with over 7,000 lines of code to a streamlined version of just 400 lines. Key improvements included drastically reduced loading times, a significant decrease in game crashes, and enhanced performance metrics. The author emphasizes the importance of architectural patterns like Decorators and Interceptors, showcasing how they can simplify application logic and improve efficiency in software development.
如何使用 Kotlin 和 MVI 架构构建游戏引擎并避免被解雇
这个引擎从 7,000 行代码缩减到仅 400 行可读、线性、结构化且高效的代码。
重點摘要
加载时间从约 20 秒改善到仅 1.75 秒!
游戏崩溃率从 8% 降至 0.01%!
游戏过程中的电池消耗大幅减少。
在这篇文章中,作者分享了使用 Kotlin 和 MVI 架构构建跨平台游戏引擎的过程。面对客户提出的极端要求,团队从一个超过 7,000 行代码的旧引擎过渡到仅 400 行的精简版本。关键改进包括大幅减少加载时间、显著降低游戏崩溃率以及提升性能指标。作者强调了装饰者和拦截器等架构模式的重要性,展示了它们如何简化应用逻辑并提高软件开发的效率。
如何使用 Kotlin 和 MVI 架構建立遊戲引擎並避免被解僱
這個引擎從 7,000 行代碼縮減到僅 400 行可讀、線性、結構化且高效的代碼。
重點摘要
加載時間從約 20 秒改善到僅 1.75 秒!
遊戲崩潰率從 8% 降至 0.01%!
遊戲過程中的電池消耗大幅減少。
在這篇文章中,作者分享了使用 Kotlin 和 MVI 架構建立跨平台遊戲引擎的過程。面對客戶提出的極端要求,團隊從一個超過 7,000 行代碼的舊引擎過渡到僅 400 行的精簡版本。關鍵改進包括大幅減少加載時間、顯著降低遊戲崩潰率以及提升性能指標。作者強調了裝飾者和攔截器等架構模式的重要性,展示了它們如何簡化應用邏輯並提高軟體開發的效率。