rafaelcp / smbdataset

Super Mario Bros. (NES) gameplay dataset for machine learning.
Creative Commons Attribution 4.0 International
8 stars 0 forks source link

MSB to LSB code #1

Closed 00ricardo closed 3 years ago

00ricardo commented 3 years ago

Hello sir, I'm trying to extract the information from your datasets but i'm having problems to decoding the action.

Exemple: Rafael_dp2a9j4i_e0_1-1_f219_a20_2019-04-13_20-00-20.win

Action : 20 Looking at the picture i figure out that 20 = right, but how can i decode this to your 8-bit system (from MSB to LSB). I really dont understand this. Maybe Math problems. Can you please help me?

00ricardo commented 3 years ago

print(f"{20 & 0b11111111:08b}")

How can i read this? output: 00110000

Looking at the output it seems to match with :

0 - up 0 - down 1 - left 1 - right 0 - A 0 - B 0 - start 0 - select

rafaelcp commented 3 years ago

Hey! :) Actually, 20dec in binary is 00010100, so: 0 - up 0 - down 0 - left 1 - right 0 - A 1 - B 0 - start 0 - select (running to the right, which is probably the most common action in the dataset btw)

I tested your code and it gives me 00010100, so I'm not sure how you ended with 00110000. In summary, your logic is correct, you just need to get the conversion right.