"Win" and "game over" status access via a script!
-
Hi,
I wonder if is that possible to access "win" or "game over" status while some game is running in retroarch? I want to write a python script and monitor game status (which game is running? how much time passed? how much credits does the player have? and get an event when he looses or he wins).
I am familiar with cheats and actually I've found those memory addresses in cheat menu, but I don't know how to monitor that memory address in my python script?
Thanks. -
As far as I know, there's no method to fire a script/custom action when certain conditions regarding game's memory are met. There is the RetroAchievement code that calls stores/triggers an achievement or there's the ability to make the controller rumble based on a 'cheat code'.
RetroArch also exposes the emulated game's memory via the network control interface with the READ_CORE_RAM command, but that's a polling approach which may not yield the best results.
-
@mitu
Wow, network control interface is a great feature which I didn't know anything about that. But unfortunately "_ READ_CORE_RAM_" command didn't work for me. I monitored verbose log of retroarch and it showed that command is "unrecognized command". I tried "READ_CORE_RAM" but nothing happened.
Could you please explain how to use that command exactly to receive RAM data?
Thanks. -
@Mohsen said in "Win" and "game over" status access via a script!:
Could you please explain how to use that command exactly to receive RAM data?
I think you need to add the address and the number of bytes read - see here. It seems like it works only if achievements are supported for that core, since it uses the cheevos functions. See the discussion here for some usage examples.
What version of RetroArch and what core are you using ?
-
@mitu
It worked! thanks a lot.
I'm using "Version: 1.4.1" for retroarch.
I just wrote a script in python to send UDP packets with this command
"READ_CORE_RAM <address> <len>"
Then I received related bytes.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.