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 --- Bug Reports --- Site News

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

  

Author Topic: Arcade Genius - Automated Compatability Tester  (Read 723 times)

0 Members and 1 Guest are viewing this topic.

yo1dog

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 361
  • Last login:Yesterday at 10:50:44 pm
    • MikeArcade
Arcade Genius - Automated Compatability Tester
« on: July 07, 2019, 04:20:18 am »



arcadegenius.yo1.dog


Warning: This tool is still in Alpha stage.

For a while I have had the idea for a tool to help people quickly figure out which games would be supported at what level on various configurations of MAME cabinets. This includes both controls and video.

Ideally the tool would be able to answer these kinds of questions:
  • If I build a cabinet with 2x 8-way joysticks, 6 buttons each, and a horizontal NTSC CRT TV, which of my favorite games will be supported by this setup?
  • What if I used a 31kHz PC monitor instead?
  • Do I really need a spinner?

It would tell you that Metal Slug would play great, Elevator Action would be playable but suffer from the lack of a 4 way joystick, Missile Command would be unplayable due to the lack of a trackball, and Pacman would look terrible due to it being a vertical game on a horizontal 15khz CRT (and would also suffer from the lack of a 4 way joystick).

Of course, there are a lot of opinions and words like "playable", "looks terrible", etc. are very subjective. My idea was for the tool to point out potential issues and start with a default set of "opinions" of how important each of those issues are. But, those opinions would be editable by the user. For example, the user could change the opinions such that even if fractional scaling of the video would be required, the video looks "good" not "bad". Or that an 8-way joystick is a "good" not "bad" control for 4-way games.

Video Compatibility
I tackled what I thought would be the hardest part of this first: how to determine video compatibility. I realized this problem was already solved by people like Calamity and the GroovyMAME project. You give GroovyMAME your monitor specs and a ROM name and it determines the best modeline that can be used. It even tells you what types of compromises had to be made (fractional scaling, uneven stretching, interlacing, doublescan, etc.). So, I ripped the SwitchRes/modeline C++ code right out of GroovyMAME and compiled it to run in WebAssembly in a browser. Using the exact same code as GroovyMAME ensures the tool returns the exact same results as if you were testing it on an actual setup running GroovyMAME theoretically******

******A bunch of asterisks here because 1. C++ is defiantly not my strong suit so it's possible I messed up something when porting the code and 2. I won't pretend like I understand enough to know if I am accounting for all variables involved.

Controls Compatibility
The next step is controls. The plan is to leverage the controls.dat project - specifically my controls.json project. The hope is this will help people determine what controls they really need on their control panel. When they see that only 2 games on their list of 50 favorite games requires a spinner, they may decide not to include one. Or that the 5th and 6th buttons for player 3 and 4 are used by 0 games and can be removed. It could get really intense with a control panel builder/layout tool that encourages/enforces best practices like button layout, control spacing, player spacing, viewing angle, etc. That may be a little too ambitious.

Future
In the future I can see the tool helping with other aspects of MAME cabinet setups - especially the parts that can be difficult for newbies. For example, it could help you pick your graphics card, OS, etc. for best compatibility with CRT Emudriver. Explain your options for lightguns depending on your setup. Etc. General advice can become much more concise and specific when you know the details of the person's setup.

Known Bugs
  • Some of the presets result in errors as the strings are garbled when sent to WebAssembly. Prob some bug in my C++ code.
« Last Edit: August 07, 2019, 08:11:15 pm by yo1dog »

Arroyo

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 736
  • Last login:Today at 01:33:48 am
  • Budgets are boring
    • newforum.arcadecontrols.com/index.php/topic,156267.0.html
Re: MAME Genius - Automated Compatability Tester
« Reply #1 on: July 07, 2019, 09:01:06 am »
Brilliant!  This is a fantastic idea.

Don’t know if the data in mame includes original physical screen size (19” vs 25”, etc.) but if so can input in the first feature request? 

Nice work!

Mike A

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3417
  • Last login:Yesterday at 10:43:05 pm
  • card carrying purist
Re: MAME Genius - Automated Compatability Tester
« Reply #2 on: July 07, 2019, 09:54:49 am »
This would be awesome. If a piece of software told someone their idea sucked then I would be off the hook.

yo1dog

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 361
  • Last login:Yesterday at 10:50:44 pm
    • MikeArcade
