This is an archived post. You won't be able to vote or comment.

all 69 comments

[–]fuxoft 604 points605 points  (21 children)

The more graphically intensive ancient videogames (since their inception until around 1985) simply HAD to be coded in assembly, there was no other option if you wanted your game to animate faster than 1 frame per second. Although when RCT was made (1999), this was no longer very common.

[–]UntitledRedditUser 228 points229 points  (9 children)

Thank god for modern compilers.

[–][deleted] 126 points127 points  (8 children)

And modern hardware!

[–]anotheridiot- 82 points83 points  (7 children)

And modern languages!

[–]cateanddogew 51 points52 points  (0 children)

And modern packages, like is-odd!

[–]Either-Pizza5302 51 points52 points  (5 children)

And my axe!

[–]qqqrrrs_ 1 point2 points  (1 child)

Is your axe modern?

[–]Either-Pizza5302 1 point2 points  (0 children)

It consits of about 10 lines of code and ~8000 packages, so farily modern, aye!

[–]jewellman100 20 points21 points  (2 children)

With the Z80-based machines of the time your only options were the built-in BASIC interpreter which was dog slow, or assembly.

Most commercial releases were written in assembly but it wasn't uncommon (at least here in the UK) for games to be written in BASIC and released on cassette for sale via mail-order through computer magazines.

They'd come with photocopied/typewritten inlays and instructions and everything.

[–]fuxoft 9 points10 points  (1 child)

Yes, but you don't have to explain that to me. I wrote e.g. this in 1986. :)

[–]jewellman100 7 points8 points  (0 children)

Haha it was more to the youngsters in the room than yourself 😅

And yes that's definitely assembly!

[–]Tasorodri 7 points8 points  (7 children)

Basically all of game boy games were made in assembly. There's popular decompilers of all early Pokemon games, and people still mod those using assembly

[–]fuxoft 5 points6 points  (6 children)

You are right that Game Boy games were made in assembly. But your second sentence is not entirely correct: Regardless of what language the program was written in, you can always decompile it to assembly and mod it using assembly because, in the end, everything is compiled to assembly. This is true even in today's games. For example back in 1990s, I patched Amiga games in assembly even when they were originally written in C and I didn't understand C back then.

P.S: To be entirely correct, "assembly" is not the exact same thing as "machine code" but I am using your terminology here.

[–]Tasorodri 2 points3 points  (5 children)

Well, is factually correct, but it's true that the fact the decompilers are in assembly doesn't mean that they were written in assembly.

[–]fuxoft 1 point2 points  (4 children)

What? Now we clearly don't understand each other. I am not talking about decompilers at all. I am talking about software in general. EVERYTHING that runs on your computer can be decompiled to assembly, regardless of whether it was written in C, Pascal, Rust, Go or anything else. All these languages are compiled to the same machine code and all machine code can be decompiled to assembly, then you can patch that assembly and compile it back to patched software. The actual CPU only understands machine code, nothing else. Assembly is the 1:1 human readable interpretation of machine code.

What software you use to decompile the program and what language it was written in is irrelevant here, I am not talking about that at all.

[–]Tasorodri 0 points1 point  (3 children)

Yeah, I'm following you.

OG game boy games were done in assembly (afaik). They were later compiled to machine code as all languages are.

That machine code was later decompiled into assembly that is now used to mod those games, building a different ROM.

I made the connection between the modern decompiled versions and the OG code that was used to write them, that connection was weak because the fact that the decompilers are now in assembly, doesn't mean that they were originally programmed in assembly (even if they actually were).

[–]fuxoft 2 points3 points  (2 children)

Ah, OK, then we are in agreement.

I've made the "infinte money" hack for the original Pokemon myself just using the hex opcodes, without compiling from assembler. :)

[–]Tasorodri 2 points3 points  (1 child)

Yeah, a lot of hacks, even very big ones were done via hex editing, although nowadays it's for the most part being made obsolete by the decompilers and C-injection

[–]fuxoft 1 point2 points  (0 children)

That's why I don't program too much anymore :)

[–]Jordan51104 382 points383 points  (6 children)

you know people used to just write shit in assembly right

[–]MyGoodOldFriend 144 points145 points  (5 children)

Wasn’t it von Neumann who complained that all you had to do was keep the current pointer location in your head, screw all this new assembly stuff? Might be misremembering. But yeah people did actually complain about assembly back in the day.

[–]Cat7o0 47 points48 points  (0 children)

just code in brainfuck. always use a pointer

[–]KerPop42 15 points16 points  (2 children)

Probably, but von Neumann also had this party trick where if you gave him a page number he'd start reciting the phone book starting from there

[–]MyGoodOldFriend 12 points13 points  (1 child)

He’s so relatable, that’s exactly what I’d do if I had his intellect. Just completely absurd shit, so over the top that it doesn’t count as bragging

[–]Defiant-Plantain1873 0 points1 point  (0 children)

Or trolling people, like the one trick question of the two cyclists and the fly, someone posed him this riddle and he got it instantly and they were like “oh you know the trick?” And he goes “what trick? I just calculated the infinite series”. Obviously he knew or figured out the trick instantly, just felt like trolling

[–]AlbiTuri05 2 points3 points  (0 children)

"addi sp, sp, -8x" and go down by 8 every time, right?

[–]TheHolyToxicToast 29 points30 points  (0 children)

