Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Controls Database (FE programmers inside, please)  (Read 5139 times)

0 Members and 1 Guest are viewing this topic.

potatojin

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:September 07, 2003, 11:48:43 pm
Controls Database (FE programmers inside, please)
« on: March 18, 2002, 11:57:43 am »
Hello everybody.  I've been lurking here at BYOAC for a while now as I've been getting my cabinet built.  It's pretty much all done and I'll post pictures soon.

As I've been researching FE's and thinking about making my own or trying to contribute to an existing one, I got an idea that I was wondering if the community would be into (or that might have already been done).

I've been spending lots of time figuring out or explaining to friends what buttons do what in various games and have really been itching to have some quick way to communicate which buttons do what in all my games.

So I was wondering if there already is, or if we should try to build, a database somewhere that contains all the button mappings for every emulated game.  I'm imagining an end product that looks something like a big xml file that contains the rom name and then mappings (with descriptive names) of each of the game's controls to the mame virtual buttons (Player 1 Button 1, etc).  Something like this:

<MAMECONTROLS>
 <ROM NAME="mslug3">
    <BUTTON NAME="Player1Button1" DESCRIPTION="Shoot">
 </ROM>
</MAMECONTROLS>

That's just off the top of my head, but you should get the idea.  The file would be available to FE authors and could be tied into your favorite image generation software to output control panel diagrams for every game and display them in the FE.  This would go great with something like ArcadeFX's flash-based control layout app, so FE users could configure the generated diagrams to look exactly like their own control panel.

Alternatively, this could just be maintained as a separate application that would be distributed with FE's and would populate another folder like /controlsnaps that FE authors could just pull PNG files from.

I'm imagining the population part of this project, where we actually get all the information about what button does what would involve a moderated database-driven website.  Volunteers could come to the site and see which games still need control information and fill it in.  FE authors or whoever could download the latest version of the control database xml doc.

What does everybody think?  Sorry about the long first post, but I had one of those taking-a-shower epiphanies and I wanted to see if what people thought.

potatojin
« Last Edit: December 31, 1969, 07:00:00 pm by 1026619200 »

Dr. Jay

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 43
  • Last login:January 05, 2003, 11:17:19 am