Re: MAME Genius - Automated Compatability Tester
« Reply #3 on: July 15, 2019, 02:27:55 pm »
Added support for checking compatibility with controls. The UI for both configuring and displaying the results is still very primitive, but all the data is now there. Referring back to the example question proposed in the original post:

Ideally the tool would be able to answer these kinds of questions:
  • If I build a cabinet with 2x 8-way joysticks, 6 buttons each, and a horizontal NTSC CRT TV, which of my favorite games will be supported by this setup?
  • What if I used a 31kHz PC monitor instead?
  • Do I really need a spinner?

It would tell you that Metal Slug would play great, Elevator Action would be playable but suffer from the lack of a 4 way joystick, Missile Command would be unplayable due to the lack of a trackball, and Pacman would look terrible due to it being a vertical game on a horizontal 15khz CRT (and would also suffer from the lack of a 4 way joystick).

The tool is now at a state where this can be done. Here is a link to an example configuration showing just that:

Example

And a screenshot of the results:


Again, the UI is very simple and does not explicitly list the compatibility issues. However, if you look at the JSON in the details, you can see all the data needed to power that UI exists. Next step is to build it.

« Last Edit: July 15, 2019, 02:31:34 pm by yo1dog »

Calamity

  • Moderator
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 6689
  • Last login:Today at 12:51:56 am
Re: MAME Genius - Automated Compatability Tester
« Reply #4 on: July 15, 2019, 02:36:17 pm »
Hi yo1dog,

For some reason the "arcade_15ex" preset still doesn't work (you're probably aware of this since you mentioned about issues with some presets).

I'd love to get the classic modeline format in addition to the split format you get now.
Important note: posts reporting GM issues without a log will be IGNORED.
Steps to create a log:
 - From command line, run: groovymame.exe -v romname >romname.txt
 - Attach resulting romname.txt file to your post, instead or pasting it.

CRT Emudriver, VMMaker & Arcade OSD downloads, documentation and discussion:  Eiusdemmodi

yo1dog

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 361
  • Last login:Yesterday at 10:50:44 pm
    • MikeArcade
Re: MAME Genius - Automated Compatability Tester
« Reply #5 on: July 15, 2019, 02:43:22 pm »
Hi yo1dog,

For some reason the "arcade_15ex" preset still doesn't work (you're probably aware of this since you mentioned about issues with some presets).

I'd love to get the classic modeline format in addition to the split format you get now.

Yea I still need to look into that bug. I've been focusing on other more fun stuff for now. I'll throw in the classic modeline format as well.

Arroyo

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 736
  • Last login:Today at 01:33:48 am
  • Budgets are boring
    • newforum.arcadecontrols.com/index.php/topic,156267.0.html
Re: MAME Genius - Automated Compatability Tester
« Reply #6 on: July 15, 2019, 03:14:58 pm »
Nice work.

Substring

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 111
  • Last login:Yesterday at 04:28:25 pm
  • I want to build my own arcade controls!
Re: MAME Genius - Automated Compatability Tester
« Reply #7 on: July 16, 2019, 05:36:51 pm »
Awesome tool, keep up the good work!

yo1dog

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 361
  • Last login:Yesterday at 10:50:44 pm
    • MikeArcade
Re: MAME Genius - Automated Compatability Tester
« Reply #8 on: July 17, 2019, 08:37:13 pm »
I've got a bunch of work done on the UI. You can now see the compatibility results in a friendly UI. It tells you why your monitor won't work and what controls are missing or are being substituted.

I also threw in some things like a JSON tree view for exploring the raw data.

Check it out: Example Link.




yo1dog

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 361
  • Last login:Yesterday at 10:50:44 pm
    • MikeArcade
Re: MAME Genius - Automated Compatability Tester
« Reply #9 on: July 20, 2019, 07:29:45 pm »
Some more UI updates. I also made the large resources load async/dynamically as needed so initial loading is much faster. No reason for the main UI to wait on the large JSON files to load when they are not needed until a compatibility check.

A lot of unseen changes around control compatibility checking. Before it was simply allocating the best CP control in order of the game controls. Now it uses rounds of  optimization to ensure the best compatibility outcome. Lots of other unseen framework changes as I learn webpack (this is my first project with it).

Also a spiffy new logo.

Check it out: Example Link.
« Last Edit: July 20, 2019, 07:34:24 pm by yo1dog »

