Archive for the 'Video Games' Category

Jumpcore: A starting point for SDL/OpenGL games

Wednesday, July 1st, 2009

NON-PROGRAMMERS READ THIS

Here, download this silly physics toy:

    “Typewriter”

Controls: Keyboard, mouse, F1, F4, ESC

PROGRAMMERS READ THIS

(UPDATE 4/11: Instead please see the page for Jumpcore 2.0.)

When I started writing Jumpman, something that frustrated me was that there are a couple of seemingly basic things that SDL/OpenGL doesn’t actually provide out of the box, and that I couldn’t seem to find a really good source for sample code for– things like drawing text, or creating a simple GUI, or building a crossplatform binary. So once the game was done I decided to clean up my code a little, strip out the “Jumpman” parts and release the basic skeleton as open source sample code. Below is that code, and a small tutorial on setting up Mac OS X such that it can build Windows and Linux executables. The hope is to make an overall package that would allow someone starting an SDL/OpenGL game to just sit down and start writing, rather than having to spend time downloading and fiddling with libraries.

The Jumpcore package comes in two versions. A minimal version that includes only:

  • The ability to draw text (provided by the Freetype and FTGL libraries).
  • A code snippet for managing “internal files” (which live in a directory named “Internal” on windows/linux, and inside the application package in OS X)
  • Alt-tab support for OS X (SDL does not do this out of the box for fullscreen apps)
  • Makefiles (and one .xcodeproj) for Windows, Mac and Linux

And a more fully featured version that also comes packaged with:

  • The Chipmunk 2D physics library
  • The LodePNG library (and a code snippet for loading PNGs into OpenGL textures)
  • The TinyXML library
  • Some color conversion routines
  • A minimal “ControlBase” GUI library (dependent on Chipmunk)
  • The “Typewriter” demo code linked at the top of this post.

The included libraries were picked in an attempt to include all the basic stuff a game needs, while still making the package as easy as possible to port and reuse in weird situations: all the libraries are self-contained and except for SDL itself can be built from the package as source where necessary; nothing depends on anything more complicated than the STL– I avoided heavyweight dependencies like Ogre or libpng; and everything is under a BSD-like license. The biggest limitation of the package at the moment is that it’s a bit mac-centric (I have not tested it with Visual Studio or Dev-C++).

Basically, here’s a box full of Legos and half a robot. Have fun.

DOWNLOAD

HOW TO BUILD

Included is a Jumpcore.xcodeproj for compiling on mac, which can be compiled with XCode; windows makefile and support files are in a folder named win/, and can be compiled with mingw; Linux makefile and support files are in a folder named lin/, and can be compiled with gcc. More detailed instructions for all three platforms follow:

    If you’re on a mac:

To build a mac executable, from a mac: Included is a Jumpcore.xcodeproj for use with XCode; just build that in Release mode and it should produce a 10.3.9-compatible universal binary (though note, I’ve not specifically tested it with 10.3.9).

    If you’re on a mac and you want to build a Windows executable:

Here’s the best way I’ve found to do this:

  1. There is a “Cross Compilers for Mac OS X” page here that actually has OS X installers for mingw. PPC and Intel versions are included; I installed 4.3.0 for Intel. The only problem with these particular installers is they install into strange places, so whichever installer from that page you pick, write down the “Installation directory” listed to the right of it.
  2. Once you’ve installed an installer from that page, you need to install SDL headers. In order to do this, go to the SDL download page and look under “Development Libraries” -> “Win32” -> “Mingw32”. Download that tarball. Once you’ve downloaded it ignore the “INSTALL” file, which is full of lies, and do this: Edit the “Makefile” in the directory so that the “CROSS_PATH” on line 4 is the “Installation directory” you wrote down in step 1. Like in my case this would be:
      CROSS_PATH := /usr/local/i386-mingw32-4.3.0

    Once you’ve done this, run “sudo make cross” and it will install the SDL headers into your mingw directory.

  3. Go into the “win/” directory. Run “make” with the argument MINGW=[Installation Directory], where [Installation Directory] is again the directory from step 1– in my case this would be
      make MINGW=/usr/local/i386-mingw32-4.3.0

A directory named “Jumpcore” will be created with a Jumpcore.exe and all the support files necessary.

    If you’re on a mac and you want to build a Linux executable:

Just distribute source. No, really. Building Linux binaries for distribution is tricky, and binaries aren’t what people want anyway. However if you want to do what I did and chicken out, what I recommend is installing Virtual Box or Q (probably Virtual Box, though Q is what I used) and loading up an Ubuntu install CD. This is quicker and easier than trying to set up a cross compile. Then go into the “lin/” directory and type “make”.

    If you’re on Windows:

I was able to successfully compile Jumpcore on Windows by doing the following:

  1. Download and install MinGW. (Make sure to install the C++ package.)
  2. Download and install MSYS (it’s part of MinGW, but a separate download)
  3. As described on the MinGW install HOWTO, add C:\MinGW\bin to your path: right-click “My Computer”, click “Advanced”, click “Environment Variables”, double-click the line that says “PATH”, and in the second line add the characters ;C:\MinGW\bin
  4. Go to the SDL download page and look under “Development Libraries” -> “Win32” -> “Mingw32”. Download that tarball and open up its contents in MSYS. Type “make native” and it will install itself.
  5. A kind of odd step: right-click the file “README.txt”, open it in Wordpad, and immediately save it. (This will strip out my evil UNIX newlines.)
  6. Go into the directory win/ and run: make WINDOWS=1

This will create an install directory named “Jumpcore”. If you want to compile for debugging, in that last step type: make WINDOWS=1 DEBUG=1

    If you’re on Linux:

Install Freetype and SDL. Go into the directory lin/ and run make. This will create an install directory named “Jumpcore”. If you want to compile for debugging, instead type: make DEBUG=1

GETTING STARTED

Once you get the thing built, you’re going to want to start focusing on swapping out the Typewriter code for your own code. Jumpcore consists of a main.cpp that does basic bringup/teardown and event loop work hopefully good enough for most games, and makes callbacks as appropriate into a display.cpp (display logic) and a program.cpp (game logic) you provide. You’ll want to implement the following methods:

In display.cpp

    display_init() – This is called once each time the display surface is initialized. It’s a good place to do things like initialize fonts and textures. (Note it could be called more than once if the window size ever changes.)

    display() – This is called when it is time to draw a new frame.

    audio_callback() – This is set up as the SDL audio callback.

    drawButton (“full version” only) – This is a cpSpaceEach callback which the default display() calls on each interface item. If you want to change the appearance of the ControlBase controls this is a good place to do that.

In program.cpp

    program_init() – This is called once when the program begins.

    program_update() – The default display() calls this once per framedraw.

    program_eventkey() – This is called when SDL gets a key event.

    program_eventjoy() – This is called when SDL gets a joystick event.

    program_eventmouse() – This is called when SDL gets a mouse event.

    program_interface() – This is called after the event system finishes dispatching events to ControlBase controls, to give the interface a chance to redraw itself.

    BackOut() – Called when ESC is hit (quits).

    AboutToQuit() – Called right before the program quits.

Documentation for the individual libraries and functions included with Jumpcore can be found on these separate pages:

LIMITATIONS AND POSSIBLE FUTURE IMPROVEMENTS

