Issue asserting Cartridge title SML
I am having some difficulty running the SML land Rom in pyboy. I am under the impression that pyboy will use the cartridge title (from the header) to determine which game wrapper to use, and this is why the sample code includes the assert pyboy.cartridge_title == "SUPER MARIOLAN".
Right now my code fails this assertion, and when I made some code to read the header, it says the title should be "SUPER MARIOLAND"
with the "D" at the end. Well, modifying the assert statement to reflect this additional D did not help.
I can run the code without the assert statement but then I get issues, like "AttributeError: '_cython_3_0_8.cython_function_or_method' object has no attribute" 'game_area_mapping' which I assume is because the proper wrapper is not being used.
I did just check the pyboy version and it is Version: 1.6.14, so perhaps I need to update. I am running the code in the puffertank container in WSL, which VS Code is connected to. It looks like that was the pyboy version that was required by pokegym.
20 Replies
Modifying the code won't be an effective way to debug unless you recompile PyBoy from source after doing so, just FYI. I can't help more right now but maybe someone around here has a checksum of the rom--my first guess is that you have a different or modified rom file of some kind.
Don't know about puffertank etc. You should probably ask the author (@jsuarez?) about which versions of PyBoy are supported.
You're right that SML does in fact have the bytes for "LAND" with a 'D'. Can't remember right now if there are any reason to truncate it
But SML has always been part of the testing, so it's weird if it doesn't work
There were multiple Super Mario Land games for the gameboy, maybe it's a different one?
I just downloaded 3 additional roms from different sites and tried them all to the same result. I need run a checksum comparison which I have not yet.
Please don't tell us where you got the ROM from. We cannot condone piracy
Here is an explanation why the name is truncated https://gbdev.io/pandocs/The_Cartridge_Header.html#0134-0143--title
Pan Docs
The Cartridge Header
The single, most comprehensive technical reference to Game Boy available to the public.
The reason is "that's just kinda how it is"
ok my bad
Yep. I forgot about this, but the correct sha256 sum can be found in the test code:
Thank you for the checksum. One does match that checksum, but strangly it still run into the assertion issue.
curious. any chance it's loading from a save state?
I restarted vs studio code, and am reconnecting to the docker container for puffertank. I was thinking maybe it was trying to reference one of the previous files.
Also, could you paste the first part of your code? Just so we can see if anything is off
(pro tip: put ```py before your code for syntax highlighting)
this code based on the SML example also got the AssertionError
Ok, so your problem is that you're running an old version (v1.6) of PyBoy and mixing with v2.0 API
So I decided to just try Kirby instead because I know I had used the environment on my laptop before. I copied the code to my pc and it ran into the same assertion issue with kirby. I went ahead and updated pyboy in the container and that fixed the assertion issue. so I'm thinking it is something to do with the Version: 1.6.14 Pyboy
See this one for an example that matches your version: https://github.com/Baekalfen/PyBoy/blob/v1.6.14/extras/examples/gamewrapper_mario.py
So at line
assert pyboy.cartridge_title == "SUPER MARIOLAN"
you have a problem because in v1.6 cartridge_title
is a function, so you should do cartridge_title() == ...
.
In v2.0 it's a variableok I see
Thank you both for your help. I got mario jumping around again. Now to improve these rewards, and get multiple envs going.