
Show HN: Emulator-Backed Remakes, a new way to make classic game remakes - ggambetta
http://www.gabrielgambetta.com/remakes.html
======
byuu
> I did some research and this seems to be an original idea. Why hasn’t anyone
> tired this before?

I've done it. Making the emulator, debugger, and hooks to extend games is the
easy part. The really hard part is getting people to then go back and enhance
games.

In my case, I created some new I/O registers for the SNES. One set is called
MSU1, which lets you read in up to 4GB from a data file, and also lets you mix
in CD-quality audio (which you can use for voice acting, or replacing audio
tracks while keeping sound effects.) Particularly nice about the MSU1, was
that it was designed to be possible on real hardware. And a flash cart called
sd2snes implements it.

Here's an example of Legend of Zelda: A Link to the Past with a remastered
audio soundtrack:
[https://www.youtube.com/watch?v=HnAg2T7d6uU](https://www.youtube.com/watch?v=HnAg2T7d6uU)

And here's an example where the Playstation full-motion video intro was
inserted into the SNES version:
[https://www.youtube.com/watch?v=Gn_jXf7FHGA](https://www.youtube.com/watch?v=Gn_jXf7FHGA)
(yes, that full motion video really is possible on a real SNES.)

Not an enhancement, but d4s ported Road Blaster (a full FMV game) to the SNES,
even:
[https://www.youtube.com/watch?v=THJvsIezXrQ](https://www.youtube.com/watch?v=THJvsIezXrQ)

Another I/O register set I put in place was called HSU1. This one lets your
SNES game send and receive network packets. I've used it to implement a high-
score leaderboard in Campus Challenge '92 and Powerfest '94\. You play the
game in the emulator, and your score shows up on a website. But it's bi-
directional. You could take this concept a lot further, with dynamic content
in games, special events on certain days, etc.

I've also toyed with adding rumble support to the controllers. Although I was
beaten to the punch there by some patches a guy made for the Xbox port of
ZSNES a few years prior.

Lastly, in our community, we have some pretty sophisticated OpenGL pixel
shaders. One person implemented a real-time map display of Super Metroid where
the shader read in the player position from the SNES' RAM. You could utilize
that concept to show any kind of additional information to the player.

~~~
ggambetta
That's very impressive work.

I really had no idea any of this existed before writing mine, and so far
people have pointed out several instances of this applied to consoles (which I
haven't explored at all), but none about PC games. I wonder why is this? Do
consoles have higher-level APIs you can hook into that makes this more
reusable across games - more similar to adding hooks to a game engine vs an
individual game in the PC world?

~~~
byuu
Well, having a game under emulation gives you more control over what you can
do, certainly. You now control the software _and_ hardware. But I think most
people also don't want to make enhancements that only work on a single
emulator. And getting emulator authors to cooperate is like herding cats
(which is why we are still using the woefully inadequate iNES header format in
2014.) So I could have made MSU1 run some 1080p video mode with a 2GHz
simulated x86 processor, but it was important to me that the protocol be as
simple as possible and exist in a physical implementation that worked on the
real system.

More along the lines of your example, my emulator core is completely
abstracted to its own library and is GPL, so it would be quite easy to hook
routines as you have to do things like hires textures even on the SNES. But
there are some more extreme challenges to that than just identifying key
functions, as the SNES renderer is _very_ elaborate.

I can't say I've specifically _enhanced_ PC games, but I've definitely worked
on translations of them from Japanese to English. There's definitely lots of
fun tricks you can do outside of emulation, still. I usually write a debug
process launcher that uses DLL injection, which is then followed by installing
trampolines in various functions.

We worked on a game called Heroine Anthem, where the movie file format was
entirely custom. So we ripped the movie with screen capture software,
subtitled it, encoded it to XviD (this was a while ago), and then ran our own
DirectShow window to play back the movie in place of the originals.

We also patched an online multiplayer game, Fuurai no Shiren, to add a new
dialog to configure the server you connect to. We reverse engineered their
protocol (their "encryption" was a strtr function on streams of hex values.
Quite laughable.) and then created our own PHP server, called OpenShiren, so
that people could run their own instances. Especially useful once Chunsoft
shut their servers down.

I've done far, far crazier things with manipulating others' applications, but
since they weren't games, I won't elaborate on those here.

------
mots
The N64 emulation scene has been doing this for quite a while. There's several
finished retextures of N64 games like Djipi's Zelda: Ocarina of Time
retexture, bringing a cel-shaded look to the game
[https://www.youtube.com/watch?v=lnYyK3vflb4](https://www.youtube.com/watch?v=lnYyK3vflb4).

Here's where most of the development happens:
[http://www.emutalk.net/forums/110-N64-Textures](http://www.emutalk.net/forums/110-N64-Textures)

~~~
waterfowl
Yeah, I immediately thought of this beautiful N64 mod for Super Mario 64.
[https://www.youtube.com/watch?v=tYCl6eazCTQ](https://www.youtube.com/watch?v=tYCl6eazCTQ)

------
ksherlock
The re-release of Wasteland
([http://www.gog.com/game/wasteland_the_classic_original](http://www.gog.com/game/wasteland_the_classic_original))
uses the original game with a custom version of DOSBox
([https://s3.amazonaws.com/inxile-
wasteland/dosbox-0.74-Wastel...](https://s3.amazonaws.com/inxile-
wasteland/dosbox-0.74-WastelandEXT.zip) ) doing something similar to add in
updated graphics, sound, and and voiceover text.

~~~
ggambetta
So it _has_ been done before! Awesome!

------
geon
Some guy patched Dosbox to rip out the physics engine of Pinbal Fantasies and
replace it with an actual pinball table.

[https://www.youtube.com/watch?v=CGpTfb8HUCY&list=UUs-
pFQ5_s3...](https://www.youtube.com/watch?v=CGpTfb8HUCY&list=UUs-
pFQ5_s3HazyMAqI0Yz8w)

~~~
ggambetta
Now _that_ is insane.

------
boomlinde
Very interesting concept. The least daunting way to "remake" a game in this
way could be something like changing the color palette per level, kind of like
how the Super Game Boy does to some Game Boy games; an effect reminiscent of
the color filters used in Nosferatu.

I'm sort of opposed to the idea of "better art" as something that can be
achieved on a technical level, though, especially considering the example used
in the article (Monkey Island SE), which I personally think looks a lot worse
than the original game. If you want better art you need a better artist.

~~~
ggambetta
I'm not sure I understand your thoughts about "better art". My idea is to
reuse the game logic with entirely new art - with a better artist, as you say.
But MISE falls exectly into this category - completely new art, not done by
technical means (even if you don't personally like it).

~~~
boomlinde
My point is that "better art" could as well be achieved by replacing the
original art without modifying the game code or hooking it into an emulator,
sticking to the original restrictions. I don't think that the process
described in the article necessarily facilitates the possibility of "better
art".

On a technical level, the possibly increased resolution and color depth that
can be achieved using this method will certainly impose less limitations on
the artist in exactly those terms, but in my opinion that doesn't necessarily
mean that they will make it easier to produce good art.

~~~
ggambetta
Right, I see what you mean.

On the other hand, it doesn't mean it's easier to produce good art; the idea
is that it makes it _possible_ to modify the art at all. This is supposed to
be used for games where you _don 't_ have the source code.

------
zokier
Fan patches for various games can go pretty far in this direction too. For
example here is one guy making a D3D10 renderer for Unreal (the original one):
[http://kentie.net/article/d3d10drv/](http://kentie.net/article/d3d10drv/)

Sure they usually do not employ emulators, but still often afaik they place
themselves between the game and the API, translating it to something more
modern in passing.

~~~
ggambetta
That's very interesting! However, by injecting your code at that level you can
draw prettier polygons but still the same number of polygons as before, right?
For these cases I was thinking hooking at a higher level (the "render model"
method vs the "render triangle" method), for the things you can't do at the
driver level.

~~~
zokier
I haven't delved in game reverse engineering in depth, but I'd imagine that
most games would handle 3d models (and textures) in a fairly opaque blob
manner which quite naturally allows upgrading them without code change if the
rendering engine is capable of handling increased load. So instead of
upgrading the data on the fly you would replace the data files with upgraded
ones.

------
TheZenPsycho
this is way cool. I wonder if there's an easier way to find those entry
points. For videoram for instance, isn't it possible to set a break point on a
write to some spot in vram, and then dump stack at that point- one of the
functions on the stack is going to be your "draw tile" function, no?

and how do you deal with the somewhat more complicated NES games where
"sprites" are often constructed of multiple conjoined hardware sprites?
there's no "draw sprite" method there, it's just manipulating x,y registers in
obj ram!

~~~
georgemcbay
Yeah, this is really cool and the poster did a great job of writing it up and
making everything available.

His bit on the legality of this sort of thing when done without permission
should be ignored, though (to be fair, he does offer the standard IANAL
disclaimer). If you made graphics/sound/music that were totally unique, you'd
be fine, but if you made higher resolution versions of what already existed
that is clearly a derivative work and puts you in copyright violation trouble,
if the copyright owner cares to go after you.

Also, as you mentioned this method wouldn't work that great for all platforms;
basically any older console or older console-like computer (eg. Amiga, Atari
ST) tends to have much more complicated interplay between the graphics being
drawn and the hardware (real or emulated) in terms of timing (eg. to
vsync/vblank), having the graphics actually be low-level commands to a
coprocessor, etc. Once you get to the PC era where games are generally using a
relatively straightforward memcpy-type bitblt you're fine, but before that all
bets are off, at the very least the code you are patching in is likely to be
much more complex and fragile, if it could be made to work at all.

~~~
ggambetta
About the legality, for "totally new art", sure, but if I play an X-Wing
remake I want Darth Vader to look like Darth Vader... and as you say, a
higher-res Darth Vader would probably infringe something.

------
JoshTriplett
I've always wanted to see this algorithm implemented in an emulator:
[http://research.microsoft.com/en-
us/um/people/kopf/pixelart/...](http://research.microsoft.com/en-
us/um/people/kopf/pixelart/index.html)

You wouldn't want to apply it to the entire screen, but rather to individual
sprites and background images separately. The design of the graphics hardware
on the NES and SNES should make that mostly possible for the majority of
games.

~~~
FreakyT
I find it disappointing that MSR never released the code for this, as far as I
can tell.

~~~
JoshTriplett
Likewise. There's enough information in the paper to recreate a few portions
of the algorithm, but not the whole thing.

------
oddevan
Excellent proof-of-concept. I want to say Nintendo had a patent that implied
something like this for the Wii Virtual Console, but they never delivered on
it.

Anyone have any idea if Christian Whitehead's Retro Engine[1] (used in the
recent Sonic 1/2/CD remakes) does something like this?

[1]
[http://christianwhitehead.com/?page_id=51](http://christianwhitehead.com/?page_id=51)

~~~
deltaphc
The Sonic 1/2/CD remakes were actually done from scratch in his Retro Engine
(which is just a regular game engine that focuses on Retro-style 2D games).
They aren't emulator-backed or anything.

------
DerekL
I've been thinking about doing the same thing with X-Wing. My goal is to build
a control panel for the game with levers and switches, and indicator lights
for power levels and status, and video screens for radar and craft
identification. After that, I'd replace the cockpit window display with a high
resolution screen and more detailed models.

I worked on this for about a month before I dropped it for other side
projects. I ran the Windows version of X-Wing and used a utility called Cheat
Engine. I found the locations in memory for the throttle, power settings,
laser and shield power levels, remaining torpedoes, etc. My next step would be
learning how to do DLL injection, and using a debugger to find a good place to
inject code.

I wouldn't have to do any of this if LucasArts would release remakes of X-Wing
and TIE Fighter that supported custom controls and displays, or open source
the old code. But the market for that is small, and now they might have to
coordinate with EA since they granted them the license to make Star Wars
games.

------
marpalmin
Buena Gabriel! Much better than your z80 emulator ;)

~~~
ggambetta
Gracias :) For some reason I always end up emulating some CPU.

We're obviously from the same country. Have we met before?

------
ibisum
In the OpenPandora (and other F/OSS gaming console) scenes, there is already a
bit of this going on to a degree - for example, MAME and NES emulators have
different rendering modes that can be configured to make the graphics less
pixelated and more vector'ized, giving a new and appealing boost to the look
and feel of the older games. This has definitely been advantageous - my kids
don't like to play "those games where you can always see the pixels", but when
I turn on smooth-render/vector mode, they're like "oh, that's much better, now
we can play Mario Bros!" ..

~~~
jcromartie
I think Dosbox already supports hqx
([http://en.wikipedia.org/wiki/Hqx](http://en.wikipedia.org/wiki/Hqx))
scalers.

------
InnocentB
I think the first place I saw this technique used was in EmuDX, which had
swapped-out graphics for Pac-Man, Ms. Pac Man, Galaxian, Frogger, and Donkey
Kong. This was around 1999 or 2000. Its site no longer exists, but here's a
mirror:
[http://www.arcadeathome.com/emudx.phtml](http://www.arcadeathome.com/emudx.phtml).

I was always sad it never really caught on, I think it's a great way to
revitalize old games while preserving gameplay.

------
phkahler
I first saw this type of thing with
[http://www.manfreda.org/i-robot](http://www.manfreda.org/i-robot) John
Manfreda's I,Robot emulator where he takes parameters sent to the Atari
mathbox/rasterizer and sends them to D3D instead. This gets you classic
I,Robot with much higher resolution for the polygons.

------
bitwize
It's not exactly new. I remember a thing from the 90s that was basically a
specialized Pac-Man emulator, but hooked the graphics routines in the ROM and
displayed its own, higher color depth graphics instead. It is a cool way to
get gameplay fidelity with enhanced graphics and sound though.

~~~
sehugg
I think there were some old Shockwave games ported this way too (Frogger for
one)

------
lightguard
Microsoft's Halo: Anniversary edition basically does this. The original game
is running underneath a modern rendering engine.

~~~
ggambetta
I'd classify that as a "new edition"... since they own the code and assets,
I'd suppose they just rewrote the bindings between the old game logic and the
new game engine, not that they patched it at the binary level.

