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: Player 3 and 4 stick mapping wont work  (Read 1753 times)

0 Members and 1 Guest are viewing this topic.

ever1458

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 23
  • Last login:October 12, 2010, 03:29:42 pm
Player 3 and 4 stick mapping wont work
« on: January 24, 2009, 09:36:20 pm »
I am having a problem with MAME that I can't seem to find a solution too. In games like the simpsons or X-men, players 3 and 4 can not move diagonally, only up, down, left and right. I'm using 8 ways sticks so that isn't the problem. When I map the sticks (up=r down=e left=w right=y) so that up/right = ry, the character will only go to the right, when I change "ry" to just "y" the character will move up/right. Its like things are backwards. Anybody know what I am doing wrong? The other thing I hope somebody can explain to me is why player 2 can move in all 8 directions but under general input there are no buttons mapped to the diagonal movements. How do the diagonal movements work even though no buttons are mapped except for the up, down, left, and right movements?

severdhed

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2975
  • Last login:December 14, 2024, 05:01:52 pm
  • RIP Dinosaur Hippo
Re: Player 3 and 4 stick mapping wont work
« Reply #1 on: January 24, 2009, 10:29:37 pm »
did you try not mapping any diagonals for players 3 and 4?  i've never mapped diagonals..and my controls always work. 


the reason that it works is because it is sending the signal for left and up at the same time, so mame already knows to go left-up when that happens...try removing the diagonal mappings and i bet it works
Current Projects:      Zak-Man | TMNT Pedestal | SNES Pi | N64 Odroid
Former Projects:     4 Player Showcase | Donkey Kong | iCade

ever1458

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 23
  • Last login:October 12, 2010, 03:29:42 pm
Re: Player 3 and 4 stick mapping wont work
« Reply #2 on: January 25, 2009, 10:24:06 pm »
As it stands, neither player 3 or 4 diagonals are mapped. The strange thing is that up/down/left/right are mapped to two keys (ie K and L). In the situation I am currently in (two keys mapped to the standard 4 movements) the player can move up/down/left/right, but not diagonally in any direction. When I map the standard 4 to one key instead of the two keys it defaults too, the player will only move diagonally and I can't move exclusively up/down/left/right at all. I feel like something is misconfigured in MAME. I've deleted all of the cfg files in the cfg subdirectory, but nothing changed. Does anyone have any ideas?

surface tension

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 323
  • Last login:July 01, 2018, 08:45:48 am
  • feel the tension...
    • surface tension tables
Re: Player 3 and 4 stick mapping wont work
« Reply #3 on: January 26, 2009, 04:26:52 am »
I don't want to sound like I'm teaching you to suck eggs here...

You say they are 8-way sticks. Are they switchable to 4-way? If so, make sure they are set to 8-way.

Also, what keyboard encoder are you using? I don't know about the keywiz, but with ipacs/minipacs, once you have programmed the keys, you can get visual feedback when you press buttons or move sticks. So, to try and pinpoint where the problem lies before pulling your hair out over MAME, test the sticks out in the design layout if possible.

severdhed

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2975
  • Last login:December 14, 2024, 05:01:52 pm
  • RIP Dinosaur Hippo
Re: Player 3 and 4 stick mapping wont work
« Reply #4 on: January 26, 2009, 10:15:04 am »
thats a good point....try opening notepad and pressign the joystick directions to see if the right characters are coming up.
Current Projects:      Zak-Man | TMNT Pedestal | SNES Pi | N64 Odroid
Former Projects:     4 Player Showcase | Donkey Kong | iCade

ever1458

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 23
  • Last login:October 12, 2010, 03:29:42 pm
Re: Player 3 and 4 stick mapping wont work
« Reply #5 on: January 26, 2009, 04:45:34 pm »
As you can probably tell, I am new to the whole scene so any advice, no matter how novice, is fine with me. I should start by saying that I did not build the control panel, I bought it off the internet. I know very little about what types of sticks it uses or what keyboard encoders it has. It came preprogrammed.  I do know the sticks are 8 way only as I requested that during design and I have a dedicated 4 way because of this. I'm not sure what you mean when you say design layout.

