Earlier quoted context omitted.
> You look at the assembly code, grab an Intel Programmer Reference manual (they were about 1000 pages), look up each instruction opcode and that would tell you the clock cycles. Wouldn't this "just" tell you how many "cycles of code" there are, and not how many cycles actually run? Branches etc. will of course cause some cycles to be double-counted and others to be skipped, in the dynamic view.
Then you just calculate them all. If Branch A is taken ... total X clock-cycles. If Branch B is taken ... total X clock-cycles. If Branch C is taken ... total X clock-cycles. And so on. And then make sure that the "longest" branch fits into the clock-cycle budget.
Ask HN: How were video games from the 90s so efficient?
151–160 of 238 posts
Re: Ask HN: How were video games from the 90s so efficient?
#152The source code for Doom is available, and much has been written about how it works.[1] Go look. [1] https://doomwiki.org/wiki/Doom_source_code
For Doom, I’ve heard this book is highly recommended: https://fabiensanglard.net/gebbdoom/
https://fabiensanglard.net/gebbdoom/
He also wrote one for Wolfenstein which is good as well.
Re: Ask HN: How were video games from the 90s so efficient?
#153Hard disagree with many comments here. For ennemies AI, ok: we made progress. But for human-vs-human gameplays, we basically had everything in the nineties. Warcraft II over Kali (to simulate a LAN over the Internet for Warcraft II didn't have battle.net) was basically the gameplay of Warcraft III reforged. Half-Life and then it's counterstrike mod were basically the FPS of today. Diablo II (development for Windows 1…
Re: Ask HN: How were video games from the 90s so efficient?
#154Most of games these days weight so much due to high-res assets. 4K textures weight a lot that's why game with single map like COD: Warzone takes 200GB -.-
As we move more into realistic graphic I think this trend will reverse as this can be simulated with ML at real-time already. So you will get away with custom-ML-compressor and low poly assets that will be extrapolated at run time.
Re: Ask HN: How were video games from the 90s so efficient?
#155https://www.quora.com/Why-was-Roller-Coaster-Tycoon-written-... Funny you should mention Rollercoaster Tycoon because it was actually written in Assembly for performance reasons.
For a rube like me who views assembly coders as masters of occult incantations, this is incredibly impressive
Re: Ask HN: How were video games from the 90s so efficient?
#156Re: Ask HN: How were video games from the 90s so efficient?
#157Some games nowadays are built using Electron, which means they include a full web browser which will then run the game logic in JavaScript. That alone can cause +1000% CPU usage.
Unity (e.g. RimWorld) wastes quite a lot of CPU cycles on things that you'll probably never use or need, but since it's a one-size-fits-all solution, they need to include everything.
For Unreal Engine, advanced studios will actually configure compile-time flags to remove features that they don't need, and it's C++ and in general well designed, so that one can become quite efficient if you use it correctly.
And then there's script marketplaces. They will save you a lot of time getting your game ready for release quickly, but they are usually coded by motivated amateurs and super inefficient. But if CPUs are generally fast enough and the budgets for game developers are generally low, many people will trade lower release performance for a faster time to market.
=> Modern games are slow because it's cheaper and more convenient that way.
But there still are tech demos where people push efficiency to the limit. pouet.net comes to mind. And of course the UE5 demo which runs on an AMD GPU and a 8-core AMD CPU:
Re: Ask HN: How were video games from the 90s so efficient?
#158Re: Ask HN: How were video games from the 90s so efficient?
#159I built games in the 90s. Graphics was obviously the hardest part. We thought about things in terms of how many instructions per pixel per frame we could afford to spend. Before the 90s it was hard to even update all pixels on a 320x200x8bit (i.e. mode 13h) display at 30 fps. So you had to do stuff like only redraw the part of the screen that moved. The led to games like donkey kong where there was a static world and…
I dabbled with graphics using mode 13h and later with VGA. It was orders of magnitude simpler than using Vulkan or DX12. CPUs were simpler DOS and Windows 95 were very simple compared to Windows 10. That means that writing optimized C or even assembler routines was pretty easy. If we go 10 years back in time, programming Z80 or MOS Technology 6510 or Motorola 68k was even simpler.
I think the most innovative timespan was between 1950–1997'ish, and hope we get back to get the most out of hardware again as common sense.
Re: Ask HN: How were video games from the 90s so efficient?
#160I built games in the 90s. Graphics was obviously the hardest part. We thought about things in terms of how many instructions per pixel per frame we could afford to spend. Before the 90s it was hard to even update all pixels on a 320x200x8bit (i.e. mode 13h) display at 30 fps. So you had to do stuff like only redraw the part of the screen that moved. The led to games like donkey kong where there was a static world and…
Some interesting related stuff in this talk: HandmadeCon 2016 - History of Software Texture Mapping in Games https://www.youtube.com/watch?v=xn76r0JxqNM I think they say at one point it went from 14 to 8 instructions, and then the Duke Nukem guy (Ken Silverman) got it down to around 4. Quake would do something where it only issued a divide every 8 pixels or something, and then only interpolate when inbetween and the…
Does anyone know of a book like it? I'm very interested in getting started with software rendering from the ground up, mainly to scratch an intellectual itch of mine. I learn better from well-curated books than online material in general.