在翻译2020年汉堡HaxeUp会议的报告- 冬季Haxe状态报告时,有人问了一个问题,为什么需要Haxe。当然,他们在评论中在同一位置回答了他。我认为,从过去的HaxeUp提议的另一份报告的翻译建议应该是捍卫Haxe的另一种论点,因为 这份报告是关于一款收入超过5亿欧元的游戏的。
该报告的作者Nenad是InnoGames程序员之一,他致力于将《帝国锻造》从ActionScript 转换为Haxe。2年前,InnoGames在阿姆斯特丹谈论了他们在这个方向上的工作。今天我们可以说他们完全做到了-现在Web客户端的两个版本(Flash和html5)都是从基于Haxe的单个代码中组装而成的。这份报告本质上是对已完成的工作和所做出的决定的回顾,无论成功与否。

让我们从介绍开始-谁是InnoGames?
InnoGames — (. ) 400 . , , ( ). (lifetime revenue) 1 . .

Forge of Empires — :
- InnoGames ( )
- : , ( ). PvE, PvP .
- 500 .
- , 2012
- Android iOS.

, Forge of Empires , InnoGames Flash. , html5- , Flash-.
, , , html5-:

1. , InnoGames — , , tween-, .

, (, CreateJS Flash API ActionScript- JavaScript). Egret OpenFL — . Egret , . Egret — , "", . , .
Haxe OpenFL — , .. . , OpenFL .

2. :
:
- . ActionScript- , ActionScript- . , "" ActionScript-, ,
- ,
- html5- flash-. ( QA), . , . flash-, html5- .
:

2018 html5-, . .
html5- -.
, .
A/B , html5-, — flash-. 2018 html5- -. html5- 85-86% .

3. :
- - -. Egret, .. . , : Forge of Empires , ActionScript Haxe, InnoGames . , InnoGames ActionScript->Haxe. InnoGames , , , ( InnoGames Haxe).
- .. , InnoGames
- Haxe OpenFL
- Haxe .

4. , mocked-, .

, mocked-:
ActionScript- — , , mocked- ActionScript. Haxe- ( ). .
"" (, ). Haxe- :
( ) .

5. — , ActionScript- , "" :
.. — , ActionScript-.

6. , , , — . .
flash- - swf, ATF-. , html5-. : html5-, flash- .
: swf- , OpenFL .

7. ( ) — , . Pull Request Flash JavaScript.
, UI-.
html5- Flash-.

8. (dependency injection) Robotlegs, swiftsuspenders. swiftsuspenders . Haxe- @:rtti
— xml-, . .. , html5- ( xml- ). , : @:rtti
ITypeDescriptionAware
— , , , , ( ). , .

9. Canvas- , .. , Microsoft Edge — ( ).

10. ? , - .
InnoGames OpenFL , , WebGL, drawcall.

11. OpenFL . SubBitmapData
— , ( — !). , , drawcall.

12. ? , !
html5- . — , drawcall ( , drawcall’, ; gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS)
). drawcall’. .

13. ? — !
- html5- 60 , Internet Explorer — webgl-, . , , Internet Explorer 10% , "" !
Internet Explorer Flash- .

, InnoGames Haxe, .. Flash- ActionScript-, html5- — Haxe-, . html5-, OpenFL html5.
, InnoGames (. . 4), , , , ActionScript. Haxe . , "" .
.
Haxe-, Flash, JavaScript. , Haxe- .
, — .

: OpenFL html5-, Flash- , .
HaxeUp.

14. ( ) — Haxe, 2 . , ( Haxe- , IDE), :
- -, . , . , ,
src
ActionScript-, Haxe- . , "" CI, IDE, . " " (ActionScript- ), , , , " ", Haxe git, ActionScript- - -, . Haxe , ActionScript-. Haxe ActionScript- Ant-. .
, :

1. (workflow) — 2 : . , — . , mocked-, .
ActionScript Haxe, ( ).

2. — . Haxe- :
- master- ""
- conversion- Haxe-
- develop- -.
merge-, - ActionScript develop- Haxe-. , "". .

3. — html5- , . , Internet Explorer Flash-, , Haxe .
因此,如果团队不得不重新开始转换器的开发,那么它将尽可能地跨平台。

但是,现在两个版本的Forge of Empires浏览器客户端都使用Haxe代码。感谢您的关注!