Vegz78
November 22, 2021, 6:58pm
6
For anyone skilled enough to contribute and inclined to share, or just curious or interested enough to learn more about the pxt build system and figure out how to make MakeCode Arcade games run as (experimental and as of yet unsupported)standalone apps/native executables on Windows, Mac and Linux etc., there is an ongoing GitHub issue about this in @eanders ’ explorative UWP repo here:
opened 04:02PM - 19 Nov 21 UTC
Hi Eric, and thanks for an interesting MakeCode Arcade(MCA) UWP project!
I g… et it to build and run for the included _castle-crawler_ game. But unfortunately I am unable to swap out this game for other MCA games, even though I compile and download them as similar pxt64 VM files.
With reference to e.g. [this forum thread](https://forum.makecode.com/t/play-makecode-arcade-game-in-app/10787/3), there might be quite a few people out there apart from yourself and I, that are interested in finding ways to run MCA games as standalone apps/executables.
From what I have read* and gathered from browsing the various pxt source codes and your projects, there seems to be at least 2 viable approaches to achieve this:
1. _VM_: Like you have done here; to compile the MCA games to VM pxt64 files, which then somehow with a [native SDL interpreter should be possible to run on Windows, MacOS and Linux](https://forum.makecode.com/t/how-to-launch-makecode-arcade-uf2s-in-raspbian-retropie/2725/2) desktops.
(I understand that this approach should also be possible on ARM and other platforms, and your UWP-approach is of course interesting, as the game would also run on XBox. But I have still not figured out how to get this SDL VM interpreter to work, and if it's like the web simulator/uf2 boot image, with a menu where you could choose among various games, or if each game needs to be bundled with its own interpreter...)
2. _Native executables_: Directly compile native x86_64 executables on Windows(WIn32 exe), MacOS(Mach-O) and Linux(elf).
([Already solved for ARM/RPi Linux .elf](https://forum.makecode.com/t/how-to-launch-makecode-arcade-uf2s-in-raspbian-retropie/2725/25), but I have not yet figured out how to do this on Windows, MacOS and Linux x86_64. But it should be possible, and maybe you know how?)
There might, of course, be other interesting approaches, like [appifying online shared MCA games](https://github.com/Microsoft/WindowsTemplateStudio), integrate the online shared MCA games or downloaded .js of the games with [WebView2](https://docs.microsoft.com/en-us/microsoft-edge/webview2/), get the simulator to run locally etc.
However, the 2nd alternative might be the most straight forward and with the smallest storage footprint per game? In any case, both approaches are very interesting to explore further, with many different applications and use cases.
On a local pxt server, I have managed to compile the following:
- binary.asm files with various contents(what looks like the IR(VM?) bytecode or ARM assembly, but I am unable to assemble)
- binary.js, which I understand is the file type that the web simulator runs
- binary.pxt64 which I understand is the VM bytecode
- binary.uf2 for all the listed handheld MCU hardware
- binary.elf for ARM/RPi native executable
- A dockercross folder with what seems to be the C++ source code for `pxt.dll`(or the game with `pxt.dll`?), which I am unable to compile yet, but I suspect might be possible to compile somehow with [multiarch crossbuild](https://github.com/multiarch/crossbuild).
But I have not yet found a way to get pxt to output x86_64 executables for Windows, MacOS or Linux, nor a ready compiled `pxt.dll`.
Would you be interested to please help us make this _black magic_ work, document the various approaches, and maybe find the documentation for win32 binaries etc.?
Sources:
- https://www.microsoft.com/en-us/research/publication/static-typescript/
- https://www.microsoft.com/en-us/research/publication/makecode-and-codal-intuitive-and-efficient-embedded-systems-programming-for-education-jsa/
- https://www.infoq.com/presentations/makecode/
As I understand it, this should definitely be possible, with such native and VM build targets already envisioned at some time and included in MakeCode/pxt , but with “a couple regressions” today that should be possible to fix.
For me, this looks a little like the perfect community project, befitting MakeCode’s open source, its mission statement* and its friendly and knowledge thirsty users, where everyone can be creative and have fun together while learning from, and finding and developing new use cases for technology. -Maybe MakeCode Arcade even carries a little bit of the spirit of will it run Doom ?
Looking forward to seeing the first MakeCode Arcade game playable on a bread toaster!!!
*“Microsoft MakeCode is a free, open source platform for creating engaging computer science learning experiences that support a progression path into real-world programming. ”
1 Like