Super Gameboy palette glitches

Discussion of programming and development for the original Game Boy and Game Boy Color.
Post Reply
calima
Posts: 1745
Joined: Tue Oct 06, 2015 10:16 am

Super Gameboy palette glitches

Post by calima »

I've been playing Pokemon Red/Blue on a PAL SGB. Occasionally, the palettes it sets get corrupted. Maybe 60% of the glitches only affect the "changed" area (such as when you bring a new pokemon out, the palette for that pokemon's area becomes wrong), the rest affects the entire screen (usually turning white green, and other colors seemingly random). The palettes get fixed on the next palette change.

I've seen some references to this online, so it's probably not my unit being faulty. Anyone have info on this? Is it a SGB bug, or a bug in the GB code?

Pokemon being such a high-profile title, having a bug this obvious seems unlikely. I'm using two Everdrives, one old GB and one new X7, happens on both. I suppose it could be an everdrive issue too, but none of the online mentions say they used a flashcart.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Super Gameboy palette glitches

Post by tepples »

You underestimate how many bugs can ship in "such a high-profile title," and I'm not just talking about Butterfree, Beedrill, and Paras Hilton. Luigi would love Game Freak's code in Pokémon Red and Blue because it's "lotsa spaghetti." It's a miracle that the games work at all.

I'll pass on the question to a Discord server I'm in. But they'll probably need help to reproduce it. What were you doing right before it glitched? What language version of the game?
calima
Posts: 1745
Joined: Tue Oct 06, 2015 10:16 am

Re: Super Gameboy palette glitches

Post by calima »

Regular USA versions, and it doesn't have any particular trigger. If you play for an hour, you will see it. It happens most often in battles naturally, since that's when most of the palette changes happen.
Shonumi
Posts: 342
Joined: Sun Jan 26, 2014 9:31 am

Re: Super Gameboy palette glitches

Post by Shonumi »

calima wrote: Pokemon being such a high-profile title, having a bug this obvious seems unlikely.
I'll echo what tepples said. Off the top of my head, I name Pokemon R/B among one of the most glitchy games on the Game Boy. Stuff like Missing No., the nugget bridge Mew trick, or even being able reprogram the game through TAS and arbitrary code execution are just the surface. I took a look at some of the glitches out there for Gen 1 Pokemon, and I honestly get the impression these games are at some points held together by rubber-band and glue. SGB palette glitches are, in that light, definitely probable.

One could argue that the SGB palettes glitches aren't as technical or difficult for ordinary users to trigger, compared to some of the other glitches (which to the uninitiated look like magic, given some of the bizarre requirements and conditions). In theory, Game Freak should have fixed any issues like that, since they would be fairly obvious in testing. But considering the entire codebase of the game, I can easily see a palette glitch slipping by.

FWIW, you can poke around the source code. It's been thoroughly disassembled, and anyone can see it all firsthand.
User avatar
koitsu
Posts: 4201
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: Super Gameboy palette glitches

Post by koitsu »

Two words: deadlines and priorities.

Other than quality-of-life being better, does the "quality" of the code really matter? Before answering, sit back in your chair and ponder. A developer/company, releasing a game whose goal is to be functional and as bug-minimal as reasonably possible before shipping date, is not going to hem-haw over "quality of code" because the buyers aren't going to be looking at it (and even if they were, would the average player even understand it? Think about how much time/effort goes into reverse engineering efforts). What matters is that its functional. During testing and quality assurance, what gets prioritised highest are game-crashing or game-crashing bugs; quality-of-life bugs are usually last, assuming it isn't super severe. "Glitchy palettes" would classify as minor.

All sorts of counterarguments can be made here, but they really don't matter: the limitations (see: deadlines) trump everything.

Established companies over time tend to spend a little bit of effort (and I do mean little) trying to "clean up" code and turn things into a kind of general-purpose engine for re-use. This has obvious advantages, mainly being that they can churn out the next game easier, and with fewer overall tweaks to the innards. Management often understands the importance of that, but again, the limitation reality often ends up winning. As such, the engine developers tend to do this type of work on their own, working longer hours (on top of already long hours!), in hopes that the pain/effort pays off the next time the code/engine is used. Meanwhile, the deadline gets closer and closer every day -- assuming it isn't being pushed forward (i.e. sooner release).

This applies just as much to new games on newer systems/platforms as it does old ones. Nothing has really changed in this regard in the past 30 years.

This is all compounded by situational details, too. For example, the code in Final Fantasy is supposedly pretty terrible despite the programmer being pretty skilled. Reason? Deadlines compounded with the fact that Square expected it to be the last/final game they could release before going under/closing up shop. It just so happened that it turned out to be a hit. Square got lucky.

On the flip side... there's a semi-recent-ish article about how one major-ish game developer/company actually used a bug in their own code to patch their own software in the future. I can't remember the details, and my Google-fu is terrible; I could also be remembering the circumstances incorrectly, but the overall premise was what I've said.

I've mentioned this before in another thread some time ago I'm pretty sure, but: we (as players of game) didn't care about "glitchy crap" like that back in the day. Really. "Flickering pixel" on Contra's title screen? Wonky corrupted crap showing up at the top of Crystalis' status bar? Scrolling in Zelda once in a blue moon glitching out but fixing itself? Corrupted graphics appearing during transitional screens in Trojan? We didn't care because were too busy enjoying the game. I think, for whatever reason, nowadays people hem and haw and spend literally days/weeks on this type of thing, to the point where it almost becomes an obsession. I'd rather not speculate as to why.
Rahsennor
Posts: 479
Joined: Thu Aug 20, 2015 3:09 am

Re: Super Gameboy palette glitches

Post by Rahsennor »

koitsu wrote:On the flip side... there's a semi-recent-ish article about how one major-ish game developer/company actually used a bug in their own code to patch their own software in the future. I can't remember the details, and my Google-fu is terrible; I could also be remembering the circumstances incorrectly, but the overall premise was what I've said.
It's not exactly "recent", and so probably not the one you're thinking of, but the developers of Ratchet and Clank: Up Your Arsenal did exactly what you describe. Article on Gamasutra, bottom of the page (warning: site has five metric fucktons of ads and doesn't display at all without scripts).
User avatar
koitsu
Posts: 4201
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: Super Gameboy palette glitches

Post by koitsu »

@Rahsennor -- Bingo! That's the exact one I was thinking of. Someone put it into a gist to avoid all the ads/trash. Thank you for effectively reading my mind!
Post Reply