Food Fight - joystick troubles, solved
-
@Riverstorm You can try it out no bother when its done not a problem. All i want it something i can play in and just use without too much effort for myself. Only games i really need fixed for teh panel is the sf2 variants and toobin as well as mk. Rotary games like midres and ikari warriors work well if you map z/x dial contrls to l/r on the joypad.
-
@grant2258 - Toobin' is a classic but the default controls on a 6 button layout are pretty wonky for sure. It's pretty straight forward left/right forward, left/right back and throw a can! :) I mapped the far left and right for the movements and both center buttons for throwing cans depending if you prefer the upper or lower row for throwing.
-
@Riverstorm
Toobin would be fun to play mapped to the quadrants of the joystick. And then just one fire button. Might simplify the layout. -
the original game never had a joystick though 5 buttons if i remember right
-
@mahoneyt944 - Yeah as @grant2258 pointed out and you probably know it is a 5 button game. I do get a bit slap happy on the buttons on an arcade panel. With a joystick I use the 4 thumb buttons and the triggers to throw cans.
The idea of making the player move with joystick quadrants would prove to be interesting though! :)
-
@Riverstorm @grant2258 I know that toobin is a 5 button game but I think joystick control would be easier since it's a predefined layout.
I'm sure it could be done. Digital would need grants centering fix or else use analog. Then just check if you're in a quadrant. If so, that button is applied once.
It could be a toggled option in the dip menu. "Override to use joystick"- on/ off. "Off" would use your mapped buttons as it does normally and "on" would activate the joystick override feature.
I would apply them in a scheme like this.
static int joystick_override ( int temp ) { UINT8 joyx = readinputport(?); // Find joy p1 UINT8 joyy = readinputport(?); UINT8 joyx2 = readinputport(?); // Find joy p2 UINT8 joyy2 = readinputport(?); // throw over movement if (temp == 0x0100 || temp == 0x0200) return temp; // player 1 else if (joyx < 0x7f && joyy < 0x7f) return 0x0010; else if (joyx > 0x7f && joyy < 0x7f) return 0x0020; else if (joyx > 0x7f && joyy > 0x7f) return 0x0040; else if (joyx < 0x7f && joyy > 0x7f) return 0x0080; // player 2 else if (joyx2 < 0x7f && joyy2 < 0x7f) return 0x0001; else if (joyx2 > 0x7f && joyy2 < 0x7f) return 0x0002; else if (joyx2 > 0x7f && joyy2 > 0x7f) return 0x0004; else if (joyx2 < 0x7f && joyy2 > 0x7f) return 0x0008; // all other values pass through else return temp; }
Just need to add new analog ports to read the joystick. If you're joystick is in the quadrant, it presses the button digitally for you.
Then hook this function in the original return
// hook input value - dip option turned on if (readinputport(?) == 0x01) return joystick_override(original_input); else return original_input;
-
@mahoneyt944 - Wow, you put some thought into it for sure and that's an incredibly generous gesture but I'm ok with the more "traditional" controls. That being said if it ever does end up in m3plus I wouldn't hesitate to give it a go and see how it plays! ;)
-
@Riverstorm yeah it's by no means necessary. I feel that "emulation" is more than just the circuits of the game and the controls it had. It's replicating the "experience" you got from playing the game in the first place. At the end of the day I just want to play games and enjoy them.
For example Food fights controls were accurately emulated in mame but the experience sucked. This was due to the special joystick that made the game play right, which wasn't something that was missed in programming the driver. Live center is an attempt to emulate the experience of using that special joystick and having that precise control back but with any ordinary controller. This makes playing the game fun again.
-
Live Center Rev 5 officially merged into mame2003-plus, update from source. Welcoming testers to report here.
-
Setup instructions.
How to use
- update mame2003-plus from source to get the new update
- verify "Center axis for digital controls" in the retroarch core options is enabled. This is a new default setting
- delete any foodf, foodf2, or foodfc nvram files, if you previously loaded this game in the core
- Start rom in mame2003-plus
- once loaded, open mame menu, dip switches, live center -> on
- coin up and test the game
- add debounce delay as needed for your controller type.
Note
The Live Center hack must be set to "off" if you recalibrate the joystick in the service menu. More simply you can delete your nvram file and a fresh calibration will be included in the new nvram file that's automatically created at game launch.Debounce Delay Tips
For digital joysticks I typically test to make sure I can stop on the diagonals without any trouble first. So if I'm running up and left then let go I stop facing up and left. Increase the delay if it's not stopping on the diagonal properly. Next, I test quick directional changes left to right. So I run left and quickly bump right then let go. It should recognize that I pressed right last and stop facing right. If the delay is set too high the player wont recognize that right was pressed last and will stop facing left.On a analog joystick I have a dead zone of 15 set in the core options but this can be adjusted to preference as well. Delay can be set at 0 for analog sticks but I find it sets stops too fast for some of my controllers so a little delay here helps too. It's all about what feels good to the user.
The reason we have a debounce delay setting is because the hack is checking to see when the joystick returns to it's center value and is constantly updating it's stopping positions while not at center. On a analog joystick there isn't really an issue because your getting true values when not at center (your X and Y values move together). For a digital joystick, X and Y are separate on / off contact switches and there is no true center value which is why we artificially give it a center value when none of the switches are being pressed. This creates an issue where if I'm going up and left then let go, it's easy to release the up or left button slightly before the other and inadvertently stop facing up or left instead of diagonal. So the delay slows how quickly the stopping position samples are taken to allow some human error when releasing the joystick.
-
@mahoneyt944 fwiw, fbneo doesn't seem to require all those additional steps
-
@barbudreadmon in fbneo , and all versions of mame besides mame2003-plus, your player will face right when you let go of the joystick. This hack fixes this issue by allowing you to stop facing the direction last applied. This is a new control hack described in post #97. And post #119 describes how to setup the hack.
-
@mahoneyt944 ok, it seems i didn't understand the issue, i'll see if a fix can be implemented for fbneo
-
@barbudreadmon this hack could be ported I'm sure, but would require lots of conversions. Here's the details.
For digital controls to work, a default value has to be applied when no direction is being pressed. This emulates a analog sticks center position value. Here's the fix and patch to this fix here
#786 - digital centering correction patch
#815 - digital centering bug patchGood luck.
-
New bootstrap patch to include the joystick calibration. Eliminating the setup hassles. Once it's merged I'll update the setup instructions in post #119.
-
New bootstrap officially merged, updated instructions in post #119.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.