• 1
  • 2
  • 3
  • 4(current)
  • 5
  • 6
  • 13
Player Manager
#46
(2017-07-17, 22:31)MrTarantula Wrote: What is the theoretical virtual controller-per-port limit? Because the first thought I had after seeing this is a "Twitch plays X" kind of scenario but instead of voting on the next button press, thousands of participants could be registered to that port and fighting for control of the game. That would be pretty wild.

The per-port count is virtually unlimited. This is one of my design requirements so that "Twitch Plays X" is possible in the future. This depends on the netplay code, but the GUI's design certainly won't limit this.
RetroPlayer releases: https://github.com/garbear/xbmc/releases

Donations: eigendude.eth
Reply
#47
I think the switch for exclusive ports is perfect, especially the way it dynamicly adjusts. It looks to be the best idea and i don't have a problem with a big window as the user shouldn't have it up for long.
Reply
#48
(2017-07-18, 10:00)nihilisticEevee Wrote: I think the switch for exclusive ports is perfect, especially the way it dynamicly adjusts. It looks to be the best idea and i don't have a problem with a big window as the user shouldn't have it up for long.
I fully agree, thanks garbear sensei! Can't thank you enough and eagerly awaiting Kodi 19/20 or whenever the game database, netcode and all the rest of the awesome stuff being worked on is complete
Reply
#49
(2017-07-20, 18:36)sectune Wrote:
(2017-07-18, 10:00)nihilisticEevee Wrote: I think the switch for exclusive ports is perfect, especially the way it dynamicly adjusts. It looks to be the best idea and i don't have a problem with a big window as the user shouldn't have it up for long.
I fully agree, thanks garbear sensei! Can't thank you enough and eagerly awaiting Kodi 19/20 or whenever the game database, netcode and all the rest of the awesome stuff being worked on is complete

More like Kodi "1920" Wink We probably won't have a game library for v18, but RetroPlayer is merged and shipping whether I want it to or not. We'll probably start shipping beta releases in a few months, so time for the more important features (file parsing, Android support, BIOS support, and better save support) is running out.
RetroPlayer releases: https://github.com/garbear/xbmc/releases

Donations: eigendude.eth
Reply
#50
(2017-07-20, 20:13)garbear Wrote: More like Kodi "1920" Wink We probably won't have a game library for v18, but RetroPlayer is merged and shipping whether I want it to or not. We'll probably start shipping beta releases in a few months, so time for the more important features (file parsing, Android support, BIOS support, and better save support) is running out.

Garbear, thanks for your clarification that v18 won't have a games library. I have a couple of questions:

a) Since BIOS is not supported in v18 this means cores requiring BIOSes won't work in v18?

b) What about cores that require asset files in the System directory (for example PPSSPP and recently Dolphin)?

c) What do you mean by "file parsing"?

I take the opportunity for an additional, little off-topic question. Currently Advanced Emulator Launcher support RetroPlayer using the following

Code:
xbmc.Player().play(ROMFileName.getPath(), bc_listitem)

where bc_listitem has the following fields

Code:
bc_romfile = os.path.basename(ROMFileName.getPath())
bc_listitem = xbmcgui.ListItem(bc_romfile, "0", "", "")
bc_parameters = {'Platform': 'Test Platform', 'Title': 'Test Game', 'URL': 'testurl'}
bc_listitem.setInfo(type = 'game', infoLabels = bc_parameters)

Can I use the same launching mechanism in Leia? I'm asking this because I want AEL to support Leia and Retroplayer since first beta.
Reply
#51
(2017-07-21, 08:53)Wintermute0110 Wrote: a) Since BIOS is not supported in v18 this means cores requiring BIOSes won't work in v18?

Sorry, I meant "BIOS add-ons". You can copy BIOSes manually, but I hope to bring an in-GUI method to BIOS installation.

(2017-07-21, 08:53)Wintermute0110 Wrote: b) What about cores that require asset files in the System directory (for example PPSSPP and recently Dolphin)?

