RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Metadata Improvements in EmulationStation

    Scheduled Pinned Locked Moved Ideas and Development
    emulationstationmetadatadevelopment
    73 Posts 15 Posters 31.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Z
      Zigurana @fieldofcows
      last edited by

      @fieldofcows Personally, I've never used it, but it was one of those things that came back to haunt me when I released Kid-modes for ES. This is just to say that others are using it currently, not sure what for other than creating more gategories besides systems.

      If tetris has thought me anything, it's that errors pile up and that accomplishments dissappear.

      herb_fargusH 1 Reply Last reply Reply Quote 0
      • E
        ebtalk
        last edited by

        I don't use folders but have contemplated using them for arcade. With this, I would be totally ok without folders.

        One thing I would add is to be careful on how much ability of customization you enable for the end user. In my field of work with some software implementations, the more fields and abilities you give to the end user, the more problems it creates. Just my two cents though.

        1 Reply Last reply Reply Quote 1
        • herb_fargusH
          herb_fargus administrators @Zigurana
          last edited by

          @Zigurana I don't really use folders but there are some cases like scummvm or dos where they have multiple game files so I keep them in folders to keep them organised. That may be a use case that isn't addressed by the filters.

          If you read the documentation it will answer 99% of your questions: https://retropie.org.uk/docs/

          Also if you want a solution to your problems read this first: https://retropie.org.uk/forum/topic/3/read-this-first

          Z 1 Reply Last reply Reply Quote 1
          • Z
            Zigurana @herb_fargus
            last edited by

            @herb_fargus said in Metadata Improvements in EmulationStation:

            @Zigurana I don't really use folders but there are some cases like scummvm or dos where they have multiple game files so I keep them in folders to keep them organised. That may be a use case that isn't addressed by the filters.

            True, but is there not a shell script placed in the parent directory that is used to launch the game? Maybe, the subdirectories can effectively be ignored?

            If tetris has thought me anything, it's that errors pile up and that accomplishments dissappear.

            1 Reply Last reply Reply Quote 0
            • mattrixkM
              mattrixk @fieldofcows
              last edited by

              @fieldofcows I've been thinking about filters and forgot about something I've been wanting. Is it possible to add more images to the ROM metadata? I've been hearing about marquees, and obviously video previews, so could we add other fields for fan-art, screenshots, box-art and the like? I know the Pi isn't too powerful so you don't want to go too overboard with the images, but I'd like to have the option there.

              I've been using UXS to make some nice combo images involving screenshot, box-art and game logo, but I can't really do one of the things I really want to do, which is the big fan-art in the background. I can use UXS to make a small image (640x360) that will scale up to full screen on the Pi. I don't mind if the large fan-art gets blurry because it's behind a "screen" anyway, but when the box-art and screenshot scale up, the blurriness is unacceptable.

              I can still make the theme I want within ES if I use UXS to put the screenshot, box-art and logo together into a single image, then use that as the scraped image, but it will be missing the large fan-art background.

              Even if we could just add the option for a second image, I can do the rest myself.

              My ES themes: MetaPixel | Spare | Io | Indent

              1 Reply Last reply Reply Quote 0
              • mediamogulM
                mediamogul Global Moderator @fieldofcows
                last edited by

                @fieldofcows said in Metadata Improvements in EmulationStation:

                Who is using folders to organise their roms?

                I use folders for several different purposes and I'd genuinely hate to see them eliminated. However, if they are going to cause a lot of difficulty moving forward, I guess I could find alternative methods to adapt.

                Would you miss this feature if it was removed but replaced with a more comprehensive set of filters?

                My main concern is that I keep categorized folders of launch scripts in the RetroPie menu to accomplish different tasks, such as system backup, as well as dozens of controller key-mappings organized by system. Would the new set of filters you mention be able to replace this type of use case scenario?

                RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                fieldofcowsF 1 Reply Last reply Reply Quote 0
                • fieldofcowsF
                  fieldofcows @mediamogul
                  last edited by

                  @mediamogul said in Metadata Improvements in EmulationStation:

                  Would the new set of filters you mention be able to replace this type of use case scenario?

                  Maybe not.

                  I spent some time last night looking at how to build folder support into my metadata model and I think I've cracked it so it looks like folders should be back on the feature list.

                  mediamogulM 1 Reply Last reply Reply Quote 2
                  • mediamogulM
                    mediamogul Global Moderator @fieldofcows
                    last edited by mediamogul

                    @fieldofcows

                    That's fantastic! I really appreciate all of the time you've put into all this. Emulation Station is really on the move and I look forward to seeing it all come together.

                    RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                    1 Reply Last reply Reply Quote 0
                    • Z
                      Zigurana @fieldofcows
                      last edited by Zigurana

                      @fieldofcows said in Metadata Improvements in EmulationStation:

                      ...
                      I had a look at the 'sqlite' changes made (I think) by Aloshi and decided I wanted to go a stage further so I'm currently busy implementing a new set of C++ classes that manage the game list and metadata using sqlite over multiple tables. I'm not a database software engineer so it may not be perfect but should hopefully be an improvement over what's there now.

                      I can see a number of benefits once this is working:

                      1. Very fast startup and shutdown of ES
                      2. Metadata can be managed separately to the installed game list meaning (for example) the metadata can be shared and distributed without a romset but when roms are available the metadata is already there
                      3. Metadata fields can be added or removed without recompiling ES
                      4. Tags will be supported meaning ES can filter based on tags (like favourites or 'kid friendly' for example)

                      ...
                      I'm trying not to making it a 'breaking' change in that the new version should be able to read the current gamelist.xml files and populate the database automatically.

                      Ok, maybe I am just in a negative mood, but please help me reason through this here: With the step to a fully querieable SQLite database, are you/we moving away from XML files altogether?
                      That would mean we are also moving away from a lot of supporting scripts and tools, from the venerable Sselph scraper, to the new and flashy UXS tool. Also, the Big Benefit of XML is that the data is user readable and editable. It would be very nice if we can somehow retain that aspect of the community-effort.

                      #1 was a real issue but is it still? PR#78 was merged in recently, and should mostly solve the issue of long saving times (loading not so much propably). #4 is an important additional feature, I agree, but SQL is not needed for it. #2 and #3 are nice to have features, but their gain lie mostly in the future, when other aspects (i.e. a framework for sharing metadata packages, and some interface to change and populate the metadata) are put in place.

                      And really, do we need SQLite for that? Once the metadata is in memory, it doesn't really matter one way or the other, or does it?This is a real question of which i do not know the answer.
                      There have been many discussions on this before:

                      • here at the RetroPie-repo,
                      • here at Herdingers fork, and some more, see also their design document, for inspiration.

                      and of course here on the forum:

                      • pro DB by @SimonBelmont and
                      • anti-DB by @Arcuza

                      I guess the answer really comes down to what the metric is you are trying to improve. If it is performance, maybe we should start with some profiling to see if the loading can be just as easily sped up as the the saving apparently could (see the recent PR). Its clear that things can be improved, but I rather do it in a way that keeps the existing XML based tooling.

                      Again, I am really not trying to be a downer, it's just that we should be doing things for the right reasons, and I'm not seeing those at the moment.

                      If tetris has thought me anything, it's that errors pile up and that accomplishments dissappear.

                      S 1 Reply Last reply Reply Quote 1
                      • S
                        sselph @Zigurana
                        last edited by

                        These types of questions should be answered. Adding complexity to maintaining the project should have measurable benefits.

                        @Zigurana said in Metadata Improvements in EmulationStation:

                        With the step to a fully querieable SQLite database, are you/we moving away from XML files altogether?

                        In the original sqlite branch there was code to detect a new xml on boot and import it. It also would be fairly trivial to write an importer/exporter for the current XML format, which would be good when migrating to a new system.

                        That would mean we are also moving away from a lot of supporting scripts and tools, from the venerable Sselph scraper, to the new and flashy UXS tool. Also, the Big Benefit of XML is that the data is user readable and editable.

                        I could write to sqlite but it is a little more of a pain since using the C library makes it difficult to cross-compile. The ability for a human to edit xml is questionable. Simple things are okay but I've helped lots of people who have mangled their xml by opening it in windows. I also wrote a neat web based metadata editor a long time ago but it was pending the sql update.

                        #2 and #3 are nice to have features, but their gain lie mostly in the future

                        I actually don't know if #2 is very feasible. It might be for MAME but for console games unless you use my renamer or my hash algorithms, it would make it hard to have an entry in a DB waiting for the file to appear.

                        Auto-scraper: https://github.com/sselph/scraper
                        Donate to Extra-Life 2018 and help save lives: https://goo.gl/diu5oU

                        1 Reply Last reply Reply Quote 0
                        • fieldofcowsF
                          fieldofcows
                          last edited by

                          @Zigurana - the question should absolutely be asked as to whether this is the right approach. Believe me I've asked myself the same thing many times over the last few days looking at how much time this is taking me.

                          At the end of the day, it's not my decision as to whether this should be implemented in any 'official' branch or not. I am, after all, doing this as a hobby and would not be offended if it is decided that this is the wrong approach. All I can do is provide the facts, code and test results and leave it up to others to decide. Some of the 'facts' that I've found so far though:

                          1. I have already implemented the parser from both gamelist.xml and scanning the ROMS directory exactly as non sqlite ES did. This means that we
                            could if we wanted to still use this as the only persistent game/metadata source, recreating the database of every start (it doesn't take long). The sqlite database is then only used as an internal query engine.

                          2. The whole system/game view architecture is based on the layout of the configuration folders and XML files. This needed large changes in order to support some of the filtering/queries I plan to implement. It is simpler for me to understand my new code than try to massage the old code when changing this. I think implementing #4 with the current architecture would be hard.

                          3. It would be very easy to write a standalone import/export tool to convert from gamelist.xml to sqlite. I can certainly put this together as part of this work

                          4. The tag/filtering changes were always going to be large regardless of whether we use sqlite or XML. I wanted to put some unit testing into the code in order to reduce the risk of introducing bugs but the existing code does not lend itself to unit testing without a major rewrite so I used the opportunity to switch to sqlite.

                          I'm sure there are more but it's getting late and my brain is getting fuzzy.

                          Z mattrixkM 2 Replies Last reply Reply Quote 2
                          • Z
                            Zigurana @fieldofcows
                            last edited by

                            @fieldofcows Thank you for your considered response! I will mull it over while trying to sleep.
                            I am glad you are taking this so very professional, even when it's your hobby!

                            Lets get back to this when we are both fresh and less fuzzy.

                            If tetris has thought me anything, it's that errors pile up and that accomplishments dissappear.

                            1 Reply Last reply Reply Quote 1
                            • mattrixkM
                              mattrixk @fieldofcows
                              last edited by

                              @fieldofcows just throwing it out there as I thought of it: how likely is a "related games" filter?

                              Eg: on the Detailed View would it be possible to have a list of other games that share a number of tags/filters/whatever?

                              On further thinking, it probably wouldn't work with the way things work now, but I just wanted to mention it.

                              My ES themes: MetaPixel | Spare | Io | Indent

                              fieldofcowsF 1 Reply Last reply Reply Quote 1
                              • fieldofcowsF
                                fieldofcows @mattrixk
                                last edited by

                                @mattrixk That's a really good idea. Technically it's easily possible but I don't know how well it would fit in the UI.

                                mattrixkM 1 Reply Last reply Reply Quote 0
                                • mattrixkM
                                  mattrixk @fieldofcows
                                  last edited by

                                  @fieldofcows yeah, it was the UI implementation that I wasn't sure about. I was originally thinking of a second gamelist, but how do you access it? If up/down travels the main gamelist and left/right changes system, how do you move over to the "related" gamelist? Without menu intervention at least.

                                  Interesting in theory, but I don't know how it would work in practice.

                                  My ES themes: MetaPixel | Spare | Io | Indent

                                  1 Reply Last reply Reply Quote 0
                                  • M
                                    MWGemini
                                    last edited by

                                    I just wanted to add that for those of us with large collections, folder structure is vitally important. Also, @Zigurana, yes performance is still very much an issue. I've got about 63,000 ROMS in my collection currently, and startup time on my stock-clocked Rpi3 is roughly 8 minutes using the most recent "official" (v2.1.0RP) version of EmulationStation. ES is also not saving metadata, and although I haven't fully tracked down the issue yet, I believe the collection size is playing a factor (yes, I've checked all the easy settings/configs already, but let's not derail this topic for this particular problem).

                                    Also, @fieldofcows, you said you are not a database engineer; I've done some database design professionally and would be happy to help with this project. I sent you an email with further information a few days ago. I've been thinking about this for the last few days, and have some ideas that will allow people to use their existing folder structures (i.e. grouped by system type), but also to easily save/add new filter types and search queries for the main system select screen (i.e. "Classic Platformers" or "Mario Collection" or "Favorites" or whatever). Furthermore, I have some ideas that will allow for each of these filter types to (relatively easily) have their own custom themes.

                                    @mattrixk and @Nismo have both been doing some great theme work and have expressed interest in recent posts with having things like video previews, fan-art backgrounds (made easier now to thanks to the UXS scraper by @screech), etc. It looks like @sselph is updating his scraper and looking towards better ES integration now as well.

                                    I've also read posts from other users who would like to see additional artwork, and this could all be easily referenced by the new database system, and displaying it should be pretty easy too, although I'm not familiar with the guts of the current ES codebase. This could also give us the ability to do more advanced things like dynamically rotating and scaling artwork while scrolling through games, for example, which would give theme designers a much more powerful toolset to work with, without a large development burden.

                                    From a user's perspective, I love what you've already done and am very excited to see where this goes. From a developer's perspective, I'm willing to provide some assistance with implementing these features.

                                    fieldofcowsF 1 Reply Last reply Reply Quote 3
                                    • fieldofcowsF
                                      fieldofcows @MWGemini
                                      last edited by

                                      Hi @MWGemini. Thank you very much for your post. I was beginning to wonder about the value of the metadata update I'm working on because it is taking quite a lot of my limited spare time but you have just made it all worthwhile.

                                      I had a bit of a problem with spam email over the last couple of day - I think some scraper has used my email address to send a load of spam and I got ~500 failed delivery reports so I just bulk deleted it all so I would appreciate it if you could resend your email. Thanks.

                                      What I have is a little bit away from working but I think the data structure now allows three different (at least) types of grouping:

                                      • Folder structure from a relative root directory (so the path for a game is stored as "dir1/dir2/game.zip" for example)
                                      • Tags - just a text field. Any number of tags can be specified per game
                                      • Metadata - this is just a list of tag/value pairs. Like tags above, there can be any number of these per game

                                      I have a C++ class named GameData that manages the game list and metadata. In order to query the database you just ask for the game list and specify the filter. At this stage the results are queried from the database and populated in memory. They are populated either as a flat gamelist or maintaining the folder hierarchy where equivalent relative paths in different systems are grouped together.

                                      It all seems to make sense to me at the moment. The code is a bit scruffy and incomplete and the version of ES built on my codebase doesn't work properly at the moment but if you want to examine the code then you can take a look at https://github.com/fieldofcows/EmulationStation/tree/sqlite. Most of the code for the game data is in the es-gamedata subdirectory.

                                      M 1 Reply Last reply Reply Quote 0
                                      • M
                                        MWGemini @fieldofcows
                                        last edited by

                                        @fieldofcows I've just re-sent the email, and I'll try to set aside some time to look through your recent code changes and try to put my database design ideas into a diagram to send to you.

                                        fieldofcowsF 1 Reply Last reply Reply Quote 0
                                        • fieldofcowsF
                                          fieldofcows @MWGemini
                                          last edited by

                                          @MWGemini Got your email, thanks. I'll have a good read and get back to you. Thanks!

                                          1 Reply Last reply Reply Quote 0
                                          • mattrixkM
                                            mattrixk
                                            last edited by

                                            @Zigurana: You asked for it, here it is.
                                            @fieldofcows: This is for you.
                                            @MWGemini: You might be interested in this too.

                                            I made a design proposal doc with Google Docs, full of ideas about how I think we could make metadata and filtering work a lot better in ES.

                                            It's still a WIP and kind of trails off towards the end, but I'll keep working on it, and people are welcome to leave comments (and if it's wanted, I can open it up to editing).

                                            My ES themes: MetaPixel | Spare | Io | Indent

                                            M 1 Reply Last reply Reply Quote 2
                                            • First post
                                              Last post

                                            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.