Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
A recreation of the first level of Super Mario Bros. in Python (github.com/justinmeister)
124 points by cacois on Feb 22, 2014 | hide | past | favorite | 54 comments


So I created this project (I just found out this morning someone posted it here).

To answer a few questions:

1) DMCA/Copyright: I have no idea the legal grounds for this sort of project. There is an Javascript/HTML5 version of Mario that is much better and more complete than mine and it still exists on Github. If I get a takedown notice, I suppose the only people who lose out are people other than me who want to check it out. I'm not too concerned either way, to be honest.

2) Memory / CPU issues: Anyone concerned about these issues wouldn't make a game in Python and Pygame. I'm just a hobbyist who enjoys the language and the particular library I used.

3) Audio Latency: That is purely from the screen recording. There is no latency when you play it on your machine (to my knowledge).

4) Purpose of this project: I have been programming for 7 months, 2 of which I spent on this project. I never expected this project to get this much attention, but I suppose the cross-over appeal of Python and Mario is quite high. Fundamentally this was a learning activity to create something I thought was cool. Like I explained here: http://www.youtube.com/watch?v=HBbzYKMfx5Y , I knew basically nothing about making a platformer before this project. I still have a lot to learn.


So my two cents. Awesome job. I wouldn't have been able to approach anything like this five months after I started teaching myself to code.

I don't know how anyone could watch the vid and be so cynical about the choice of game, language or library. It's a clear example of autodidactic exploration.

