RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Food Fight - joystick troubles, solved

    Scheduled Pinned Locked Moved Help and Support
    ad stick
    125 Posts 5 Posters 10.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mahoneyt944
      last edited by mahoneyt944

      Player always faces right when no direction is pressed / digital controls continue moving "can't stop".

      UPDATE
      A proper fix was posted in post #97 for food fight with instructions in post #119 on how to use it. Fixed in mame2003-plus, update from source and follow the instructions.

      1 Reply Last reply Reply Quote 1
      • M
        mahoneyt944
        last edited by mahoneyt944

        @grant2258

        Is there a way to convert my digital joystick to act as a analog input for food fight?

        It seems like it just needs an auto stop signal that's applied unless a direction is being used. Perhaps a cheat could be applied?

        1 Reply Last reply Reply Quote 0
        • G
          grant2258 Banned
          last edited by grant2258

          joust is not an analog game I dont know if this is how the game actually is its nothing to do with analog. For food fight the code would most likely need updated to be more digital friendly it improves a bit when you add an auto center not great though some analog games wont translate well without extra work put in to work with digital controls.

          For example in joust press the left button once, then press it again youll see the behavior. It like a 3 click system for the speed you go its nothing to do with analog

          1 Reply Last reply Reply Quote 0
          • M
            mahoneyt944
            last edited by

            How do I use auto center? For Food fight mame2003 or 2003 plus?

            C G 2 Replies Last reply Reply Quote 0
            • C
              Cornervizion @mahoneyt944
              last edited by Cornervizion

              @mahoneyt944 Hi,

              Food fight has a control issue which was discovered over 10 years ago and has not been corrected by the MAME team to the best of my knowledge.

              https://mametesters.org/view.php?id=2681

              1 Reply Last reply Reply Quote 0
              • G
                grant2258 Banned @mahoneyt944
                last edited by grant2258

                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

                M 1 Reply Last reply Reply Quote 0
                • M
                  mahoneyt944 @grant2258
                  last edited by mahoneyt944

                  @grant2258

                  Thank you, so if I update mame 2003 plus again I'll lose the mcr high score fix that was just updated though right?

                  1 Reply Last reply Reply Quote 0
                  • G
                    grant2258 Banned
                    last edited by

                    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

                    1 Reply Last reply Reply Quote 0
                    • M
                      mahoneyt944
                      last edited by mahoneyt944

                      @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?

                      1 Reply Last reply Reply Quote 0
                      • G
                        grant2258 Banned
                        last edited by

                        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.

                        M 1 Reply Last reply Reply Quote 0
                        • M
                          mahoneyt944 @grant2258
                          last edited by

                          @grant2258

                          Here's a video showing authentic behavior. Start at 5:30. You can see how he stops in different positions.

                          1 Reply Last reply Reply Quote 0
                          • G
                            grant2258 Banned
                            last edited by

                            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

                            M 1 Reply Last reply Reply Quote 0
                            • M
                              mahoneyt944 @grant2258
                              last edited by mahoneyt944

                              @grant2258

                              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.

                              1 Reply Last reply Reply Quote 0
                              • G
                                grant2258 Banned
                                last edited by grant2258

                                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

                                M 1 Reply Last reply Reply Quote 0
                                • M
                                  mahoneyt944 @grant2258
                                  last edited by mahoneyt944

                                  @grant2258

                                  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.

                                  1 Reply Last reply Reply Quote 0
                                  • G
                                    grant2258 Banned
                                    last edited by

                                    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.

                                    M 1 Reply Last reply Reply Quote 0
                                    • M
                                      mahoneyt944 @grant2258
                                      last edited by mahoneyt944

                                      @grant2258

                                      Tested more games with centering confirmed to work now:

                                      Roadrunner
                                      Paperboy

                                      So for food fight it seems:

                                      Vertical range is from 0x0F through 0xEF
                                      Up is high limit at 0xEF
                                      Down is low limit at 0x0F

                                      Horizontal range is 0x0F through 0xEF
                                      Left is high limit at 0xEF
                                      Right is low limit at 0x0F

                                      So hypothetically 0x7F should be center but obviously were getting right. For this I have two ideas:

                                      1. Rounding issue.
                                      2. Perhaps the value needs set for each direction, 1 place in each direction.

                                      Idea 1 - easiest to test, try:
                                      Current = 0x80

                                      Idea 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.

                                      1 Reply Last reply Reply Quote 0
                                      • G
                                        grant2258 Banned
                                        last edited by

                                        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.

                                        M 1 Reply Last reply Reply Quote 0
                                        • M
                                          mahoneyt944 @grant2258
                                          last edited by mahoneyt944

                                          @grant2258

                                          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.

                                          1 Reply Last reply Reply Quote 0
                                          • M
                                            mahoneyt944
                                            last edited by mahoneyt944

                                            Maybe not relevant but I noticed in the service menu of roadrunn the center of the stick is 80 too

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            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.