this post was submitted on 17 Oct 2024
1381 points (98.9% liked)

RetroGaming

19794 readers
130 users here now

Vintage gaming community.

Rules:

  1. Be kind.
  2. No spam or soliciting for money.
  3. No racism or other bigotry allowed.
  4. Obviously nothing illegal.

If you see these please report them.

founded 2 years ago
MODERATORS
 
top 50 comments
sorted by: hot top controversial new old
[–] [email protected] 179 points 2 months ago (1 children)

To be fair, assembly lines of code are fairly short.

/ducks

[–] [email protected] 43 points 2 months ago (2 children)

Back in the day we wrote everything in asm

[–] [email protected] 52 points 2 months ago (1 children)

Writing in ASM is not too bad provided that there's no operating system getting in the way. If you're on some old 8-bit microcomputer where you're free to read directly from the input buffers and write directly to the screen framebuffer, or if you're doing embedded where it's all memory-mapped IO anyway, then great. Very easy, makes a lot of sense. For games, that era basically ended with DOS, and VGA-compatible cards that you could just write bits to and have them appear on screen.

Now, you have to display things on the screen by telling the graphics driver to do it, and so a lot of your assembly is just going to be arranging all of your data according to your platform's C calling convention and then making syscalls, plus other tedious-but-essential requirements like making sure the stack is aligned whenever you make a jump. You might as well write macros to do that since you'll be doing it a lot, and if you've written macros to do it then you might as well be using C instead, since most of C's keywords and syntax map very closely to the ASM that would be generated by macros.

A shame - you do learn a lot by having to tell the computer exactly what you want it to do - but I couldn't recommend it for any non-trivial task any more. Maybe a wee bit of assembly here-and-there when you've some very specific data alignment or timing-sensitive requirement.

[–] [email protected] 20 points 2 months ago

I like ASM because it can be delightfully simple, but it’s just not very productive especially in light of today’s tooling. In practice, I use it only when nothing else will do, such as for operating system task schedulers or hardware control. It’s nice to have the opportunity every once in a while to work on an embedded system with no OS but not something I get the chance to do very often.

On one large ASM project I worked (an RTOS) it’s exactly as you described. You end up developing your own version of everything a C compiler could have done for you for free.

load more comments (1 replies)
[–] [email protected] 169 points 2 months ago (4 children)

Roller coaster Tycoon is one of a lifetime game.

Now everything is electron or react shit. Gone are the times of downloading fully featured software under 10mb.

[–] [email protected] 66 points 2 months ago (12 children)

Fun quote from an interview with Chris Sawyer:

Latterly the machine code came back to haunt us when the decision was made to re-launch the original game on mobile platforms as RollerCoaster Tycoon Classic a few years ago, and it took several years and a small team of programmers to re-write the entire game in C++. It actually took a lot longer to re-write the game in C++ than it took me to write the original machine code version 20 years earlier.

[–] [email protected] 16 points 2 months ago (5 children)

Further proof C++ is a pita

[–] [email protected] 16 points 2 months ago

It's probably not because it's sucks. It's because they're trying to perfectly replicate an existing target. They have to read the assembly, digest it, then create the identical solution in C++. If they were just creating a new game, it likely would be much faster.

load more comments (4 replies)
load more comments (11 replies)
[–] [email protected] 31 points 2 months ago* (last edited 2 months ago) (22 children)

I don't think old=good is a good mentality though, lot of people seem to have it

All the old software I know and use is exceptionally good, however I've heard about and chosen to use it because it's survived the test of time (also because it's still actively maintained and has had thousands of bug fixes over the years)

Vscode and obsidian are pretty good and they're electron, discord's alright, pretty sure steam uses some kind of web wrapper as well.

Real issue is electron is very accessible to inexperienced developers and easy to do badly, but I imagine people back in the old Unix days got an equal amount of shit bloated software

[–] [email protected] 20 points 2 months ago (2 children)

Survivor bias is a thing and part of the reason people are nostalgic for old media.

load more comments (2 replies)
load more comments (21 replies)
[–] [email protected] 26 points 2 months ago (1 children)

But the modern OpenRCT, written in an actual language, is better in every way.

[–] otp 43 points 2 months ago (1 children)

Probably not as optimized though.

RCT could run on a toaster from the 90's (ok, maybe early 2000's) and looked amazing for the time.