Have you seen the portal gun mario? [1] (I hadn't until five minutes ago; link stolen from a comment down the page here: https://news.ycombinator.com/item?id=7284719 )

Might be interesting to think of different and/or bizarre ways you could potentially alter the game mechanics as you go along to create a new experience. I like those kinds of exercises because they help me think about structuring things in a decoupled way so I can arbitrarily modify part of the mechanics without having to rewrite everything. Might be a cool/informative exercise if you keep playing with the game.

Either, cool project.

[1] http://stabyourself.net/mari0/


I'm impressed! The code is well structured and you're using Python and PyGame, which is awesome! Well done!

For anyone wanting to learn Python and PyGame I'll just leave this here: http://pluralsight.com/training/Courses/TableOfContents/game...


So you took a game that used to take a few dozen KB of memory and an 8-bit CPU running at less than 2MHz, and turned it into one requiring many orders of magnitude more memory and CPU speed? I'm impressively disturbed.


It's a shame that you're getting voted down for making a very valid and truthful comment.

It really isn't impressive when we see 1980s-era games recreated in JavaScript, for example, and the same should be true when dealing with Python.

That's not to say that this effort lacks value. The author likely enjoyed working on it, and maybe learned something while working on it, too. It could be a useful reference work for those getting started with Python or PyGame, as well. But we surely should not be impressed by it in any way.


>So you took a game that used to take a few dozen KB of memory and an 8-bit CPU running at less than 2MHz, and turned it into one requiring many orders of magnitude more memory and CPU speed?

That's what I thought too.

Not sure why it's getting as much attention. Maybe because it's the combination of Python and Super Mario. A very popular language combined with a very popular game and a breeze of nostalgia.

However it's a fun little project but being on the HN frontpage is a little too much attention for something like that.


Going the opposite direction would be much more deserving IMHO; e.g. trying to fit a Flappy Birds clone in a few hundred bytes or something like that.


That would require skills. Also it's not "fun". It's not "fun" to be caring about optimizations or type-safety or general correctness and elegance.


> Also it's not "fun".

But it is fun. It's called "working for hack value"!


Not sure about python but there's plenty of those in JavaScript. Here's one

http://js1k.com/2014-dragons/demo/1659

I'm defining a few as 10 :P


I think it was just something the guy did for fun. It wasn't meant to be a super-optimised piece of code.

Also man hours are now a lot more valuable than CPU time. This is why people use things like python instead of coding in assembler, as would have been done for the original.


Personally, I prefer mari0. It's mario with a portal gun.

It's written in Lua using LÖVE, it's really cool.

http://stabyourself.net/mari0/

https://love2d.org/


Whoa. Glad I came in here if for no other reason than to see this. I always get a kick out of people copying quirky new mechanics onto other games to see what happens.


For anyone having trouble to run this on OS X Mavericks, you need this pygame binary:

http://www.pygame.org/ftp/pygame-1.9.2pre-py2.7-macosx10.7.m...


thank you. I was on the way to making a virtual environment and pip installing it


Thanks mate


DMCA takedown in 3, 2, 1...

Still a cool project anyway.


https://github.com/Diogenesthecynic/FullScreenMario is still there, even after a legal complaint from Nintendo.


But they did have to close the site. And I guess that Nintendo could easily bring them to court and win (not that they will, it's a small non-profit target).

My comment was meant as a "funny" way to say that Nintendo is usually very unforgiven with clones of their games.


You're not very funny.


The only thing that infringes copyright are the images and music... And those can be sourced very easily. So if he removes those, he should be fine. Those images could easily be replaced with placeholders too.


I would have liked to see all the sound and music done with FM synthesis (or whatever the Nintendo used) in Python as well, instead of .ogg files.


Also the palette shifting that they used to get different colors out of the same assets.


Why do you want to see these things? These are adaptations to the platform that the original game was developed on (and its limitations). What would be the purpose of reproducing those limitations in a new implementation for a completely different platform?


I spent a year remaking Pac-Man and many of its peculiarities. (Namco shut it down on github, while a thousand other pacman remakes there remain.)

Games will be considered a form of art someday. And it is the whole form of an art piece that is important (i.e. the medium, inner workings, presentation). In the future, the innards of classic games may become increasingly important, perhaps from an anthropological perspective. When video games become centuries old, I feel they will be artifacts of an emergent art form.


I'd like to see it because it would be cool. Why implement the game at all in another language? Why not just play the game on the Nintendo, or distribute a ROM for use with an emulator?


Textbook skeuomorphism.


Would providing alternative art/music and not using the Mario trademark make this legally safe? If the project is serious about continuing, I am sure any number of people would be willing to help out with legally acceptable replacements.


Nintendo seems to be pretty lenient about non-profit fangames, actually. Mari0 (http://stabyourself.net/mari0/) and Super Mario Bros. Crossover (http://www.explodingrabbit.com/games/super-mario-bros-crosso...) have both gotten a lot of media attention without any legal issues I'm aware of.




Code is still clean, just has the wrong name.


https://github.com/justinmeister/Mario-Level-1/blob/master/d...

Why on Earth would you create the level like this instead of using something like Tiled[1]? Pretty much everything you can make a game with has support for TMX tilemaps, and if not making basic support yourself shouldn't be too hard either, and ultimately way less effort.

[1] http://www.mapeditor.org/


He talks about it extensively in the video on the site, and I think he agrees with you that tilemaps would be preferable.


No way. This is awesome. Any plans to do other Mario levels or other classic games?


Neat project! You should to tutorials - it's a great learning example


I feel like I'm not knowledgeable or experienced enough to write tutorials, but I wrote a list of resources people might use if they want to get into pygame on reddit: http://www.reddit.com/r/Python/comments/1ymn1w/i_recreated_t...


does that huge lag bother anyone?

it might just be an out of sync screen recording, but it seems to me like there is an input lag.


The real Super Mario Bros. feels that way as well. This is due to Mario's very shallow acceleration curve. It's one of the main reasons the game is so challenging to play!

Edit: After having watched the video, it appears to be out of sync and dropping frames.


Maybe spend an afternoon learning up on copyright and trademark law.

Why would you spend so much time on something that clearly violates the intellectual property of Nintendo?


This may qualify as fair use, and in any case it's not like this is going to jeopardize sales of the 29 year-old Super Mario Bros or any of it's derivatives.


If your position is "may", you're on shaky legal ground at best. Regardless, he would be forced to shutter his side project with a CnD, since I doubt he's willing to go to court.


Who gives a shit about shaky legal ground? How will a CnD shutter his side project? Could just take it offline and continue to build it. I doubt Nintendo are going to go through the lengths to force him to destroy a .py file or two...

It's as if every line of code written needs to be useful. I'm seeing this more and more. Many cool projects are criticised based on how useful they are rather than how cool they are. Maybe if a project was positioned as useful/sellable, then perhaps such criticism is justified, but when something is obviously not meant for sell and has obviously been built for all except seriousness, it just comes across as daft.

Just the other day I saw a comment about an embedded PHP interpreter. "How will this EVER be useful?" Who gives a shit? It looks fun to write, so it was written.

I personally enjoy programming. Most code I have written has made me 0 money, has been seen by 0 eyes and has provided me hours of fun and pleasure in writing it. I'm sure many programmers are the same.


His homebrew version, for self education does way less harm than the millions of ROMs out there running on MAME. It is a single level, not a full clone that gets sold for profit at Target.


A Derek Sivers post that appeared here recently goes over some of the rationale for copying-as-learning, and imperfect-copying as an essential part of creative work:

http://sivers.org/mirror

HN discussion (with more personal & famous historical examples):

https://news.ycombinator.com/item?id=7168467


Have you heard the story of how Commander Keen came about?


No, please educate me; this sounds interesting


http://en.wikipedia.org/wiki/Commander_Keen#Creation_and_dev...

John Carmack and John Romero developed a clone of Super Mario 3 for the PC using a smooth-scrolling technique that had never been achieved on the platform before.

They went and showed Nintendo, who weren't interested. So they changed the name, artwork, and levels and went off to start id software and all the money went to them instead.


for the sake of learning?

EDIT: Also, if you check the commit history, I'm quite sure he didn't spend way much time.


Exactly. You do it for the same reason why people try to paint famous works of art. You get to really see many of the pain points that the original artist went through and connect with something on a different level unlike any casual observer.

In this case, the medium that is being used for the implementation is different, but you still get to solve many of the same problems.


133 commits? And you have to violate copyright or trademark to learn? Please.


I'm pretty sure you care more about this than Nintendo ever will. Get off your high horse. As someone who has never used PyGame, this is really cool to look into and learn from.


most of the commits are done on the last days... some of them are just some line changes... (https://github.com/justinmeister/Mario-Level-1/commit/586b96...) I code on my free time too, On the night I turn on my laptop and code for a couple hours, I am a bussiness owner, most of my day is related with other activities, and I just want to think in another thing and relax. Coding it's the perfect choice, but you need a project to feel motivated, something not related with your day work and something easy enough to be accomplished in a couple days (so you can fell your progress and feel proud). I see he completed level 1, my intuition says he won't go more far away to another level, because he just got the satisfaction he needed. Probably now he will choose another project and develop it.


Because he can? I know the word "hack" is meant very lightly on this site but creating for the sake of creating falls under that nomer




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: