Ancurio / mkxp

Free Software implementation of the Ruby Game Scripting System (RGSS)
GNU General Public License v2.0
509 stars 128 forks source link

Creation of a libretro core to support a variety of platforms #214

Closed ghost closed 3 years ago

ghost commented 5 years ago

I'm creating this issue as a tracker for what is needed in order to make mkxp accessible from retroarch and other libretro supporting platforms like GNOME Games and Kodi.

The creation of a libretro core would allow support for the variety of platforms that retroarch supports, like the web, Android, the Nintendo Switch, and a variety of other consoles. This will also make the use of mkxp more convenient to users.

pulsejet commented 5 years ago

I have no experience with retroarch, but you might want to strike off iOS from that list, since while it might be (anyhow, say) theoretically possible to run mkxp on iOS, it won't every go into production for any game, since App Store is incompatible with GPL =(

ghost commented 5 years ago

@pulsejet I have amended my original comment to reflect that, thanks.

frozenLake commented 5 years ago

Has anything happened in regards to This?

God, I'd love a way to play MKXP on Android, since Neko really sucks.

greysondn commented 5 years ago

You don't need to strike any platform from the list.

RetroArch is a standard pluggable interface for architecture emulation. In that sense, mkxp would be behaving as an architecture to a libretro user ("host"). So it's more "we're targetting retroarch, and retroarch happens to have hosts that run on all these things", not "we're targetting all these things".

It is not uncommon to abuse RetroArch to do other things; for example, one of the commonly used sanity check RA implementations is just 2048 as self-contained code.

I would consider poking someone who works in the console emulation scene, as retroarch came about - largely - to help support that. To my mind, adelikat, but only because I'm a fan of bizhawk. I don't know if adelikat works with RetroArch in his (her?) work or not.

Edit: I poked Adelikat in his discord server. There should be no need to poke him a second time.

frozenLake commented 5 years ago

Any news, in regards to this? I imagine it would be the easiest way to go multiplatform.

Ancurio commented 5 years ago

@frozenLake I don't think anyone is working on this. From my review of libretro a couple years ago, the library/platform seems to be geared towards self-contained emulators, of which mkxp is neither, and I don't really see the point in it as SDL2 is already heavily cross-platform.

greysondn commented 5 years ago

@Ancurio if I Could offer my argument, for two reasons.

One, frontends for libretro unify games, so if nothing else, at least building a proper frontend to play multiple games from would be one way to do that.

Two, when you're into that sort of thing, some frontends have appealing tools. Bizhawk's libretro hosting is (admittedly) not great, but if it was on par with other cores in Bizhawk we'd have save states, a scriptable system, recording, output to avi/wav, and anything else Bizhawk provides as a host.

I realize that you look at that and say "well, we can just do that" - and you're not wrong. But demanding that there be developers for everything to add these features when there are systems set up to do so requires more man hours than should be necessary for common tooling, which was half the motivation for libretro in the first place.

While libretro is largely meant for emulators, there are cores which can be compared to mkxp in terms of how closed their in-execution context is. See the left-hand list from this linked example for more on that: https://docs.libretro.com/library/easyrpg/

It's important to grasp that the interface generalizes, it just has a target intention.

greysondn commented 5 years ago

Also just point out for anyone who thinks libretro is a silver bullet for cross-platform support - that's not how that works. Things still have to build for target platform in the first place - that's just one of the rules of code compilation. (Edit: Yes, I just glossed over a lot of information; the remark is directed at non-programmers.)

cremno commented 5 years ago

I'm not opposed to it but there's something to keep in mind: RGSS-based RM games have a higher chance of not running with a generic mkxp build (as libretro core or standalone) than a RM200x game with EasyRPG for various reasons (Ruby version differences, use of Win API and DLLs, etc.).

greysondn commented 5 years ago

My key concern, personally, would be the Win API if people think it's the magic way to get cross-platform going.

frozenLake commented 5 years ago

I mean, there used to be plugin support, so maybe the functions could be recreated.

Of course, the plugin branch hasn't been updated for years, so I don't know if such a thing is still possible.

AptGetGnome commented 5 years ago

I wish I knew more to be able to work on this because having mkxp on Switch would be awesome. Along with other consoles too.

Ancurio commented 5 years ago

@adamsarin Having mkxp run on the Switch isn't really much of a technical issue I reckon. SDL has been (non-publicly) ported to the Switch, there is an OpenAL drop-in by Ryan Gordon that apparently works there too, and OpenGL support exists from the get-go. I was about to gain access to the SDK a year or so ago in relation to porting a certain game to the Switch, but someone higher up decided to go with Unity instead. Really, the biggest "hurdle" is the Switch being (I presume) a non-open platform that is hostile to Software Freedom / GPL.

greysondn commented 5 years ago

@Ancurio it's doubtful that "official" SDK was the intended target. This exists: Link

In the same way, EasyRPG is supported on many consoles using homebrew libraries.

The Nintendo Development Kit (NDK) is under an NDA that extends to the point where you cannot discuss the API. It's very doubtful they'd be okay with signatures showing up in an open source database repository. Homebrew APIs are the way to go if that's a target.

Ancurio commented 5 years ago

@greysondn The beauty of platform abstractions is that I almost never have to touch the underlying platform directly. E.g. for Android I wove in some SDL features that made the engine more mobile-friendly, but there is pretty much no reference to Android in the source code save for maybe an enum and a couple defines.

That being said, I don't know what SDK the SDL port targets, I just assume it's the Nintendo Kit because Ryan cannot make it public. Edit: Based on this tweet

If someone wrote an SDL backend targeting the homebrew libs, that'd be great for sure.

frozenLake commented 5 years ago

Ask, and you shall receive!

3DS: https://github.com/nop90/SDL-3DS (note: sdl 1.2)

I wasn't able to find the switch one easily, but this might help for the 3ds, at least.

Edit: I have located one for the switch! https://github.com/reswitched/sdl-libtransistor that one is SDL 2.0, so...

There is also the sdl2.0 port for the 3ds by xerpi, which may or may not work. https://github.com/xerpi/SDL-3DS

ReinUsesLisp commented 5 years ago

devkitpro provides an SDL2 port for the Switch and an OpenGL implementation through nouveau. I haven't tried the former (I've always used EGL + nouveau OpenGL).

Ancurio commented 3 years ago

Since the discussion here has somewhat shifted more towards "mkxp on switch", I'd prefer a separate tracking issue for it. The pathway through devkitpro / homebrew seems promising. Regarding retroarch:

The creation of a libretro core would allow support for the variety of platforms that retroarch supports, like the web, Android, the Nintendo Switch, and a variety of other consoles. This will also make the use of mkxp more convenient to users.

mkxp running on the web
mkxp running on Android

If you still want to see this happen, I suggest you look at building an SDL2<->libretro bridge (ie. implement libretro as a windowing platform within SDL).