TASEmulators / mame-rr

MAME Rerecording is the rerecording version of MAME with many customized features designed to aid in recording movie input files. There's only a pre-alpha version at this time
http://tasvideos.org/EmulatorResources/Mamerr.html
21 stars 7 forks source link

Some buttons are ignored by the joypad on lua scripts #14

Open gsjunior86 opened 3 years ago

gsjunior86 commented 3 years ago

Hello,

i am working on a bot that can play cps1/cps2 games. The backend is in java, exchanging data through a tcp socket.

However, when the neural network predicts "Button 4", "Button 5" or "Button 6", they do not work for both players.

I created a small test to check this, on the following script:

 local Buttons = {
    "P1 Left",
    "P1 Right",
    "P1 Up",
    "P1 Down",
    "P1 Button 1",
    "P1 Button 2",
    "P1 Button 3",
    "P1 Button 4",
    "P1 Button 5",
    "P1 Button 6"
}

emu.registerstart(function()
    local obj = savestate.create(1)
    savestate.load(obj)

end)

while true do
   local jp ={}
   for i=1, #Buttons do
      jp[Buttons[i]] = false
   end
   local r = math.random(1,10)
   jp[Buttons[r]] = true
   joypad.set(jp)
   emu.frameadvance()
end

Up, Down, Left, Right, Button 1, 2 and 3 works fine, but the kick buttons (4,5,6) are simply ignored when set to 'true' and nothing happens.

I tested this for XmenVsStreetFighter and SFAZ

vadosnaprimer commented 3 years ago

Hi. This project is dead and I won't be working on it. But if you manage to figure this out and send a pull request, I'll merge it, and try to make a build for you.

gsjunior86 commented 3 years ago

Hi, thanks for the reply.

I'll try to do it. I'm very rusted on Cpp, but will work on it. Thanks.