I’m not really sure if this is ultimately going to be useful to anyone, and I don’t intend to maintain it unless there are people actually using it. However if there turns out to be any interest in this there are a few things I’d like to improve in a future release:

  • The package contains everything you need to build a Windows version from a Mac. It would be awesome if I could eventually reach the point where a Windows user could build a Mac version (is that even possible?).
  • Linux version is poorly tested in general. I have reports of issues on 64 bit systems, and the original Jumpman code seemed to have issues with switching to and from full screen mode.
  • The final executable size is pretty large– 2 or 3 MB compressed for the very minimal typewriter demo. I’m curious if this can be improved on. At least on the mac a large chunk of this is taken up by SDL, which gets bundled along with the executable. However, to someone who’s using OpenGL to draw, a lot of this is wasted space– because much of the complexity in SDL is taken up by the 2D drawing support. I’d like to try to swap out the SDL libraries for versions that lack 2D drawing.
  • iPhone compatibility? Now that I’m doing iPhone development I’m becoming pretty firmly convinced it does not make sense to create a single codebase that compiles on both PC and iPhone– the platforms are too different– but maybe it would make sense to rewrite some parts of the typewriter demo to make portability to something like iPhone easier (for example, rewriting the drawing code to be OpenGL ES-compatible).
  • I am not sure that every library included with this is the most recent version.
  • The one “every game needs this” feature that isn’t in this package is configurable joystick/gamepad support. I’m not sure whether it makes sense to try to add it or not.

Finally, there have actually been a number of interesting-looking SDL “game engines” released lately, so you should be aware of those in case one fits your needs better than Jumpcore does. One I’m aware of is 2D Boy’s Boy engine (though that one does not appear to come with build files for anything except Visual Studio); if you know of others feel free to share them in the comments below.

Jumpman Level Database

Sunday, March 1st, 2009

So my Jumpman game has a level editor, and I thought I should make a place for people to put the level packs they’ve made.

Until I think of a better way to do this: if you made a level pack you want to share, zip up the .jmp and email it to jumpmanlevels@gmail.com and I’ll post it here. Include the name you want me to identify you by, and (if you want) a URL to link you at. (Notes: By emailing me your level pack, you are of course giving me permission to mirror it here. I reserve the right to not post your level pack, or to omit your URL, or to write whatever description seems appropriate.)

If you want to play anything below, just download the file into the same folder as the Jumpman program and unzip it. Then run Jumpman and click “Editor”.

All the level packs below are under 15 kilobytes. For calibration on the times, I can beat the main Jumpman level pack in about 15 minutes (…I’ve had practice).

Enjoy:

Peter Mawhorter’s Levels
(Operation Jumpman, Jumpquest, Pixels, Slalom, Uneven)
Peter has made an entire series of excellent level packs which you can download at his website above.

Freefall
Creator: mcc | Type: Playground | Added: 3-22-09
A little experiment I made which I think you will find interesting. It’s only one level long but it may take you awhile. There is no exit, your goal is to reach the orange ball.

Precaution
Creator: fzeroracer | Type: Cruel Challenge | Added: 3-1-09
Do you think Jumpman is hard? Jumpman is not hard. This is hard.

Sonic
Creator: Fly | Type: Playground | My time: 0:26, 0 lives
Fly is from Chile. I assume the “Sonic” burger chain must be very popular in Chile, since I cannot think of anything else this name could possibly be in reference to.

JumpPAC
Creator: ToastyKen | Type: Platformer | Added: 3-1-09 | My time: 5:26, 23 lives
A collection of platforming challenges in strangely familiar settings.

Mikesta
Creator: Mikesta | Type: Cruel Challenge | Added: 3-1-09 | My time: 26:41, 152 lives
Mikesta takes the editor’s edge cases and does something truly epic with them.

Jumpman Gaiden (beta)
Creator: Kitsune Zeta | Type: Platformer | Added: 3-3-09 | My time: 3:26, 5 lives
This is the guy who’s been posting in the comments saying that he is trying to create a level pack that can serve as a full replacement for the Jumpman main level set, complete with tutorial levels. The version linked here is only like 15 levels but it seems to be going well. The sense of visual style is fantastic, the early bits look, like… art deco, somehow, which I’m not sure how pixel art can even be art deco but it seems to work?

Easy
Creator: AndrewFM | Type: Platformer | Added: 3-3-09 | My time: 3:26, 5 lives
A fairly basic level set but with some very creative ideas in places. Warning, it appears to be possible to get permanently stuck in level 13.

Randomness
Creator: Zachary Nicholas | Type: Platformer | Added: 3-22-09 | My time: 3:28, 30 lives
A short series of platforming challenges.

Kyou’s Playground
Creator: Kyou | Type: Playground | Added: 3-1-09 | My time: 0:57, 11 lives
Kyou has some fun with the physics engine… maybe a little too much fun.

Farik
Creator: Farik | Type: Short Platformer | Added: 3-1-09 | My time: 3:50, 1 life
A neat little combination of platforming level and pixel art.

Fly
Creator: Fly | Type: Short Platformer | Added: 3-1-09 | My time: 0:56, 14 lives
Fly does not see what’s so great about platforms that stay in one place.

FAN ART

A man named JB Winter sends in this awesome hypothetical Jumpman box art. I can totally imagine seeing this at Babbage’s.

Jumpman box art

Also:

Jumpman fanart by Taya

Update 2/22/11: This mindblowing image was sent in by sQuiz:

Jumpman fanart by sQuiz

Jumpman

Thursday, February 19th, 2009

I made a video game.

DOWNLOAD (Version 1.0.2)

GAMEPLAY VIDEO

FEATURES

  • Old-school puzzle platforming with some twists
  • Low-definition graphics
  • Gamepad support
  • Full level editor

PLOT

  • Guide Jumpman to the exit.

 
————————————————————————————————————————
 
(OTHER STUFF)

  • There is a collection of user-created levels for Jumpman here.
  • In 2010 I released an iPhone/iPad version of Jumpman.
  • You can find the source code for this game on Bitbucket.

A Game of the Year 2008 Poll: Results

Friday, January 9th, 2009

CLICK HERE TO JUMP TO THE PRETTY COLOR-CODED FULL RESULTS

I’m just gonna copy and paste the explanation I gave last year:

For the last few years I’ve been hosting this Game of the Year poll for the users of some forums I read. There are a lot of GOTY polls out there, but this one I think is kind of special. Most polls, you’re given a list of four or five options and you’re asked to pick the one you liked best. This poll, people are given a list of a couple of hundred options, consisting of every new game released in the previous year– and asked to rate their top ten or twenty.

This does a few interesting things. First off, we get to see all the information about what people’s second, third etc choices are. Second off, because the second, third etc choices count, people are more likely to vote for the game they want to win, rather than the game they think is likely to win– they’re less likely to engage in “strategic voting”. Finally, because we have all this information, we’re actually able to provide somewhat reasonable rankings for something like the top hundred or so games of last year.