Re: Controls Database (FE programmers inside, plea
« Reply #1 on: March 18, 2002, 12:26:14 pm »
Not a programmer, but it sounds nice.
 This is what I did though.  I made a nice looking graphic of my keyboard layout, and I display it in my frontend instead of having a flyer pic.  I've got the marquee at the top, screen shot next, and the control layout on the bottom.  Once the template was done, I just edited the text for each button.  Having a universal sounds nice, but what about everybody's crazy control panel layouts, and different keymappings?  Like I said, I'm not a programmer, but it sounds interesting.
« Last Edit: December 31, 1969, 07:00:00 pm by 1026619200 »

potatojin

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:September 07, 2003, 11:48:43 pm
Re: Controls Database (FE programmers inside, plea
« Reply #2 on: March 18, 2002, 01:57:46 pm »
I got started thinking about this by looking at building a system for myself that would add control panel information to snaps, but I think the universal system would not be that much more work and would be something everybody could use.

Quote


As far as crazy control panel layouts go, I was thinking that the client-side application would come with a template builder, like what you did for your layout.  Then the app could just pull in the info from the universal file and change the text under each of the custom-placed buttons.  Keymappings may be something I underestimated though.  I might have to go back to the drawing board on that.

« Last Edit: December 31, 1969, 07:00:00 pm by 1026619200 »

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re: Controls Database (FE programmers inside, plea
« Reply #3 on: March 18, 2002, 04:06:13 pm »
I like the idea, but would like some more info added to it (or parallel to it).

Joystick/spinner/pedal information.  Mame already has the bases for this with "mame -listinfo", but only list the primary input.  
Examples:
1. a racing game might list a spinner ("dial") for input with "mame -listinfo", but doesn't list wheather it has one or two pedals.  
2. DOTron doesn't list that it needs both a spinner and an 8way joystick, but instead lists a trackball as the input!

I'm just too lazy and unknowledgable to do it myself.;D
« Last Edit: December 31, 1969, 07:00:00 pm by 1026619200 »
Robin
Knowledge is Power

simpleman46

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19
  • Last login:December 29, 2003, 10:54:47 pm
  • Nummy Goodness
    • From Rocks
Re: Controls Database (FE programmers inside, plea
« Reply #4 on: March 18, 2002, 09:57:02 pm »
Sounds like a great idea.  Could be very useful inside a FE.  If this ever gets off the ground, I would be more than willing to help assemble data from games.
« Last Edit: December 31, 1969, 07:00:00 pm by 1026619200 »

ArcadeFX

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 188
  • Last login:November 10, 2004, 11:16:56 pm
  • All the Dude ever wanted was his rug back!
    • ArcadeFX
Re: Controls Database (FE programmers inside, plea
« Reply #5 on: March 19, 2002, 10:12:12 am »
The database I use with ArcadeFX has the following alrady entered for every MAME game.

"gamename","gamedescription","gameyear","gamemanufacturer","gamecloneof","gameromof","gamecategory","gameversion","videoscreen","videoorientation","videox","videoy","videocolors","videofreq","soundchannels","inputplayers","inputcontrol","inputbuttons","inputcoins","driverstatus","drivercolor","driversound","drivercolordeep","available","favorite","favorite2","favorite3","favorite4","favorite5","counter"

The last 7 fields are specific for each user and not taken from the listinfo.

I am not sure how usefull a database would be of key mappings since each cabinet could have their own mappings.  Anyone who did any custom key mapping in MAME might not find it very useful.
« Last Edit: December 31, 1969, 07:00:00 pm by 1026619200 »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 11:22:04 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Controls Database (FE programmers inside, plea
« Reply #6 on: March 19, 2002, 10:14:27 am »
It sounds like a cool idea, but other than telling you which games have spinners (which we can already get) and some interesting eye candy, what purpose would it serve?

Here's a thought, same idea, but use it for a totally different purpose.  Me and lilwolf were talking about making a on-the-fly key remapper.  Now if you gave all button functions a generic name (fire 1 fire 2 fire 3, ect)  then it could be useful for that.  

Just a thought, keep at it.
:)
« Last Edit: December 31, 1969, 07:00:00 pm by 1026619200 »

Trenchbroom

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 276
  • Last login:November 21, 2020, 09:25:43 pm
  • Wampus? Get over here!
Re: Controls Database (FE programmers inside, plea
« Reply #7 on: March 19, 2002, 03:45:13 pm »
Actually here's another idea for the esteemed programmers among us (certainly not me, and thanks for the hard work BTW).

Make a program like ArcadeFX's ICPD where someone could easily setup his own contol panel layout and save it as a picture in the FE itself.  Then, when each game is highlighted on the menu have the picture of the control panel highlight what each button does in that particular game.  The user would have to input the controls for each game, of course, although many games could use a more generic layout that the user indicates as such (i.e. all Donkey Kong clones would use the "DK" button layout, all Street Fighter the "6 button fighting" layout, etc.)
« Last Edit: December 31, 1969, 07:00:00 pm by 1026619200 »

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8187
  • Last login:Today at 12:38:03 am
  • The Bears Still Suck!
Re: Controls Database (FE programmers inside, plea
« Reply #8 on: March 19, 2002, 03:53:16 pm »
Quote
"favorite","favorite2","favorite3","favorite4","favorite5"
Quote


WHAT!!!  A limited amount of favorites with a database design:)
hehe, mt FE has unlimited categories and favorites:)  Oh wait, I'm not really going to release it to the public for pblic use anyway, just release it and use it at your own risk:)
« Last Edit: December 31, 1969, 07:00:00 pm by 1026619200 »

potatojin

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:September 07, 2003, 11:48:43 pm
Re: Controls Database (FE programmers inside, plea
« Reply #9 on: March 19, 2002, 04:42:13 pm »
Quote
Then, when each game is highlighted on the menu have the picture of the control panel highlight what each button does in that particular game.


This is pretty much exactly what I was originally thinking about.  In response to Howard, I was thinking it would go beyond eye candy by reminding me and telling my friends exactly what each of the 7 buttons on my control panel do when I load up a game.  You'd only see it before loading the game, but it might be better than nothing.

I'm still trying to hash out the technical feasibility re: key mappings.  I'd rather not have a solution that requires a huge amount of special coding by individual FE authors.  I haven't tried parsing the mame config files and don't know how hard anyone else has tried.
« Last Edit: December 31, 1969, 07:00:00 pm by 1026619200 »

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8187
  • Last login:Today at 12:38:03 am
  • The Bears Still Suck!
Re: Controls Database (FE programmers inside, plea
« Reply #10 on: March 19, 2002, 08:32:56 pm »
There is a big downsdie to this, it'd take alot of time.
Someone would have to go through each game, find out what it's controls are, and enter them in a db.

Like with mvsc you'd have to put in what fierce punch is and such.

AND some people (like me) change their buttons so button 1 isn't always the same from one game to the next.

It's be cool, but difficult to do.

NOW, why might be better is if people could get pictures of instruction cards for games like their is marquees, flyers, and other artworks....
« Last Edit: December 31, 1969, 07:00:00 pm by 1026619200 »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 11:22:04 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Controls Database (FE programmers inside, plea
« Reply #11 on: March 19, 2002, 09:08:05 pm »
Quote

I'm still trying to hash out the technical feasibility re: key mappings.
« Last Edit: December 31, 1969, 07:00:00 pm by 1026619200 »

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re: Controls Database (FE programmers inside, plea
« Reply #12 on: March 20, 2002, 12:41:53 am »
Quote
As for mame config... it's in some type of format other than text.... I haven't had much luck parsing it.


Those dang .cfg files! ;p
They are mostly a binary file.  (Units in the file are 8 bit hex pairs, integer(16 bit) = 2 hex pairs, word(32 bit) = 4 hex pairs.)
First are 7 chars ("MAMECFG" to be exact), followed by the version of the config file in hexadecimal ("0x08" currently).  After that comes all the driver's default input settings, followed by all the current input settings. Small stuff after that (Coins entered each coin slot, then sound settings).

Each input setting goes (in hex):

input_type {integer, or 2 pairs},
input_mask {word, or 4 pairs},
input_default value {word},
input_sequence {word, + x# integer(s)}.  

type is the input type, such as joystick_left, button1, or spinner. (two hex pairs)
mask contains info like which player #, auto_center, and other stuff. (four hex pairs)  
default value is used mostly by analog inputs, and is the "starting" value, or the value centered toward if the mask includes auto_center. (four hex pairs)
sequence starts with the length of the sequence (four hex pairs).  The value can be from 0x00 to 0x10 (0-16), depending on how many inputs you have mapped to that input.  That number of inputs, represented by two hex pairs, follows.  For example, if you had joyButton 0, key "ctrl", and mousebutton 0, mapped to the same input, I think you would have a length of 14 hex pairs: starting with 0x05 {word} followed with: {integers} the 3 inputs separated by 2 "CODE_OR"s  (or in pseudocode: input_sequence_length_5 {word}, joybutton0 {integer}, OR {integer}, "ctrl" key {integer}, OR {integer}, mousebutton0 {integer}).

The translation of the numbers to inputs is done in inptport.c, input.c, and [OS]/input.c.  The biggest problems are that each input setting can very in length, and each .cfg files can vary which inputs are saved.

We are mostly interested in reading/editing the second set of input settings, as those are the settings used in the games.

Hope this helps anyone.
« Last Edit: December 31, 1969, 07:00:00 pm by 1026619200 »
Robin
Knowledge is Power

potatojin

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:September 07, 2003, 11:48:43 pm
Re: Controls Database (FE programmers inside, plea
« Reply #13 on: March 20, 2002, 12:40:31 pm »
Quote

...lots of computer stuff...


Rebelscum, that was very helpful.  I imagine all this stuff is available at mame.net, which is my next stop as soon as I have some time.

For whatever reason, I still think this might be a good idea.  Let me summarize what I think I'm talking about and if everyone thinks it's a stupid idea, I'll think of something else or go cry:

- A database that contains all control information with friendly names for the functions of the inputs.  This db can be dumped to xml and downloaded to users' machines.
- A "control layout" mini-application that lets users create a graphic template of their control layout.
- An application which batches the job of populating this template with the friendly names from the db for each game.  This app will check against the .cfg files for each game so the button mappings are correct.
- A directory full of .png files that contain the finished product: one png file for each game, named by rom, that looks like the user's control panel layout, with descriptions of each buttons function.

That's it in a nutshell.  Let's set aside feasibility for a moment (I think it would be a lot of work, but would be doable), and just everybody tell me what they think about this idea.

Thanks.
« Last Edit: December 31, 1969, 07:00:00 pm by 1026619200 »

potatojin

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:September 07, 2003, 11:48:43 pm
Re: Controls Database (FE programmers inside, plea
« Reply #14 on: March 20, 2002, 12:45:11 pm »
Quote
There is a big downsdie to this, it'd take alot of time.


It would take a lot of time, but I'm thinking we could rely on a little internet magic to speed it up.  I'm thinking of a web-based db that's fed by the community, like the IMDB, with a moderator or two checking to make sure the info is consistent.

This community seems full of people itching to volunteer for things, and it wouldn't take that long to go to the control db site, find out which games don't have descriptions yet, and spend 10 minutes filling out five of them.

Work-in-progress database dumps could be made available so the most popular games, which will probably be filled out first, can start working as soon as possible.

The moderator can deal with control replication, like sf2->msvc->sfa3, etc. through an admin interface to further speed things up.
« Last Edit: December 31, 1969, 07:00:00 pm by 1026619200 »

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8187
  • Last login:Today at 12:38:03 am
  • The Bears Still Suck!
Re: Controls Database (FE programmers inside, plea
« Reply #15 on: March 20, 2002, 02:07:08 pm »
Quote


It would take a lot of time, but I'm thinking we could rely on a little internet magic to speed it up.
« Last Edit: December 31, 1969, 07:00:00 pm by 1026619200 »