I opened notepad and I am seeing what is mapped in mame. For example, when I press player 3 stick to the right I get "un" and when I press down I get "nv". Now when I press the stick diagonally down and right I will get "v". Do you think this has something to do with a poorly programmed keyboard encoder?

severdhed

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2975
  • Last login:December 14, 2024, 05:01:52 pm
  • RIP Dinosaur Hippo
Re: Player 3 and 4 stick mapping wont work
« Reply #6 on: January 26, 2009, 04:51:51 pm »
sounds to me that the player 3 and 4 joysticks are physically rotated 45 degrees, that is why they are registering two keys when going up and down, and only 1 when moving diagonal....


Current Projects:      Zak-Man | TMNT Pedestal | SNES Pi | N64 Odroid
Former Projects:     4 Player Showcase | Donkey Kong | iCade

ever1458

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 23
  • Last login:October 12, 2010, 03:29:42 pm
Re: Player 3 and 4 stick mapping wont work
« Reply #7 on: January 26, 2009, 05:44:51 pm »
I'd agree with you if they always worked, but the problem is that when I can get them to go left/right/up/down correctly, meaning the character on screen goes the direction I am pushing, the diagonal directions won't work/register, however, there are other times after I configure mame with different keyboard commands (one command "n" instead of two "nv") the left/right/up/down movements make the character on screen move diagonally and still the diagonal movements do nothing. At first I thought the sticks were broken, but they do register when I test them in notepad or assign a specific unique keyboard command to them. So they aren't defective sticks, which leads me to believe that its a MAME config issue. Also, if they were turned at a 45 degree angle then they wouldn't work properly, but I'd still be getting 8 ways of movement X-men, even if it was incorrect movement.

severdhed

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2975
  • Last login:December 14, 2024, 05:01:52 pm
  • RIP Dinosaur Hippo
Re: Player 3 and 4 stick mapping wont work
« Reply #8 on: January 26, 2009, 06:01:44 pm »
they almost have to be rotated though...because when you are in notepad, that has nothing to do with how they are configured in mame..only the encoder programming.  so if you press UP and it registers 2 keys, then you are hitting two switches...similarly, if you press up-right and it only registers 1 key, then it is only hitting 1 switch. 

i am assuming that player 3 is on the clear left, and player 4 is on the clear right...

so for instance, using player 3, assuming a 45 degree rotation, when you press diagonally up-right, you are actually just pressing Up as far as the joystick is concerned.   so, to fix this, go into mame, hit tab, go to input general.  find player 3 up, then hit enter and press the p3 joystick diagonally up-right.  for right press it down-right, for down press it down-left, and for left, press up-left.  for the digaonals, do not map anything.  make sure there is nothing specifically configured under Input THis Game that contradicts your programming you just made.
now you should have full 8way movement on player 3.

repeat this process for player 4, only consider that it is rotated the oposite direction
Current Projects:      Zak-Man | TMNT Pedestal | SNES Pi | N64 Odroid
Former Projects:     4 Player Showcase | Donkey Kong | iCade

Turnarcades

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1973
  • Last login:May 13, 2017, 08:14:29 am
  • Craig @ Turnarcades
    • Turnarcades
Re: Player 3 and 4 stick mapping wont work
« Reply #9 on: January 26, 2009, 09:04:21 pm »
Maybe this panel is wired using a sub-standard encoder or a keyboard hack too? If it is you could also be suffering from key blocking if those key inputs are on the same matrix...

ever1458

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 23
  • Last login:October 12, 2010, 03:29:42 pm
