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: Discussion of 4-way predictor code in MAME (hardware testing request)  (Read 1523 times)

0 Members and 1 Guest are viewing this topic.

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
I decided to start a new thread for this, rather than further muddy the 4-way games list thread.
I'm not sure why it seems everyone is sour about MAME's 4-way restriction. If you are using a joystick with a 4-way restricter, then it shouldn't be an issue (should it?).

If you are using a physically restricted 4-way stick, then it won't matter, no. 

The problem comes in when you are using an 8-way.  Then, MAME's software restriction will "guess wrong", and PacMan dies.  I'm not saying it's a totally bad thing, it may work better than it would without the restriction code, just that it isn't a CURE for the problem.
A little more info - as I see it - there are three possible cases that MAME needs to deal with regarding 4-way games -  (And I am only sure of the first two examples, and not positive of that).

Games that used a 4-way joystick, but the game expected you to be able to hit diagonals - Tron for example - In this case, MAME should treat the game as JOY8WAY, but a restricted joystick (hardware or software) will play better.

Games that used a 4-way joystick but the game did not expect you to hit diagonals - This would be like Nibbler from the description above.  In this case, for accurate emulation, the controls should freeze when the game hit a diagonal.  MAME should code it to work this way, but this would make the game very difficult to play on an 8-way stick.

Games that used a 4-way joystick, but the game expected you to hit the diagonals - I think Pac-Man would be an example of this.  Note that there are two ways the game could handle this - it could ignore the diagonal input - i.e. keep the primary input, or it could ignore the primary input, i.e. jump to the new input.  This was what was changed with the stickymode change in the R35 - R36??? cycle.

It sounds to me like MAME should have 4 input types - Joy8way, Joy4Way-NoPredictor, Joy4Way-FastPredictor (the current code), mame immediately jumps to the new direction,  Joy4way-SlowPredictor (MAME maintains the current direction longer).  And the dev team should experiment and see what the original game did and code the drivers to work accordingly.

BTW, here is an (Idealized) explanation of the different modes and how they work.  Imagine you have a protractor on your CP so straight up is 0 degrees and full right is 90 degrees of a 360-degree rotation.  You are moving the stick from UP to Right.

Ideally, with a 4-way stick, the UP switch disengages at approximately 44.5 degrees and the RIGHT switch activates at 45.5 degrees with a 1-degree deadzone with neither switch activated.

With an 8-way stick, let's assume the RIGHT switch activates at 30 degrees and the UP switch disengages at 60 degrees.

Note that these two points (30 and 60 degrees) are the only points that the inputs change on an 8-way joystick, so these are the only places MAME can make an action.

What the new DRS 4-way code in the GP-Wiz49 does is read the stick position and move the transition points closer to 45-degrees rather than 30 or 60.  (But it can only do this because of the greater resolution of the 49-way joystick).

Here are MAME's options regarding 4-way behavior when you are using an 8-way stick, again assuming you are moving the stick from Up to Right -

Send the Up command from 0 to 30 degrees, send no command (stick centered) from 31 to 60 degrees, send the Right command from 61 to 90 degrees.  This sounds like what nibbler does, but would be terrible for gameplay with the sticks.

Send the Up command from 0 to 30 degrees, send the Right command from 31 to 90 degrees.  This is what MAME currently does.

Send the Up command from 0 to 60 degrees, send the Right command from 61 to 90 degrees.  This is what MAME did prior to R35 or R36 or so.

What I would like to propose, and it should be pretty easy to do for someone with a dedicated 4-way game - I will use PacMan as an example (but would like results for many games):

Start a game with Pac-Man heading up and a right-turn tunnel up ahead, and depress the right joystick switch without releasing the up switch.  Does PacMan?

a) Stop moving - Mode 1 above.
b) Continue on and turn right when he hits the tunnel - Mode 2 above.
c)  Continue moving up, going past the tunnel - Mode 3 above.

If we can get conclusive results, maybe we can see about changing MAME's behavior.
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

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+
I'd prefer seperating how mame handles 8way joystick to 4way games from the flags.

I propose 4 flags (one additional from current):
- 8way
- 2way
- 4way
- 4way-almost-but-actually-has-diagonal (tron/bagman)


and 3 options:
- fast predicition (current)
- slow prediciton (sticky 4way)
- no prediction (send diagonals)

The defaults would be:
- the standard 4way have "fast" (like current so most poeple won't notice any changes)
- all others would have "no"
- only the two 4ways could change the prediction setting.

In addition, I'd rename the prediction types to something other than "prediction", because it's not really predicting anything. ;)
Robin
Knowledge is Power

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Thanks for the comments, urebel.

Couple of things to point out, when you refer to flags, I think you mean source code definitions.  When you refer to to options, I think you mean command-line modifiers.  I was using flags for what you meant by options, but your definitions are clearer.
I'd prefer seperating how mame handles 8way joystick to 4way games from the flags.
I propose 4 flags (one additional from current):
- 8way
- 2way
- 4way
- 4way-almost-but-actually-has-diagonal (tron/bagman)
I was originally thinking the Tron/bagman setting should just be 8-way and you would have to have the proper stick restriction to play the game, but that won't work well with most sticks, so I could see adding a new ''flag".
Quote
and 3 options:
- fast predicition (current)
- slow prediciton (sticky 4way)
- no prediction (send diagonals)
okay.
Quote
The defaults would be:
- the standard 4way have "fast" (like current so most poeple won't notice any changes)
- all others would have "no"
- only the two 4ways could change the prediction setting.
Mame currently doesn't use prediction in the two-way and 8-way games, correct?  I don't see any reason for it to.

Basically, I agree, but I think the defaults should match what the actual game used, if we can determine that - even if it makes gameplay worse.
Quote
In addition, I'd rename the prediction types to something other than "prediction", because it's not really predicting anything. ;)
I don't care what the names are, as long as you can clearly tell what it means.
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

BSR

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 23
  • Last login:January 09, 2006, 07:52:00 pm
  • I'm a lurker
I would like to see Mame better document the type of control interface and the type of control. I like the idea of the information being consolidated and accurate.

Currently, there are several configurations which are not handled consistently:

1.)   Games where the internal hardware can recognize diagonals, but the game shipped with 4way joystick.
For instance, Pac-Mania is currently set to 8way; the hardware recognizes 8way, but uses 4way joystick.
Tapper and Timber is set to 4way in MAME and used 4way joysticks, but the hardware can recognize diagonals.
To complicate matters more you have the 4way joysticks that can hit diagonals and the ones that can't.
(Games that do recognize diagonals but do not use them seem less prone to control mishap when using 8ways.)

2.)   Games where the internal hardware cannot recognize diagonals, but the game shipped with 8way joystick.
Rampage is currently set to 8way for player1 and 2, but 4way for player3 (I think someone must've been testing the inputs at one point). The hardware cannot detect diagonals which can be verified in the test menu. Controls.dat lists the game as 8way and and other online resources lists it as a Monroe 4/8-Way Joystick.

Overall, the issue seems to be what type of joystick was actually used for a particular game, be it 8ways with small diagonals, 4ways with big diagonals or whatever.

paigeoliver

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 10994
  • Last login:July 06, 2024, 08:43:49 pm
  • Awesome face!
There is another problem as well. Some games allow you to choose between 4-way and 8-way joysticks in the setup menu. One game that does this for sure is Magical Tetris (not in Mame yet, at least not last I checked), but if that game has that option I would be willing to wager that other games have that option as well.
Acceptance of Zen philosophy is marred slightly by the nagging thought that if all things are interconnected, then all things must be in some way involved with Pauly Shore.