m2:ros


#1

That wasn’t a joke.

I’ve hacked/disassembled/poked at Metroid 2 intermittently over the past couple of years, but it wasn’t until literally last week that I got around to coding anything that could edit it. A while back some of us at metroidconstruction tried getting together to make an editor, but, um, nothing really came of it.

I wrote some stuff in Python to read the various kinds of level data, then I tried displaying it.

Here’s where I’m at so far: https://imgur.com/a/gmpQ5

My code takes around ~15 seconds to render a full map. I know I’m using an interpreted language, but I suspect something is a tad unoptimized (probably either file-io related or the fact that I literally have functions returning bitmaps).

Q: What’s a good GUI library for Python?


#2

Oh wow. This is ace.

I was using PyQt for a thing. It was fine! Kinda depends on what you want to do, and where you wanna do it.


#3

Comedy “wrap it in an Electron web app” option


#4

yeah PyQt is acceptable


#5

is a good question, and a hard one at that.
Phyton 2.x, I assume?


I curse the day i agreed to take python3 for the project at work that i am involved in atm, because IF you get a recommendation, ''of course it is for 2.x, you silly! why'd you use 3 you fool?''

Because We Can™

Anyway, in the request lib for doing lowlevel network & IP messaging stuff, an interesting issue has reared its head this week:
Namely if you have the wireless connection to wayside going down and up again, new resolve.conf information never seems to get through to pythons innards, the lib and/or the application, and that’s a case we have to considerrrrrrrrrrrrrrrrrrr without kicking the application or god beware, rebooting the host, hrmmmmmmmmmmmm~~~~~~~~


#6

I think most people finally up and switched to 3 in 2015-2016. I still fuck up the print statement and iteritems occasionally but otherwise I’ve made my peace (though 3’s urllib is still terrible at unicode, you should be using requests instead)


#7

Admittedly most of my Python work lately has been limited-use internal tools but I haven’t run into very much that’s actually stuck in 2.X anymore. Maybe I’m just not looking in the “right” categories.


#8

Thanks for the suggestion. I’ve decided to go with it.

Python 3, actually. I was aware that it was incompatible with 2.x, but wasn’t really aware of the pros/cons. I’m relatively new to Python, and not really sure why I decided to do this project in that language, but here we are.


In the process of porting/refactoring my rendering code from using Pillow to PyQt, I produced this lovely image.

pyqt metatileset

The weird colors are because I had been ignoring tiles with indexes >= 128, and in the process of moving the code over I removed the code that initialized the bitmaps with a solid fill-color, so I got some surprisingly nice looking uninitialized data.

That was enough to convince me to add support for the upper half of the tileset (it’s loaded separately), which also happens to be necessary for rendering the surface area (the ship takes a boatload of tiles).

So yeah, here’s a map with the surface area. Marvel at the differences between the beginning and ending landing sites. (Also, the new code renders it about 3 times faster.)

Here's the state of the "gui":

rose

Currently the only interactive portion is the file dialog, but hey it’s a start. The tutorials and documentation for PyQt have been very useful.

Another feature I added, as seen in the gui, is a visualization of the scroll data for each bank.

Behold

scroll9 scroll10 scroll11

scroll12 scroll13 scroll14

scroll15

Again, there are vestiges of unused rooms in some of these that I plan on documenting on TCRF eventually.