Forge of Empires de AS3 a Haxe. Post mortem

En los comentarios sobre la traducción del informe de HaxeUp Sessions 2020 Hamburg - Informe de invierno sobre el estado de Haxe - se hizo una pregunta sobre por qué se necesita Haxe. Por supuesto, le respondieron en el mismo lugar, en los comentarios. La traducción propuesta de otro informe del pasado HaxeUp debería, en mi opinión, ser un argumento adicional en defensa de Haxe, ya que Este informe trata sobre un juego que ha ganado más de 500 millones de euros.


El autor del informe, Nenad, es uno de los programadores de InnoGames que trabajó en la conversión de Forge of Empires de ActionScript a Haxe. Hace 2 años en Amsterdam, InnoGames habló sobre su trabajo en esta dirección. Hoy podemos decir que lo hicieron completamente, ahora ambas versiones del cliente web (Flash y html5) se ensamblan a partir de una única base de código en Haxe. Y este informe es esencialmente una revisión del trabajo realizado y las decisiones tomadas, tanto exitosas como no muy buenas.


imagen


Comencemos con la introducción: ¿quiénes son InnoGames?


InnoGames — (. ) 400 . , , ( ). (lifetime revenue) 1 . .


imagen


Forge of Empires — :


  • InnoGames ( )
  • : , ( ). PvE, PvP .
  • 500 .
  • , 2012
  • Android iOS.

imagen


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


, , , html5-:


imagen


1. , InnoGames — , , tween-, .


imagen


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


imagen


2. :
:


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

:


  • , .
  • ,
  • ,

imagen


2018 html5-, . .


html5- -.


, .


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


imagen


3. :


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

imagen


4. , mocked-, .


imagen


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


"" (, ). Haxe- :


  • mocked- Haxe
  • mocked-
  • .

( ) .


imagen


5. — , ActionScript- , "" :


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

.. — , ActionScript-.


imagen


6. , , , — . .


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


: swf- , OpenFL .


imagen


7. ( ) — , . Pull Request Flash JavaScript.


, UI-.


html5- Flash-.


imagen


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


imagen


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


imagen


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


imagen


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


imagen


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


imagen


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


Internet Explorer Flash- .


imagen


, InnoGames Haxe, .. Flash- ActionScript-, html5- — Haxe-, . html5-, OpenFL html5.


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


Haxe-, Flash, JavaScript. , Haxe- .


, — .


imagen


: OpenFL html5-, Flash- , .


HaxeUp.


imagen


14. ( ) — Haxe, 2 . , ( Haxe- , IDE), :


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

, :


imagen


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


ActionScript Haxe, ( ).


imagen


2. — . Haxe- :


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

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


imagen


3. — html5- , . , Internet Explorer Flash-, , Haxe .


Por lo tanto, si el equipo tuviera que reiniciar el desarrollo del convertidor, entonces sería lo más multiplataforma posible.


imagen


Pero ahora ambas versiones del cliente de navegador Forge of Empires usan el código Haxe. ¡Gracias por la atención!


All Articles