0xabad1dea,

one of these is the leaked official, original source code of Pokemon Emerald and one of these is a decompile made by hobbyists trying to reverse engineer what the game is doing

and you know I wouldn't be posting this if they were not, apparently, switched at birth.

screenshot of an absolute disaster of completely obtuse magic numbers. THIS IS THE GROUND TRUTH SOURCE CODE

Ronflaix,
@Ronflaix@mastodon.gamedev.place avatar

@0xabad1dea Honestly? The screenshot of the leak sounds kinda logic: good old magic numvers mapped to memory and size, what could go wrong?

pyrex,

@0xabad1dea

admittedly i think i would be dramatically more likely to write the original code

thorsummoner,

@0xabad1dea if One needed to write a lot of code fast the second takes hugely fewer key strokes, especially for a project that is never going to be read by another person once shipped? eh.

FrankHghTwr,
@FrankHghTwr@meow.social avatar

@0xabad1dea I guess when you've been working on "old" systems like the SNES and the Gameboy, you probably get used to using numbers instead of variable names

lispi314,
@lispi314@mastodon.top avatar

@0xabad1dea cc @ezio Magic numbers

wintery,

@0xabad1dea I feel like we'd have a lot more actual game source releases if people wouldn't cherrypick segments of code from leaks and say that this points to issues in the company nearly 20 years later...

0xabad1dea,

@wintery I uh, I don’t think one girl on mastodon saying “game freak doesn’t like to name variables lol” is why Nintendo does not release the source code of its games

and this is… not cherry picked, at all. the whole thing is like this

MrL314,
@MrL314@peoplemaking.games avatar

@0xabad1dea as someone who is intimately familiar with some specific reverse engineered vs ninty source code, yeah this happens quite a lot lmao. I don’t think I’ve seen many that were this ridiculous, but I’ve seen some pretty bad ones lol

The Yoshi’s Island source is an absolute nightmare. At least the SMK source isn’t horrible (it’s actually pretty fine in most regards) but there’s a couple things that are just disgusting.

davidr,
@davidr@hachyderm.io avatar

@0xabad1dea How did it decompile into symbols that apparently were never in the symbol table?

0xabad1dea,

@davidr when you decompile something by hand, you name things manually

wardellbagby,

@0xabad1dea Everyone knows the more magic numbers you have, the better your code! It’s right there in the name!

glairedaggers,
@glairedaggers@peoplemaking.games avatar

@0xabad1dea brought to you by the same devs who made several pokeballs & moves have literally the opposite of the stated effect in the earlier gens 👍

vaeleery,
@vaeleery@neovibe.app avatar

@0xabad1dea I think it technically leverages things that aren't guaranteed by the standard, but if my assumption of what's going on here is correct, I much prefer to see classes or structs set up for this instead of the bare pointer math with a magic number offset plus casting/dereferencing. Assigning/reading a named member is much nicer imo. All of that RE code is still leagues better than the original source tho jfc that's a nightmare, my commentary here is being picky at best I'll admit lol

cykonot,
@cykonot@mas.to avatar

@0xabad1dea maybe the devs weren't that good at English anyway? So gibberish either way

SnepperStepper,
@SnepperStepper@mastodon.social avatar

@0xabad1dea the of had charm to it. The beauty of excess. Life's a mess so why not be obtuse and verbose, y'know?

Canageek,
@Canageek@wandering.shop avatar

@0xabad1dea aaaaahhhhh

I am confused as to how memorizing magic numbers would ever be faster

0xabad1dea,

“as long as it works!” pokemon is the singly most notoriously buggy mainstream game series, it in fact does not work!

Flyingmana,
@Flyingmana@phpc.social avatar

@0xabad1dea there are a lot of hacks which have interesting stories behind them, I wonder what the story might be here.

snailerotica,

@0xabad1dea the? i dunno about that, there's some real stiff competition

StarTracker,

@0xabad1dea it’s really hard to believe that scarlet/violet and TOTK run on the same hardware

Rairii,
@Rairii@haqueers.com avatar

@0xabad1dea gen 3 of course being "asm devs' first proper C project" and it shows

seiKay,

@Rairii @0xabad1dea

A lot of the code in the decompilation was derived from the leaked source.

Speaking of which, is the gen 5, 6 code out there? or?

0xabad1dea,

@seiKay @Rairii the decomp long predates the leak and barely references it all for obvious reasons

seiKay,

@0xabad1dea @Rairii this was true until 2021

gregdavis,
@gregdavis@hachyderm.io avatar

@0xabad1dea A pattern I've noticed in a lot of code written between 2000 and 2005 (post dotcom bubble burst) is that it is intentionally obtuse. This was a job-security strategy, and one that works, sadly. Not sure if it's the case here for a game from 2004, but sure is a coincidence.

jay,
@jay@toot.zerojay.com avatar

@gregdavis @0xabad1dea It's not really a thing in video games as most games - especially back then - didn't reuse code from previous games so you wouldn't really be gaining any job security from doing so since it would all be rewritten again the next game anyways. I could imagine Pokemon itself being an exception to that, though but haven't looked at its source to say.

andwhyisit,
@andwhyisit@ohai.social avatar

@jay @gregdavis @0xabad1dea I call bullshit. I have pulled apart 3 Natsume games (Japanese Natsume, not US Natsume) for the Gameboy from 2 separate game franchises and there are clear signs of code reuse.

jay,
@jay@toot.zerojay.com avatar

@andwhyisit @gregdavis @0xabad1dea I'm not saying it didn't happen back then at all, it just wasn't a super common thing back then, especially not like today, where code reuse is a goal for cost/time savings.

0xabad1dea,

@gregdavis I doubt that's the case here as Japan is noted for having a much more "employment with a company is for life unless something goes really wrong" attitude - and also that Game Freak specifically is notorious for mountains of code written very quickly that miraculously just barely work

breadbin,
@breadbin@bitbang.social avatar

@0xabad1dea @gregdavis People generally don’t get fired because anything to do with code. The higher ups don’t know you and are just looking at some sheet. Boom. You are gone. Everyone’s expendable.

I suspect Game Freak is stuck in a rut and refuses to try any new ways of doing things. They could probably do with some new engineering leadership. <— Armchair guess mind you.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • rosin
  • osvaldo12
  • thenastyranch
  • DreamBathrooms
  • khanakhh
  • magazineikmin
  • InstantRegret
  • Youngstown
  • slotface
  • mdbf
  • love
  • kavyap
  • GTA5RPClips
  • everett
  • anitta
  • cubers
  • ethstaker
  • Durango
  • ngwrru68w68
  • tacticalgear
  • modclub
  • cisconetworking
  • Leos
  • provamag3
  • normalnudes
  • tester
  • megavids
  • JUstTest
  • All magazines