The full results– showing the exact number of voters who ranked each game first, second, third place etc– can be found here. In the meantime, the final results were:

  1. Fallout 3 (8780) *** GAME OF THE YEAR ***
  2. Left 4 Dead (6626)
  3. Grand Theft Auto 4 (5032)
  4. Super Smash Bros. Brawl (4321)
  5. Rock Band 2 (3290)
  6. Dead Space (3151)
  7. Gears of War 2 (2942)
  8. Fable 2 (2751)
  9. Braid (2729)
  10. Metal Gear Solid 4 (2666)
  11. Little Big Planet (2520)
  12. No More Heroes (2241)
  13. Audiosurf (2152)
  14. Castle Crashers (2083)
  15. Valkyria Chronicles (2027)
  16. Mario Kart Wii (2014)
  17. The World Ends with You (2000)
  18. World of Warcraft: Wrath of the Lich King (1914)
  19. Penny Arcade Adventures: On The Rain-Slick Precipice of Darkness Ep. 1 (1910)
  20. Sins of a Solar Empire (1850)

The numbers in parentheses are the final scores each game got under the poll’s ranking system. (The scores in general were a lot closer than last year–basically all the rankings 14-18 are within a couple votes of each other!) Thanks if you voted, and some more elaborate analysis of the results (plus an explanation of the scores) can be found below.

NOTEWORTHY WINNERS

  • GOTY 2008:

    #1, Fallout 3

  • Top-ranked Wii Exclusive:

    #4, Super Smash Bros. Brawl

  • Top-ranked 360 Exclusive:

    #7, Gears of War 2

  • Top-ranked PS3 Exclusive:

    #10, Metal Gear Solid 4

  • Top-ranked PC Exclusive:

    #13, Audiosurf

  • Top-ranked DS Exclusive:

    #17, The World Ends With You

  • Top-ranked PSP Exclusive:

    #39, Crisis Core: Final Fantasy VII

  • Best FPS:

    #2, Left 4 Dead

  • Best RPG:

    #1, Fallout 3

  • Best Sports Game:

    #27, Burnout Paradise

  • Best Game Only Available Through A Console Download Service:

    #8, Braid

  • Special “Cult” Award (see below):

    #26, Persona 4 & #15, Valkyria Chronicles (Tie)

NOTEWORTHY LOSERS

  • Best game of 2008 which somehow nobody considered to be their #1 pick: #33, Spore
  • Worst game of 2008 that at least one person considered their #1 pick: #179, Midnight Club: Los Angeles (Only two people voted for this)
  • Worst game of 2008: #203, Mystery Case Files: MillionHEIR (Only one person voted for this; it was their #20 pick)

There were also ten games which were listed, but which no one voted for at all.

ALTERNATE SCORING METHODS

The rankings listed above are based on what was intended to be an approximation of Condorcet voting, but which I’m told is actually closer to the Borda count. In my Borda-ish voting method, each vote cast for a game gives that game a certain number of points. If someone ranks a game #1, that game gets 20 points. If they rank it #2, the game gets 19 points. If they rank it #3 the game gets 18 points… and so on. I have a script that checks a couple of alternate ways of ranking the same data, though.

For example, if we rank games only by the number of first post votes they got, we get a wildly different list:

First Past the Post

  1. Fallout 3 (182 first-place votes)
  2. Left 4 Dead (109)
  3. Super Smash Bros. Brawl (42)
  4. Metal Gear Solid 4 (42)
  5. Valkyria Chronicles (39)
  6. Persona 4 (39)
  7. Grand Theft Auto 4 (35)
  8. Dead Space (31)
  9. Rock Band 2 (30)
  10. The World Ends with You (30)
  11. World of Warcraft: Wrath of the Lich King (30)
  12. Gears of War 2 (23)
  13. Little Big Planet (21)
  14. No More Heroes (19)
  15. Braid (15)
  16. World of Goo (14)
  17. Spelunky (12)
  18. Sins of a Solar Empire (11)
  19. Fable 2 (10)
  20. Prince of Persia (10)

Every year when I do this there’s some game which scores horribly low in the objective rankings but gets a really startling proportion of first-place votes; last year the standout game in the “cult” department was Persona 3; this year the standout was, interestingly enough, Persona 4, which only got 87 votes at all, placing it at #26 in the overall rankings– but nearly half of those votes, a full 39, ranked it in first place, putting it in sixth place in the First Past the Post ranking above. Tying Persona 4 in the First Past the Post ranking is Valkyria Chronicles, which did a little better in terms of how many people voted for it (117 votes) but which still gets a pretty great cult ranking since one in three of those voters considered it their #1 game. (Honorable mention in the cult category should probably go to “Spelunky“, a wildly obscure but kind of awesome freeware pixel art game released in the last two weeks of December, which came in way down at 51st place in the overall rankings but managed to come in 17th in first-pace votes– with again nearly one-third of the people who voted for Spelunky at all rating it #1.)

I also did two more ways of sorting the rankings: an “approval” vote, where nothing is counted except the number of votes a game received (i.e. a first-place and a twentieth-place ranking count the same– all the matters is if the game was on someone’s list); and an instant runoff vote. Most years I’ve done this the Instant Runoff and pseudo-Borda rankings have been almost the same, but this time there were some interesting differences (with the biggest one being, for some reason I don’t understand, World of Goo somehow jumping a good seven spots in the rankings?!). Your eyes are probably starting to glaze over at this point, so I bolded the places where these two votes differ from the normal rankings:

Approval

  1. Fallout 3 (488)
  2. Left 4 Dead (388)
  3. Grand Theft Auto 4 (325)
  4. Super Smash Bros. Brawl (266)
  5. Rock Band 2 (205)
  6. Dead Space (204)
  7. Braid (187)
  8. Gears of War 2 (185)
  9. Fable 2 (184)
  10. Audiosurf (161)
  11. Little Big Planet (161)
  12. Metal Gear Solid 4 (161)
  13. Castle Crashers (160)
  14. Penny Arcade Adventures ep.1 (176)
  15. No More Heroes (155)
  16. Mario Kart Wii (148)
  17. The World Ends with You (129)
  18. Professor Layton and the Curious Village (128)
  19. Mega Man 9 (124)
  20. Sins of a Solar Empire (122)

IRV

  1. Fallout 3
  2. Left 4 Dead
  3. Grand Theft Auto 4
  4. Super Smash Bros. Brawl
  5. Dead Space
  6. Rock Band 2
  7. Gears of War 2
  8. Fable 2
  9. Braid
  10. Metal Gear Solid 4
  11. Little Big Planet
  12. Castle Crashers
  13. Mario Kart Wii
  14. No More Heroes
  15. World of Goo
  16. AudioSurf
  17. The World Ends with You
  18. Valkyria Chronicles
  19. Penny Arcade Adventures ep.1
  20. Sins of a Solar Empire

FINALLY: PER-FORUM BREAKDOWNS

As mentioned before, this poll mostly exists for a handful of video game forums where some people I know post. Since last year when I started posting the results on this blog, I’ve tried to actually run some extra results, in each case counting only those voters who– as far as one could tell from looking at the logs– had come to the poll from one particular forum or other.

So, here you have it– these numbers aren’t totally accurate because my logging method is not entirely trustworthy, but here’s an approximate by-forum breakdown of these results. Links go to color-coded full listings.

Penny Arcade Forums (806 voters)

  1. Fallout 3
  2. Left 4 Dead
  3. Grand Theft Auto 4
  4. Super Smash Bros Brawl
  5. Rock Band 2
  6. Dead Space
  7. Braid
  8. Gears of War 2
  9. Fable 2
  10. Metal Gear Solid 4
  11. Little Big Planet
  12. AudioSurf
  13. Mario Kart Wii
  14. Castle Crashers
  15. No More Heroes
  16. Valkyria Chronicles
  17. World of Warcraft: Wrath of the Lich King
  18. Penny Arcade Adventures ep.1
  19. The World Ends with You
  20. Sins of a Solar Empire