In this case, "BIOSes" refers to assets too. The mechanism behind their support is this PR: https://github.com/libretro/RetroArch/pull/3715 . The goal is to load resources (BIOSes and assets) through a VFS so that they can be provided by an add-on. Until then, these are supported, but will need to be manually copied. The exception is static, non-restricted files, which we can distribute with the add-on, such as the system files for BlueMSX: https://github.com/kodi-game/game.libret...ces/system

If you find any libretro cores with system files we can distribute, let me know.

(2017-07-21, 08:53)Wintermute0110 Wrote: c) What do you mean by "file parsing"?

Currently, we solve the question of "Is this a game?" by detecting the file extension. File parsing means that we make this decision based on the actual data. For example, with an ISO, we parse the ISO image looking for game, music of DVD files.

(2017-07-21, 08:53)Wintermute0110 Wrote: Currently Advanced Emulator Launcher support RetroPlayer using the following

Code:
bc_romfile = os.path.basename(ROMFileName.getPath())
bc_listitem = xbmcgui.ListItem(bc_romfile, "0", "", "")
bc_parameters = {'Platform': 'Test Platform', 'Title': 'Test Game', 'URL': 'testurl'}
bc_listitem.setInfo(type = 'game', infoLabels = bc_parameters)

Can I use the same launching mechanism in Leia? I'm asking this because I want AEL to support Leia and Retroplayer since first beta.

The "game" type was added in Leia. You can see the supported fields here: https://alwinesch.github.io/group__pytho...90e8edbf18 . The valid info labels are:
  • title
  • platform
  • genres list
  • publisher
  • developer
  • overview
  • year
  • gameclient

You can drop "url", RetroPlayer uses the listitem path.

You can force a particular game client using the "gameclient" label. Set this to the game client ID, either installed or uninstalled. If this is unspecified, RetroPlayer will ask the user to choose an emulator. This prompt will go away when we have a way to choose automatically.
RetroPlayer releases: https://github.com/garbear/xbmc/releases

Donations: eigendude.eth
Reply
#52
RetroPlayer actually have or will have for Kodi 18 zip support? and 7zip?

In all screenshots I always see the final rom extension, but I don't know if this is because you have raw roms (because RetroPlayer dind't have zip/7zip support?) or because it shows the final file name.

Well, I supose that if RetroPlayer didn't provide this directly, this will be core support. Some cores can open zip's directly, or Bettle PSX can open PBP files (feature added by libretro team). But in RetroPlayer, have front-end support for 7zip is a win. I can open directly my n64 roms that are in a merged rom-set without extract it first, the emulator list the files and I can select what I want inside the 7zip, and history works with the 7zip rom too! is awesome.

I read that you want to do this using the VFS, but I don't know if this use case (play ziped / 7ziped files) is already implemented. RetroArch basically extract the file in a "cache" folder.
Reply
#53
Thanks a lot for your detailed answer, Garbear.

(2017-07-21, 19:43)garbear Wrote: In this case, "BIOSes" refers to assets too. The mechanism behind their support is this PR: https://github.com/libretro/RetroArch/pull/3715 . The goal is to load resources (BIOSes and assets) through a VFS so that they can be provided by an add-on. Until then, these are supported, but will need to be manually copied. The exception is static, non-restricted files, which we can distribute with the add-on, such as the system files for BlueMSX: https://github.com/kodi-game/game.libret...ces/system

If you find any libretro cores with system files we can distribute, let me know.

I'm currently in the process of documenting how to run most of the Retroarch cores with all required files (BIOSes or assets). Here is the link in case is useful.

Redistributing BIOSes into addons may be a problem... because I believe most BIOSes are still under copyright. I think the best thing to do is document properly every core so the user can easily locate the BIOSes required on their own (most of them can be found on the Internet Archive from MAME ROM sets).

(2017-07-21, 19:43)garbear Wrote: The "game" type was added in Leia. You can see the supported fields here: https://alwinesch.github.io/group__pytho...90e8edbf18 . The valid info labels are:
  • title
  • platform
  • genres list
  • publisher
  • developer
  • overview
  • year
  • gameclient

You can drop "url", RetroPlayer uses the listitem path.