OpenRCT can run on a toaster from the 2010's and looks great because of the timeless art style of the original.

It's still an incredible feat, though!

[–] [email protected] 22 points 2 months ago (3 children)

You are very unlikely to write assembly that is more optimized than what a modern compiler could produce for anything longer than a trivial program. I don't know if it made sense at the time of the original RCT, but OpenRCT would definitely not benefit from being written in assembly.

load more comments (3 replies)
load more comments (1 replies)
[–] [email protected] 157 points 2 months ago (1 children)

I don't know if everyone gets the reference: RollerCoaster Tycoon is in fact writing mostly in assembly to use the hardware more efficiently

[–] [email protected] 146 points 2 months ago (2 children)
  • Programming was never meant to be abstract so far from the hardware.
  • 640k is enough ram for everybody.
  • The come with names like rust, typescript, go, and python. Names thought up by imbeciles.
  • Dev environments, environmental variables, build and make scripts, and macros, from the minds of the utter deranged.

They have played us for fools

[–] [email protected] 16 points 2 months ago (2 children)

I dabbled with making a fairly complex program for a microcontroller the other day and quickly hit the stack limit for a simple object.

It wasn't so much that it was a large object, but to provide flexibility I was amazed how fast I filled the memory.

I've done heaps with memory managed languages in the past but shit as soon as I had to think about what I was doing under the hood everything got hard af.

So serious question - does anyone have any good resources for a competent programmer, but with no clue whatsoever how to manage memory in a microcontroller space and avoid fragmentation etc?

I got it to work but I'm sure I did shit job and want to be better at it.

load more comments (2 replies)
load more comments (1 replies)
[–] [email protected] 139 points 2 months ago (3 children)

Your game will actually likely be more efficient if written in C. The gcc compiler has become ridiculously optimized and probably knows more tricks than you do.

[–] [email protected] 47 points 2 months ago (8 children)

Especially these days. Current-gen x86 architecture has all kinds of insane optimizations and special instruction sets that the Pentium I never had (e.g. SSE). You really do need a higher-level compiler at your back to make the most of it these days. And even then, there are cases where you have to resort to inline ASM or processor-specific intrinsics to optimize to the level that Roller Coaster Tycoon is/was. (original system specs)

load more comments (8 replies)
[–] [email protected] 21 points 2 months ago (1 children)

Yep but not if you write sloppy C code. Gotta keep those nuts and bolts tight!

[–] [email protected] 31 points 2 months ago (5 children)

If you're writing sloppy C code your assembly code probably won't work either

load more comments (5 replies)
load more comments (1 replies)
[–] [email protected] 129 points 2 months ago (1 children)

I love Roller Coaster Tycoon. It's absolutely crazy how he managed to write a game in a way many wouldn't even attempt even in those days, but it's not just a technical feat, it's a creative masterpiece that's still an absolute blast to play.

It still blows my mind how smoothly it gives the illusion of 3D and physics, yet it can run on almost anything.

OpenRCT brings a lot of quality of life and is often the recommended way to play today, but the original RCT will always deserve a spot on any "Best Games of All Time" list.

[–] [email protected] 16 points 2 months ago

It was even ported to the original Xbox. I remember the total games file size being incredibly small - compared to most other titles on that system.

[–] [email protected] 91 points 2 months ago (1 children)

If you’ve written 500k lines of code you were surely pretty confident about your decision.

[–] [email protected] 51 points 2 months ago (1 children)
[–] [email protected] 28 points 2 months ago* (last edited 2 months ago) (11 children)

I’m a developer, I don’t just continue doing things for years if it doesn’t make sense.

(If I’m the one making the decisions)

[–] [email protected] 20 points 2 months ago (1 children)

I have seen Devs do things for many years that make no sense

