Food Fight - joystick troubles, solved
-
git clone https://github.com/libretro/mame2003-plus-libretro.git cd mame2003-plus-libretro/ wget https://github.com/grant2258/Blaster-Barcade/pull/2.patch git am 2.patch make -j8 platform=rpi3
@mahoneyt944 I find it easier just to provide a fix for you rather than getting into details. press each direction and it will calibrate (i never see this issues with using an analog stick yet).
I found if you go to the test menu then go to the joystick calibration this problem doesn't occur after a reset or restart not like its a big deal to circle the joystick. There is a new core option at the bottom to turn this off and on. Test with afterburner youll see it autocenters straight away.
just in case your interested in what was changed the diff is here https://github.com/grant2258/Blaster-Barcade/pull/2/commits/b0c0c219ae59379c98bf6fc86d77d2f105069aeb?diff=unified&w=1
-
Thank you, so if I update mame 2003 plus again I'll lose the mcr high score fix that was just updated though right?
-
yea you would but you can just add that patch as well
wget https://github.com/libretro/mame2003-plus-libretro/pull/780.patch git am 780.patch
do that before the last make line
-
@grant2258 Thank you.
UPDATE
Just tested food fight and while he's no longer running around by himself he always stops facing right instead of the direction last applied. This makes it hard to throw at enemies up, down, left and diagonal facing. Maybe this section need updated more so that every time you press a direction it updates the stopping direction/ variable to be that direction. That way if I'm moving down, he stops facing down. etc.Id guess the center position value would just need updated every time you press up, down, left, or right plus the diagonals so it can stop in that direction?
-
Even fbneo and mame stops in one direction the game would need looked to to observe it behavior that is as good as your going to get until the driver get an update. I cant say ive ever really played this game in the arcade myself only on emulation.
It will help any other games that dont have a auto center as well and you can turn it off and on something thats really needed at times with arcade controls.
-
Here's a video showing authentic behavior. Start at 5:30. You can see how he stops in different positions.
-
well considering it has a gimbal joystick it will allow for high accuracy nudges by moving the joystick slightly at a guess. The thing is the cab self calibrates as well you would really know what he code is doing and looking for in the game itself. You would never pull this kind of control off with a digital stick either to be honest maybe mess about with the sensitivity settings with an analog stick see if you have any luck
-
Basically you'd be hardcoding potentiometer values to each button press and each button press would set a stop variable to be used when you have no directions pressed.
The direction move part I don't think is as critical because we can move in those directions already. Each direction just needs to set a stop value that corresponds to facing that direction. It's probably just the lowest value that corresponds with that direction. So if 0.000 through 1.000 is move right, the stop value for that direction would be 0 or 0.001 (move in that direction so slowly you don't move. Or noticably anyhow)
This also probably explains why he's always facing "right" right now, because the absence of a value ( 0 or null) is the right facing direction.
This would allow "nudge" to work.
-
Hard coding wont make a difference it doesnt even work right in current mame or fbneo with an analog joystick. The game mechanics need looked at to see what going on with it for sure. The analog values are reading properly anything else apart from checking what the code is doing would be guessing to be honest. And if you start messing with random values it will just re-calibrate during play it calibrates as your playing as well. Chance your key sensitivity to 1 and youll see just the eyes move if you keep the button in longer the character will eventually move that how digital analog works you decide how much time it takes to increase. If i was as simple as hard coded values someone would have fixed it by now. Truth is you would benefit from a real cab to see how it plays I get a feeling it just the high precision throw the joystick gives to let you pull this off again just a guess. Its actually a really small driver if your interested in looking into it
-
I've been testing this a lot.
With centering off, the movements stay active after you release. So if you hold left then hold up. He continues to move left as he goes up.
With centering on, the movements only go where you want them to. So if you hold left then hold up he'll stop going left then go up. This is more like it should be.
Unfortunately, setting "current" to the default value will stop his active movements but change his facing direction to be fixed which isn't right.
Maybe we need to use centering to decelerate the "current" value instead of setting it to default?
Displaying the "current" value on screen could be helpful for testing here. The ability to set/adjust the "current" value when centering could be helpful to test different values.
-
Ill tell you what use current mame for your experimenting it has all the options you need to test your theory. If you manage to get something reproducible let me know the steps to do it.
the default center is set in the driver to 0x7f all analog controls need to know where the center is so it sets it to that vale when your analog stick is at center. If you want the driver to center the joystick you would add IPF_CENTER flag to the driver normally.
There really is no need to do this with an analog joystick at all thats why this works without the patch in mame it just reads the position. This patch doesnt effect the real analog controls at all.
Now there something you need to get clear this happens in analog and digital to analog when centering . This patch doesnt effect a real analog joystick only digital it working the same way the analog is at the moment its facing a side when centered just like mame current is.
-
Tested more games with centering confirmed to work now:
Roadrunner
PaperboySo for food fight it seems:
Vertical range is from 0x0F through 0xEF
Up is high limit at 0xEF
Down is low limit at 0x0FHorizontal range is 0x0F through 0xEF
Left is high limit at 0xEF
Right is low limit at 0x0FSo hypothetically 0x7F should be center but obviously were getting right. For this I have two ideas:
- Rounding issue.
- Perhaps the value needs set for each direction, 1 place in each direction.
Idea 1 - easiest to test, try:
Current = 0x80Idea 2 - you'd have to set horz and vertical independently based on the last direction pressed.
Could you test idea 1 out? If it's just a rounding issue we would just need an option to set the default value to be compatible, on top of your current centering fix.
-
the default value is set here feel free to change it (0x7f) https://github.com/libretro/mame2003-plus-libretro/blob/0134c428b75882aa474f78dbbf2c6ecde49b97b7/src/drivers/foodf.c#L251-L260
changing this value just changes the way your character will face.
-
Changing which value do you mean?
I'm not really familiar with changing things in mame/ compiling either. But it seems like the solution is here between the center values set in foodf.c and the center value in your centering fix.
-
Maybe not relevant but I noticed in the service menu of roadrunn the center of the stick is 80 too
-
setting it to 0x80 doesnt fix the issue for foodf
-
When you say "it", which value did you change to 80? The driver or the centering fix? Which way did he face with the change? Left or left up?
-
Im a bit lost now are you using a digital or analog stick for your testing ?
The auto centering fix just sets the center to whats set in the driver the same applies to real analog stick it centers to whats set in the driver. This fix has no effect a real analog stick. The center is set to 7f in the driver
-
Sorry, I'm messing with both the driver and your fix using a digital controller.
I was seeing if manipulating the center changes anything. One things for sure this could be fixed by changing the fixed center position based on the last direction pressed. That way your centering value always tips in favor of the direction last touched.
-
thats probably ok for digital wont help analog controls it probably wants a certain range. I have messed about with it. I really think this driver would work properly and a analog controller with a bigger throw for more precise movement. Ie slight circles would let you shoot round without moving.
I dont have any type of gimbal analog devices to test it though. A u360 would be handy to test this stuff on but i dont have one.
I better explain this a little better imagine you added a 30cm shaft to a xbox360 controller you could get more fine movements on it and easily move the just the eyes doing a small circle
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.