Platformers.net (42 voters)

  1. Super Smash Bros. Brawl
  2. Fallout 3
  3. Left 4 Dead
  4. Apollo Justice: Ace Attorney
  5. No More Heroes
  6. Persona 4
  7. Mega Man 9
  8. Professor Layton and the Curious Village
  9. The World Ends with You
  10. AudioSurf
  11. Grand Theft Auto 4
  12. World of Goo
  13. Dead Space
  14. Castlevania: Order of Ecclesia
  15. Metal Gear Solid 4
  16. Advance Wars: Days of Ruin
  17. Little Big Planet
  18. Rock Band 2
  19. Tales of Vesperia
  20. Braid
360Arcadians.net (37 voters)

  1. Fallout 3
  2. Grand Theft Auto 4
  3. Left 4 Dead
  4. Gears of War 2
  5. Rock Band 2
  6. Metal Gear Solid 4
  7. Fable 2
  8. Geometry Wars: Retro Evolved 2
  9. Little Big Planet
  10. Dead Space
  11. Saints Row 2
  12. Sins of a Solar Empire
  13. Burnout Paradise
  14. Prince of Persia
  15. Valkyria Chronicles
  16. Castle Crashers
  17. NHL 09
  18. Lost Odyssey
  19. Penny Arcade Adventures ep.1
  20. Civilization Revolution

Mechanically Separated Meat (6 voters)

  1. Super Smash Bros Brawl
  2. Professor Layton and the Curious Villiage
  3. Super Street Fighter 2 HD Remix
  4. Mega Man 9
  5. World of Goo
  6. Trauma Center: Under the Knife
  7. The World Ends with You
  8. Iji
  9. Barkley, Shut Up and Jam: Gaiden Hourglass
  10. Fallout 3

Super Mario World vs. the Many-Worlds Interpretation of Quantum Physics

Sunday, February 3rd, 2008

Short version: Just watch this video.

Okay, now what was that?

So a few months back some of my friends were passing around these videos of something called “Kaizo Mario World“, which I was told, at first, translated to “Asshole Mario World”. This turned out to have actually been a misunderstanding of something in the youtube posting of the original creator’s videos:

[Asshole Mario] is not the real name for this series of videos, but it is my personal name for it.
The literal translated name for 自作の改造マリオ(スーパーマリオワールド)を友人にプレイさせる is “Making my friend play through my own Mario(Super Mario World) hack”, hence Kaizo(hack) Mario to the USA.

…but, the name is pretty appropriate. Kaizo Mario World is one of a series of rom hacks people create in special level editors that let you take Super Mario World and rearrange all the blocks; the point of Kaizo appears to have been to create the most evil Super Mario World hack ever.

I started watching these videos, but after seeing how the player got past the first gap stopped, went wait, this actually doesn’t look so bad, and started playing it instead. It’s actually not that bad! I was expecting it to be like Super Mario Frustration, Kaizo Mario World’s equivalent in Super Mario Bros. 1 hacks– all ridiculous jumps that require pixel-perfect timing, memorizing the location of a bunch of hidden blocks that exist only to foil a jump and, occasionally, actually exploiting glitches in the game engine.

Kaizo Mario World actually turns out though really to be kind of more like a puzzle game– giving you a series of seemingly impossible situations and then leaving you to figure out how to get past them. It only uses the sadistic-invisible-block trick sparingly (and, hey, even SMB2JP did that a couple times). And it actually turns out to be kind of fun.

It’s still sadistically hard, though, so if you want to play it you have to use what are called “save states”. Most emulators let you do this kind of save-and-rewind thing, where if you screw up you can back up just a few seconds to the last time you were standing in a safe place. So if you’re playing Kaizo Mario world you find yourself playing the same four-second section over and over and over until you get the jump just right, listening to the same two seconds of the soundtrack looping Steve Reich style

Anyway, the idea for the video up top was inspired by an offhanded comment in the “original” Kaizo Mario World youtube post I linked above:

The original videos were in god awful codecs that were a bitch to convert, so unfortunately the Tool Assisted Speedruns came first to most youtube watchers.
This is rather unfortunate, as I feel you lose a lot of the “appeal” by watching those.

This refers to the way that most emulators, if you are recording a video of yourself playing a game and you do the save-state rewind thing, they’ll rewind the video too, such that the video shows only your final attempt, not any of your messups. People use this to make “speedruns” showing a best-of-all-possible-worlds recording of them playing through some game or other, with all the errors scrubbed out. The guy’s point was that watching Kaizo Mario World this way kind of ruins it, since most of what makes Kaizo great is watching someone fail over and over and over again until they finally get it right.

On the other hand, Kaizo Mario World involves SO much failing that this means all the “real” videos are, like, twenty minutes long just to get through what in a tool-assisted run would have been a two-minute level. So I was thinking, what if you had a special tool that instead of erasing all the screwups, it saved all of them and made a video of all the screwups plus the one successful path superimposed? I kept thinking about this and eventually I just sat down and hacked SNES9X to work exactly like that. The result was the video up top, showing the 134 attempts it took me to successfully get through level 1 of Kaizo Mario World.

I think I’m going to make some more videos in this style of different Kaizo Mario World levels and post them back here, but in the meanwhile, if you want to make your own many-worlds speedrun videos, here’s my custom version of SNES9X 1.43 with the multi-record function:

  1. For the Mac OS X version, click here.
  2. For a Windows version, click here. (Many thanks to Syndalis of 360Arcadians for compiling this for me.)
  3. If you want a Linux version, you’ll have to compile that yourself, but you can do this by finding a copy of the 1.43 source and replacing movie.cpp with this.
  4. And for the full Mac OS X source, click here.


[Update 2/9/08: The Mac version now correctly processes movies recorded in the Windows version.]
[Update 2/10/08: Mac version updated to fix a problem where certain kinds of corrupt recording files could cause the program to loop endlessly; window titlebar now contains status information.]

Note that this is a quickly-tossed-together hack all done to make a single video, and I make NO promises as to the quality, ease-of-use, correctness, or safety of these links. Also, I think the video feature should work with any SNES game, but I’ve only tested it with Kaizo. If anyone attempts to try this yourself, I’d be curious to hear about your results.

To make a video: First, use SNES9X’s “record movie” function to record yourself playing some game; while the game is running, use the save and restore feature at least once. When you’re done, you’ll find that SNES9X has created a yournamehere.smv file and also a series of files with names like yournamehere.smv.1, yournamehere.smv.2, etc. These .number files are all the different “mistake” playthroughs, so keep all these files together in one directory.

To turn this into an actual movie you can watch, you will need to use the OS X version of the emulator. Unfortunately, the Windows and Linux versions can only record multiple-run SMVs– they can’t do the export-to-quicktime thing. The quicktime-export code is based on alterations to the mac-specific parts of 1.43 (although considering that I hear the Quicktime API is mostly identical between Mac and Windows, it might be pretty easy to port that code to Windows at least…).

