Skip to main content

Link's Awakening & Kaeru no Tame ni Kane wa Naru technical comparison

· 6 min read

Hero image

Did you know? The Legend of Zelda: Link's Awakening's engine was not an original creation; it was actually taken from a Nintendo title made a year earlier known in Japan as Kaeru no Tame ni Kane wa Naru.

Well, not really. I already tried to debunk this story with a bit of journalistic research, but a point I could definitely expand on further is that they are very different games internally. How so? Let's take a look at it.

What is an engine, anyway?

While we all know what an engine is in the context of modern games (a software framework designed for game development), it's not so clear in the context of retro video games. Most games were written directly in ASM back then, when development tools were extremely basic.

So what does it mean in this context? Well, it simply means that a game incorporated a substantial amount of code from a different game at least during early development. This implies that elements like data structures and memory maps would likely exhibit similarities between the two games.

For example, if we look at modern open source engines for GB, such as ZGB and retr0-gb, we can find it includes code to facilitate the development of things like the main loop, collisions or animations with an opinionated data structure.

Obvious examples of this can be found in commercial games too, such as the save data of DKL2 and DKL3, which are basically identical. This level of similarity is not to be expected, but having similar data structures following the same sequence is.

Sprites

A noticeable difference between the two games becomes apparent right off the bat: Link's Awakening uses the 8x16 mode for objects, while Kaeru uses 8x8. This implies that major changes to the sprite system and data structures were made. However, since this might have been necessary to better accommodate some metasprites, it's not definite proof.

VRAM comparison

Getting into the code, both games start the sprite update routine in a similar way: by moving objects out of the screen. This is a relatively common practice, but we can immediately spot a difference: Link's Awakening has a simpler implementation that cleans the total of objects and Kaeru does it in a more optimal way by controlling which objects need to be cleaned.

That change certainly made me raise an eyebrow. It's also worth mentioning that the objects palettes for the protagonist are reversed between games.

Conclusion: taking into account all these changes, it is very unlikely that the sprite code was shared.

Maps

Both games follow the common practice of storing data in 2x2 blocks, which they then transfer to RAM to compose the final map and calculate collisions. However, the way they achieve this is completely different.

While Kaeru composes the complete map in RAM and transfers one column at a time to VRAM, Link's Awakening composes them directly in VRAM by copying 2x2 blocks from ROM.

Map blocks in RAM

Also, curiously, Link's Awakening sets 4 empty blocks at the end of each line in RAM to align the blocks with a 10-byte grid, which makes it very easy to read in the hex editor. This does not happen in Kaeru.

Frankly, there's no need to go much further into this aspect since the differences so far are quite sufficient.

Conclusion: the map code was not shared.

Text and scripts

The first thing that stands out is that the maximum number of characters per line is different between both games: 18 in Kaeru and 16 in Link's Awakening. Similarly, the maximum number of characters for the character's name is 4 in Kaeru and 5 in Link's Awakening.

Looking at the code, we can see that Link's Awakening transfers directly to VRAM, tile by tile, the graphics that represent the dialogues. Meanwhile, Kaeru does it in a much more complex way, figuring out the characters it will need and transferring those tiles first and using them later to compose the text in VRAM.

Something that the western public probably doesn't know is that both games have different fonts. In fact, Kaeru uses kanji while Link's Awakening does not.

Font comparison

Conclusion: the text code was not shared.

Main loop

The main loop and common routines, which are the very essence of what you can call 'an engine', are completely different. Very basic stuff, like the input polling routine, is completely different in both games (the 'button pressed' byte is stored swapped, for example). OAM DMA transfer is executed at the very beginning of the VBlank interrupt in Kaeru, while Link's Awakening does it at the end of the main loop.

The routine to switch banks is a bit weird in Kaeru, as it masks the bank number and always forces a write to disable RAM Banking, which is completely unnecessary. Of course, this is not present in Link's Awakening.

This, and the fact that I have not been able to find a case in which a data structure follows a similar sequence between games, makes me think that the main loop was not shared either.

Conclusion: the main code was not shared.

So is it true?

I could have continued analyzing other facets of the game like the audio design or the game saves for hours, but I think it's abundantly clear that the two games are fundamentally different internally.

Is it entirely out of the question that they might have shared some code in their early stages? No, of course not, that's something only the game developers can know. What I can say is that, after analyzing both games, I have found no evidence of it. Even if they did share code at some point, it changed so much during development that virtually no trace of the original remains.

Considering this, along with the research I mentioned at the beginning of the article, I can confidently state that the story of Link's Awakening using Kaeru no Tame ni Kane wa Naru's engine is false.