å€ãã®unixoidã®ãªãŒãã³è£œåã§ããOpenTTDããããŸãããã®ãããã³ãã¥ãã±ãŒã¿ãŒãPDAã«ã€ã³ã¹ããŒã«ããããšã§ããã€ã¬ãå°äžéã§ãã²ãŒã ããæ°ãæ£ããããšã¯ã§ããŸããã ã©ãŒã¯ã¢ã¢
ç§ã¯æ£çŽã«èªããããšãã§ããŸããTransportTycoon Deluxeããã¬ã€ããã®ã«èšå€§ãªæéãè²»ãããŸããã ã¯ããç§ã¯ãã®ã²ãŒã ã®ãã¡ã³ã§ãã ãã®ãããmozillaã®äººãã¡ãDoomãã©ã®ããã«ç§»æ€ãããã«ã€ããŠã®èšäºãããã«æ²èŒããããšãããã®ã¢ã€ãã¢ã«è奮ããŸãããããã§ãæ°ã«å ¥ãã®ã²ãŒã ã®1ã€ãã€ã³ã¿ãŒãããã«è»¢éããŸãã ã¡ãªã¿ã«ããã®èšäºã¯ã»ãšãã©ãããŸããã§ããããäž»èŠãªããš-emscriptenã䜿çšããŠç§»æ€ã§ããããšãç¥ããŸããã ãã®ãããªãããžã§ã¯ããå®è£ ããå¯èœæ§ã®ã¢ã€ãã¢ããŸãã«å§ãŸã£ãŠãã1幎ãçµã£ãŠããŸããïŒç§ã®æåã®è©Šã¿ã¯èª€è§£ã®å²©ã«crashèœããŸããïŒã ãããŠä»æ¥ãç§ã¯ããªãã®ãã¹ãŠãåã°ããããã«æ¥ãã§ããŸãïŒç§ã¯ãããããŸããïŒ ããã§ãã€ã³ã¿ãŒãããã«æ¥ç¶ãããä»»æã®å ŽæããTTDã§ã²ãŒã ã®èåŸã«ããã座ãããããšãã§ããŸãã
ãããŠãããã«ãããªããããŸãïŒ
ãã£ãã¡ãªäººã¯ä»ãããã¬ã€ãéå§ã§ããŸãã äœããããŸããããªãå Žåã¯ç解ããŠãã ããã ãã®ããŒãžã§ã³ã¯ãã¹ãäžã®ã¿ã§ãã ã²ãŒã ã¯ééããªãFF13ïŒæšå¥šãã©ãŠã¶ãŒïŒããã³ChromeïŒiumïŒã§åäœããŸãã äœéãµãŒããŒãµãŒããŒãè² è·ãåŠçã§ããããšãé¡ã£ãŠããŸãã ãããŠãã¯ããç§ã¯ãã³ã¯ã®ã¿ã€ã«ã«ã€ããŠç¥ã£ãŠããŸããç§ã¯ããã«åãçµãã§ããŸãã
OpenTTD
JavaScriptããŒãžã§ã³ã®ãœãŒã¹ã³ãŒãæäŸè ã«ãªã£ãOpenTTDãããžã§ã¯ãã«ã€ããŠå°ãã話ããããšæããŸãã äžè¬çãªèŠç©ããã«ããã°ããããžã§ã¯ãã«ã¯çŽ300,000è¡ã®C ++ã³ãŒããå«ãŸããŠããŸãã ããã«ããããžã§ã¯ãã®å¯èœæ§ã¯éæ¹ããªãã§ãã èªåã§å€æããïŒ
- 4ã€ã®ã°ã©ãã£ãã¯ãµãã·ã¹ãã ïŒãã©ã€ããŒïŒ
- 5ã€ã®ãµãŠã³ããã©ã€ããŒ
- ãªãã«/ããã°ãšã³ãã£ã¢ã³
- ãœãŒã¹ã¬ãã«ã§ã¯ãã·ã³ã°ã«ã¹ã¬ããããã³ãã«ãã¹ã¬ããã®å®è¡ããµããŒããããŠããŸãã
- ãããã¯ãŒã¯ç°å¢ïŒãããã¯ãŒã¯ããã°ã©ãã£ãã¯ãšé³æ¥œã»ãããããŠã³ããŒãããïŒã§ããããªãã§äœæ¥ãã
- ãã«ããã¬ã€ã€ãŒã²ãŒã
- lzmaã§ä¿åãã¡ã€ã«ãå§çž®ãã
- ãã£ãã·ã¥ã¬ã³ããªã³ã°
- ã«ã©ãŒãã¬ããã®å転ã«ããã¿ã€ã«ã®ã¢ãã¡ãŒã·ã§ã³
- çµã¿èŸŒã¿ã®Squirelã¹ã¯ãªããèšèª
ã»ãšãã©ã®ã³ãŒãã¯åµé çã«æžãããŠããŸãã ãã®ãããžã§ã¯ãã®å éšãæãäžããããšã¯éåžžã«èå³æ·±ãããšã§ããã æ®å¿µãªãããç§ã¯ãã®ãããªéé£ã®ä»£éãæ¯æããªããã°ãªããããã®å Žåç§ã¯å·šå€§ãªã¢ã»ã³ããªã·ã¹ãã ã«åºããããŸããã 移æ€ã®ããŒãºã«åãããŠOpenTTDã¡ã€ã¯ãã¡ã€ã«ã®ããããèªååããperlã¹ã¯ãªãããäœæããå¿ èŠããããŸããã
OpenTTDã®ç§»æ€ã¯ã次ã®æ§æã§å¯èœã§ããã
- ã·ã³ã°ã«ã¹ã¬ããã¢ãŒã
- ãªãã«ãšã³ãã£ã¢ã³
- å®å šã«ç¡å¹åããããããã¯ãŒã¯æ©èœ
- ãããªãã©ã€ããŒ-ä¿®æ£æžã¿SDL
- samopisnyãµãŠã³ããã©ã€ããŒ
- ãµãŒããŒã«ã²ãŒã ãä¿åããããã®ããããããã¡ã«ããºã
- ããããåœãŠãã²ãŒã ãªãœãŒã¹ãã±ãŒã¿ãŒ
æ®ãã¯ããã©ã«ãã§ãã
ãšãã·ããã³
Emscriptenã¯ã³ãŒãã®ç§»æ€ãæ³èµ·ãããç§ã¯ãã®ãããã¯ãæ¶åã§ããããã«æ³èµ·ãããŸããã ååã®èšäºãäœæããŠããã®é£è§£ãªæè¡ã®ä»çµã¿ã説æããŸãã
èãæ¹ã¯åçŽã§ãïŒC ++ã³ãŒãã¯clangã䜿çšããŠLLVMãã€ãã³ãŒãã«ã³ã³ãã€ã«ãããŸãã ãã€ãã³ãŒãã¯ãemscriptenã䜿çšããŠJavaScriptã§ã³ã³ãã€ã«ãããŸãã LLVMãã€ãã³ãŒãã¯ãäœã¬ãã«ã®ä»®æ³ãã·ã³ã§å®è¡ã§ããäžéã³ãŒãã§ãã ãã€ãã³ãŒãLLVMã®ä»æ§ã¯ååã«ææžåãããŠããããããã³ãŒãã®äžéè¡šçŸãšããŠãããžã§ã¯ãäœæè ã«ãã£ãŠéžæãããçç±ã®1ã€ã§ãã emscriptenã³ã³ãã€ã©ã¯ã次ã®å³ã®ããã«ããã€ãã³ãŒãåœä»€ã1察1ã®JavaScriptã³ãŒãã«å€æããããšããŠããŸãïŒå·ŠåŽã®ãã€ãã³ãŒããå³åŽã®JavaScriptïŒã
ã»ãšãã©ã®åœä»€ã§ã¯ããã®åè·¯ã¯å®å šã«æ©èœããŸãã ãã ãããã®ãããªã³ã³ãã€ã©ã®éçºã¯ç°¡åãªäœæ¥ãšã¯èšããŸããã LLVMãã€ãã³ãŒããšJavaScriptã¯éåžžã«ç°ãªããŸãã ããè€éãªãã®ïŒãã€ã³ã¿ãŒæŒç®ãã«ãŒãããšã©ãŒåŠçïŒãå®è£ ããã«ã¯ãè¿œå ã®äœæ¥ãå¿ èŠã§ãã C ++ãšJavaScriptã®ç°ãªãåäœã®ç°¡åãªäŸã次ã«ç€ºããŸãã
C ++ã§é€ç®ãè¡ããšãæ°å€ã®å°æ°éšåãç Žæ£ãããŸãã JavaScriptã§åãæ©èœãåŸãã«ã¯ãMath.floorã®ãããªããªãã¯ã«é Œããªããã°ãªããŸããïŒäžèšã®ã³ãŒãã¯ãã¹ãŠã®å Žåã«æ£ãããªããã»ãšãã©ã®å Žåã«åœãŠã¯ãŸããŸãïŒã
ããè€éãªäŸã¯ãLLVMãã€ãã³ãŒããšJavaScriptã®ã«ãŒãå®è£ ã§ãã
JavaScriptã§åæ§ã®æ©èœãå®è£ ããæ¹æ³ã¯å€æ°ãããŸããããã®å€ãã¯çç£æ§ãäœããããã§emscriptenã®ã¿ã¹ã¯ã¯æãçç£çãªã³ãŒããçæããããšã§ãã
ãããã®äœã¬ãã«ã®ãã®ã«å ããŠãemscriptenã¯libcãlibcxxãPOSIXãSDLãGLãGLESãããã³ãã®ä»ã®ã©ã€ãã©ãªã®å®è£ ãæäŸããŸãã å®å šã«å®è£ ããããã¡ã€ã«ãµãã·ã¹ãã CïŒfopenãfcloseãfreadã...ïŒã ã»ãšãã©ã®ããã°ã©ã ã¯ãemscriptenã䜿çšããŠåé¡ãªãã³ã³ãã€ã«ã§ããŸãã Emscriptenã€ããªãã®ãŒã®å šäœçãªé åã¯ããœãŒã¹ã³ãŒããç·šéããå¿ èŠããªãããšã§ã-ããã¯ãšã«ããåäœããŸãã ãã®å Žåããããžã§ã¯ãã®JavaScriptãžã®ç§»æ€ãæåããå ŽåãããŒãžã§ã³ããããŒãžã§ã³ãžã®ç§»è¡ã¯ç°¡åãã€èªç¶ã«å®è¡ãããŸãã ããšãã°ãç§ã¯emscriptenãèŠãŠããŸããããã³ãã¥ããã£ã¯OpenTTDã®æ¬¡ã®ãã€ããŒããŒãžã§ã³ããªãªãŒã¹ããããšãã§ããŸãããããœãŒã¹ãåæããææ°ããŒãžã§ã³ã®äŸ¿å©ãªç§»æ€çãåŸãŸããã
Transport Tycoon Deluxe
JavaScriptã®emscriptenã䜿çšããŠãDoomãzlibãPopplerãOpenJPEGãFreeTypeãBulletãSQLiteãPythonãRubyãLuaãªã©ãååãªæ°ã®æ·±å»ãªãããžã§ã¯ããæ¢ã«ã³ã³ãã€ã«ãããŠããŸãã çŸåšãemscriptenãã£ã¹ã«ãã·ã§ã³ã°ã«ãŒãã§ãFortranã®ã³ã³ãã€ã«ã«é¢ãã掻çºãªè°è«ãè¡ãããŠããŸãã
ãã ããè€éãªãããžã§ã¯ããæ£åžžã«ã³ã³ãã€ã«ããã«ã¯ãC ++ã®ç¥èãå¿ èŠã§ãã ããšãã°ãOpenTTDãåããŠæ£åžžã«ã³ã³ãã€ã«ãããšãã«åŸãããçµæã§ãã
ãã®ããŒãžã§ã³ã§ã¯ãããŠã¹ãããŒããŒããæ©èœããŸããã§ããã ãã®ç»åã®ã¿ããã¹ãŠã§ãã
emscriptenã®äœæè ã¯ãå€æ°ã®ã©ã€ãã©ãªããµããŒããããšäž»åŒµããŠããŸããããã®ãµããŒãã¯å®å šã«ã¯å®è£ ãããŠããŸããã ããšãã°ãemscriptenã¯ãSDL 1.2ãæ··åšããSDL 2.0ã®å°ããªãµãã»ããã®ã¿ãå®è£ ããŸãã ãããã£ãŠãç§ã¯emscriptenã«å¿ èŠãªæ©èœã®æ¬ åŠã«çŽé¢ããããããèªåã§å®è£ ããªããã°ãªããŸããã§ããã ããããç§ã¯ãããžã§ã¯ãã³ããã¿ãŒã®äžäººã«ãªããŸããïŒ ChSV !!! ïŒã
äžèšã®ã¹ã¯ãªãŒã³ã·ã§ããã§ææãããåé¡ã¯ãemscriptenã§ã®SDL 1.2ã®å®è£ ã32ããããµãŒãã§ã¹ã®ã¿ããµããŒãããSDL_HWPALLETEãã©ã°ã«ã€ããŠäœãç¥ããªãã£ããšããäºå®ãåå ã§ããã SDL_HWPALLETEã¢ãŒãã®ç»åã¯ã8ãããïŒ256è²ïŒã§ãšã³ã³ãŒããããŸãã ããã¯ããã®é¢é£ããç»åå§çž®ã䜿çšããŠããŸãã ãªãæ°Žå¹³ã«åæ ãããã®ã§ããïŒãŸã ããããŸããã ããã«ã次ã®é¢æ°ãå®è£ ããå¿ èŠããããŸããïŒSDL_VideoModeOKãSDL_VideoDriverNameãSDL_QuitSubSystemãããã³strndumpã èè ã«å ±åãããæ·±å»ãªããã©ãŒãã³ã¹ã®åé¡ãç¹å®ãã圌ãã¯ãããä¿®æ£ããŸããã æ®å¿µãªããããµãŠã³ããµãã·ã¹ãã ã§ã®ç§ã®ç·šéã¯ãçŸæç¹ã§ã¯emscriptenã³ãŒãããŒã¹ã«ã¯å«ãŸããŠããŸããã
emscriptenæé©åãã©ã°ã«é¢ããå€ãã®åé¡ãç¹å®ãããŠããŸãã ãããªã«è¡šç€ºããããã³ã¯è²ã®ã¿ã€ã«ã¯ãæé©åã®åé¡ã«ãããŸãã-ãã©ã°ããªããã°æ£ããè²ã§ãã ãã®çš®ã®åé¡ã«å¯ŸåŠããããšã¯éåžžã«å°é£ã§ãã åé¡èªäœã¯æ£æ°ã§ã¯ãªãïŒ2æ¹åã«45床ã®åŸæããããã³ã¯è²ã®æ°Žã¿ã€ã«ïŒãæé©åããªã³ã«ããŠç§»æ€ããã®ã«éåžžã«é·ãæéïŒ2æé以äžïŒãèŠãããããå€ãã®å Žåããã¹ãããŸããã ãããããããžã§ã¯ãã¯éåžžã«è¿ éã«éçºãããŠããããã°ã¯1ã2æ¥ä»¥å ã«éããããŸãïŒå°ãªããšãç§ã®å ŽåïŒã
éåžžãemscriptenã䜿çšããŠè€éãªãããžã§ã¯ãã移æ€ããããšã¯ãæ¬åœã«å¿ èŠãªå Žåã«å¯èœã§ãã ãããã«ãããemscriptenãŸãã¯ãããžã§ã¯ãèªäœãå°ãç·šéããå¿ èŠã«çŽé¢ããå¿ èŠããããŸãã ããããäžåºŠå®äºããã°ãåé¡ãªã移æ€ãäœåºŠãç¹°ãè¿ãããšãã§ããŸãã
ãšãŠãé ãã§ããã
ãããžã§ã¯ãã®èè ã§ããã¢ãã³ã»ã¶ã«ã€ã¯ããšã¯ãªãã»ã³ã«é¢ããã¬ããŒããšã®ã«ã³ãã¡ã¬ã³ã¹ã§è¬æŒããJavaScriptèªäœã¯éåžžã«é«éã§ãããããã«ããã¯ã¯ã³ã³ãã€ã©ã§ãããå¿ ãããæé©ãªã³ãŒãå€æã§ã¯ãªããšããæèŠãè¡šæããŸããã 圌ã¯æ¬¡ã®ãã¬ãŒããåŒçšããã
SpiderMonker ïŒSMïŒã¯ãFirefox JavaScriptãšã³ãžã³ã§ãã åä»ãé åïŒTAïŒã¯ãçŸåšemscriptenã«ãã£ãŠæäŸãããŠããæéã®JavaScriptããŒããšãã¥ã¬ãŒã·ã§ã³æ¹æ³ã§ãã è¡šã®ã»ã«ã®æ°å€ã¯ãJavaScriptã§ã³ã³ãã€ã«ãããã³ãŒãã®å®è¡ããã€ãã£ãã³ãŒããããé ãããšãå€æããåæ°ã瀺ããŠããŸãã ã芧ã®ãšãããã¹ãã¬ããã¯1ã8åã§ãïŒãã ããå¹³åã¯3ã5ååŸã§ãïŒã
äžã®å³ã®æ°åã¯ããã¹ãã¹ã€ãŒãhttp://shootout.alioth.debian.org/ã§ç¹å®ã®èšèªãC ++ãããé ãåæ°ã瀺ããŠããŸãã ïŒæ³šïŒãã®æ å ±ã¯ãã§ã«ããªãå€ããJavaScriptãé«éèšèªã§ããããšã瀺ãããšãç®çãšããŠããŸããããã«åæããªã人ã¯å£°ããããä»ã®èšèªã«è§Šããªãã§ãã ããã
äžè¬ã«ããããã®æ°åã«åæããOpenTTDã®JavaScriptããŒãžã§ã³ã¯ãã€ãã£ãããŒãžã§ã³ãããçŽ5ã7åé ããšèšããŸãã ãã ããFireFoxãã©ãŠã¶ã®ã¿ã§ãã ãããŠãããã¯ç§ãèªåèªèº«ã§çºèŠããæãçŽ æŽãããç¬éã§ãã nodejs + Chromiumã§éçºãäž»å°ããŸããã ç§èªèº«ã¯FFã®ãã¡ã³ã§ãããæ®å¿µãªããšã«ãopenTTD JavaScriptããŒãžã§ã³ã¯çŽ50ã¡ã¬ãã€ãã®ãµã€ãºã§ãããFFã¯ãã£ãããšãã³ã°ããŸããããã¯ãã ã¯éåžžã«é«éã«åäœããŸããã ç§ã¯æ³¢ã®ã¯ãã ãèããŠããŸããããçªç¶ããªãªãŒã¹çã¯ã¯ãã ãããFFïŒ2ã3åïŒã§ã¡ãã€ãã®ãªãé床ã§åäœããããšãããããŸããã ãããã£ãŠãFireFoxã䜿çšããŠãã¬ã€ããããšããå§ãããŸãã
ç§ã¯ãã®ãããžã§ã¯ããåãäžããŠå®æãããããšãéåžžã«å¬ããæããŸãã clangãllvmãpythonãjavascriptã«ã€ããŠå€ãã®ããšãåŠã³ãŸããã é¢çœã人ãšãããã¹ãã ã³ãã¥ããã£ã¯ç§ã®ãããžã§ã¯ããæ¬åœã«æ°ã«å ¥ããŸãããæè¿ã§ã¯ãèè ãemscriptenãã¢ãããžã§ã¯ãããŒãžã«å¯çš¿ããŸããã è¡ãããäœæ¥ãã倧ããªæºè¶³ãåŸãŸããã äžè¬çã«ãç§ã¯çã«æãããšã
ããäžåºŠãåç §ïŒ play-ttd.com
VKã¢ããªã±ãŒã·ã§ã³
UPDã æ°ãããããžã§ã¯ããµã€ãã