
Extracting Super Mario Bros levels with Python - yeahdef
http://matthewearl.github.io/2018/06/28/smb-level-extractor/
======
doomlaser
I made this a few years ago. It's pretty much all of Super Mario Bros. in one
image: [https://i.imgur.com/g6JQ2WV.png](https://i.imgur.com/g6JQ2WV.png) /
[https://twitter.com/Doomlaser/status/1004802864433147904](https://twitter.com/Doomlaser/status/1004802864433147904)

I want to do more of these and experiment with training generative neural nets
on that kind of thing when I get the chance.

~~~
godot
As a kid in the early 1990s I always thought 8-1 was unusually long and I
always seem to get down to the 99s warning music before I can finish the
level, even running at full speed. This visualization really shows clearly how
much longer that level is compared to the rest.

~~~
T-hawk
Besides the physical length, 8-1 also starts you with 300 ticks on the timer
rather than the usual 400.

------
martin_drapeau
Very nice. A few years back I wrote
[http://mariocraft.club/](http://mariocraft.club/) for fun (Super Mario in
Javascript). Allows you to build your own levels. Very basic and unfinished
but people love building levels.

If anyone has interest in picking up the project, and auto-generating the
levels, ping me.

------
BZH314
@matts_ramblings approach is great to get a perfect authoritative reference we
can use to test and/or train other tools.

Other tools mapping the Super Mario Bros. levels:

1\. animmerger [1] by bisqwit

Written in C++.

Takes png images as input.

This tool seems to be the reference in creating level maps for Super Mario.

Matt's tool seems to use animerger to generate the color palette according to
the source code [2]

2\. ALMA [3] by BZH314 (disclaimer: our baby project)

Matt mentions using this approach as a possibility in the post.

Written in Python using the OpenCV [4] computer vision library.

ALMA takes videos as input, generates the map levels as images (png and
animated gifs) and also generates the videos to show the algorithm in action
[5]

(shameless self plug: need more YouTube subscribers to get that sweet sweet
vanity URL please :-)

ALMA applies background subtraction to remove the moving enemies in order to
keep only the background (a problem Matt's tool does not have)

3\. Manually stitched

If you're looking for good SMB1 level maps stitched manually, there are some
good work out there:

Rick N. Bruns' nesmaps.com [6]

Mariowiki: example of World 1-1 [7]

Are you aware of other tools out there?

\---

[1]
[https://bisqwit.iki.fi/source/animmerger.html](https://bisqwit.iki.fi/source/animmerger.html)

[2]
[https://gist.github.com/matthewearl/733bba717780604813ed588d...](https://gist.github.com/matthewearl/733bba717780604813ed588d8ea7875f)

[3] [https://bzh314.com/alma/](https://bzh314.com/alma/)

[4] [https://opencv.org/](https://opencv.org/)

[5]
[https://www.youtube.com/watch?v=wanvx0PpE1w&list=PLa4uefpt5W...](https://www.youtube.com/watch?v=wanvx0PpE1w&list=PLa4uefpt5WhLxWtTluGVEP5utqysh_PDy)

[6]
[http://www.nesmaps.com/maps/SuperMarioBrothers/SuperMarioBro...](http://www.nesmaps.com/maps/SuperMarioBrothers/SuperMarioBrothers.html)

[7]
[https://www.mariowiki.com/World_1-1_(Super_Mario_Bros.)](https://www.mariowiki.com/World_1-1_\(Super_Mario_Bros.\))

~~~
kchr
Thanks for this trove of resources! :-)

------
arthurfm
How difficult would it be to do the same with Super Mario World on the SNES?

~~~
hypeibole
I am not by any means an SMW expert but lately I've developed a keen interest
on the SMW romhack scene.

If what you want to do is extract a level and/or play around with level
creation the golden standard tool is Lunar Magic [0].

There are some forums with information about rom hacking, level creation,
music creation and so on for SMW, like SMWCentral [1].

[0]
[https://fusoya.eludevisibility.org/lm/index.html](https://fusoya.eludevisibility.org/lm/index.html)

[1] [https://www.smwcentral.net/](https://www.smwcentral.net/)

