The gold standard of optimization: A look under the hood of RollerCoaster Tycoon
111–120 of 186 posts
Re: The gold standard of optimization: A look under the hood of RollerCoaster Tycoon
#112Reminds me of blood moons in Zelda https://www.polygon.com/legend-zelda-tears-kingdom/23834440/...
Re: The gold standard of optimization: A look under the hood of RollerCoaster Tycoon
#113It does make you wonder if the future of AI-assisted development will look more like the early days of coding, where one single mind can build and deliver a whole piece of software from beginning to end.
Re: The gold standard of optimization: A look under the hood of RollerCoaster Tycoon
#114Warcraft 1 (1994), Warcraft 2 (1995), and StarCraft (1998) all use power-of-2 aligned map sizes (64 blocks, 128 blocks, and 256 blocks) so the shift-factor could be pre-computed to avoid division/multiplication, which was dang slow on those old 386/486 computers. Each map block was 2x2 cells, and each cell, 8x8 pixels. Made rendering background cells and fog-of-war overlays very straightforward assembly language. All…
Re: The gold standard of optimization: A look under the hood of RollerCoaster Tycoon
#115> it turns an optimization done out of technical necessity into a gameplay feature And this folks is why an optimizing compiler can never beat sufficient quantities of human optimization. The human can decide when the abstraction layers should be deliberately broken for performance reasons. A compiler cannot do that.
Re: The gold standard of optimization: A look under the hood of RollerCoaster Tycoon
#116> Imagine a programmer asking a game designer if they could change their formula to use an 8 instead of a 9.5 because it is a number that the CPU prefers to calculate with. There is a very good argument to be made that a game designer should never have to worry about the runtime performance characteristics of binary arithmetic in their life, that’s a fate reserved for programmers Numeric characteristics are absolutel…
I remember the older driving games. They'd progressively "build" the road as you progressed on it. Curves in the road were drawn as straight line segments. Which wasn't a problem, but it clearly showed how the programmers improvised to make it perform.
Re: The gold standard of optimization: A look under the hood of RollerCoaster Tycoon
#117What language is this article talking where compilers don't optimize multiplication and division by powers of two? Even for division of signed integers, current compilers emit inline code that handles positive and negative values separately, still avoiding the division instruction (unless when optimizing for size, of course).
Re: The gold standard of optimization: A look under the hood of RollerCoaster Tycoon
#118Warcraft 1 (1994), Warcraft 2 (1995), and StarCraft (1998) all use power-of-2 aligned map sizes (64 blocks, 128 blocks, and 256 blocks) so the shift-factor could be pre-computed to avoid division/multiplication, which was dang slow on those old 386/486 computers. Each map block was 2x2 cells, and each cell, 8x8 pixels. Made rendering background cells and fog-of-war overlays very straightforward assembly language. All…
It's a shame that when a Redditor discovered the source code for the original StarCraft "gold master" on a CD, they sent it back to Blizzard in exchange for some fucking blizzard merch [1] EA a while back released the source code to (most) of the old Command & Conquer games [2] though interestingly left out Tiberian Sun and Red Alert 2, StarCraft's closest competitors at the time. Would've been nice for historical pr…
The StarCraft source code is something that must be kept behind closed walls, under tight control by Blizzard, even though the original people working on the game at Blizzard have already left and there is nothing to protect here other than eternal shame.
Re: The gold standard of optimization: A look under the hood of RollerCoaster Tycoon
#119Earlier quoted context omitted.
The 4 bit stuff is a hangover from Mojang having to squeeze every bit of perf from their Java based engine that they could. Their original sound engine was so sketchy that C418's (music composer) minimalist sound is partly because it really couldn't handle much more than what got released. MS has been loosening up on the 4 bits limit and have created a CPP variant of Minecraft which performs better, but they've also…
Hey, this isn't entirely accurate! The 4-bit stuff is a hangover from Notch doing this (I'd maybe even say a similar-calibre programmer to Chris Sawyer...). The sound has nothing to do with technical limits, that's a post-facto rationalisation. The game never played midi samples, it was always playing "real" audio. The style was an artistic choice, many similar retro-looking games were using chiptune and the sorts. I…
Re: The gold standard of optimization: A look under the hood of RollerCoaster Tycoon
#120Earlier quoted context omitted.
> Integer tricks and optimizations are pointless. They’re not pointless; they’re just not the first thing to optimize. It’s like worrying about cache locality when you have an inherently O(n^2) algorithm and could have a O(n log n) or O(n) one. Fix the biggest problem first. Once your data layout is good and your cpu isn’t taking a 200 cycle lunch break to chase pointers, then you worry about cycle count and keeping…
> And if you’re doing SIMD, your integer SIMD instructions can be 2 or 4x higher throughput than float32 if you can use int16 / int8 data. Your float instructions can also be 2x the throughput if you use f16. With no need to go for specific divisors. For values that even can pack into 8 bits, you rarely have a way to process enough at once to actually get more throughput than with wider numbers. I'm sure there's a pr…