You can force a particular game client using the "gameclient" label. Set this to the game client ID, either installed or uninstalled. If this is unspecified, RetroPlayer will ask the user to choose an emulator. This prompt will go away when we have a way to choose automatically.

Thanks a lot, this is very helpful.

Regarding the platform names: this is the list currently AEL uses. It would be nice to quickly set an "standard" for everyone to use.

Also, is there a way of programmatically know if a gameclient addon has been installed? If AEL knows the installed cores I can let the user choose which core he wants to launch a particular launcher and then set the gameclient label in the listitem automatically. If user wants to change the core then he can edit the launcher using the context menu.
Reply
#54
(2017-07-21, 22:34)Julipo Wrote: RetroPlayer actually have or will have for Kodi 18 zip support? and 7zip?

I read that you want to do this using the VFS, but I don't know if this use case (play ziped / 7ziped files) is already implemented. RetroArch basically extract the file in a "cache" folder.

This is pretty much the definition of VFS. It virtualizes zip files, so their contents look like files on a normal file system. You can see which cores have VFS support here: http://kodi.wiki/view/Game_add-ons#Libretro_cores

Once VFS support has been added to the libretro API, it can also be used for dynamic patching or overlay filesystems. Unzipping to a "cache" folder could be used as a backup for cores that don't support VFS. This is what IARL does. However, effort spent on this feature is arguably better spent on proper VFS support.
RetroPlayer releases: https://github.com/garbear/xbmc/releases

Donations: eigendude.eth
Reply
#55
(2017-07-24, 00:54)Wintermute0110 Wrote: I'm currently in the process of documenting how to run most of the Retroarch cores with all required files (BIOSes or assets). Here is the link in case is useful.

Yes, this is incredibly useful. If we had a standard like this in Kodi, then when a BIOS isn't found, we can inform the user of which BIOS they need.

(2017-07-24, 00:54)Wintermute0110 Wrote: Redistributing BIOSes into addons may be a problem... because I believe most BIOSes are still under copyright. I think the best thing to do is document properly every core so the user can easily locate the BIOSes required.

Yes, many BIOSes are restricted. An idea I had is "Game resource add-ons", add-ons that can provide BIOS files. That way, when a BIOS isn't found, the user will know what to look for, e.g. "game.resource.bios.saturn".

(2017-07-24, 00:54)Wintermute0110 Wrote: Regarding the platform names: this is the list currently AEL uses. It would be nice to quickly set an "standard" for everyone to use.

Agreed. The lack of a standard has held back several feature I've started working on.

However, because there's so many of such platform lists, we need a universal way of mapping between these. First, we need to decide what platform list to use in the GUI. We can use your list verbatim for this. Next, we need to create a platform taxonomy, with taxonomic relationships between platforms so that we can map between your list and e.g. TheGamesDB.net, even if one considers "Sega CD" and "Sega" to be the same platform, and the other considers them separate platforms.

While I don't have a schema for platforms yet, I do have one for controllers: https://github.com/kodi-game/kodi-game-c...ers/addons . Instead of platforms, I'm mapping them directly to emulators. I'm also adding topological mappings now, such as x IS-COMPATIBLE-WITH y.

BTW, a few years ago I created a mapping between file extensions and platforms: https://github.com/topfs2/heimdall/blob/...tem.py#L86

(2017-07-24, 00:54)Wintermute0110 Wrote: Also, is there a way of programmatically know if a gameclient addon has been installed? If AEL knows the installed cores I can let the user choose which core he wants to launch a particular launcher and then set the gameclient label in the listitem.

You can use the standard JSON-RPC functions to accomplish this I think. However, Kodi doesn't expose which extensions are supported by which add-ons, and I'm sure there are other limitations.

I'm hesitant to expose this info because then each add-on will implement its own core selection logic, using its own list of platforms or whatever. I would rather centralize this in RetroPlayer to expose the functionality to all add-ons. Can you better explain your use case? We should identify the needs that overlap with IARL and then kill two birds with one stone.
RetroPlayer releases: https://github.com/garbear/xbmc/releases

