To be fair, assembly lines of code are fairly short.
/ducks
Vintage gaming community.
Rules:
If you see these please report them.
To be fair, assembly lines of code are fairly short.
/ducks
Back in the day we wrote everything in asm
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.
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.
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.
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.
Further proof C++ is a pita
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.
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
Survivor bias is a thing and part of the reason people are nostalgic for old media.
But the modern OpenRCT, written in an actual language, is better in every way.
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!
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.
I don't know if everyone gets the reference: RollerCoaster Tycoon is in fact writing mostly in assembly to use the hardware more efficiently
They have played us for fools
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.
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.
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)
Yep but not if you write sloppy C code. Gotta keep those nuts and bolts tight!
If you're writing sloppy C code your assembly code probably won't work either
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.
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.
If you’ve written 500k lines of code you were surely pretty confident about your decision.
You sweet summer child...
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)
Like the classic, inherit a broken code base, and not being allowed by the owner to rewrite it from scratch. So you have to spend more time making each part work without the others working. Also before you are finished the customer says they have something else for you to do
try writing it it in Assembly
Small error, game crashes and takes whole PC with it burning a hole in the ground.
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
I mean, I'm pretty sure it would be a good learning experience so I would really not regret it.
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.
Assembly requires a knowledge of the cpu architecture pipeline and memory storage addressing. Those concepts are generally abstracted away in modern languages
Shifts bit to the left
Um what am I doing
Shifts bit to the right
program crashes
They call me the Programmer and I speak to the metal,
Now check out this app, that really shows off my mettle!
petah please what's this mean
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.
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.
Chris Sawyer is a madman.
Not Assembly, but HROT was written in Pascal by one person and runs buttery smooth.