HowTo: Generate Pretty, Curated MAME Playlists the Easy(ish) Way


#41

Ok, got it.

I ran the latest github version of the script on “MAME - ROMs (v0.179_XML).dat” and “pS_snap_fullset_170.zip” again, but this time I added script steps to copy files into three folders: 1 detected dummy files 2 successfully renamed files 3 non-dummy files that ran into a “continue” step in the script and wasn’t renamed.

Result: no files ended up in folder 3. Good!

Next I ran a crc32 check on folder 1, the dummy files. Any file with < 10 crc32 duplicates was copied to a new folder, which I browsed. I found only screenless dummy games there.

TL;DR the script now works on “MAME - ROMs (v0.179_XML).dat” and “pS_snap_fullset_170.zip”.


#42

Two updates I wanted to share with the thread.

  1. As of the next nightly RetroArch image, there is automated support for translating prohibited characters in playlist entries to underscores. That means that playlist files no longer have to scrub these characters from the “display name” – For example, when RA sees a playlist entry titled 1943: The Battle of Midway it will automatically look for a thumbnail file called 1943_ The Battle of Midway. This means that the the playlist generator script can keep the ‘fancy names’ intact as long as the thumbnail renaming script replaces those characters with _[B].

[/B] I haven’t tried to edit the playlist script to reflect this change, and current playlists ought to be backwards-compatible once the update hits.

  1. The new RA code change clarifies the list of prohibited filename characters to be the same as No-Intro, which is one character different than the list I have been using. Here’s the No-Intro list: & \ / ? : ` < > * |

Fortunately I don’t think that MAME uses the backtick character in game names, so this doesn’t really affect us. I have, however, added a line to scrub the backtick to the AutoHotKey scripts on github just to be sure.


#43

As of now, the Libretro thumbnail repository should support this and other MAME playlist generation scripts with an up to date set of thumb images. Exciting!

[B]I have been working on an updated, one-step script that can use the thumbnails from the Libretro thumbnail repository and put them in the correct folders at the same time as generating these multiple themed MAME playlists.

Perhaps more importantly, it can be configured via a new GUI.[/B]

Access the experimental one-step playlist/thumbnail script

Notes:

  1. Rather than using the Progetto SNAPS thumbnail files or another source, this script expects the libreto MAME thumbnail pack from http://thumbnailpacks.libretro.com/ to be unzipped in a location which the script has access to
  2. This script can download individual thumbnail files from http://thumbnails.libretro.com/ that are represented in the local ROM set if there is not a thumbnail pack available. This can theoretically be used to build a thumbnail set for a small collection of ROMs. Also handy for testing!

If you have worked with Alexandra’s original scripts you will probably be able to figure out how this one works. Speaking of which, Alexandra, apologies again for posting so much in your thread. I hope some of this is useful to you in addition to being fun for me!


#44

I wuold share with you my step for categorized lpl and thumbnails

  1. For lpl use the bat script for separate the ROMS
  2. In RetroArch scan every single Roms folder (like Action) and rename the playlist generated in Action.lpl (do this for all other Roms Categorized Folder) Remember to rename frist to start scan new folder
  3. Downloaded the Progetto SNAPS thumbnails for Arcade and renamed the folder in “Action”
  4. Using this command for create symbolic link for other playlists

ln -sT /storage/thumbnails/Action/ /storage/thumbnails/BeatEmUp

Replace BeatEmUp with the other Roms categorized folder name

What do you think? Very sorry for my bad english


#45

Very clever, gleam2003.

If I understand correctly (use my pre-made batch files to copy roms, make RA create a playlist for each folder, share thumbnails via symbolic link) that will make per-genre playlists with images and without using AutoHotKey scripts. I haven’t tested it but it seems plausible at first glance.

That said, I believe the playlists would only show raw rom filenames, instead of the expanded full game names, right?


#46

[QUOTE=Alexandra;52555]Very clever, gleam2003.

If I understand correctly (use my pre-made batch files to copy roms, make RA create a playlist for each folder, share thumbnails via symbolic link) that will make per-genre playlists with images and without using AutoHotKey scripts. I haven’t tested it but it seems plausible at first glance.

That said, I believe the playlists would only show raw rom filenames, instead of the expanded full game names, right?[/QUOTE]

Full games names are show, not the raw

Yes, not use AutoHotkey Script, more simple for me

Note: Important to rename the lpl every scan because they use not the ROM folders as name but the Emulator Name and all ROMS use the same emulator Note 2: Need to set the default emu for created playlist or the ask you all time you run a ROM


#47

Great thread. However, I think I’m still missing a step that is preventing my MAME roms from showing up in LAKKA.

Here’s how I understand it - can you please tell me if I’m not grasping something correctly…

Here’s how I understand it:

Lakka wants 0.78 Romsets that follow the Progetto-SNAPS MAME 0.78 naming structure.

I have some 0.78 MAME roms downloaded, and I have that Progetto DAT file, but I still can’t seem to rename properly them to get Lakka to see them.

Move followed some scanning and rebuilding guides, it still no luck.

Do I have the versions correct?

Thanks!!


#48

[QUOTE=KillerQ;53133] Here’s how I understand it: Lakka wants 0.78 Romsets that follow the Progetto-SNAPS MAME 0.78 naming structure.

I have some 0.78 MAME roms downloaded, and I have that Progetto DAT file, but I still can’t seem to rename properly them to get Lakka to see them.

Move followed some scanning and rebuilding guides, it still no luck.

Do I have the versions correct?

Thanks!![/QUOTE]

KillerQ – if it would be helpful, there are a few of us Lakka users in the AHK playlist generator thread that could help you with your project: https://libretro.com/forums/showthread.php?t=7802 Most of the users in this thread aren’t using Lakka so you may want to think of this in two phases.

Once you have the basic playlist generation working at all in Lakka, then I’d suggest taking the next step of separating the ROMs into curated playlists per Alexandra’s method in this thread.


#49

Thanks Markwkidd and Roldemort for your optimisation of the snapshots renaming script. That’s quite the difference in speed! :slight_smile:

Making the playlist is still really slow though. I’ve just remade everything for Mame 180/181 now that R-type has fixed most problems of the libretro core (huge thanks to him).


#50

@Markwkidd:

I should add I had to modify this line on windows to reverse the slash (). It made Retroarch crash at launch on windows 7 with the new Mame.

This is what I used for the latest mame.dat from http://www.progettosnaps.net/dats/

;### AUTOHOTKEY SCRIPT TO GENERATE MAME PLAYLIST FOR LAKKA/RETROARCH
;### Based on prior work by libretro forum users roldemort, Tatsuya79, Alexandra, and markwkidd

;---------------------------------------------------------------------------------------------------------
#NoEnv                          ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input                  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%      ; Ensures a consistent starting directory.
;---------------------------------------------------------------------------------------------------------

playlistname = MAME.lpl
;### Local path to output the playlist file.
;### Should include the .lpl extension.
;### NOTE: THIS SCRIPT WILL DELETE ANY EXISTING FILE WITH THIS NAME
;### As of 5/2016 using the name "MAME.lpl" results in icons appearing for
;### MAME and its playlist entries in Lakka. Other file names may require 
;### adding icons or copying the MAME set.
;### Default: MAME.lpl

dat = E:\Emulateurs\RetroArch64\database\MAME 181 Arcade.dat
;### Example: C:\MAME\dats\MAME 078.dat
;### local path to a MAME ROM database file

windowsroms = E:\Roms\Arcade - MAME
;### Example: C:\MAME 0.78 Non-Merged\roms
;### DO NOT INCLUDE A CLOSING SLASH AT THE END OF THE PATH
;### This path is a MAME ROMs folder accessible to THIS WINDOWS HOST. These 
;### ROMs should be the same set that will be used in Lakka
;### and should be of the same MAME version as the datfile.


FileRead, dat, %dat%
FileDelete, %A_ScriptDir%\%playlistname%  		;### Clears old MAME.lpl file if present 
playlistfile := FileOpen(playlistname,"a")  	;### Creates new playlist in 'append' mode

ROMFileList :=  ; Initialize to be blank.
Loop, Files, %windowsroms%\*.zip 
{
    ROMFileList = %ROMFileList%%A_LoopFileName%`n
}
Sort, ROMFileList