Re: Player 3 and 4 stick mapping wont work
« Reply #10 on: January 26, 2009, 10:49:01 pm »
So I did some more testing and things are getting more confusing. From what I can tell the control panel seems to have already determined what my keys should be. I'm not sure if that makes any sense so let me explain what I did. I did what severdhed said about trying to rotate the controls so that hitting up/right for up and I went around the gauntlet accordingly, but unfortunately that didn't work, so I tried to make it as simple as possible. If I hit up on my joystick mame says it maps to j and k, right maps to k and l, and so forth. When it is setup like this, my up/down/left/right for players 3 and 4 work fine, but I can't move the character diagonally in any way. So after going back into the mapping area of Mame, I mapped single keystrokes so that up=i, left=L, right=j and down=k. However, when I ran the game, my characters moved diagonally only when I pressed up, down, left or right while using the joystick, when I pressed the keys on my keyboard they worked fine. On the joystick I had to push diagonally to get them to go straight in any corresponding direction. It seems like something is mapping the diagonal movements with single keystrokes behind the scenes and the reason I am getting two key strokes when mapping a single x/y axis direction, for example "up", is because to get "up" I need to move up and right for it to work, basically counteracting the diagonal movements. I hope I am explaining myself clearly because I'm getting confused just typing this. In short, it feels like the keyboard encoder or what have you is telling the game that I have to use k for up/right and I have to use L for down/right so that when I want to just go right it has to use two keys to make that happen. Almost like the inverse of how mame should do things (ie using up and right to make up/right)

I bought the panel from Jack at Arcades R Fun. I heard he had a good rep so I went with him. 

severdhed

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2975
  • Last login:December 14, 2024, 05:01:52 pm
  • RIP Dinosaur Hippo
Re: Player 3 and 4 stick mapping wont work
« Reply #11 on: January 26, 2009, 11:04:20 pm »
i'm not sure i follow you entirely here..but once you mapped up, down, left and right to single keys, your character moved diagonally when you pressed up,down, left or right?  and what happened when you pressed the joystick diagonally?  did they move either up,down,left or right? 

in order to completely clear this up..in mame make sure your controls so that each of the four main directions (up,down,left and right) are each mapped to a single key.  then press each of the 8 directions on your joystick and tell us how your character moved for each of those directions..


for instance:

Joystick up = up left
joystick up right = up
joystick right = up right
joystick down right = right
joystick down = down right
joystick down left = down
joystick left = down left
joystick left up = left

etc.... maybe that will help us get to the bottom of things
Current Projects:      Zak-Man | TMNT Pedestal | SNES Pi | N64 Odroid
Former Projects:     4 Player Showcase | Donkey Kong | iCade

surface tension

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 323
  • Last login:July 01, 2018, 08:45:48 am
  • feel the tension...
    • surface tension tables
Re: Player 3 and 4 stick mapping wont work
« Reply #12 on: January 27, 2009, 04:22:01 am »
I just had a look on arcades r fun, and after reading the above posts have the suspicion that you are trying to use the P3 and P4joysticks in the same orientation as P1 and P2?

The P3 and P4 controls are angled in by 45 degrees to face the screen, so it sounds like you are pushing the sticks what you see as forward, but it's a diagonal.

I'm probably off the mark here, so no offence intended  :)

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: Player 3 and 4 stick mapping wont work
« Reply #13 on: January 27, 2009, 02:26:51 pm »
I'm not sure if the OP is understanding the help being given.  I'll repeat what severdhed has said, but in a little different (technical) view, and a partial solution that will mostly work in mame/mess but no other app (AFAIK).