Donations: eigendude.eth
Reply
#56
(2017-07-24, 18:34)garbear Wrote:
(2017-07-24, 00:54)Wintermute0110 Wrote: Regarding the platform names: this is the list currently AEL uses. It would be nice to quickly set an "standard" for everyone to use.

Agreed. The lack of a standard has held back several feature I've started working on.

However, because there's so many of such platform lists, we need a universal way of mapping between these. First, we need to decide what platform list to use in the GUI. We can use your list verbatim for this. Next, we need to create a platform taxonomy, with taxonomic relationships between platforms so that we can map between your list and e.g. TheGamesDB.net, even if one considers "Sega CD" and "Sega" to be the same platform, and the other considers them separate platforms.

While I don't have a schema for platforms yet, I do have one for controllers: https://github.com/kodi-game/kodi-game-c...ers/addons . Instead of platforms, I'm mapping them directly to emulators. I'm also adding topological mappings now, such as x IS-COMPATIBLE-WITH y.

BTW, a few years ago I created a mapping between file extensions and platforms: https://github.com/topfs2/heimdall/blob/...tem.py#L86

OK. Currently AEL uses long names for platforms (for example, "Sega MegaDrive") but I plan to include the ability to use both a short name and a long name (for example, "psx" "Sony Playstation"). Short names are very convenient when creating the directories to place the ROMs and assets and also for the utilities to test the scrapers (for example: ./test_TheGamesDB_metadata psx "Tomb Raider.iso")

Also, in AEL some of the platform names are aliases ("TurboGraphx 16" is an alias of "PC Engine") but currently these aliases are not indicated in the platform list. I'm in the process of rebuilding/improving the Offline scraper, refurbish the platform name data model and will try to finish off ASAP. I don't expect that the current platform names will change that much.

The taxonomy is already done in AEL. If you look down in the Python file whose link I posted you can see how AEL maps its platform names to TheGamesDB, MobyGames, etc. On a best-effort basis. It is impossible to make a platform list that is 100% compatible with all sites (for example, some databases consider "PC Engine" and "TurboGraphx 16" different platforms but in reality they are the same machine on different regions) so AEL policy is to follow No-Intro/Redump platform naming.

(2017-07-24, 18:34)garbear Wrote:
(2017-07-24, 00:54)Wintermute0110 Wrote: Also, is there a way of programmatically know if a gameclient addon has been installed? If AEL knows the installed cores I can let the user choose which core he wants to launch a particular launcher and then set the gameclient label in the listitem.

You can use the standard JSON-RPC functions to accomplish this I think. However, Kodi doesn't expose which extensions are supported by which add-ons, and I'm sure there are other limitations.

I'm hesitant to expose this info because then each add-on will implement its own core selection logic, using its own list of platforms or whatever. I would rather centralize this in RetroPlayer to expose the functionality to all add-ons. Can you better explain your use case? We should identify the needs that overlap with IARL and then kill two birds with one stone.

The use case will be: suppose the user want to create a SNES launcher. Currently, he/she knows before hand the emulator or Retroarch core he wants to use (exernal emulator). If user chooses Retroplayer as the launcher, then AEL will show a list of installed cores that are able to run ROMs of that platform so user can choose which core he/she wants as default and not be asked every time a ROM is launched. Of course, the default launching core can be changed any time in the context menu and user preference is saved on AEL launcher JSON DB.
Reply
#57
(2017-07-26, 18:27)Wintermute0110 Wrote: The taxonomy is already done in AEL.

lol, if I had scrolled a bit further I would have noticed this. These tables you've built are an excellent resource. Can you extract these into a declarative data format? Do you have any experience with JSON-LD? This would enable reuse across many projects and programming languages.

(2017-07-26, 18:27)Wintermute0110 Wrote: The use case will be: suppose the user want to create a SNES launcher.

Currently, he/she knows before hand the emulator or Retroarch core he wants to use (exernal emulator).