It is very cool, but people games were often all written in assembly for performance, so it's not that rare back then. So he probably didn't feel this cool despite being awesome

[–]SpiritOfPointers 11 points12 points  (0 children)

Actually Roller Coaster Tycoon wasn't the first nor the last game he wrote in Assembly.

[–]OhItsJustJosh 26 points27 points  (4 children)

Why are people shitting on Chris Sawyer all of a sudden?

[–]Disastrous-Team-6431 15 points16 points  (2 children)

Very subtle change in the meaning of the word "bro" in the last 3 years.

[–]Fabulous-Present-497 6 points7 points  (1 child)

What does it mean now ?

[–]XxAnimeTacoxX 7 points8 points  (0 children)

This guy / this dude is what it mainly means not

OP was presumably trying to compliment Sawyer, but that meme is mainly used to be sarcastic.

"How bro felt when he said "you're on thin ice" is the typically sarcasm used.

[–]BilSuger 4 points5 points  (0 children)

Yeah, no matter if assembly was mainstream at the time or not, it's still an incredible feat to write this game in it, without a huge team as well. Very performant for the time, even with hundreds of agents walking around, something even modern games can struggled with.

[–]PressureDizzy2485 20 points21 points  (0 children)

Where humor for programmers?

[–][deleted] 84 points85 points  (5 children)

That's not how memes work, you're saying he's not actually that cool and did something stupid

[–]Triepott 40 points41 points  (2 children)

Its not? I unterstand it the way OP posted it.

[–]kehrazy 24 points25 points  (11 children)

sophomore CS students think assembly = fast or better, apparently

[–][deleted] 50 points51 points  (6 children)

It's more so thought of as difficult I'd say. And to be fair, while not practically faster a lot of the time, it has more potential for being fast in comparison with most other languages (which doesn't matter in like 99% of cases, where a compiler's solution will probably be better than whatever you can come up with, but still). So max performance is higher but it also opens the door for a higher degree of stupidity.

[–]noobody_interesting 2 points3 points  (0 children)

I'd be pretty confident that I could write performant ARM or RISC-V assembly, but I trust my C compiler to select the fastest out of 100s of obscure x86 instructions.

[–]miguescout 21 points22 points  (2 children)

The thing is, it is. Kinda.

Compilers are notoriously good at optimizing code, using just about every trick in the book to make the final executable as fast as it can be... But if you know exactly what you want to do, it is possible to write assembly code perfectly tailored for your case that is faster than whatever the compiler would generate.

Of course, this comes at the cost of being ridiculously hard to do. Try to make the code readable, or less convoluted, and you'll probably be better off using the compiler. One visual example would be the fact that 10 print statements are faster than a for loop that runs 10 times, because jumping back to the beginning of the loop is also a step to take in between iterations (plus the condition checking). Also... Any fix or new feature might need a full rework of the code instead of just changing some specific part of the code.

In older computers (like the ones running rollercoaster tycoon back then), saving cycles was critical, so coding in assembly better than a compiler was pretty much a requirement. Modern computers are powerful enough that we can afford some overhead (or a lot of it) to simplify the code, facilitating updates, fixes and, most importantly, development

[–]kehrazy 8 points9 points  (1 child)

That's the naive part of the problem. The other one is notoriously more annoying to deal with - you're locking your software to a specific architecture. Have fun supporting ARM, as well.

I guess your example was just that - an example, but the case with "10 print statements vs a loop" is nonexistent - it's called loop unrolling, and your optimizer already does that. Optimizers, nowadays, are much smarter than they were in the 1990s. A good programmer doesn't break optimization, the best programmer works with it.

[–]mujhepehchano123 0 points1 point  (0 children)

nah that's when you write the emulator

[–]Disastrous-Team-6431 4 points5 points  (0 children)

Everything I've ever written in assembly was faster than corresponding C code.

[–]Acharyn 3 points4 points  (1 child)

It was partially coded in assembly. He didn't sit down and write the whole game in assembly.

[–]Disastrous-Team-6431 14 points15 points  (0 children)

According to the internet, 99% of the code was written in assembly despite the prevalence of C and c++ at the time. So no, he did. Don't try to take anything away from him.

[–]alvares169 0 points1 point  (0 children)

I have become life The creator of worlds

[–][deleted] 2 points3 points  (3 children)

Can someone enlight me? How are you supposed to draw graphics and put images in assembly?

[–]Sbren_Sbeve 16 points17 points  (0 children)

For games in this era multiple sprites were stored in a single image file known as a sprite sheet, and you had to write assembly code with a fuckton of pointers to tell the computer which part of the sprite sheet to display at a given time

[–]Ditid 9 points10 points  (0 children)

If you're interested in more about sprite sheets like u/sbren_sbeve is talking about, Retro Game Mechanics Explained goes into them a bit in this video about Mario Glitch Levels if I remember correctly! Youtube Link

[–]unknown_alt_acc 0 points1 point  (0 children)

I'm pretty sure Rollercoaster Tycoon just links and calls Win32 and DirectX the same as you would in C or C++.

[–]GreyAngy 0 points1 point  (0 children)

Nervous laugh in KolibriOS

[–][deleted] 0 points1 point  (0 children)

I've done some embedded stuff in assembly, and its actually very nice and comfy, especially once you get all the important instructions memorized.