libretro / easyrpg-libretro

⚠️⚠️⚠️ DON'T USE THIS FORK FOR YOUR OWN BUILDS / PACKAGES / ETC ⛔️⛔️⛔️ NO SUPPORT WHEN YOU USE IT ⚠️⚠️⚠️ It is only used by the libretro buildbot. ❤️❤️❤️ For your own builds use the upstream repository: https://github.com/EasyRPG/Player/ (See: "Building a libretro core" in the Readme) ❤️❤️❤️
https://easyrpg.org/
GNU General Public License v3.0
10 stars 8 forks source link

[Feature Request] Expose RAM for Retroachievement support #49

Open riku55 opened 4 years ago

riku55 commented 4 years ago

Heya,

with having a libretro core for rpg maker 2000/2003 games, the possibility of having retroachievements for those games comes to mind. This issue explains it quite well I think: https://github.com/libretro/FreeIntv/issues/44 I'd love having this feature and I would definitely want to make achievement sets for some of those old rpg maker games.

Ghabry commented 4 years ago

This is not an emulator and does not have a fixed memory map. In emulators you always have a linear memory region because they need a way to store the emulated RAM.

This could be faked at least for switches and variables by providing them as "fake RAM" to make the API happy but this is a hack and not very flexible. Will break easily.

I would prefer when RetroAchivements invents some way to make integrating for non-emulators easier. E.g. instead of reading memory values they could ask e.g. the core for (the text string) "variable 123" and then the core responds with this one value from var123. Solves all mem-layout problems and can be easily extended

riku55 commented 4 years ago

Alright, I forwarded your answer to one of the RetroAchievements admins and this is the answer I got:

Too much of the functionality is built around accessing memory by index. It might be possible to fake something though. Instead of named variables, they could expose whatever internal data structure they have as an array of integers and when we ask for memory 0x0002, they'd just return the second integer. The searching functionality and everything else would still work as if it were a block of contiguous memory. However, without knowing how their internals work, it's hard to say if that sort of adaptation would be possible. I do see a possibility in the future via variables. If a lookup fails for a variable, we could ask the emulator/core for the value of the variable. But we'd still need some way to "search" external variables. [...] But I agree with them. I don't see this being feasible anytime soon.

So I guess one has to adapt to the other for this to work. I can understand if this is not a thing to happen in the near future. That said I'd love to stand corrected on this or to just see it at some point in the future!

Ghabry commented 4 years ago

they could expose whatever internal data structure they have as an array of integers and when we ask for memory 0x0002, they'd just return the second integer.

That's the Fake RAM version I mentioned above but as I said this is inflexible and slow because I have to copy each frame all relevant data structures in this continuous block to keep it in-sync. Also I hate it because it is a hack :(

I would be really interested in RetroAchivements support but I would prefer to wait until they provide a non-emulator friendly API.

Btw, did you already try to invent achivements for RPG Maker games or is there any community? Even without any way to get the achivements in RA it would be useful to have a list with prerequisites.

E.g. "Vampires Dawn: [Kill everybody in Shannar]: Switch 26 is ON" (Arbitrary not checked which Switch they use for this)

When there is enough community behind this it could be even integrated into the Player directly and bypassing RA for now (could use another hosted solution, e.g. rmarchiv.tk, I know the webmaster)

riku55 commented 4 years ago

That's the Fake RAM version I mentioned above but as I said this is inflexible and slow because I have to copy each frame all relevant data structures in this continuous block to keep it in-sync. Also I hate it because it is a hack :(

I would be really interested in RetroAchivements support but I would prefer to wait until they provide a non-emulator friendly API.

I totally get that. Maybe at some point I might take a closer look at how to add support to this, not expecting this to be any time soon though :/

Btw, did you already try to invent achivements for RPG Maker games or is there any community? Even without any way to get the achivements in RA it would be useful to have a list with prerequisites.

E.g. "Vampires Dawn: [Kill everybody in Shannar]: Switch 26 is ON" (Arbitrary not checked which Switch they use for this)

When there is enough community behind this it could be even integrated into the Player directly and bypassing RA for now (could use another hosted solution, e.g. rmarchiv.tk, I know the webmaster)

Honestly I lack time and motivation to build a whole project and community for this. I couldn't find anything like this existing already, only thing I found is some plugins for directly integrating achievements into your own rpg maker game, only for newer versions like MV though.

If there are signs for an achievement system coming soon to old rpg maker 2000/2003 games, I might think about looking at some variables and switches in advance, that' definitely a good idea. (Though it has been years since I opened a game in rpg maker, so I'd need to get into that again aswell~)