Nos comentários sobre a tradução do relatório das HaxeUp Sessions 2020 Hamburg - Winter Haxe Status Report - uma pergunta foi feita sobre por que o Haxe é necessário. Claro, eles responderam no mesmo lugar, nos comentários. A tradução proposta de outro relatório do HaxeUp passado deveria, na minha opinião, ser um argumento adicional em defesa do Haxe, como este relatório é sobre um jogo que ganhou mais de 500 milhões de euros.
O autor do relatório, Nenad, é um dos programadores da InnoGames que trabalhou na conversão do Forge of Empires do ActionScript para o Haxe. Há dois anos em Amsterdã, a InnoGames falou sobre seu trabalho nessa direção. Hoje, podemos dizer que eles fizeram isso completamente - agora as duas versões do Web client (Flash e html5) são montadas a partir de uma única base de código no Haxe. E este relatório é essencialmente uma revisão do trabalho realizado e das decisões tomadas, bem-sucedidas e não muito boas.
![imagem](https://habrastorage.org/webt/8d/vy/jj/8dvyjj1wuuv_brmdd09f-h6eouw.png)
Vamos começar com a introdução - quem é o InnoGames?
InnoGames — (. ) 400 . , , ( ). (lifetime revenue) 1 . .
![imagem](https://habrastorage.org/webt/v7/bu/te/v7butexfsemcmlkmddq4naqre2a.png)
Forge of Empires — :
- InnoGames ( )
- : , ( ). PvE, PvP .
- 500 .
- , 2012
- Android iOS.
![imagem](https://habrastorage.org/webt/es/kc/xf/eskcxfspjc9x3wndggjdw_0gadk.png)
, Forge of Empires , InnoGames Flash. , html5- , Flash-.
, , , html5-:
![imagem](https://habrastorage.org/webt/mp/gh/ep/mpghephg3ucistzvdvd2vfeaoe0.png)
1. , InnoGames — , , tween-, .
![imagem](https://habrastorage.org/webt/kb/im/xh/kbimxh3fo-h3pny6qzyy615gy94.png)
, (, CreateJS Flash API ActionScript- JavaScript). Egret OpenFL — . Egret , . Egret — , "", . , .
Haxe OpenFL — , .. . , OpenFL .
![imagem](https://habrastorage.org/webt/0r/dd/qe/0rddqegqe38vaerc2nztywremgs.png)
2. :
:
- . ActionScript- , ActionScript- . , "" ActionScript-, ,
- ,
- html5- flash-. ( QA), . , . flash-, html5- .
:
![imagem](https://habrastorage.org/webt/5f/7z/pr/5f7zprh0qd5fh72ntcrzdwggeou.png)
2018 html5-, . .
html5- -.
, .
A/B , html5-, — flash-. 2018 html5- -. html5- 85-86% .
![imagem](https://habrastorage.org/webt/_k/gy/pn/_kgypnmnhdy5wdw4p8_nsqd-yds.png)
3. :
- - -. Egret, .. . , : Forge of Empires , ActionScript Haxe, InnoGames . , InnoGames ActionScript->Haxe. InnoGames , , , ( InnoGames Haxe).
- .. , InnoGames
- Haxe OpenFL
- Haxe .
![imagem](https://habrastorage.org/webt/az/7z/xs/az7zxsfzpp22anbpkyl7bhhhpr4.png)
4. , mocked-, .
![imagem](https://habrastorage.org/webt/7_/gw/9b/7_gw9btbjvaxdprllxmuvhrdv94.png)
, mocked-:
ActionScript- — , , mocked- ActionScript. Haxe- ( ). .
"" (, ). Haxe- :
( ) .
![imagem](https://habrastorage.org/webt/e9/j_/kb/e9j_kbfogkjm_5iov0ztuoe7rxk.png)
5. — , ActionScript- , "" :
.. — , ActionScript-.
![imagem](https://habrastorage.org/webt/j3/xi/kc/j3xikcp1lnhlz68dn-tpqes0jza.png)
6. , , , — . .
flash- - swf, ATF-. , html5-. : html5-, flash- .
: swf- , OpenFL .
![imagem](https://habrastorage.org/webt/j4/mv/sg/j4mvsgmjsmuh-dz_7fq1ln4hae4.png)
7. ( ) — , . Pull Request Flash JavaScript.
, UI-.
html5- Flash-.
![imagem](https://habrastorage.org/webt/wp/gp/ux/wpgpuxmcpin3swfseoru6gewqa8.png)
8. (dependency injection) Robotlegs, swiftsuspenders. swiftsuspenders . Haxe- @:rtti
— xml-, . .. , html5- ( xml- ). , : @:rtti
ITypeDescriptionAware
— , , , , ( ). , .
![imagem](https://habrastorage.org/webt/qa/3a/ao/qa3aao8pou-p-loncn69o3rajj0.png)
9. Canvas- , .. , Microsoft Edge — ( ).
![imagem](https://habrastorage.org/webt/0c/cn/t2/0ccnt2suavvhsoeyp7pcmqk7doi.png)
10. ? , - .
InnoGames OpenFL , , WebGL, drawcall.
![imagem](https://habrastorage.org/webt/tm/lw/ax/tmlwax4fzw1ysdn-wnoxzebjcwy.png)
11. OpenFL . SubBitmapData
— , ( — !). , , drawcall.
![imagem](https://habrastorage.org/webt/ue/mi/tr/uemitrye598ly-j_coyysom8cu8.png)
12. ? , !
html5- . — , drawcall ( , drawcall’, ; gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS)
). drawcall’. .
![imagem](https://habrastorage.org/webt/zx/ka/er/zxkaerfsk-y4vohajdr83xy7_mg.png)
13. ? — !
- html5- 60 , Internet Explorer — webgl-, . , , Internet Explorer 10% , "" !
Internet Explorer Flash- .
![imagem](https://habrastorage.org/webt/3q/lt/xe/3qltxepru2o1mycyrhxpqofkkik.png)
, InnoGames Haxe, .. Flash- ActionScript-, html5- — Haxe-, . html5-, OpenFL html5.
, InnoGames (. . 4), , , , ActionScript. Haxe . , "" .
.
Haxe-, Flash, JavaScript. , Haxe- .
, — .
![imagem](https://habrastorage.org/webt/zd/mw/t4/zdmwt4r_uu5bh9g2frnbjlh-p90.png)
: OpenFL html5-, Flash- , .
HaxeUp.
![imagem](https://habrastorage.org/webt/vo/qu/yd/voquydu-zebkycjdsffaef6ovns.png)
14. ( ) — Haxe, 2 . , ( Haxe- , IDE), :
- -, . , . , ,
src
ActionScript-, Haxe- . , "" CI, IDE, . " " (ActionScript- ), , , , " ", Haxe git, ActionScript- - -, . Haxe , ActionScript-. Haxe ActionScript- Ant-. .
, :
![imagem](https://habrastorage.org/webt/vf/vr/ex/vfvrexoikjd1vid7ciitt2zjovw.png)
1. (workflow) — 2 : . , — . , mocked-, .
ActionScript Haxe, ( ).
![imagem](https://habrastorage.org/webt/1b/u7/if/1bu7ifmffcilstos7hjozjmucsc.png)
2. — . Haxe- :
- master- ""
- conversion- Haxe-
- develop- -.
merge-, - ActionScript develop- Haxe-. , "". .
![imagem](https://habrastorage.org/webt/xu/zi/vn/xuzivnl96qd5lf7w2v6fs2yrffo.png)
3. — html5- , . , Internet Explorer Flash-, , Haxe .
Portanto, se a equipe tivesse que reiniciar o desenvolvimento do conversor, seria o mais multiplataforma possível.
![imagem](https://habrastorage.org/webt/jn/e4/42/jne442cfayeyas__5qe2kqu2vaw.png)
Mas agora as duas versões do cliente de navegador do Forge of Empires usam o código Haxe. Obrigado pela atenção!