load more comments (1 replies)
load more comments (10 replies)
[–] [email protected] 68 points 2 months ago (7 children)

try writing it it in Assembly

Small error, game crashes and takes whole PC with it burning a hole in the ground.

[–] [email protected] 50 points 2 months ago

Just don't make any errors. Not one.

[–] [email protected] 20 points 2 months ago

It dis-assembled the computer!

load more comments (5 replies)
[–] [email protected] 59 points 2 months ago (2 children)

I want to get off Mr. Bones' Wild Ride

load more comments (2 replies)
[–] [email protected] 50 points 2 months ago (9 children)

Step 1: Begin writing in Assembly

Step 2: Write C

Step 3: Use C to write C#

Step 4: Implement Unity

Step 5: Write your game

Step 6: ???

Step 7: Profit

[–] [email protected] 33 points 2 months ago
[–] [email protected] 30 points 2 months ago

Step 6 extort developers

load more comments (7 replies)
[–] [email protected] 38 points 2 months ago (1 children)

I mean, I'm pretty sure it would be a good learning experience so I would really not regret it.

[–] [email protected] 30 points 2 months ago (8 children)

I tried decades ago. Grew up learning BASIC and then C, how hard could it be? For a 12 year old with no formal teacher and only books to go off of, it turns out, very. I've learned a lot of coding languages on my own since, but I still can't make heads or tales of assembly.

[–] [email protected] 23 points 2 months ago (2 children)

Assembly requires a knowledge of the cpu architecture pipeline and memory storage addressing. Those concepts are generally abstracted away in modern languages

load more comments (2 replies)
load more comments (7 replies)
[–] [email protected] 27 points 2 months ago

Shifts bit to the left

Um what am I doing

Shifts bit to the right

program crashes

[–] [email protected] 25 points 2 months ago (1 children)

They call me the Programmer and I speak to the metal,

Now check out this app, that really shows off my mettle!

load more comments (1 replies)
[–] [email protected] 25 points 2 months ago (1 children)

petah please what's this mean

[–] ayyy 68 points 2 months ago (2 children)

The game Roller Coaster Tycoon was famously hand written in raw CPU instructions (called assembly language). It’s only one step removed from writing literal ones and zeros. Normally computers are programmed using a human-friendly language which is then “compiled” into CPU instructions so that the humans don’t have to deal with the tedium and complication of writing CPU instructions.

[–] [email protected] 23 points 2 months ago* (last edited 2 months ago) (1 children)

To further emphasize this, I had an assembly course in university. During my first lab, the instructor told us to add a comment explaining what every line of assembly code did, because if we didn't, we would forget what we wrote.

I listened to his advice, but one day I was in a rush, so I didn't leave comments. I swear, I looked away from the computer for like 2 minutes, looked back, and had no idea what I wrote. I basically had to redo my work.

It is not that much better than reading 1s and 0s. In fact in that course, we spent a lot of time converting 1s and 0s (by hand) to assembly and back. Got pretty good at it, would never even think of writing a game. I would literally rather create my own compiler and programming language than write a game in assembly.

[–] [email protected] 15 points 2 months ago (3 children)

I'm probably completely insane and deranged, but I actually like assembly. With decent reverse engineering software like Ghidra, it's not terribly difficult to understand the intent and operation of isolated functions.

Mnemonics for the amd64 AVX extensions can go the fuck right off a bridge, though. VCVTTPS2UQQ might as well be my hands rolling across a keyboard, not a truncated conversation from packed single precision floats into packed unsigned quadword integers.

load more comments (3 replies)
[–] [email protected] 19 points 2 months ago (5 children)
load more comments (5 replies)
[–] [email protected] 19 points 2 months ago (1 children)
[–] [email protected] 15 points 2 months ago (1 children)

I believe you meant to write genius.

[–] [email protected] 23 points 2 months ago (1 children)
load more comments (1 replies)
[–] [email protected] 15 points 2 months ago (1 children)

Not Assembly, but HROT was written in Pascal by one person and runs buttery smooth.

load more comments (1 replies)
load more comments
view more: next ›