compsyguy / TekkenBot

AI and tools for playing and understanding Tekken 7
MIT License
15 stars 3 forks source link

Recording and verifying Character Movelists #2

Open compsyguy opened 5 years ago

compsyguy commented 5 years ago

Not Done

Anna Williams Armor King Asuka Kazama Bob Richards Claudio Serafino Craig Marduk Devil Jin Eddy Gordo Eliza Feng Wei Geese Howard Gigas Heihachi Mishima Hwoarang Jack-7 Jin Kazama Josie Rizal Julia Chang Katarina Alves Kazumi Mishima Kazuya Mishima King Kuma Lars Alexandersson Lee Chaolan Lei Wulong Leo Kliesen Lili De Rochefort Ling Xiaoyu Lucky Chloe Marshall Law Master Raven Miguel Caballero Rojo Negan Nina Williams Noctis Lucis Caelum Panda Paul Phoenix Shaheen Steve Fox Yoshimitsu

Working

Bryan Fury (@Sam-Si 12/6/2018)

Done

Akuma Alisa Dragunov

I'm currently generating the XML files from rbnorway, but haven't created them all since rbnorway is a bit out of date. If you want to work on one, let me know and I'll post the XML file here.

Video tutorials on how to record and verify the moves can be found here: Recording (apologies for the echo, didn't realize I had two mics on) https://www.youtube.com/watch?v=reJJ7CWkzvA

Verifying and some correction https://www.youtube.com/watch?v=qrX30-3yzw8

If you don't want to correct the moves that don't work, just keep track of them and I'll look at them.

Sam-Si commented 5 years ago

I will try to help you :)

compsyguy commented 5 years ago

@Sam-Si Thank you! Take a look at the videos, and let me know if you have any questions... and then what character you want to work on

Sam-Si commented 5 years ago

@compsyguy I would like to work on bryan fury

compsyguy commented 5 years ago

@Sam-Si Here's the file. Let me know if you have any questions on the video tutorials. Bryan.zip

Thank you!

Sam-Si commented 5 years ago

@compsyguy I tried recording for Bryan but it didn't work for me.

In the beginning, I ran GUI_TekkenAcademy.py then chose "record" option. It gave me an error the XML is missing so I figured it out where to place the XML.

I chose the keyboard as my controller and the went through all move-list. After printing recording, I got another error that "file doesn't exist" ie, "Recorded_move_commands". Seems like the parent directory was absent therefore I got this error.

I added the below snippet at line 276 in "CommandRecorder.py" to fix this

` import os

file_name = 'xml_maker\\' + character + '_move' + '_commands.txt'

dir_name = os.path.dirname(file_name)
if not os.path.exists(dir_name):
    os.makedirs(dir_name)`

After fixing the above issue when all the moves were recorded and I finally hit print record. There was nothing to be seen in "Recorded_move_commands"

Am I missing something here?

compsyguy commented 5 years ago

@Sam-Si Thank you for figuring that out, I know that this is very rough... so I appreciate your patience.

I'm not sure why it didn't print anything... I'll have to look into that and see.

compsyguy commented 5 years ago

@Sam-Si I found the issue. There was some updates done upstream that I merged into my local copy that caused it to stop working. I have since fixed my code to work with the original branch. If you grab the code again, it should work.

Sam-Si commented 5 years ago

@compsyguy Thanks I will try again

Sam-Si commented 5 years ago

@compsyguy I have created the files correctly(I guess). But the bot doesn't do anything when I select the keyboard as my bot controller and punish test bot under the TekkenBot menu. I am attaching the updated files Movelists.zip

compsyguy commented 5 years ago

@Sam-Si I was able to load your files and they would do the playback. Let's verify some of the settings to make sure: Practice Mode -> CPU Action: Controller P1 (shouldn't matter) P2: 2p keyboard (I hit home on my keyboard for this)

2P keyboard is set to defaults (arrow keys for directions, 7 = 1, 8 = 2, 4 =3, 5 =4)

When I did do the run though, it looked like the timings were off. For example the 1,2 strings all had a delay of 10 frames between them, which meant the 2 didn't come out. I'm not sure why that would be right now, but when I did a quick test recording, the first 1,2 put an 11 frame delay, but the rest only did a 2 or 3 frame delay...

Sam-Si commented 5 years ago

@compsyguy I think I found the error. I was pressing "B" since I am using a controller. I should have used home button thanks for clarifying :)

I will look into that delay and see what could be done about that.

Btw what should I do for the commands that are not present in the movelist but are present in the XML? I don't know how we could record those.

Can you manually hit that move and record it? So that you could fill that in later.

compsyguy commented 5 years ago

@Sam-Si You should be able to manually record it, though I haven't tested that yet.

Sam-Si commented 5 years ago

@compsyguy Whenever I try to record either from movelist or manually. The recorded moves never work when I replay them. I need to manually go to the XML file and change the frames in the string.

So, there is a lot of trial and error. I am not sure what might be causing this to happen

compsyguy commented 5 years ago

@Sam-Si hmm... that's not good... that shouldn't be happening. The whole point of the recorder was to get rid of much of that trial and error.

I did notice when I tried recording Bryan's moves to test your previous issue, I was seeing something similar. I wonder if there's a special case for Bryan.

Can you try doing a few moves of the ones already done and see if you see the same issue there?

Sam-Si commented 5 years ago

@compsyguy Yes I am facing similar issues again

compsyguy commented 5 years ago

@Sam-Si thank you for taking the time to verify again. The holidays were really busy for me and I hadn't had a chance to look at it much. I've reverted the TekkenGameState.py to what I had before I merged the main branch, can you test again to see if you're still having the issue?

I did a few moves that seemed to work out well on my computer, and I hope they'll work out well on yours too.

Sam-Si commented 5 years ago

@compsyguy I will try them out whenever I get the time to do so.

compsyguy commented 5 years ago

@Sam-Si thank you! I'll try and make some progress on it too now that I have a bit more time