Anyway, in the OS X version, open up the appropriate ROM and choose “Export to Quicktime Movie” from the Option menu. Before leaving the export dialogue, make sure to click the “Compression…” button. You *MUST* choose either the “None” or “Planar RGB” codecs, and under the “Compressor” pane you *MUST* choose a depth of “Millions of Colors+”. The “+” is important. Once you’ve saved the movie location, go to “Play Movie” in the Option menu and choose the .smv you want to play. The emulator will play through each of the playbacks one by one; when it’s done (you’ll know because the background turns back on) your movie will appear in the location you chose. Note that there’s one more step! You won’t be able to actually play this movie, at least not very well, because the export feature works by creating a different movie track for each playthrough and the file will be huge and bloated. Open your video in Quicktime Player, then choose “export” and export to some video codec with actual compression (like H.264). This will flatten all the different layers of the movie into one. Okay, NOW you’re done.

…So what’s this about quantum physics? Oh, right. Well, I kind of identify the branching-paths effect in the video with the Everett-Wheeler “Many Worlds Interpretation” of quantum physics. Quantum physics does this weird thing where instead of things being in one knowable place or one knowable state, something that is quantum (like, say, an electron) exists in sort of this cloud of potentials, where there’s this mathematical object called a wavefunction that describes the probabilities of the places the electron might be at a given moment. Quantum physics is really all about the way this wavefunction behaves. There’s this thing that happens though where when a quantum thing interacts with something else, the wavefunction “collapses” to a single state vector and the (say) electron suddenly goes from being this potential cloud to being one single thing in a single place, with that one single thing randomly selected from the different probabilities in the wavefunction. Then the wavefunction takes back over and the cloud of potentials starts spreading out again from that randomly selected point.

A lot of scientists really don’t like this “collapse” thing, because they’re uncomfortable with the idea of nature doing something “at random”. Physics was used to dealing with randomness before quantum physics came along– the physics of gases are all about the statistics of randomly moving gas particles, for example– but those kinds of randomness aren’t assumed to be actually random, just “effectively random” because the interactions of air molecules are so chaotic and complicated that they’re too unpredictable for humans to track. Think about what happens when you roll a die: the number that comes up when the die lands isn’t strictly speaking “random”, it’s absolutely determined by the physics of motion and the velocity at which you let go of the die and so forth. The “randomness” of a die roll isn’t about actual indeterminacy, but rather just a way of talking about your ignorance of how the deterministic processes that control the die operate. Quantum physics, on the other hand, has things that as far as anyone can tell are really, objectively random, with no mechanism producing that randomness and nowhere apparent to stick one.

Since this makes some physicists uncomfortable, they came up with a sort of a philosophical trick: they interpret quantum physics in such a way that they say when there’s more than one possible random outcome of some quantum process, then the different possibilities all happen, in alternate universes. They can’t prove or disprove that this idea is true– from the perspective of someone inside one of these universes, everything behaves exactly the same as if the “wavefunction collapse” really was just picking a random option. But it’s one way of looking at the equations of quantum mechanics, and as far as the mathematics cares it’s as valid as any other. Looking at things this way, if there’s a 3/4 chance of a quantum process doing one thing and a 1/4 chance of it doing the other, then we get three universes where the one thing happens and one universe where the other one does. This does mean that there’s some universe where two seconds ago all of the atoms in your heart spontaneously decided to quantum-tunnel two feet to the left, but in almost every universe this doesn’t happen so we don’t worry about that.

Science fiction authors love this. There’s a bunch of stories out there exploring this idea of a multiverse of infinite possibilities all occurring side by side (the best of these I’ve ever read being Robert Anton Wilson’s Schrödinger’s Cat). Most of these stories get things totally wrong. Science fiction authors like to look at many-worlds like, this morning you could either take the bus to work or walk, so the universe splits in two and there’s one universe where you decided to walk and one universe where you decided to take the bus. This is great for purposes of telling a story, but it doesn’t really work like that. The many-worlds interpretation is all about the behavior of quantum things– like, when does this atom decay, or what angle is this photon emitted at. Whereas human brains are big wet sloppy macroscopic things whose behavior is mostly governed by lots of non-quantum processes like neurotransmitters releasing chemicals.

This said, tiny quantum events can create ripples that have big effects on non-quantum systems. One good example of this is the Quantum Suicide “experiment” that some proponents of the Many-Worlds Interpretation claim (I think jokingly) could actually be used to test the MWI. The way it works is, you basically run the Schrödinger’s Cat thought experiment on yourself– you set up an apparatus whereby an atom has a 50% chance of decaying each second, and there’s a detector which waits for the atom to decay. When the detector goes off, it triggers a gun, which shoots you in the head and kills you. So all you have to do is set up this experiment, and sit in front of it for awhile. If after sixty seconds you find you are still alive, then the many-worlds interpretation is true, because there is only about a one in 1018 chance of surviving in front of the Quantum Suicide machine for a full minute, so the only plausible explanation for your survival is that the MWI is true and you just happen to be the one universe where the atom’s 50% chance of decay turned up “no” sixty times in a row. Now, given, in order to do this, you had to create about 1018 universes where the Quantum Suicide machine did kill you, or copies of you, and your one surviving consciousness doesn’t have any way of telling the people in the other 1018 universes that you survived and MWI is true. This is, of course, roughly as silly as the thing about there being a universe where all the atoms in your heart randomly decided to tunnel out of your body.

But, we can kind of think of the multi-playthrough Kaizo Mario World video as a silly, sci-fi style demonstration of the Quantum Suicide experiment. At each moment of the playthrough there’s a lot of different things Mario could have done, and almost all of them lead to horrible death. The anthropic principle, in the form of the emulator’s save/restore feature, postselects for the possibilities where Mario actually survives and ensures that although a lot of possible paths have to get discarded, the camera remains fixed on the one path where after one minute and fifty-six seconds some observer still exists.

Note: Please do not use the comments section of this post to discuss ROMs or where to get them. IPSes are okay. Thanks.

A Game of the Year 2007 Poll: Results

Wednesday, January 9th, 2008

CLICK HERE TO JUMP TO THE PRETTY COLOR-CODED FULL RESULTS

So for the last few years I’ve been hosting this Game of the Year poll for the users of some forums I read. There are a lot of GOTY polls out there, but this one I think is kind of special. Most polls, you’re given a list of four or five options and you’re asked to pick the one you liked best. This poll, people are given a list of a couple of hundred options, consisting of every new game released in the previous year– and asked to rate their top ten or twenty.

This does a few interesting things. First off, we get to see all the information about what people’s second, third etc choices are. Second off, because the second, third etc choices count, people are more likely to vote for the game they want to win, rather than the game they think is likely to win– they’re less likely to engage in “strategic voting”. Finally, because we have this information, we’re actually able to provide somewhat reasonable rankings for something like the top hundred or so games of last year.

The full results– showing the exact number of voters who ranked each game first, second, third place etc– can be found here. In the meantime, the final results were:

  1. Portal (9532) *** GAME OF THE YEAR ***
  2. Bioshock (8004)
  3. Super Mario Galaxy (7968)
  4. Mass Effect (5874)
  5. Team Fortress 2 (5256)
  6. Call of Duty 4 (5051)
  7. Halo 3 (4848)
  8. Half Life 2: Episode 2 (4660)
  9. Rock Band (3788)
  10. Guitar Hero 3 (2968)
  11. Metroid Prime 3: Corruption (2948)
  12. Assassin’s Creed (2937)
  13. Legend of Zelda: Phantom Hourglass (2605)
  14. World of Warcraft: Burning Crusade (2324)
  15. Super Paper Mario (2215)
  16. Pokemon Diamond/Pearl (2083)
  17. Crackdown (1978)
  18. Puzzle Quest: Challenge of the Warlords (1773)
  19. Phoenix Wright: Ace Attorney – Justice for All (1621)
  20. Zack and Wiki (1453)

