250 points · by isaacfrond · 3y ago · 76 comments
If you just mean how can it be so high in general? Old, well optimized, games run really well on faster modern hardware. I remember getting over 1,000 fps in Guild Wars 1 on a GTX 1060 when looking at an area with no monsters/NPCs.
edit( this paragraph doesn't apply here) ~~The PS1 also doesn't have floating point math, mostly everything is done in fixed point with integer math which is obscenely fast compared to floating point (it could also simulate an FPU if the precision is absolutely necessary but that's not suitable for realtime)~~
Just read further down the article that they converted it to float. I guess the game is just super optimized. I would have thought fixed point savings factored in here.
ah gotcha, thanks. The bandwidth would have to be terabytes/sec. Come to think of it, pretty dumb of me to think they did.
Plenty (maybe nearly all?) of games do this because modern engines decouple the engine speed from the display speed. In older systems where you knew the engine was only going to run for a specific game on specific hardware (e.g. a SNES or GameCube or PlayStation), and you knew you were always going to be targeting 30fps, no more no less, you could pretty safely assume the game would _always_ run at 30fps and could use a "frame" as a unit of time. So if you want some in-game action like a melee attack to take 1 second, you could just count 30 frames and you would know it was 1 second long. But if somehow this game was later run at 60fps, that same attack would now only take .5 seconds, since there were twice as many frames in a second now.
So if you took a game like this meant for 30fps and ran it at 60, everything would just run twice as fast. You wouldn't actually be able to play the original game at anything higher than the original frame rate.
What they're saying here is that they decoupled the two, where originally they were coupled. So now the game can run at high fps and feel smoother than the original lower fps rate, but the gameplay is still at the original intended speed.
There was a patch at some point to fix this, but honestly just easier to load the game up in a PSX emulator these days.
> He takes the code from 40,699 lines to 7,731 and notably loved an excuse to work in C. “I had an absolute blast cleaning up this mess!”
I't just marvelous to learn what kind of crap coding makes it to production. It's a huge boost to my self-esteem.
When code is fresh in your mind, there's more tolerance for how disorganised the code can be and still be easy to change.
If your shipping method is "one shot".. time spent cleaning it has a chance to provide value; but time spent adding features is very likely adds value. -- Probably if the code is very clean, then at least some time would have been better spent adding features.
I don't want to push for lax testing standards. And I generally prefer modern build practices for programming. It is hard to take a lot of criticism of gaming code seriously, though, as games were shipped at what feels like a higher success throughput than most business software.
"Good" and modern code often has many abstractions. In some cases, that gives ultimate flexibility, but in some cases, if you are fighting the abstraction or the framework, it will make it almost impossible to change.
The great debate is always "will I want to change this tiny thing here without impacting everything else?" vs DRY. Studio cultures differ, but I would say at least half resort to hard coding things like positions of every item manually given the excuse they might want to shift something by a bit later (in a hurry, crunching etc.) without side effects.
Thankfully the emergence of more standard tooling and engines has pushed this to being more of an art resource concern, but it does lead to things like being told that taking a game that assumes a 16:9 1080P display and making it more flexible will take multiple years of person time.
Personally I cannot stand this tendency, but do get why they do it.
Stuff like "this single player game we've been working on for 2 years now has to be a multiplayer game". That was a fun one.
In other industries I've been able to reasonably strategize for various changes but in games the change can be so profound and out of left field it's pretty much impossible to anticipate the change and plan for it.
Truer words were never spoken.
For example, the Playstation 1 had a MIPS R3000 CPU, and a single instruction pipeline, so it's basically doing only doing 1 thing at a time. Multithreading doesn't exist. Our only parallel processing was that we could do all the game logic + all the math to transform all the triangles into screen space, and simultaneously the GPU would be drawing the last frame we drew. We had 4MB of memory total, so when we were were working on games then, we would have actual discussions about whether it was worth the overhead of including a malloc/free, or just hard-coding all your memory addresses because of the space you'd save. We would compile out our abstracted, "nice" versions of functions, count the instructions, and compare sizes to see where we could optimize the code to reduce the compiled output size. In return, we might be able to draw an extra triangle or two.
The instruction and datacache were tiny, and loaded based on address, so sometimes we would add code or instructions that didn't do anything just to make a loop not cross a cache boundary.
So we were working on under strict time pressure, with unknown hardware and badly translated japanese print manuals (and sometimes not even translated), in small teams without any real ability to communicate with anyone else in the industry about it (since we are all under NDA).
I'm not saying that we didn't write bad code, we did write plenty of it, but a number of the decisions on HOW to write the code itself that we were considering then aren't even visible to people reading the code now and making judgements on it. I knew I was writing spaghetti code some of the time, because I didn't have the memory budget to load it as data. Is there a cleaner way to do their UX and in a data-driven fashion? Sure. But for me to get that data, I would have to write a function to load a/multiple blocks of data from a 1x CD that a super low transfer rate, and an appallingly long seek times. Making a data-driven UI is possible, but not practical when someone hits the start button, they want the menu to come up immediately.
In many cases, we knew that we were writing bad code, but didn't have the capacity to write anything better. It literally didn't fit our budget for memory or CPU. Then you have to make decisions about where you CAN afford an abstraction, and those decisions can be quite painful.
I haven't violently disagreed with anyone in any of these threads, but did want to offer a bit of my first hand perspective on things that are often overlooked.
When you have more resources, you can write things prettier, not rely on side-effects, not 'abuse' features to do things normally considered BadTM, not "cross the streams". Or perhaps I should say when you fit easily within available resources, you have luxuries.
Don't feel bad about what you built, when you're aware of the constraints you were under and that the tradeoffs you were making were the best available choices at the time.
Then you go to the next function, and realize it doesn't even need the previous function at all, so you get mad at yourself and delete all that wonderful code you just wrote.
Then you try a new way: instead of inside out (start at the internal functions) you start at the top - you find where the code handles some particular task, and you drill down deep into it, throwing away useless code left and right and rewrite the thing better. (Your advantage being you know exactly what it needs to do, unlike your previous self who did not know that since he was still developing it.)
You also use a tool that finds dead code - in particular functions that are never called by anything.
1. Is proficient in C.
2. Understands Playstation architecture and development better than the original programmers of the game. (Although Psygnosis had far less time and hindsight on their side.)
3. Is apparently quite familiar with 3D game programming and techniques in general, and how/when to use them.
4. Already had experience reverse-engineering parts of the game previously.
5. Had the free time to undertake a project of this scale.
So it's not something any random dev can just snap their fingers and decide to do. It's a case study on the intersection of experience, preparation, and luck.
So many people I work with these days are constantly looking for tricks, or secrets, magic tools, or whatever they seem to think I'm doing to consistently outpace them, just to avoid writing code (/ reading code / thinking through code). They take 2-10x longer and their result is invariably worse. When you ask why they do it, they answer "you'd have to do so much refactoring", "the algorithm would be hard to implement", "I'd have to replace dependency X", and so on as a list of things that actually aren't so hard or time-consuming if you sit down and just do the work. But my only "trick" is that I write the code.
Just sit down and do it! I'm reminded of Harlan Ellison, commenting on why he wrote in public,
I do it because I think particularly in this country people are so distanced from literature, the way it’s taught in schools, that they think that people who write are magicians on a mountaintop somewhere. And I think that’s one of the reasons why there’s so much illiteracy in this country. So by doing it in public, I show people it’s a job.
Wipeout was asses in chairs writing code. This cleanup is an ass in a chair writing code. Yes soft skills are important blah blah. But if you want to be good, to learn to do this stuff, there's no way around putting your ass in the chair and writing code.
Solidly agree, copyright / IP shouldn't be about holding the public hostage. It should be about maximizing the mutual benefit for both the creator and, very importantly, the public.
Culture deserves love and respect and must be 'accessible' (able to buy); or it should be set free (public domain).
That's a pretty common pattern when you're porting to a substantially different system, from a bespoke base like a small launch title, that was never intended to run on anything else. Especially in an era before everyone used vcs tools like git with cheap branches. We used to work on diverging whole copy forks constantly.
Going through this mess and cleaning it all up must have felt incredibly satisfying because of all the low-hanging fruit. It's like a long overdue spring cleaning.
The bonking against sides, the short view distance induced by excessively-curved tracks makes it feel like the NES game RC Pro-Am, but instead of an tightly-cropped overhead view of the track, you see the next fifty feet of track ahead (at 1,000 scifimeters/sec).
The game felt brute-forceable through its brittle, unforgiving driving but it was so frustrating I never gelled with it. Was I missing anything?
"The 5000 lines of if else that handles the menu state is a striking witness to this insanity."
I can say, quite confidently, that was probably some junior developer who built the shell. It is always some junior developer that builds the shell. And it was a designer/director that didn't know what they wanted until just prior to putting the gold master in an envelope to send to the pressing house. Also the shell is completely throw away code that will never, ever be used again in any other game.
"Each time by a different set of developers that somehow had to make sense of this mess. The code still contains many of the remains of what came before. There was never any time to clean it up."
Exec Producer at publisher: "Hi, here's $25,000, can you port Wipeout from this platform to that platform? We'll give you another $10,000 if can do it by this date, and another $25,000 three years later if the port sells so many bajillion copies.
Desperate Studio Producer: "Absolutely can do that, let me find two cheap programmers to take care of that. Hey guys can you spend the next two months crunching like crazy with unpaid overtime to help me keep my boss happy and get that promotion? There will be a significant reward (a two pizza pizza party) if you can hit this release date."
The two developers then spend an inordinate amount of time trying to get the damn project to build and find some obscure missing header files, layers on more hacks and ships in the 11th hour.
And the rest is history. And nobody ever looks at the code ever again. Until the next poor programmer has to port it to a new platform.
Super Mario 64 has also had stupendous rewrites from decompiled code I believe.
His videos on the Sine function in sm64 is a fun watch as the limitations make nearly all optimizations justifiable.
https://store.steampowered.com/app/517710/Redout_Enhanced_Ed...
Note that it's VR supported not VR required. You can play this without VR just fine.