Here is where our projects run into an impedance mismatch. I've told this story a few times, but my eye-opening moment was when I gave a talk to 11-year-olds in a poor neighborhood a few hundred miles from the border of Mexico. When I said "I work with emulators" I got blank stares. These kids have parents who couldn't afford game consoles growing up, so SNES is foreign to them. Some kids had a friend with a new Xbox or PlayStation. One console emulating the hardware of another is an idea they had never been exposed to.

So both "advanced" and "launcher" are roadblocks to the majority of the human population being able to enjoy retro games.

And that's my idea for RetroPlayer: putting the games first and abstracting away the emulators. Hence my reluctance to expose emulator information and break this abstraction.

(I'm definitely not knocking your project, just saying our target user bases aren't identical)

I would like RetroPlayer to support use cases like AEL, but I need to be really careful when designing the interface.

(2017-07-26, 18:27)Wintermute0110 Wrote: a list of installed cores that are able to run ROMs of that platform

Here's a question: Do cores specify the platforms they support, or the file extensions they support? Can a NES emulator only accept ROMs with a certain header type? Can another emulator accept multiple platforms, as long as the ROMs are .iso's?

This is why I haven't yet created my game platform ontology - it's a GUI abstraction, not an emulator abstraction. RetroPlayer is 100% happy being platform-agnostic, because at the emulator level the file format is what's important, not the semantics of which platform the file belongs to.
RetroPlayer releases: https://github.com/garbear/xbmc/releases

Donations: eigendude.eth
Reply
#58
(2017-07-26, 22:07)garbear Wrote: And that's my idea for RetroPlayer: putting the games first and abstracting away the emulators. Hence my reluctance to expose emulator information and break this abstraction.

This concept is the main reason why I think retroplayer fits with Kodi. 15 years ago, if you wanted to play a real player video, you needed real player. Qt needed QuickTime player. Wmv needed windows media player. This was idiotic. So players like XBMC and VLC came along and cut all that nonsense out. It became unnecessary to say which player you needed for which video. Ideally, retroplayer will do the same thing. You'll select the game... and then just hit play. And that's it. Simple.
Reply
#59
(2017-07-26, 22:07)garbear Wrote: lol, if I had scrolled a bit further I would have noticed this. These tables you've built are an excellent resource. Can you extract these into a declarative data format? Do you have any experience with JSON-LD? This would enable reuse across many projects and programming languages.

Your wishes are orders. Just give and example of the JSON-LD output format you want and I will create an script to export the platform information. I will place the scrip in AEL-offline-scraper repository: it is a helper repository I use to develop the scrapers and includes AEL addon as a Python submodule to reuse code.

(2017-07-26, 22:07)garbear Wrote: Here is where our projects run into an impedance mismatch. I've told this story a few times, but my eye-opening moment was when I gave a talk to 11-year-olds in a poor neighborhood a few hundred miles from the border of Mexico. When I said "I work with emulators" I got blank stares. These kids have parents who couldn't afford game consoles growing up, so SNES is foreign to them. Some kids had a friend with a new Xbox or PlayStation. One console emulating the hardware of another is an idea they had never been exposed to.

So both "advanced" and "launcher" are roadblocks to the majority of the human population being able to enjoy retro games.

And that's my idea for RetroPlayer: putting the games first and abstracting away the emulators. Hence my reluctance to expose emulator information and break this abstraction.

(I'm definitely not knocking your project, just saying our target user bases aren't identical)

I would like RetroPlayer to support use cases like AEL, but I need to be really careful when designing the interface.

...

Here's a question: Do cores specify the platforms they support, or the file extensions they support? Can a NES emulator only accept ROMs with a certain header type? Can another emulator accept multiple platforms, as long as the ROMs are .iso's?

This is why I haven't yet created my game platform ontology - it's a GUI abstraction, not an emulator abstraction. RetroPlayer is 100% happy being platform-agnostic, because at the emulator level the file format is what's important, not the semantics of which platform the file belongs to.

(2017-07-28, 15:23)natethomas Wrote: This concept is the main reason why I think retroplayer fits with Kodi. 15 years ago, if you wanted to play a real player video, you needed real player. Qt needed QuickTime player. Wmv needed windows media player. This was idiotic. So players like XBMC and VLC came along and cut all that nonsense out. It became unnecessary to say which player you needed for which video. Ideally, retroplayer will do the same thing. You'll select the game... and then just hit play. And that's it. Simple.