The numbers in parentheses are the final scores each game got under the poll’s ranking system. (Bioshock and Galaxy were close!, as were Guitar Hero, Metroid, and Assassin’s Creed.) Thanks if you voted, and some more elaborate analysis of the results (plus an explanation of the scores) can be found below.

NOTEWORTHY WINNERS

  • GOTY 2007:

    #1, Portal

  • Top-ranked 360 Exclusive:

    #4, Mass Effect

  • Top-ranked Wii Exclusive:

    #3, Super Mario Galaxy

  • Top-ranked PS3 Exclusive:

    #34, Uncharted: Drakes Fortune

  • Top-ranked PC Exclusive:

    #14, World of Warcraft: Burning Crusade

  • Top-ranked DS Exclusive:

    #13, Legend of Zelda: Phantom Hourglass

  • Top-ranked PSP Exclusive:

    #56, Castlevania: Dracula X Chronicles

  • Top-ranked GBA Exclusive:

    #100, Legend of Spyro: Eternal Night

  • Best FPS:

    #1, Portal

  • Best RPG:

    #4, Mass Effect

  • Best Sports Game:

    #27, Forza Motorsport 2

  • Best Game Only Available Through A Console Download Service:

    #49, Sin and Punishment

  • Special “Cult” Award (see below):

    #25, Persona 3

NOTEWORTHY LOSERS

  • Best game of 2007 which somehow nobody considered to be their #1 pick: #19, Phoenix Wright: Ace Attorney – Justice for All
  • Worst game of 2007 that at least one person considered their #1 pick: #187, Hammerfall (Only two people voted for this)
  • Worst game of 2007: #208, SNK vs Capcom Cardfighters DS (Only one person voted for this; it was their #19 pick)

There were also five games which were listed, but which no one voted for at all.

ALTERNATE SCORING METHODS

The rankings listed above are based on an approximation of Condorcet voting. In my pseudo-Condorcet approximation, each vote cast for a game gives that game a certain number of points. If someone ranks a game #1, that game gets 20 points. If they rank it #2, the game gets 19 points. If they rank it #3 the game gets 18 points… and so on. I have a script that checks a couple of alternate ways of ranking the same data, though.

For example, if we rank games only by the number of first post votes they got, we get a slightly different list:

First Past the Post

  1. Portal (176 first-place votes)
  2. Super Mario Galaxy (170)
  3. Mass Effect (105)
  4. Bioshock (88)
  5. Rock Band (48)
  6. Team Fortress 2 (44)
  7. Call of Duty 4 (39)
  8. Halo 3 (27)
  9. Persona 3 (20)
  10. World of Warcraft: Burning Crusade (14)
  11. Metroid Prime 3: Corruption (12)
  12. S.T.A.L.K.E.R.: Shadow of Chernobyl (10)
  13. Half Life 2: Episode 2 (10)
  14. Zack and Wiki (9)
  15. Uncharted : Drakes Fortune (9)
  16. Phoenix Wright: Ace Attorney – Trials and Tribulations (8)
  17. Forza Motorsport 2 (7)
  18. Legend of Zelda: Phantom Hourglass (6)
  19. Pokemon Diamond/Pearl (6)
  20. skate. (5)

Every year when we do this there’s some game which scores horribly low in the objective rankings but gets a really startling proportion of first-place votes; this year the standout game in the “cult” department was Persona 3, which only got 78 votes at all, placing it at #25 in the overall rankings– but 20 of those votes ranked it in first place, putting it in ninth place above.

I also did two more ways of sorting the rankings: an “approval” vote, where nothing is counted except the number of votes a game received (i.e. a first-place and a twentieth-place ranking count the same– all the matters is if the game was on someone’s list); and an instant runoff vote. Almost every time I’ve ever done this the Instant Runoff and pseudo-Condorcet rankings have been almost the same, but this time they were actually kind of different. Your eyes are probably starting to glaze over at this point, so I bolded the places where these two votes differ from the normal rankings:

Approval

  1. Portal (537)
  2. Bioshock (473)
  3. Super Mario Galaxy (445)
  4. Mass Effect (336)
  5. Team Fortress 2 (322)
  6. Halo 3 (321)
  7. Call of Duty 4 (314)
  8. Half Life 2: Episode 2 (307)
  9. Rock Band (228)
  10. Guitar Hero 3 (211)
  11. Assassin’s Creed (202)
  12. Metroid Prime 3: Corruption (200)
  13. Legend of Zelda: Phantom Hourglass (182)
  14. Super Paper Mario (176)
  15. World of Warcraft: Burning Crusade (159)
  16. Crackdown (153)
  17. Pokemon Diamond/Pearl (150)
  18. Puzzle Quest: Challenge of the Warlords (139)
  19. Phoenix Wright: Ace Attorney – Justice for All (122)
  20. S.T.A.L.K.E.R.: Shadow of Chernobyl (102)

IRV

  1. Portal
  2. Super Mario Galaxy
  3. Bioshock
  4. Mass Effect
  5. Team Fortress 2
  6. Call of Duty 4
  7. Halo 3
  8. Half Life 2: Episode 2
  9. Rock Band
  10. Metroid Prime 3: Corruption
  11. Assassin’s Creed
  12. Guitar Hero 3
  13. Legend of Zelda: Phantom Hourglass
  14. Super Paper Mario
  15. World of Warcraft: Burning Crusade
  16. Crackdown
  17. Pokemon Diamond/Pearl
  18. Puzzle Quest: Challenge of the Warlords
  19. Zack and Wiki
  20. S.T.A.L.K.E.R.: Shadow of Chernobyl

FINALLY: PER-FORUM BREAKDOWNS

As mentioned before, this poll mostly exists for a handful of video game forums where some people I know post. This year, I decided to actually run some extra results, in each case counting only those voters who– as far as one could tell from looking at the logs– had come to the poll from one particular forum or other. Meanwhile, as coincidence would have it, a few days into the vote one of the posts from my blog– where I had also posted about the poll– got linked by Digg, and as far as I can tell from the logs a group of the Digg users actually clicked over to the next post and voted in the poll.

So, here you have it– these numbers aren’t totally accurate because my logging method is not entirely trustworthy, but here’s an approximate by-forum breakdown of these results. Links go to color-coded full listings.

Penny Arcade Forums (678 voters)

  1. Portal
  2. Bioshock
  3. Super Mario Galaxy
  4. Mass Effect
  5. Team Fortress 2
  6. Call of Duty 4
  7. Half Life 2: Episode 3
  8. Halo 3
  9. Rock Band
  10. Guitar Hero 3
  11. Metroid Prime 3: Corruption
  12. Assassin’s Creed
  13. World of Warcraft: Burning Crusade
  14. Legend of Zelda: Phantom Hourglass
  15. Super Paper Mario
  16. Pokemon Diamond/Pearl
  17. Crackdown
  18. Puzzle Quest: Challenge of the Warlords
  19. S.T.A.L.K.E.R.: Shadow of Chernobyl
  20. Phoenix Wright: Ace Attorney – Justice for All


