MAMEToolkit icon indicating copy to clipboard operation
MAMEToolkit copied to clipboard

MAMEToolkit only supports RGB32 and ARGB32 frame bit format games - Tekken 2 Environment

Open RielFox opened this issue 5 years ago • 2 comments

Hey there, I'm continuing development on a Tekken 2 environment to base my agents on. I have reached a point where, upon creating the environment and MAME Toolkit attempts to return the first frames, where it will crash and raise EnvironmentError("MAMEToolkit only supports RGB32 and ARGB32 frame bit format games"). I'm not sure what frame bit format Tekken 2 uses. Is this per game? Would there be a way to reformat the image so that MAME Toolkit would accept it? Also, would there be an easy way to see what frame bit format is each game and what games are compatible?

Thanks!

RielFox avatar Apr 15 '19 10:04 RielFox

I was wondering when this would become an issue. Every game has their own bitmap format. Currently the underlying mame recompilation only supports RGB32 and ARGB32 formats. I would have to edit some of the mame code to get it working with other games. I'll have a look some time. There is a command to check you game's bitmap format. I'll have to have a look over the code to find it.

M-J-Murray avatar Apr 16 '19 18:04 M-J-Murray

Hey Michael, Thanks for your reply. I had a look at the python code that causes the exception in Emulator.py and the associated video.cpp file in your modified MAME implementation to see if I could fork and modify it in some way, but it seems to be beyond my abilities as of now. RGB32 (8 bits for each color for each pixel) is the standard format for image data as far as I understand, and I thought all games would have returned the same image data format. I'm doing this project as my dissertation for university as well, my aim is to start with Tekken 2 agents and then expand their capabilities to other Tekken games emulatable by MAME , either by training a network on more than one game or using knowledge distillation between neural networks of different agents and recording their performance. Right now, as far as I am aware, your tool is the only tool that makes it easy to train RL agents on MAME (I tried to make my own LUA environment but there were a lot of constraints that required MAME to be modified and recompiled, as you did). I was under the impression that the toolkit would work with any MAME game. I know you are doing this in your free time and it would probably take a long time for an update to support more games. Perhaps I should pivot and look for other games? It would be easy to know the command that would tell you but I can try creating an environment for a game until it either stops at the exception or passes it successfully.

Edit: I tried >print(s:bitmap_format()) on MAME's command line but I got: error: [string "..."]:2: attempt to index a nil value (global 's')

Thanks!

RielFox avatar Apr 17 '19 06:04 RielFox