Jump to content

A question for .xml/.dat gurus


dark13

Recommended Posts

The question is really simple... is it possible to generate, in some ways, an xml with the same structure of the posted image from hyperspin's .xmls or emulators .dat? More infos I can get the better it is :P

post-8767-142870644515_thumb.jpg

It may seems a crazy question but... well, I've found a way to batch these kind of .xml in photoshop to create info artworks. You can create layout then assign variables to text layers and automatically create images from simple data :)

Link to comment
Share on other sites

More infos in HL data folder, looks good :P

The problem is I need to batch conversion, dealing with mame's database would be an hell :P Photoshop want a file like the one attached. Basically something like this (consider that file is "broken" in years variables, I should have told openoffice to consider it as plain text)

"romname1" "title1" "genre1" "ratings1"

"romname2" "title2" genre2" "ratings2"

(open the file in notepad to see plain text or openoffice to have tabbed version, easier to read)

The REALLY good thing is once you have a .csv like this you can batch a whole lot of nice things. Let's just imagine: you have a 5 stars images (0.png,0.1png,0.2png....5.png) and your csv has a variable (going from 0 to 5), you can automatically have a rating png's artworks for your theme. Infact it is possible to use the first variable (rom's name) as file's name. You can batch everything that would normally include boring repetitions. What about producer/manufacturer artworks (that clearly are not as many as rom's number): you can create the artworks then batch it to match roms. No boring files renaming :D Moreover you can easily deal with colums in openoffice, if you don't need a variable you can simply delete the column or create a new one.

Probably I should make a video of the process :P

SNK Neo Geo - Copia3csv.zip

Link to comment
Share on other sites

More infos in HL data folder, looks good :P

The problem is I need to batch conversion, dealing with mame's database would be an hell :P Photoshop want a file like the one attached. Basically something like this (consider that file is "broken" in years variables, I should have told openoffice to consider it as plain text)

"romname1" "title1" "genre1" "ratings1"

"romname2" "title2" genre2" "ratings2"

(open the file in notepad to see plain text or openoffice to have tabbed version, easier to read)

The REALLY good thing is once you have a .csv like this you can batch a whole lot of nice things. Let's just imagine: you have a 5 stars images (0.png,0.1png,0.2png....5.png) and your csv has a variable (going from 0 to 5), you can automatically have a rating png's artworks for your theme. Infact it is possible to use the first variable (rom's name) as file's name. You can batch everything that would normally include boring repetitions. What about producer/manufacturer artworks (that clearly are not as many as rom's number): you can create the artworks then batch it to match roms. No boring files renaming :D Moreover you can easily deal with colums in openoffice, if you don't need a variable you can simply delete the column or create a new one.

Probably I should make a video of the process :P

How are you individually naming the info artworks that Photoshop outputs?

I was working on something similar using Indesign xml (for MAME), but renaming all of the the artwork from the batch is painful. Looking forward to see what you come up with. attached is a sample artwork from indesign.

post-90020-142870644528_thumb.jpg

Link to comment
Share on other sites

mmg1 I'm using photoshop and this is not a batch but "variables and data set". I'll make a more hyperspin oriented tutorial but for now you can see this http://tv.adobe.com/watch/software-cinema-for-photographers/working-with-variables/ Remember: you must have the same number of variables in your photoshop file and your .csv or you will get an error while importing .csv. New files will be named as variables number 1 (this is why rom's name MUST be the first variable in your .csv.

@gutch92

Can you explain how you convert the file? It seems there's a problem with description. Probably because you used ,, for variables/arguments and it is used in description, can you use "" or another symbol not used in the file (you can set tab separators while importing in calc). Thank you very much :)

Link to comment
Share on other sites

Have to try it. If you have time I would be glad if you could convert it for me as i'm busy preparing graphics :P.

Obviusly these .csv could be used for A LOT of thems, including infopanel in official hyperspin themes (replacement on the low screen zone where classic HS info appear) But here's a little WIP of what i'm working too. Screenshot2 is a test for the main wheel and actually it is neo geo's genre wheel (taller pngs for genre to change wheel position) :) Info layout obviusly is still a mess, it is only a quick test for data to image exporting :D Number of players is a variable and it's on the info artwork layer.

post-8767-142870644888_thumb.jpg

post-8767-142870644891_thumb.jpg

post-8767-142870644895_thumb.png

Link to comment
Share on other sites

dark13 I converted all of the gameinfo ini files to tab separated value files. I placed the results in your ftp folder.

I didn't want to use notepad++ this time so I used autohotkey.

Path_Containing_GameInfo_Ini_Files := A_ScriptDir

Loop, %Path_Containing_GameInfo_Ini_Files%\*.ini
{
sectioncount := 0
file_labels := "rom_name"
Loop,Read,%A_LoopFileFullPath%
{
	If InStr(A_LoopReadLine,"[")
	{
		sectioncount++
	}
	If (sectioncount = 2)
	{
		break
	}
	If InStr(A_LoopReadLine,"=")
	{
		label_name := SubStr(A_LoopReadLine,1,InStr(A_LoopReadLine,"=")-1)
			;msgbox, %label_name%
		file_labels .= A_Tab . label_name
	}
}
FileRead,Contents, %A_LoopFileFullPath%
StringReplace,Contents,Contents,[,%file_labels%`r`n
StringReplace, Contents,Contents,`r`n[,`r`n,All
Contents := RegExReplace(Contents,"\R(.*)=",A_Tab)
StringReplace,Contents,Contents,]%A_Tab%,%A_Tab%,All
Loop
{
	StringReplace,Contents,Contents,`r`n`r`n,`r`n, All
	If ErrorLevel
		Break
}
StringReplace,File_name,A_LoopFileFullPath,.ini,.tsv,All
FileAppend,%Contents%,%File_name%
}

Link to comment
Share on other sites

Thank you very much :) .

There are still some problems, some of them are probably due to incorrect style of hyperlaunch data (es in some case genre-sub-genre is A|B in others A\B, so many neogeo genre are only A). Mame description sadly is still a mess, for now I think I'll keep it out from the equation (neo geo description seems to be ok). Maybe would be better to deal with it excluding other variables, I guess I can copy/paste columns with openoffice to add variables

I'll obviously have to manually correct some flaws as these script cannot be 100% "perfect" but can I ask you another favour? It seems impossibile to export empty cells from openoffice as "", could you modify the script to add - or a space when a field is empty? Maybe ... like it's already in some hyperlaunch empty field.

Some random question:

Is there a "general" or "official" rating for hyperspin? HS in neogeo xml use AAMA while hyperlaunch seems to not include ratings (is it coded into "fade"? It appear when fade is enable)

Score included in hyperlaunch is taken from the site in the url, right? I would prefer a 100% based score (you know, zzap! freak :P)... maybe metacritic or there's a better site?

Excuse me for annoying you :P

Link to comment
Share on other sites

I'll obviously have to manually correct some flaws as these script cannot be 100% "perfect" but can I ask you another favour? It seems impossibile to export empty cells from openoffice as "", could you modify the script to add - or a space when a field is empty? Maybe ... like it's already in some hyperlaunch empty field.

I have no idea what you are talking about? The files I uploaded are separated by a tab space. They look fine when I open them using excel. I don't know what you mean by export. The easiest way to fill in the empty cells in the files I uploaded would be to do a replace all on \t\t with \t...\t

Is there a "general" or "official" rating for hyperspin? HS in neogeo xml use AAMA while hyperlaunch seems to not include ratings (is it coded into "fade"? It appear when fade is enable)

Sure there are lots of ratings. The ratings hyperlaunch uses I believe come from the hyperspin xml files. For a list of HyperSpin accepted rating see this post.

Score included in hyperlaunch is taken from the site in the url, right? I would prefer a 100% based score (you know, zzap! freak :P)... maybe metacritic or there's a better site?

The scores are on 0 to 5 scale. To convert it to a 0 to 100 scale insert a new column and make a formula like =IF(ISNUMBER(A2),A2*20,"...")

Link to comment
Share on other sites

I have no idea what you are talking about? The files I uploaded are separated by a tab space. They look fine when I open them using excel. I don't know what you mean by export. The easiest way to fill in the empty cells in the files I uploaded would be to do a replace all on \t\t with \t...\t

Photoshop does not read your files. It uses "VALUE" as field separator, it ignores TAB. If I try to load your files (remaned to .txt or .csv) it says there are too many variables in the first line. So I opened it in openoffice and exported with " as cells separator. The only problems is openoffice does not import empty cells as "" but uses TAB If you have a 6 line document with an empty cell on a line photoshop will read only 5 variables instead of 6 on that line and will not load data -.-

Sure there are lots of ratings. The ratings hyperlaunch uses I believe come from the hyperspin xml files. For a list of HyperSpin accepted rating see this post.

Thank you. I asked because to make layouts I want ratings with the same name on every databases so everyone can easily create rating png's set usable trought different systems :P

The scores are on 0 to 5 scale. To convert it to a 0 to 100 scale insert a new column and make a formula like =IF(ISNUMBER(A2),A2*20,"...")

Again, thank you :)

EDIT: I now noticed your file list 99 games while the .csv I made from neogeo HS xml's list 140 roms. Script issue or not every neo geo game is listed in hyperlaunch .ini?!?

Link to comment
Share on other sites

Thanks for suggesting the Photoshop feature! I now have game descriptions on my second monitor but its a bit painful to create.

The plus is that I was able to process all the files and with less effort (when compared to Indesign XML).

The minuses:

I don't know if its my version of Photoshop (cs5.1), but I couldn't output the file name as the Variable "RomName".

Photoshop just spit out the documents name, or numbers "01.psd, 02.psd"

it would have been nice to get "aliens.psd, "airwolf.psd".

So I had to go through more steps and rename the files since I need them to match the roms.

Another limitation in PS is that you need to have all the artwork that you list in the txt file. If you are missing art, then it halts and gives you an option to continue but it wont create a file for the variable that's missing.

One more thing to watch out for; the Mame.ini I converted to txt was really messy in the "description" fields.

It had weird combinations of commas, brackets, and quotation marks that mess up the import process in Photoshop. Once the file is cleaned up, it load fine in PS.

Link to comment
Share on other sites

The game info files are incomplete so I would probably create these csv files for the themes in a different way.

Ghutch, if you allow me to give a suggestion to improve the script that you made, I would recommend following these steps:

1) Read the HyperSpin xml database files for the ratings, year, manufacturer and genre info.

2.2) You can use the code on the shared.ahk label ReadHyperSpinXML for that.

2) Use the HyperSpin xml description as the game name and use it to search on the game info files for additional info on the games (description, ...)

2.1) In order to maximize the games found on the game info, because its naming convention is not entirely compatible with the HyperSpin naming convention, I would use the same code that I use on HyperPause to try to maximize the matches. If you want to borrow the code, just take a look at the hyperpause.ahk file between lines 570 and 604.

That way you will probably have much more reliable and numerous game info for using on this.

Link to comment
Share on other sites

@ghutch92

Ahem... my fault :( I didn't mean "value" but " when opened in notepad the files must look like this

[ATTACH=CONFIG]44344[/ATTACH

Obviously i can convert "VALUE" into " but some arguments seems to stay "open"

es: first line is

rom_name§Publisher§Developer§Released§Systems§Genre§Perspective§Score§Controls§Players§Rating§Url§Description

When it should be

§rom_name§Publisher§Developer§Released§Systems§Genre§Perspective§Score§Controls§Players§Rating§Url§Description§

Anyway, reading bleasby's consideration probably is better to use latest hyperspin's .xml as base :)

post-8767-142870644919_thumb.png

Link to comment
Share on other sites

I have no interest in editing that particular bit of code.

I added § before and after all the values like you had suggested.

§rom_name§Publisher§Developer§Released§Systems§Gen re§Perspective§Score§Controls§Players§Rating§Url§D escription§
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...