There are four different 'UP's: your up (user's up), the joystick's up, mame's up, and the game's up.  Usually the four match, and all is well, so usually they can be veiwed as the same.  There are exceptions, though.  One is Qbert cab, where the joystick was rotated 45 degrees closckwise.  What is up-right diagonal to you, is just plain up to the joystick, mame, and the game.  Another is the OPs CP: what you think is up, the joystick disagrees.  When you map your up into mame, mame sees the joystick's 'up-left' diagonal should be 'up', and sends the game up if and only if the joystick's up-left diagonal is sent.

Normally, a diagonal is when two ordinal directions are pressed at the same time.  Again, there are the four different up-left diagonals: user, joystick, mame, and game.  (From now on, uUp = user's Up, jUp = joystick's Up, mUp = mame's Up, & gUp = game's Up, u(UpLeft) = user Up-Left diagonal, etc)  When the joystick's diags are mapped to mame's ordinals, mame's diagonals aren't possible.  As mapped, mUp = j(UpLeft) and mRight = j(UpRight).  So m(UpRight) = mUp + mRight = j(UpLeft) + j(UpRight), so would need jUp, jLeft, & jRight to all be pressed at the same time, and jLeft cannot be pressed at the same time as jRight.

This can be useful in rare conditions.  Again, let's look at Qbert.  If you only have a normal 8-way joystick, you can map j(UpRight) to m(Up), j(DownRight) to m(Right), ect, and it will work quite well.

However, in the OPs case, more fancy mapping needs to be done to get game diagonals.  Mame can map key combos, multiple keys, and nots.  Combo: j(UpRight), aka jUp + jRight pressed at same time, mapped to mUp means mame sees up only if both are pressed at same time.  Multiple: jUp or mouseUp mapped to mUp means mame seees up if mouse goes up or joystick up (either one, or both).  Not: jUp Not jRight Not jLeft mapped to mUp = no diags on a normal joystick. Depending if uUp is j(UpLeft) or j(UpRight):

if uUp = j(UpLeft)
mUp    = (jUp not jRight) or (jLeft not jDown)
mLeft  = (jDown not jRight) or (jLeft not jUp)
mDown  = (jDown not jLeft) or (jRight not jUp)
mRight = (jUp not jLeft) or (jRight not jDown)

if uUp = j(UpRight)
mUp    = (jUp not jLeft) or (jRight not jDown) ...etc

It's the same in actions in mapping in mame which ever way the stick is rotated: tab, Input (general), player 3/4, go to Up, enter, press u(UpLeft) then quickly u(downLeft) twice, wait.  (pressing the same key twice makes it a not see mame FAQ for more info.)  Mame now should say "w not a" or something like that.  Press enter again, press u(UpRight) then quickly u(DownRight) twice.  You should have something like "w not a or d not s" (assuming wasd as keyboard directions).  If you don't get the nots, or accidentally get a j(diagonal), move off of Up, go back to up and redo.  Repeat for the other directions, do near diagonal then twice press the far diagonal on the same side, other near and twice press the remaining diag.

This should work okay, but some people find it doesn't work as well as it should.


ever1458, could you list the exact keys joysticks 3/4 and the directions they correspond to?
(Not sure, but it's possible that the joystick is not rotated and the OP expects it to be.)
Robin
Knowledge is Power

ever1458

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 23
  • Last login:October 12, 2010, 03:29:42 pm
Re: Player 3 and 4 stick mapping wont work
« Reply #14 on: January 27, 2009, 04:09:24 pm »
So I was about write up every single keystroke and how it was mapped and then it dawned on me that I might be a huge moron. Then I confirmed that I am a huge moron, haha. The problem isn't that the sticks were at a 45 degree angel, the problem was that I was not at a 45 degree angle in reference to the screen. I kept thinking about what severdhed said about hitting two switches instead of one and then st posted about perspective and I couldn't believe it was that simple. The entire time I stood in front of the screen, instead of standing off to the side so my perspective was askew the whole time. Wow, and to think how many hours I spent trying to resolve something so silly. Anyway, I wanted to thank all of you guys, especially severdhed and st for sticking with me until I figured it out. Thanks a lot, all of you guys are great!!!!

severdhed

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2975
  • Last login:December 14, 2024, 05:01:52 pm
  • RIP Dinosaur Hippo
Re: Player 3 and 4 stick mapping wont work
« Reply #15 on: January 27, 2009, 04:32:03 pm »
i'm glad you got it figured out...i knew that eventually you would get there..i just didnt know how to explain it properly i guess.

well, enjoy your panel
Current Projects:      Zak-Man | TMNT Pedestal | SNES Pi | N64 Odroid
Former Projects:     4 Player Showcase | Donkey Kong | iCade