I agree with your idea about putting the games first and abstracting the emulators, which is pretty much what Retroarch GUI does. However, keep in mind that AEL is the third evolution of the "launcher" plugin. The original idea was an addon to launch external applications and over time I have added a lot of features to support emulators but don't forget AEL still is a general launcher addon.

As a side comment, regarding the name: Advanced Emulator Launcher is the successor of Advanced Launcher, which is the successor of Launcher. I just needed to choose a new name and included "Emulator" in the addon name. Having the word "Advanced" in the name is a legacy matter and doesn't imply that AEL is difficult to use. Indeed, I spent quite a lot of time making sure AEL is as easy as possible and default settings work well for most users.

Yes, designing the games interface will be difficult. All in all, for some platforms some knowledge of the emulated systems is needed by the user. AEL can be considered a bottom-up approach to emulation where Retroplayer can be considered a up-bottom approach. Both approaches have advantages and disadvantages of their own. Also, AEL has a lot of features regarding organisation of the games database (including a pretty complete XML ROM database, still in development) and many features that could be useful when designing the games database in Kodi core. AEL could be used as a test laboratory of how the games should look (or not... maybe AEL is doing some things wrong and could be improved).

One last thing: AEL metadata and the games content-type listitem properties are almost the same with the following exception: Retropayer differentiates between Developer and Publisher whereas AEL has Studio. I decided to have only studio because for most platforms 90% of the ROMs will have as Publisher the owner of the platform (for example, most of Genesis ROMs will have Sega as Publisher so Publisher is a little bit redundant). If you want to keep both Developer and Publisher metadata fields I will change AEL database to synchronise AEL and Retroplayer games database models.
Reply
#60
(2017-07-31, 06:17)Wintermute0110 Wrote: Also, AEL has a lot of features regarding organisation of the games database (including a pretty complete XML ROM database, still in development) and many features that could be useful when designing the games database in Kodi core. AEL could be used as a test laboratory of how the games should look (or not... maybe AEL is doing some things wrong and could be improved).

This is perfect. I want to base Kodi's game library off an existing one. We could even have AEL be the de-facto library until Kodi has its own.

(2017-07-31, 06:17)Wintermute0110 Wrote: Retropayer differentiates between Developer and Publisher whereas AEL has Studio.

IMO we should just have Developer. We can drop publisher, because I don't really care who made money off the game. I want to know who put real work into it. I like Developer better than Studio because all studios are developers, but not all developers are studios.

(2017-07-31, 06:17)Wintermute0110 Wrote:
(2017-07-26, 22:07)garbear Wrote: Can you extract these into a declarative data format? Do you have any experience with JSON-LD?

Your wishes are orders. Just give and example of the JSON-LD output format you want and I will create an script to export the platform information. I will place the scrip in AEL-offline-scraper repository: it is a helper repository I use to develop the scrapers and includes AEL addon as a Python submodule to reuse code.

The idea behind linked data is that you can compute over the semantics (meaning) of data using a standard representation, instead of having to customize your app every time someone comes along with a new idea of how game platforms should be organized.

This plays into the design of the python scraper that topfs2 wrote for his GSoC project, a metadata extractor: https://github.com/topfs2/heimdall

This metadata engine is able to "reason" about metadata. For example, if a scraper reports three types of platforms:
  • Game Boy
  • Game Boy Color
  • Game Boy Advance

And if we only show two platforms in the GUI:
  • Game Boy
  • Game Boy Advance

Then the scraper could infer that Game Boy Color games should be shown under the Game Boy library node, because we've expressed the relationship that Game Boy Color IS-A-TYPE-OF Game Boy using linked data. Note that there's no imperative program that says "If Game Boy Color -> then Game Boy". We just write the declarative rule "Game Boy Color is-a-type-of Game Boy" and the metadata engine infers that Game Boy Color games should be shown as Game Boy games.