yo1dog

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 361
  • Last login:Yesterday at 10:50:44 pm
    • MikeArcade
Re: MAME Genius - Automated Compatability Tester
« Reply #10 on: July 21, 2019, 05:44:17 pm »
For some reason the "arcade_15ex" preset still doesn't work (you're probably aware of this since you mentioned about issues with some presets).

I'd love to get the classic modeline format in addition to the split format you get now.

Fixed the bug with some of the presets not working. I also added the classic modeline format to the data output (just for you Calamity ;))

Check it out: Example Link.


Arroyo

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 736
  • Last login:Today at 01:33:48 am
  • Budgets are boring
    • newforum.arcadecontrols.com/index.php/topic,156267.0.html
Re: MAME Genius - Automated Compatability Tester
« Reply #11 on: July 21, 2019, 08:49:57 pm »
Nice job, keep it up!

yo1dog

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 361
  • Last login:Yesterday at 10:50:44 pm
    • MikeArcade
Re: MAME Genius - Automated Compatability Tester
« Reply #12 on: August 06, 2019, 05:07:39 pm »
  • Moved the site to it's own subdomain: mamegenius.yo1.dog. All previous URLs now redirect.
  • Added ROM/machine name suggestions when a name is not found. For example, if you entered "mrs pac man" it now asks if you meant "mspacman".



A lot more unseen changes have taken place.
  • Serializing and deserializing to and from state is now much more robust. It is more explicit in order to catch data problems upstream. Serialization versioning was also added so data structures can be changed while remaining backwards compatible.
  • I transitioned the project to TypeScript which is a superset of JavaScript that adds typing.

I believe the added strictness of TypeScript will make the project easier to manage. Plus when used with IDEs such as VSCode you get full IntelliSense code-completion which makes development easier and faster. And because it's a superset, anyone familiar with JavaScript should be able to jump into the code without issue.

TypeScript has become quite popular and I've been wanting to do a project with it. I have stuck with JavaScript it in the past to avoid the build step and source maps, but this project uses webpack which already requires those. If it doesn't work out, transitioning back to JavaScript is very easy.

krick

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2000
  • Last login:August 18, 2019, 07:21:58 pm
  • Gotta have blue hair.
Re: MAME Genius - Automated Compatability Tester
« Reply #13 on: August 06, 2019, 05:29:29 pm »
I believe the added strictness of TypeScript will make the project easier to manage. Plus when used with IDEs such as VSCode you get full IntelliSense code-completion which makes development easier and faster. And because it's a superset, anyone familiar with JavaScript should be able to jump into the code without issue.

TypeScript has become quite popular and I've been wanting to do a project with it. I have stuck with JavaScript it in the past to avoid the build step and source maps, but this project uses webpack which already requires those. If it doesn't work out, transitioning back to JavaScript is very easy.

You're preaching to the choir.  JavaScript is the devil.  I don't know how any serious development work actually uses it.  It's a horrible, horrible language.  I know that JavaScript can never truly go away but I'd love to see TypeScript replace it as much as possible.
Hantarex Polo 15KHz
Sapphire Radeon HD 7750 2GB (GCN)
GroovyMAME 0.197.017h_d3d9ex
CRT Emudriver & CRT Tools 2.0 beta 13 (Crimson 16.2.1 for GCN cards)
Windows 7 Home Premium 64-bit
Intel Core i7-4790K @ 4.8GHz
ASUS Z87M-PLUS Motherboard

yo1dog

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 361
  • Last login:Yesterday at 10:50:44 pm
    • MikeArcade
Re: MAME Genius - Automated Compatability Tester
« Reply #14 on: August 07, 2019, 11:59:41 am »
This will sound like I am defending JavaScript, but really by only point is that it's a tool. It will be useful in some scenarios and detrimental in others. I guess I am defending it in that I disagree that it is an inherently horrible and useless language. Though, I defiantly understand if JavaScript's quirks turn you away. I have similar feelings about other languages.

We've used JavaScript as our primary backend language (Node.JS/Express stack) for years at my current job with success. Like any loosely typed language, there are defiantly foot guns everywhere. The two biggest ones I see are: putting no effort into interface design and trying to be too clever with type coercion. TypeScript helps by giving you more restrictions, but you can still shoot yourself in the foot using type assertions and "any". It's a superset of JavaScript so many of the same language/syntax issues still exist. But, once you learn the language and especially the pitfalls it can be very powerful tool for rapid development. We make heavy use of linters to catch anti-patterns and put safeties on those foot guns for the newer developers.

