Hacker News new | ask | show | jobs
by dehrmann 2240 days ago
I have zero experience in the video game industry, but I'd think that since video games get ~zero attention after they're shipped, writing maintainable code is less of a priority.

I'd be really curious to see how the Pokemon Red/Blue split was done. Is it a C precompiler flag? Build config? Actual config? Cloned repo?

6 comments

In the Pokemon Blue codebase they use 2 flag variables to distinguish between the different games, these are `pokemon_type` and `pokemon_type_blue`. The name of the second flag definitely hints that it was added later in development.

These are the values for each game:

    Green:  pokemon_type=0 pokemon_type_blue=0
    Red:    pokemon_type=1 pokemon_type_blue=0
    Blue:   pokemon_type=1 pokemon_type_blue=1
The general pattern for branching between game variations looks like this across the codebase:

    ifn pokemon_type
      ifn pokemon_type_blue
        ; blue
      else
        ; red
      endif
    else
      ; green
    endif
Conditional assembly directives like `ifn` are resolved statically during assembly, so only the code between matching conditions is included as part of the output. To anyone interested in exploring this a bit more, I'd recommend reading Chapter 8 Section 13 of the DOS version of The Art of Assembly Language Programming [0], which starts on page 43 of the linked PDF.

Bonus fun-fact: In the Pokemon Yellow codebase it says `pokemon_type=1` is yellow, while `pokemon_type=0` is pink! This suggests to me that the idea of Pokemon Pink with Jigglypuff as your starter was probably being floated around but it was eventually scrapped. (The only remaining options for a pink starter pokemon with a pink evolution in the original 151 would be Clefairy and Slowpoke, neither of which are very cute.) The idea of Jigglypuff as a starter is further supported by her appearance alongside Pikachu on the roster of the original Super Smash Bros. which seems rather unexpected unless they had bigger plans for her.

[0] http://www.plantation-productions.com/Webster/www.artofasm.c...

I found some supporting evidence from bulbapedia "Clefairy was originally going to be the official mascot of Pokémon, but Pikachu was used instead due to the popularity of the anime and Pikachu's familiarity with fans".

Source: https://m.bulbapedia.bulbagarden.net/wiki/Clefairy_(Pok%C3%A...

Very cool find about the pink version!

I seem to recall watching a video somewhere, perhaps on Didyouknowgaming, that Clefairy was intended to be the Pokémon mascot before Pikachu. I could be completely wrong here, but if so that is really cool to think it may have had its own game!
Very cool, uncovering game development history via the source code.

Thanks for this!

In the old days that was probably more true than it is today, since so many games are "as a service" now with shared engines, online platforms, continual updates/patches, tons of expansions and DLC, supporting mods, etc.

The downside is that we'll never really be able to play today's games nostalgically like we can with old burned-to-ROM games.

Online multiplayer games have a shelf life of sorts that depends on the servers being available and having other people to play with. There's a few examples of community-driven projects to revive classic online multiplayer games with mixed success but it'll just never be the same thing.

After MSN Gaming Zone died in 2006, the Age of Empires II community developed a multitude of alternatives to play the game online (with a rating ladder). The one that was the most widely used up to the very recent release by MS of AoE2:DE on Steam was Voobly, which exists since 2008, although back then it was called IGZones.
Well there is always the case of iterative releases of games of a genre. So Pokemon Silver vs Pokemon Blue. It is going to based off of the original source code. So writing maintainable code is desired (from the dev at least).
That’s not my experience of modern games. There are loads of games out right now that get patches constantly, sometimes even weekly. It’s not just multiplayer games; lots of roguelikes are in constant development as well.
They’re touched much less often than most software, but even older games would occasionally share engines and stuff. Games these days often have DLC.
I might be wrong but it would make sense to me that the second gen games (Gold/Silver) would share a far bit of code from the first gen (Red/Blue/Yellow). In that sense in this case, the code did infant live longer than the release of the first game.