Platformers.net (73 voters)

  1. Super Mario Galaxy
  2. Portal
  3. Bioshock
  4. Legend of Zelda: Phantom Hourglass
  5. Metroid Prime 3: Corruption
  6. Super Paper Mario
  7. Half Life 2: Episode 2
  8. Phoenix Wright: Ace Attorney – Justice for All
  9. Phoenix Wright: Ace Attorney – Trials and Tribulations
  10. Team Fortress 2
  11. Pokemon Diamond/Pearl
  12. Guitar Hero 3
  13. Halo 3
  14. Mass Effect
  15. Zack and Wiki
  16. Crackdown
  17. Hotel Dusk: Room 215
  18. Wario Ware: Smooth Moves
  19. Sin and Punishment
  20. Call of Duty 4

360Arcadians.net (53 voters)

  1. Bioshock
  2. Portal
  3. Mass Effect
  4. Call of Duty 4
  5. Halo 3
  6. Assassin’s Creed
  7. Rock Band
  8. Team Fortress 2
  9. Super Mario Galaxy
  10. Crackdown
  11. Forza Motorsport 2
  12. Half Life 2: Episode 2
  13. Puzzle Quest: Challenge of the Warlords
  14. Ace Combat 6: Fires of Liberation
  15. skate.
  16. World of Warcraft: Burning Crusade
  17. Overlord
  18. Uncharted: Drake’s Fortune
  19. God of War 2
  20. Pac-Man Championship Edition


Digg?!? (16 voters)

  1. Super Mario Galaxy
  2. Portal
  3. Bioshock
  4. Guitar Hero 3
  5. Super Paper Mario
  6. Half Life 2: Episode 2
  7. Metroid Prime 3: Corruption
  8. Rock Band
  9. Legend of Zelda: Phantom Hourglass
  10. Assassin’s Creed

<— (Incidentally, the 360Arcadians guys’ 21st-place pick was Ratchet and Clank for the PS3, and their 22nd-place pick was Picross DS.)

The Physics of Super Mario Galaxy

Sunday, December 2nd, 2007

For the last week I’ve been playing this game called “Super Mario Galaxy”, and if it isn’t the best game ever made, then it’s in the top three. It has fanservice by the buckets, and a soundtrack that soars as if the game itself is just happy it is being played, and little blue tractor beam stars that sing you sad little theremin songs, and evil hats. Things happen for no reason, like they used to in old NES video games, and you don’t care why, you just love it. I don’t even know the words to express how much fun I’ve been having with this game.

So instead of trying, I’m going to instead write about the physics problems the game poses.

The gimmick in Super Mario Galaxy is that where previous Mario games had you jumping between platforms floating in the air in the Mushroom Kingdom, the new one has you jumping between little bitty planetoids floating out in space. It works like this:

You get the idea pretty quickly. So here’s what I wonder:

Most of Mario Galaxy is spent running around on the surfaces of those little asteroids, like you see on the video. The asteroids vary in size and shape, although most are roughly spherical and on average each asteroid is about the size of a Starbucks franchise. Every single one of them, regardless of size or shape, has completely normal earth gravity. And it’s hard not to think, when you see Mario taking an especially long jump on a small asteroid and landing about halfway around the planet, that he kinda looks like he’s having a lot of fun. So what I want to know is, is any of this possible in real life?

Would it be physically possible– assuming that you have more or less unlimited resources and futuristic engineering, but are still bound by the laws of known physics– to actually build a bunch of little asteroids like this, with compact volume but earth gravity? Say, if you’re a ringworld engineer or a giant turtle with magic powers. Could you build the Mario Galaxy universe?

Here’s what I worked out:

So first off, clearly we’re not going to be able to do most of the things in the Mario Galaxy universe, since SMG is of course a game and obviously they weren’t trying to be realistic or imitate anything like real physics. I’m going to just ignore these things– for example, I’m ignoring anywhere where there’s just a vanilla gravity field pointing in some direction, as if generated by a machine. As far as we know, that’s just not possible. In the physics we know, the only way to create a gravity field is to put a bunch of mass in the place that you want the gravity to point toward.

This isn’t so bad, since a lot of the planetoids in Galaxy look like this might well be what they are– just a big lump of mass creating a gravity well. In fact, some of the planets– for example the one at the start of the video above– are actually shown to just be thin hollow shells with a black hole at the center. So, in the post that follows, I show what you’d have to do to build one of these planets. I’m going to consider just a single example planet, of about the size of the one from the video above; you’d have to use different masses and densities for each planet in the game, since each has a different size but the exact same amount of gravity at the surface.

ANALYSIS

The first question to ask here is, how much mass do we need? Well, the planet in the video, eyeballing it, looks like it’s about as wide as a 747 is long. Wikipedia says a 747 is 230 feet long.

Newton’s formula for gravity is m_1*a = G * m_1 * m_2 / r^2, where I take m_1 as the mass of Mario and m_2 is the mass of the planetoid. Solving for m_2, I get:

m_2 = a * r^2 / G

r is 115 feet (half a 747), and a is earth gravity, 9.8 m/s/s.

Plugging in to google calculator, I get:

((9.8 m (s^(-2))) * ((115 ft)^2)) / G = 1.8043906 × 10^14 kilograms

So, if you want to get earth-like gravity on the surface of a 230-foot-diameter sphere, you’re going to need about 1.8 * 10^14 kg of mass. This is not that much! Checking Wikipedia I find even the smallest moons and dwarf planets in the solar system get up to about 10^20 kg. in fact, 2 * 10^14 kg is just about exactly the mass of Halley’s Comet. This sounds attainable; other characters are shown hijacking comets for various purposes elsewhere in Mario Galaxy, so no one will notice a few missing.

Meanwhile, Wikipedia’s formula for escape velocity for a planet ( sqrt( 2GM / r ) ) tells us that escape velocity from this planetoid will only be about:

sqrt((2 * G * (1.8043906 × (10^14) kilograms)) / (115 feet)) = 26.2110511 m / s

Which is about 60 MPH. So the cannon stars Mario uses in the video to move from planet to planet should work just fine. (Although platforms might not work so well, at least not tall ones; since the planetoid is so small, you’d only have to get about 45 or 50 feet up off the ground before the amplitude of gravity is halved. Actually gravity will fall off so quickly on the planetoid that there would be a noticeable gravity differential between your feet and your head: a six-foot-tall person standing on it would experience about 1 m/s^2 more acceleration on their feet than their head. So expect some mild discomfort.)

At this point the only question is: If one were to attempt to fit Halley’s Comet into a 230-foot-diameter sphere, would this turn out to be impossible for any reason? In answering, I’m going to consider two cases: One where the mass is in a black hole at the center of the sphere; and one where the mass is distributed through the sphere evenly. In both I’ll try to see if anything really bad happens.

So, first, the black hole case. Looking here I’m told that the event horizon of a mature black hole should be equal to G * M / c^2, and Wikipedia tells me that the Schwarzschild radius (the radius you have to pack a given mass into before the black hole starts to form on its own) is about twice that. So plugging this in, I find that the radius of this black hole at the center of the sphere is going to be:

(G * (1.8043906 × (10^14) kilograms)) / (c^2) = 1.33970838 × 10^-13 meters

… uh oh! Now we seem to be running into trouble. If someone wanted to construct a black hole with the mass of Haley’s comet, they’d somehow have to pack the mass of the whole thing into… well, google claims the diameter of a gold atom is 0.288 nanometers, so… about one-hundredth of the diameter of a gold atom?! That doesn’t sound very feasible.

