Build Your Own Arcade Controls Forum
Main => Software Forum => Topic started by: Onid on March 16, 2005, 05:30:17 pm
-
Wondering how many other FE developers use VB6 or .NET?
For a FE I am development I am creating a base lists creation tool.
This utility will use MAME.EXE, Controls.ini, and A category INI file to create the base file. The controls and category are optional. The controls and category files are found on other project sites.
The utiulity will spit out a massive XML file with the following game data:
Filename
Description (aka Game Title)
Year Made
Manufacturer
Chip Type
Video Type
# Audio Channels
# Players
# Coins
Controller Type
# Buttons
Button 1 Info
Button 2 Info
Button 3 Info
Button 4 Info
Button 5 Info
Button 6 Info
Button 7 Info
Button 8 Info
Button 9 Info
Button 10 Info
Command Line
Categories
Enabled or Disabled
Any other information you would find useful to store?
Also seperate category files will be created with a list of only filenames.
VB6 code will be given to show how easy it can be using just the rom filename to gather the above list of details about the game instantly. No more needing to load all data to the FE or parsing multiple files for the information.
Another utility attached will include a import/exort to Excel feature. It will conver the XML document to Excel so you can alphbatize, or add unknow information. Then using the utility import the newly saved Excel file to create an updated XML file.
Even if VB6 or .NET is not being used to code your FE you can use any XML code function to read the XML file.
-
Sounds Very useful... looking forward to it!
Art
-
Take a look at buddabings listgen tool. It serves similar purposes. But it does not yet suppprt exporting lists in xml format.
peter
-
I really don't like the XML format. A flat file (like INI ones) with same information would be very usefull. The XML format force to use XML Parser or code your own. In all case it is slower than retrieve information from the flat file.
Personnaly my Front End is coded with C++ . Configuration tools with Delphi.
-
I really don't like the XML format.
-
What ever the format you use XML or Not, you need to read the file to access Data. You can read it partially or not, but you need to read at least until you find the right data. Unless you use hashcoding technique or indexes you can not reach the data directly.
the XML is a very speaky and heavy format. If you use a XML parser to access you XML file from VB , I think your file is loaded in Memory and then you access it by browsing a kind of tree.
But if i don't like XML is not for performance issue. It is mainly for the Heavy Aspect. In the context of a front end it is not a real problem. But more an more application use the XML to transfert data via the net, i'm working on XML Daily , and it is crazy the volume of data we don't need we transfert! >:(
A quick test, Instead of generating XML for your file, generate a Flat INI file. You will see the difference in term of volume.
-
The testing I have performed shows the same speed when reaing the fir game listed in the XML or the last file listed. In all situations it is less than a half second to access and display the data. This is using a 7MB xml file with every game currently supported my .94. I guess for those that still use INI I could build a seperate convertor exe that can convert the XML file that is created back to an INI structure. The way I have the XML structure setup is having the code tag each line with the filename. For example
<numbuttons_chqflag>3</numbuttons_chqflag>
This way to parse the information it canse use the property value + filename to directly pull the information you are requesting.
Here is example of the code I am using.
--------------------------------------------------
Option Explicit
Dim XMLFilePath As String
Private Sub Form_Load()
XMLFilePath = App.Path & "\biglist.xml"
End Sub
Private Function GetNodeValue(ByVal start_at_node As IXMLDOMNode, ByVal node_name As String, Optional ByVal default_value As String = "") As String
Dim value_node As IXMLDOMNode
Set value_node = start_at_node.selectSingleNode(".//" & node_name)
If value_node Is Nothing Then
GetNodeValue = default_value
Else
GetNodeValue = value_node.Text
End If
End Function
Private Sub Command1_Click()
Dim xml_document As DOMDocument
Dim values_node As IXMLDOMNode
Set xml_document = New DOMDocument
xml_document.Load XMLFilePath
If xml_document.documentElement Is Nothing Then Exit Sub
Set values_node = xml_document.selectSingleNode("mame")
msgbox = GetNodeValue(values_node, "numbuttons_chqflag", "???")
End Sub
-
I can be wrong , but i think your XML file is loaded in memory by this line.
xml_document.Load XMLFilePath
If it is the case you are using 7 mega of RAM just for your file.
But for sure, if you do the same file as INI not XML , i think i will use it.
-
Wondering how many other FE developers use VB6 or .NET?
For a FE I am development I am creating a base lists creation tool.
This utility will use MAME.EXE, Controls.ini, and A category INI file to create the base file. The controls and category are optional. The controls and category files are found on other project sites.
The utiulity will spit out a massive XML file with the following game data:
Filename
Description (aka Game Title)
Year Made
Manufacturer
Chip Type
Video Type
# Audio Channels
# Players
# Coins
Controller Type
# Buttons
Button 1 Info
Button 2 Info
Button 3 Info
Button 4 Info
Button 5 Info
Button 6 Info
Button 7 Info
Button 8 Info
Button 9 Info
Button 10 Info
Command Line
Categories
Enabled or Disabled
Any other information you would find useful to store?
Also seperate category files will be created with a list of only filenames.
VB6 code will be given to show how easy it can be using just the rom filename to gather the above list of details about the game instantly. No more needing to load all data to the FE or parsing multiple files for the information.
Another utility attached will include a import/exort to Excel feature. It will conver the XML document to Excel so you can alphbatize, or add unknow information. Then using the utility import the newly saved Excel file to create an updated XML file.
Even if VB6 or .NET is not being used to code your FE you can use any XML code function to read the XML file.
My ListGen (http://cpmaker.mameprojects.com/files/LISTGEN.ZIP) utility already builds arbitrary game lists. It builds XML lists, too. (Kymaera uses XML in its game lists).
-
My ListGen (http://cpmaker.mameprojects.com/files/LISTGEN.ZIP) utility already builds arbitrary game lists. It builds XML lists, too. (Kymaera uses XML in its game lists).
Oops, I did not know listgen already supported xml output :-[
I think xml is a bit over hyped these days... I can appreciate the neatness of its structure and it has it uses...but for the most part I agree with Youki on this.
peter
-
My ListGen (http://cpmaker.mameprojects.com/files/LISTGEN.ZIP) utility already builds arbitrary game lists. It builds XML lists, too.
-
I can be wrong , but i think your XML file is loaded in memory by this line.
xml_document.Load XMLFilePath
If it is the case you are using 7 mega of RAM just for your file.
But for sure, if you do the same file as INI not XML , i think i will use it.
Ya it wont be a problem to have a radial button letting you choose XML or INI. For INI though should I just list all the option under [gamefilename] with no descriptions (use readme.txt to figure out order), or use descriptions like numbuttons=3. With descriptions you will have to split the string to find the data, but most programmers are used to this.
Also looking at the memory usage, I couldnt see my CPU or memory usage climb at all when pulling data from the XML. It probably does use the memory but does it so quickly it never registered. I will put in system requirement you must have a computer with 10MB or more just in case. :)