Tips on running an MSX emulator for deep learning?

Page 2/2
1 |

By wouter_

Champion (417)

wouter_'s picture

22-09-2016, 11:34

santiontanon wrote:

The first question I'd have is this: imagine I'm building an AI using Java, C++ or Python. How would I communicate with the openMSX TCL script to get a game screenshot or to send actions? a socket?

You can find some documentation here. Keep in mind that this is an asynchronous communication protocol, meaning the MSX emulation is running simultaneously with your AI code. But you can turn it into a synchronous protocol by manually sending pause and continue commands (e.g. to sync with the VDP IRQ, or with the actual frame rendering, or periodically every x (emulated) milliseconds, ..., lots of possibilities).
Note that you don't communicate 'with' a Tcl script. You're talking directly to openMSX. Technically the commands you send however are Tcl commands. These can e.g. be as simple as a single word 'screenshot' to take a screenshot, or as complex as a complete Tcl program/script. IOW for simple things you don't even notice there's Tcl involved (but complex things are also possible).

If you plan to implement your AI in C++ you can also directly insert your code in openMSX itself. This way you avoid the complexity/overhead of the (asynchronous) interprocess communication.

Page 2/2
1 |