Forge of Empires from AS3 to Haxe. Post mortem

In the comments on the translation of the report from HaxeUp Sessions 2020 Hamburg - Haxe Winter Status Report - a question was asked about why Haxe is needed. Of course, they answered him in the same place, in the comments. The proposed translation of another report from the past HaxeUp should, in my opinion, be an additional argument in defense of Haxe, as this report is about a game that has earned more than 500 million euros.


The author of the report, Nenad, is one of the InnoGames programmers who worked on the conversion of Forge of Empires from ActionScript to Haxe. 2 years ago in Amsterdam InnoGames talked about their work in this direction. Today we can say that they did it fully - now both versions of the web client (Flash and html5) are assembled from a single code base on Haxe. And this report is essentially a review of the work done and the decisions made, both successful and not very good.


image


Let's start with the introduction - who are InnoGames?


InnoGames is one of the largest game developers in Germany (Hamburg) with over 400 employees. Currently, the company is mainly engaged in mobile games, but also continues to support and develop browser games created earlier (most of their browser games also have mobile clients). This year, the company's revenue for its entire lifetime (lifetime revenue) reached 1 billion euros.


image


Forge of Empires is:


  • one of InnoGames browser projects (and quite successful)
  • one of the largest browser games on the market
  • : , ( ). PvE, PvP .
  • 500 .
  • , 2012
  • Android iOS.

image


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


, , , html5-:


image


1. , InnoGames β€” , , tween-, .


image


, (, CreateJS Flash API ActionScript- JavaScript). Egret OpenFL β€” . Egret , . Egret β€” , "", . , .
Haxe OpenFL β€” , .. . , OpenFL .


image


2. :
:


  • . ActionScript- , ActionScript- . , "" ActionScript-, ,
  • ,
  • html5- flash-. ( QA), . , . flash-, html5- .

:


  • , .
  • ,
  • ,

image


2018 html5-, . .


html5- -.


, .


A/B , html5-, β€” flash-. 2018 html5- -. html5- 85-86% .


image


3. :


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

image


4. , mocked-, .


image


, mocked-:
ActionScript- β€” , , mocked- ActionScript. Haxe- ( ). .


"" (, ). Haxe- :


  • mocked- Haxe
  • mocked-
  • .

( ) .


image


5. β€” , ActionScript- , "" :


  • ( , ..)
  • ( Haxe-)
  • Haxe-

.. β€” , ActionScript-.


image


6. , , , β€” . .


flash- - swf, ATF-. , html5-. : html5-, flash- .


: swf- , OpenFL .


image


7. ( ) β€” , . Pull Request Flash JavaScript.


, UI-.


html5- Flash-.


image


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


image


9. Canvas- , .. , Microsoft Edge β€” ( ).


image


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


image


11. OpenFL . SubBitmapData β€” , ( β€” !). , , drawcall.


image


12. ? , !
html5- . β€” , drawcall ( , drawcall’, ; gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS)). drawcall’. .


image


13. ? β€” !
- html5- 60 , Internet Explorer β€” webgl-, . , , Internet Explorer 10% , "" !


Internet Explorer Flash- .


image


, InnoGames Haxe, .. Flash- ActionScript-, html5- β€” Haxe-, . html5-, OpenFL html5.


, InnoGames (. . 4), , , , ActionScript. Haxe . , "" .
.


Haxe-, Flash, JavaScript. , Haxe- .


, β€” .


image


: OpenFL html5-, Flash- , .


HaxeUp.


image


14. ( ) β€” Haxe, 2 . , ( Haxe- , IDE), :


  • -, . , . , , src ActionScript-, Haxe- . , "" CI, IDE, . " " (ActionScript- ), , , , " ", Haxe git, ActionScript-
  • -, . Haxe , ActionScript-. Haxe ActionScript- Ant-. .

, :


image


1. (workflow) β€” 2 : . , β€” . , mocked-, .


ActionScript Haxe, ( ).


image


2. β€” . Haxe- :


  • master- ""
  • conversion- Haxe-
  • develop- -.

merge-, - ActionScript develop- Haxe-. , "". .


image


3. β€” html5- , . , Internet Explorer Flash-, , Haxe .


Therefore, if the team had to re-start the development of the converter, then it would be as cross-platform as possible.


image


But now both versions of the Forge of Empires browser client use Haxe code. Thank you for the attention!


All Articles