Ask HN: How were video games from the 90s so efficient?
Title says it all. I am interested in discovering how games like roller coaster tycoon, sim city 2000, warcraft II, and descent (blown away by this one) managed to be created and function on computers that had 500 MB HDD, 300 MHz CPU, and 4 MB RAM.
I'd even broaden the question and ask how did windows 95 stay so small?
Is it possible to recreate this level of efficiency on modern systems? Im curious because I'm interested in creating simulation video games. Dwarf Fortress and Rimworld eventually both suffer from the same problem: CPU death.
If I create a window with C++ and SFML, 60 MB of RAM is used (not impressive at all). If I put 3,000,000 tiles on the screen (using Vertex Arrays), 1 GB of RAM is used (admittedly, that is impressive) and I can pan all the tiles around smoothly.
What other tricks are available?
237 comments
[ 2.5 ms ] story [ 281 ms ] threadReading about the tricks that were used to make the most out of the limited resources is fascinating to me as well! We should not take our current hardware for granted!
Funny you should mention Rollercoaster Tycoon because it was actually written in Assembly for performance reasons.
I think it helps develop a very good mindset, lean and faithful to base facts.
Naughty Dog Co-founder Andy Gavin discusses various hacks that were used on the Playstation to get Crash Bandicoot to run smoothly. The fuller version is also worth watching.
For the disk, I guess they viewed the disk as merely just an extension of RAM? If the read/write speeds were sufficient for them... page files galore :)
I also remember that they used to write bytes to disk in specific orders so that they would maximize the correct bytes being read into the buffer every microsecond
A PS4 was/is effectively unchanged hardware between Nov 2013 and today, yet the late lifecycle games look great. Upon release of the hardware devs had plenty of performance to play with, then 5 years in they have honed their craft and are able to use all the tricks at their disposal to squeeze as much graphical and performance life out of a limited resource budget.
- The difference between 8 or 16 bit graphics at 320x200 30 fps and modern hdr 2k at 120 fps is orders of magnitude less data to manage.
- Software developers were not abstracted as far away from the hardware as they are today.
- Most games ran on DOS which was basically “bare metal” vs windows/multitasking/background processes..
- And you HAD to make efficient use of the compute and ram when dealing with limited resources, which honed the skills of serious game devs.
Remember how games made you pick your sound card because the OS didn't provide an API for this?
I'm sure RimWorld can be made more efficient; but it actually runs fairly well on my cheap laptop. There is, essentially, no real need. And any time spent on making the game run faster is taken away from all other development tasks (fixing bugs, adding features, etc.)
Lots of abstracting as pointers, esoteric assembly optimization, compiler hacks, fewer external frameworks, less physics simulation, etc
https://www.phatcode.net/res/224/files/html/index.html
My earliest days had the most fantastic tricks. So called game engines were useless. Now it’s the complete opposite.
I mean, it's hard to disagree when you phrase it this way, but... really? In the old days (mid-'90s) studios like id released many games per year, some of which with completely new technology.
Modern studios and indie developers (!) who "do things in a straightforward way" can be happy to release even one game per year, and that's with a lot of reuse. Forget novel technology once a year!
So maybe these tricks don't really increase time to market that much, compared to other variables that are also in play?
I'd actually like to link the YouTube channel of a person who is writing their own game engine and game at the same time: https://www.youtube.com/c/RandallThomas/videos
You can see how using Godot, Unity or Unreal (or most other engines) would have been much faster in regards to time to market.
Similar differences show up when you try to build the same project, once while using an engine and another without it, the performance can be much better if you write your own optimized code (supposing that you can do so in the first place), however the development still takes much longer, for example: https://www.youtube.com/watch?v=tInaI3pU19Y
Now, whether that matters to you or not is a different matter entirely: some care about learning a lot more about the lower level stuff, others just want to develop games and care more about the art/story/etc., while others care about selling them ASAP.
That is massively far from truth. Rendering graphics to the level modern games require is driving even current powerful hardware to its limits and it's far from "not having to deal with resource limitations".
Your post seems to be horribly condescending and not realising just how much work goes into squeezeing performance from modern GPUs and consoles.
For every Naughty Dog, Riot, Take-Two, CDPR, or Bethesda, there are thousands of garbage studios. Thus my “Broadly speaking” caveat.
[1] https://doomwiki.org/wiki/Doom_source_code
https://fabiensanglard.net/gebbdoom/
https://fabiensanglard.net/gebbdoom/
He also wrote one for Wolfenstein which is good as well.
Dwarf Fortress and Rimworld are both interesting topics on their own though, and while I'm dreadfully underfamiliar with their codebases I do love the games to death. I'd guess that if you profiled them, the heaviest slowdown would be accessing/manipulating memory with hundreds of values across thousands of instances. Both games are extremely heavy-handed in their approach to simulation, so it wouldn't surprise me if that constituted the bulk of their usage. Dwarf Fortress itself is an interesting case study though, because it's world generation can take hours. As more years pass, it takes longer to generate, which is probably a testament to how many interconnected pieces it's weaving.
I think this only been said in the context of games.
I'd wager the micro stuttering is GC?
Small bitmaps, with indexed palettes and run-length-encoding to further shrink them.
Caches were tiny, memory was slower, hard disks massively slower, and if you had to hit a CD to load data, forget about it. So packing data was important, and organizing data for cache locality, and writing algorithms to take advantage of instruction pipelining and avoid branches.
Fabian Sanglard has a great blog that goes into the nitty gritty of a lot of these techniques as used in different games.
https://fabiensanglard.net/
As part of a Kickerstarter campaign, Morphcat Games made this video explaining how they eked out a really incredible game with only 40 Kb (a lot like Super Mario Bros 2). I definitely recommend checking this out as they go over interesting compression methods and more general thought processes.
Most people seem to think programmers of yore were smarter, and generally, that's probably true -on average-. I mean, there weren't boot camps back then.
That aside though, the scene has changed. Write your super efficient perfect game, and nobody will play it. Look at Ludem Dare, and all the JSxK competitions. Those smart people still exist today.
But the landscape has changed so much, that consumers want the pretty graphics, heavy resources, social aspects. They don't care if it's 1kb or 1tb.
In short, people of yesterday were resource constrained so had to write smart hacks. People today have many more resources available, and use those. Both are using every bit of what they have available.
You're right - expectations change and most everything else is nostalgia.
Crazy how far we have come since then.
As for the notion that the tech doesn't change that quickly, that is simply false. Graphics programming is unbelievably cut throat, competitive, and advances very fast. Not only are there advances in technology, but different games also have different aesthetics that often require very niche or customized development to get just right so as to avoid your game feeling generic.
Graphics APIs and hardware change almost every other year and the major titles have to adapt to the latest features. You can certainly make good games without focusing on graphics, plenty of good indie games or games that don't focus on graphics, but if you are a graphics programmer and your game does focus on that, you are constantly having to keep up with advances in technology.
Sigh. The search for a field where you can learn some stuff once and coast continues....