Loop, Parse, ROMFileList, `n 
{	
			
	if A_LoopField = 
		continue 	;### continue on blank line (sometimes the last line in the file list)
	if A_LoopField in (neogeo.zip,awbios.zip,cpzn2.zip)
		continue    ;### manually skip these bios files. you can add names of other files to skip

	SplitPath, A_LoopField,,,,filename	 ;### trim the file extension from the name
	
	filter1 = <machine name=.%filename%.(?:| sourcefile=.*)(?:| sampleof=.*)(isbios|isdevice|ismechanical|runnable)
	if RegExMatch(dat, filter1)
		continue                    ;### skip if the file listed as a BIOS or device in the dat
    
    needle = <machine name=.%filename%.(?:| sourcefile=.*)(?:| cloneof=.*)(?:| romof=.*)(?:| sampleof=.*)>\R\s*<description>(.*)</description>
    RegExMatch(dat, needle, datname)

	fancyname := datname1	;### extract match #1 from the RegExMatch result
    if !fancyname
        continue                      ;### file is skipped now if not in the dat
        ;### fancyname := filename    ;### the file is not matched in the dat file, use the filename instead 
        
    ;### Replace characters unsafe for cross-platform filenames with underscore, 
    ;### per RetroArch thumbnail/playlist convention
    fancyname := StrReplace(fancyname, "'", "'")
    fancyname := StrReplace(fancyname, "&", "_")
    fancyname := StrReplace(fancyname, "&", "_")
    fancyname := StrReplace(fancyname, "\", "_")
    fancyname := StrReplace(fancyname, "/", "_")
    fancyname := StrReplace(fancyname, "?", "_")
    fancyname := StrReplace(fancyname, ":", "_")
    fancyname := StrReplace(fancyname, "``", "_")    
    fancyname := StrReplace(fancyname, "<", "_")
    fancyname := StrReplace(fancyname, ">", "_")
    fancyname := StrReplace(fancyname, "*", "_")
    fancyname := StrReplace(fancyname, "|", "_")
	
	playlistentry = %windowsroms%\%filename%.zip`n%fancyname%`nDETECT`nDETECT`n-`n%playlistname%`n
	playlistfile.Write(playlistentry)
}

playlistfile.Close()		;## close and flush the new playlist file


;## EOF

“machine name” instead of “game name”, added that sampleof category (I think it’s new?), filter out mechanical and not runnable machines, skip games not in the dat (as I was scanning a 0.181 set with the right dat and I had a lot of bios clones in my resulting playlist).

I didn’t understand the “lakkaroms=” path usage.


#51

Tatsuya79, I have also been working on a fix to support the new XML DAT format as well as to incorporate some of roldemort’s speedups for playlist generation.

Would you be willing to test out the ‘prototype’ of the new script? Link: https://github.com/markwkidd/ahk-retroarch-playlist-helpers/blob/master/one-step-arcade-processing-proto.ahk

I believe it addresses the concerns that you’re mentioning, but you might be the first person other than myself to give this enhanced version a try. I’m personally using it for MAME 2003 so it can help to have folks who are using other MAME cores to double check.

If you do take a look, ShrinkArcadeDAT() and PlaylistGenerator() are where the code you’re referring to has wound up, post-updating and refactoring.


#52

Sorry I’ve just finished dealing with all this stuff, I’ll check it again around Mame 0.190.


#53

Hey everyone,

Since this very useful tutorial was brutally murdered by the new forum formats, I thought I’d share this backup I made on Evernote of the original version back when I first used it.

(I know it’s not the ideal, the Evernote web client shrinks it horizontally, so you’ll have to scroll a bit… But it’s better than what was left here.)

(Also, I’m not sure if it was modified after I made the backup, I’ll check for changes later.)


#55

Thank you for making this available in notes . I just save it for me read later👍🏻


#56

Hi, I am running the most up-to-date RetroArch. When I have one controller plugged in everythings fine. When I have 2 or more that are the same device such as 2 xbox one controllers connected to pc, Itll show Xbox Controller 1 and 2 in the binding menu, one controller is hooked up to xbox controller 1 and the other is hooked up to xbox controller 2 but only one controller actually works. This is an ongoing issue for me, trying to plug in 3 and 4 controllers makes it much more difficult, some work and others dont. Im just trying to find the best way to get my controllers working and mapped properly, to where I hook up anywhere from 2 to 4 controllers and have to do no extra configuring. I had retroarch about a year ago and never had these issues until coming back to it recently. Any help is much appreciated.


#57

I added partial support for this in the new Retrosystem theme, but the playlists must be prefixed with "Arcade - " like “Arcade - Action” i did this to have all the arcade playlists together


#58

Great topic!

One question: I’m trying to configure RmLister and I got all the accessory *.ini and *.xml files and merged them together in the master romlister.xml file.

What I don’t get is: In the instruction you talk about “categories and sub-categories” for games, like “Fighter / Versus”. In the catver.ini file I got there are only the “basic” categories in a rom = category format.

I have also a catlist.ini file that seems to have that level of information, but it won’t load in stead of catver.ini because the format is different.

What am I doing wrong?


#59

This is going to come across as poor etiquette on my part, but could I earnestly suggest that you check out my Simple Arcade Multifilter app for your genre sorting? Simple Arcade Multifilter - app for MAME and FB Alpha ROM sets

It is not 100% compatible with Alexandra’s method any more but it is partially inspired by this thread and it’s actively maintained. Also I can help you if you have problems with that app which I am not qualified to do with romlister.


#60

Thanks, I’ll sure give a try to it!


#61

Troubling to hear about catver.ini lacking those subgenres; wonder why?

Anyway, as Mark said, his solution is actively maintained, so I agree it’s best to try that first these days.

Unrelated: I still don’t have edit access for the first two posts in this thread, unfortunately. They really decayed in the forum switchover.