m2:ros

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?

7 Likes

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.

Comedy “wrap it in an Electron web app” option

1 Like

yeah PyQt is acceptable

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~~~~~~~~

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)

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.

1 Like

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.

4 Likes

5 years? dang

there are several reasons why i got burnt out on this, many of which boil down to “I don’t want to program some absurd spaghetti code to edit variable-length data in place in a binary file when an assembler could do those things for free”

with that in mind, I’ve been working on a disassembly for the past couple of weeks, and it feels like it’s might actually come together

the end goal of this (whether i make the editor or someone else does) is to have a workflow that more closely resembles a homebrew game, with an editor that operates on free-floating files rather than an ossified binary blob

4 Likes

the most mysterious, wistful form of lost content:

image

things that were commented out of the original source code, whose existence is only hinted at by a trail of dangling references

4 Likes

extremely pointless missing content :tm:

gullugg

the enemy only moves clockwise in-game, though apparently there are unused/unreferenced tables that would have made it move anti-clockwise

~scintillating~

9 Likes

I was investigating how doors work, but was slightly confused. They had code that differed depending on if the door was hit from the right or the left, but I didn’t see any code path that would allow them to control which direction they spawned.

After just a little poking at some ram addresses, I discovered the terrifying truth:

image

lmao

turns out that the left and right door caps are a single object, conjoined at all times

compared to what i’m used to with these games, this is a bewildering (brilliant) solution to this problem

5 Likes