On the other hand, considering the case where the sphere is solid, one finds that the required density is going to be about:

(1.8043906 × (10^14) * kilograms) / ((4 / 3) * pi * ((115 feet)^3)) = 1.00023843 × 10^9 kg / m^3

As remarkable coincidence would have it, 10^9 kg/m^3 is, according to wikipedia, exactly the density of a white dwarf star, or the crust of a neutron star! So this is sounding WAY easier than the black hole plan: All you have to do is go in and chip off 180,000 cubic feet of the crust of a neutron star, and you’ve got your planetoid right there.

Of course, there’s still one more step. First off, I’m not sure what the temperature of a block of white dwarf matter that size would be, but you might not want to actually walk on it. For another thing, the reason why a white dwarf or the crust of a neutron star has that much density in the first place is that all that matter is being held in place by the incredible gravitational weight of the star the matter is attached to– your average white dwarf is about the size of Earth, which by star standards is tiny, but which compared to our little Mario Galaxy planet is rather large. So if you tore off a 747-sized chunk of one of these stars and just dumped it in space, it would almost certainly explode or expand enormously or something, because the chunk’s gravitational pull on itself would probably not be sufficient to hold it together at the white dwarf density. So we’re going to need some kind of a shell, to hold the white dwarf matter in place and (one assumes) trap things like heat and radiation inside.

When you get to the density a white dwarf is at, the main thing you have to worry about is what’s called degeneracy pressure. Usually, when you try to compress matter, the resistance you meet is due to some force or other– the force holding atoms in a solid apart, for example, or the accumulated force of marauding gas molecules striking the edge of their container. When you get to anything as dense as a white dwarf, though, the particles are all basically touching (“degenerate”), and the main thing preventing you from compressing any further is literally just the physical law that prevents any two particles from being in the same place at the same time, the Pauli Exclusion Principle. If you try to compress past that point, a loophole in the exclusion principle comes into play: it’s actually possible for two particles to share the same chunk of space as long as they’re in some way “different”, for example if one of them is in a higher energy state than the other (say, it’s moving faster). So in order to compress two particles “on top” of each other, you have to apply enough force that you’re basically pushing one of the particles up to a higher energy. For large numbers of particles, this can get hard.

Different kinds of matter degeneracy happen at different pressures. At the center of a neutron star, the pressure is so high that neutrons become degenerate and start stacking up on top of each other. The matter in white dwarfs and neutron star crusts, on the other hand, exhibits only electron degeneracy. Whew! So, how bad is this going to be? Well, looking here, we find the formula for electron degeneracy pressure to be:

P = ( (pi^2*((planck’s constant)/(2*pi))^2)/(5*(mass of an electron)*(mass of a proton)^(5/3)) ) * (3/pi)^(2/3) * (density/(ratio of electrons to protons))^(5/3)

(I’m assuming that our little white-dwarf-chunk will not be so warm that the particles will be moving at relativistic speeds; if not, we have to switch to a different formula, found here.)

So, we know the density; the ratio of electrons to protons has to be 1 (Otherwise the white dwarf would have an electric charge. Of course, if you can somehow find a positively charged white dwarf somewhere, you can reduce your required pressure noticeably!); and everything else here is a constant. Plugging this in we get:

P = ( (pi^2*((6.626068 * 10^-34 m^2 kg / s)/(2*pi))^2)/(5*(9.10938188 * 10^-31 kilograms)*(1.67262158 * 10^-27 kilograms)^(5/3)) ) * (3/pi)^(2/3) * (1.00023843 * 10^9 kg/m^3)^(5/3) = 9.91935718 × 10^21 kg m^-1 s^-2

Or in other words, if we neglect the assistance that the white dwarf material will be providing in holding itself together in terms of gravitational pull, the shell for our planetoid would need to be able to withstand 9.91935718 × 10^21 Pascals of pressure in order to keep all of that degenerate matter in. That’s a bit of a problem. Actually, it’s more than a bit of a problem. It’s most likely impossible. The strongest currently known material in the entire universe is the carbon nanotube, and it has a theoretical maximum tensile strength (I think tensile strength is what we want to be looking at here) of more like 10^11 Pascals. So you’d have to find a material that could do better than that by a power of like 10^10. But, hey, that’s just an engineering problem, right?

CONCLUSION

So what the above basically tells us is this. As long as you can do one of the following things:

  1. Hijack Halley’s Comet and collapse all of its mass down into a volume with diameter 5.35 milliangstroms, to create a small black hole
  2. Build a pressure vessel capable of withstanding 1022 Pascals of stress, then trap inside a big chunk torn out of a white dwarf

Then you, too, can have a Super Mario Galaxy style planetoid in your very own space station! Now, given, these things aren’t easy, and possibly not even possible. But isn’t it worth it?

DISCLAIMERS

The above analysis has some limitations which should be kept in mind.

  • In the case of the black hole strategy, you’d have to somehow stabilize the position of the black hole relative to the shell, so that the surface of the shell always stayed exactly 115 feet away from the black hole– otherwise random drift would cause one side or other of the shell to gradually drift toward the black hole and eventually cause the whole thing to fall in. Which probably would be kind of fun to watch, but isn’t what you want if you’re standing on it at the time.
  • In the case of the solid-body/white dwarf strategy, I am assuming that the final planetoid can be treated like a point mass. This is almost certainly wrong. I’m not sure how to go about figuring out exactly the gravitational force from a chunk of matter which rather than being treated like a point is distributed through a sphere immediately underfoot.
  • On the other hand, it might be interesting to find out, because if you knew how to do that you’d probably know also how to figure out the gravitational force from matter distributed through an irregular body. Most of the planets in Mario Galaxy are not spheres! There’s also planetoids shaped like barbells, and avocados, and cubes. Most interestingly, there are a handful of planetoids in certain places in Mario Galaxy shaped like toruses (doughnuts). I’m curious but not sure how to figure out, if you actually were to construct such a thing in real life, what would the gravity when walking on it be like? What would happen if you tried to walk onto the inside rim?
  • None of these planetoids would be able to maintain an atmosphere. The escape velocity is just too stupidly low. (Puzzlingly, this does not seem to matter in Mario Galaxy, since Mario seems to be able to breathe even when floating out in deep space. One would be tempted to simply conclude that Mario, being a cartoon character, does not need air, but no, there are sections in the game with water and Mario suffocates if he stays underwater too long. Apparently the Great Galaxy is permeated with some kind of breathable aether?)
  • Even the gravity and breathable aether aside, many the elements of Super Mario Galaxy do not seem to be possible to replicate under normal physics. For one thing no matter where Mario walks on any structure anywhere in the game, his shadow is always cast “down” underneath his feet, as if light in Mario’s universe always falls directly toward the nearest source of gravity, or if the shadows weren’t cast by light at all but were simply visual markers in a video game allowing the player to tell where they are about to land.
  • I am not a licensed structural engineer, space architect or astrophysicist. The data above is provided on an “as is” basis without any representations or warranties and should not be used in the construction of any actual space vessel or celestial object. John Carmack, this means you.

Special thanks to pervect at Physicsforums for help with the degenerate matter stuff, and Treedub for pointing out what the electron/proton ratio of a white dwarf would be.