Custom HUDs and Game Memory Hooks
-
Hello all,
I'm brand new to using retropie and its typical software flow, but so far I have not found any resources describing how to set up scripts for a couple features I'm hoping are available.
First is the ability to make a custom heads-up display - or more specifically, I just want to place some updating text in the blank margins during gameplay. I've found a lot of resources referencing overlays, but they seem to mostly deal with static images - I want to be able to draw text or shapes on the game view dynamically. Is this possible with the default setup?
The second thing I'm interested in doing is executing scripts based on changes to the executing game's memory space - for example, if $00FC changes to a 1 in the game's address space, I want to execute some script. I wasn't able to find any documentation dealing with this kind of watching or manipulation, but it feels like a capability that should already exist somewhere.
Ultimately I'm trying to get some parity with how game-monitoring scripts work with many PC-based emulators, such as BizHawk. It allows for processing on changes to game state and updating text/graphical overlays via lua. I can provide examples of what I'm talking about, but my first priority is simply finding out if that's possible or if I need to look for other solutions.
Thanks for any help,
~Omni -
@Omnigamer said in Custom HUDs and Game Memory Hooks:
First is the ability to make a custom heads-up display - or more specifically, I just want to place some updating text in the blank margins during gameplay. I've found a lot of resources referencing overlays, but they seem to mostly deal with static images - I want to be able to draw text or shapes on the game view dynamically. Is this possible with the default setup?
That's a RetroArch feature - maybe Input Overlays are better suited for a HUD like display ?
The second thing I'm interested in doing is executing scripts based on changes to the executing game's memory space - for example, if $00FC changes to a 1 in the game's address space, I want to execute some script. I wasn't able to find any documentation dealing with this kind of watching or manipulation, but it feels like a capability that should already exist somewhere.
That's a feature of the emulator used, RetroPie can't do that - there's no general method to accomplish this.
RetroArch, which is used in a lot of emulated systems in RetroPie, doesn't have this feature as you want it, but has specific functionality for monitoring memory addresses and specific hooks for dealing with it - cheats and RetroAchievements.Ultimately I'm trying to get some parity with how game-monitoring scripts work with many PC-based emulators, such as BizHawk. It allows for processing on changes to game state and updating text/graphical overlays via lua. I can provide examples of what I'm talking about, but my first priority is simply finding out if that's possible or if I need to look for other solutions.
As said above, it's up to each individual emulator to implement and suport it, a lot of emulators have support for Cheats, but scripting support is not so widespread.
-
Input Overlays as I understand them are not ideal for this. I can see in the examples that static images are manipulated across the display, but they are still static images. Say I wanted to implement a timer that hangs out in the corner during gameplay - I would have to configure logic to swap out images for each digit of the timer every time increment. That's a bit much! I'm just looking for some way to add my own system text, similar to how the frame counter, fps, or memory utilization can be optionally displayed on the OSD.
As for the latter point, it seems like reaching out to the memory domains is something you can do in libretro according to the API, but I'm not sure how to set up a script that would assess memory state as it is executed - is there any kind of next_frame event or otherwise that could be used to fire off a script to check? There are numerous layers in the system, each with their own sets of capabilities, scripts, and events, so I'm not sure which layer I want to be targeting to get this kind of functionality.
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.