Not having to think about classes, inheritance, or complex interfaces (duck-typing) is certainly nice. Also, the language has gotten MUCH better since es6/es2017 and continues to make massive strides with rolling updates.

krick

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2000
  • Last login:August 18, 2019, 07:21:58 pm
  • Gotta have blue hair.
Re: MAME Genius - Automated Compatability Tester
« Reply #15 on: August 07, 2019, 01:12:43 pm »
This will sound like I am defending JavaScript, but really by only point is that it's a tool. It will be useful in some scenarios and detrimental in others. I guess I am defending it in that I disagree that it is an inherently horrible and useless language. Though, I defiantly understand if JavaScript's quirks turn you away. I have similar feelings about other languages.

I never said it's a useless language.  There's a lot it does right.  The main problem I have with JavaScript is that it wasn't designed and just sort of happened (see also PHP).  As a consequence, there's a lot of icky baggage that it carries forward in the name of backwards compatibility and this is the main source of bugs and performance issues (see also Microsoft Windows).  I feel that if they could jettison the bad parts of JavaScript and come out with a properly designed JavaScript 2.0, the world would be a much better place.   Since that can't happen, Using something like TypeScript on top of it is probably the best path forward.

I sincerely apologize for derailing your thread.  I can delete my comments if you want.
Hantarex Polo 15KHz
Sapphire Radeon HD 7750 2GB (GCN)
GroovyMAME 0.197.017h_d3d9ex
CRT Emudriver & CRT Tools 2.0 beta 13 (Crimson 16.2.1 for GCN cards)
Windows 7 Home Premium 64-bit
Intel Core i7-4790K @ 4.8GHz
ASUS Z87M-PLUS Motherboard

yo1dog

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 361
  • Last login:Yesterday at 10:50:44 pm
    • MikeArcade
Re: MAME Genius - Automated Compatability Tester
« Reply #16 on: August 07, 2019, 03:52:07 pm »
I agree completely. I almost used PHP as a comparison as well.

Not a derailment. This thread has been about the development of the tool which certainly encompasses discussions of the language it is built in. I appreciate the input.

I've been loving TypeScript. Before I had basically poor-man's TypeScript by using jsdocs to type annotate everything. That at least got me code completion but still no type checking. I then tried to use linters to implement type checking; it worked but the jsdoc syntax is awkward and heavy.

yo1dog

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 361
  • Last login:Yesterday at 10:50:44 pm
    • MikeArcade
Re: MAME Genius - Automated Compatability Tester
« Reply #17 on: August 07, 2019, 03:59:36 pm »
I just remembered another reason why I was avoiding TypeScript at first. The TypeScript server was slowwww. Code completion was slow and builds (initial and incremental) took forever. But then I figured out why (by accident, actually):

I was referencing giant ~8MB JSON files (MAME --list output and controls.dat) and TypeScript's automatic type acquisition was creating obscenely large types for them which was bogging everything down. I told TypeScript not to do that and it was lightning quick.

yo1dog

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 361
  • Last login:Yesterday at 10:50:44 pm
    • MikeArcade
Re: Arcade Genius - Automated Compatability Tester
« Reply #18 on: August 07, 2019, 08:23:00 pm »
Renamed the project to "Arcade Genius". New logos to go along with the new name.

PL1 pointed out that the MAME name and logo are trademarked. While I am sure it would have been fine given this is a free to use tool, I went ahead and changed all the branding. There's not much that is specific to MAME anyway.



« Last Edit: August 07, 2019, 08:28:02 pm by yo1dog »

Substring

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 111
  • Last login:Yesterday at 04:28:25 pm
  • I want to build my own arcade controls!
Re: Arcade Genius - Automated Compatability Tester
« Reply #19 on: August 08, 2019, 01:49:26 am »
One suggestion : it could be interesting to dpecify which mame version dat you're using, as well as which switchres version too. I guess the json part states mame version (0.172 ?), but there can be differences between 2 versions.

This brings an idea : maybe allowing people to choose their mame version could be a nice feature (but a hell for you to fibd and parse all of them, considering switchres also evolved over time). Not everyone is running 0.172, or the last cutting edge version.