There's obviously advantages to this system, but it comes with disadvantages too. Using linked data to express relationships has a lot of cognitive and labor overhead. It requires more advanced logic to perform inference using the relationships. However, I think it's worth it, because declarative rules are easier to verify than imperative programs. A declarative rule is either "True" or "False", but a program can have many possible mistakes and failure modes, most of which are impossible (or time-intensive) to test for.

So here's what JSON-LD looks like, using game controllers as an example:

First, we split the linked data into Schemas and Instances. The schema I created for a game controller looks like:

Code:
{
  "@context": {
    "@base": "http://github.com/kodi-game/ontology/#",
    "label": {
      "@id": "http://github.com/kodi-game/ontology/#label",
      "@container": "@language"
    },
    "description": {
      "@id": "http://github.com/kodi-game/ontology/#description",
      "@container": "@language"
    },
    "gamePlatform": {
      "@id": "http://github.com/kodi-game/ontology/#gamePlatform",
      "@type": "@id"
    },
    "faceButtons": {
      "@id": "http://github.com/kodi-game/ontology/#faceButtons",
      "@container": "@set"
    },
    "shoulderButtons": {
      "@id": "http://github.com/kodi-game/ontology/#shoulderButtons",
      "@container": "@set"
    },
    "triggers": {
      "@id": "http://github.com/kodi-game/ontology/#triggers",
      "@container": "@set"
    },
    "analogSticks": {
      "@id": "http://github.com/kodi-game/ontology/#analogSticks",
      "@container": "@set"
    }
  }
}

An instance of a game controller, for example a 360 controller, looks like:

Code:
{
  "@context": "<URI to above JSON>",
  "@type": "controller",
  "label": {
    "en": "Xbox 360"
  },
  "description": {
    "en": "The Xbox 360 controller is the primary controller for the Microsoft Xbox 360. The wired and wireless versions are also compatible with Microsoft Windows."
  },
  "gamePlatform": "https://github.com/kodi-game/ontology/#platform/microsoft-xbox-360/",
  "faceButtons": [
    "a",
    "b",
    "back",
    "down",
    "guide",
    "left",
    "leftthumb",
    "right",
    "rightthumb",
    "start",
    "up",
    "x",
    "y"
  ],
  "shoulderButtons": [
    "leftbumper",
    "rightbumper"
  ],
  "triggers": [
    "lefttrigger",
    "righttrigger"
  ],
  "analogSticks": [
    "leftstick",
    "rightstick"
  ]
}

Here's an example of how it would work:

A scraper consults a website (like thegamesdb.net) and discovers that a 360 controller belongs to the 360 platform. The JSON-LD for this looks like:

Instance:

Code:
{
  "@context": {
    "@base": "http://schema.org/",
    "gamePlatform": {
      "@id": "http://schema.org/gamePlatform",
      "@type": "@id"
    }
}

Schema:

Code:
{
  "@context": "<URI to above JSON>",
  "@type": "platform",
  "gamePlatform": "http://thegamesdb.net/platform/microsoft-xbox-360/"
}

OK, so we know the game platform is of type "http://schema.org/gamePlatform" and the instance is "http://thegamesdb.net/platform/microsoft-xbox-360/". We want the game platform type to be "http://github.com/kodi-game/ontology/#gamePlatform" and instance "https://github.com/kodi-game/ontology/#p...-xbox-360/". So we would create a JSON-LD relationship (called a triple) using the relationship IS-A that expresses that:

"http://schema.org/gamePlatform" IS-A "http://github.com/kodi-game/ontology/#gamePlatform"

The metadata extraction engine that topfs2 wrote could then infer that a 360 controller from gamesdb.net should be shown under the 360 category in the GUI.

So that's my introduction to JSON-LD. We should start by designing a schema, and then fill it in with all the game platform knowledge we know about. Do some research and try to design a schema, and I'll help out if you get stuck.
RetroPlayer releases: https://github.com/garbear/xbmc/releases

Donations: eigendude.eth
Reply
  • 1
  • 2
  • 3
  • 4(current)
  • 5
  • 6
  • 13

Logout Mark Read Team Forum Stats Members Help
Player Manager1