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.
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.
#include<iostream>// because writing to the console is not included by default. intmain() { std::cout << "C++ is simple and fun ... you cretin\n"; return0; }
I had a machine language course in uni, parallel with a C++ course. Not a fun semester to be my wife, or a relative of any of my classmates. Best case our brains were in C++ mode, worst case you needed an assembler to understand us.
And yes I know my code format will piss people off, I don’t care, it’s the way I write when other less informed people don’t force me to conform to their BS “Teh oPeNiNg bracket shouwd bwee on teh sam line ass teh declawation”
Interesting… today I learned. But since I only ever use std::cout in my debugging code (i.e. DURING debugging) or for status outputs of the application (for small apps), and for everything else I use my own logging framework that uses printf & syslog udp messages… luckily nothing I need to refactor :D
Is there not a way to take assembly and automatically translate it to some higher level language?
Edit: Post-post thought: I guess that would basically be one step removed from decompilation which, as I understand it, is a tedious and still fairly manual process.
Your thought is correct. The basic problem is that higher level languages contain a lot of additional information that is lost in the compilation process.
Take for example Haskell. It’s a functionnal, typed language. In Haskell, at compile time, the compiler analyzes all the types of all your functions and if they all match, it drops them completely. There is no type information at all left in a compiled Haskell program, because the compiler can know ahead of runtime if it is correct.
You could, but there isn’t much benefit. The purpose of all that extra information is generally to make the program easier to understand for a human. The computer doesn’t need any of it, that’s why it’s not preserved in compilation. So it is possible to automatically translate assembly to C++, but the resulting program would not be much (if any) easier for a human to understand and work with.
To give a bad analogy, imagine some driving directions: turn left at 9th street, enter the highway at ramp 36, go right when you’re past the burger king, etc. These are translated into physical control inputs by the driver to actually take the car to its destination. Now we could look at the driver’s physical inputs and turn that back into a written list of instructions: turn the wheel left 70 degrees, turn it right 70 degrees, push the gas for 10 seconds, and so on.
All the street name references are now gone. There are no abstracted instructions like “enter the highway” or even “take the second left.” It would be quite difficult for a person to look at these instructions and figure out the trip’s destination. Let alone make some alterations to it because there is roadwork along the way and a detour is needed.
I get that. But the game is “finished”. there is no need for alterations. translating the assembler code into c++ in this way could serve to quickly get it in a format that is then compileable for other platforms.
But the game is “finished”. there is no need for alterations.
If only that was the case. But there is no chance a game built for windows 95 could run unaltered on an android phone. Things like the rendering systems, input handling, and sound output will need to be adapted to work on a new platform.
This is also exactly why Nintendo chooses to ship an emulator with the original ROM for their classic games, it’s just that much easier, especially when they don’t make the emulator either.
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
I mean avp requiem is a cult classic because it’s so bad so maybe not a good example. You need a movie that is immediately forgettable which is difficult because I forgot their names…
And I had to stop using vscode because of its ridiculous resource usage. I got tired of it filling up my home dir and just went back to vim.
An intern was using it, but I saw that he had set it up to run locally and connect to the ETX we were using and figured he had found a way to avoid that. Nope, turns out it runs a server on the ETX that also likes to fill up the home dir and he also just uses vim now.
Headphone would be for the phone. And background noise cancellation is perfect now days so it’s not an issue with speakers playing at a reasonable level
I’m not saying it’s phenomenal but it’s generally pretty well featured, running in a browser it’s not that heavy resource wise and the API/developer features are very good
Gnome calculator uses 103m, it’s loading style sheets for themes, UI libraries that make it look nice and modern, scientific calculator features, keyboard shortcuts, nice graphical settings menu, touch screen and screen reader support etc
I don’t think in this day and age for all the niceties people are used to that’s unreasonable.
Also other calculators are available, some are bloated but I’m sure there’s a rust or C one out there somewhere that uses a fraction of that with the bare minimum feature set
Old=good is a great mentality specifically when standing the test of time is an important factor. For the most part, the old code that’s still used today is only still used because it’s proven good, whereas it’s a grab bag with newer code. And that’s the cause of the unwarranted nostalgia thay you’re rightfully criticising.
It’s like with music. “Oh, the X’s were the best decade for music, today’s music is garbage”. No, 90% of everything is crud but unless you’re an enthusiast, once enough time has passed, you’ll only ever be exposed to the 10% that isn’t. 50 years from now nobody is going to be listening to Cardi B.
That isn’t the whole picture. I was born in 1988. The sampling of music from the 70’s that I’ve been exposed to is completely different to the sampling of music from the same period that someone born in '58 was exposed to in their lifetime. They got to listen to a bunch of bad stuff (and probably some great stuff) that I don’t even know exists.
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 feel like that’s only true if I was asked to “write the assembly for this c++ program.” If I’m actually implementing something big in assembly, I’m not going to do 90% of the craziness someone might be tempted to do in c++. Something that is super easy in c++ doesn’t mean it’s easy for the CPU. Writing assembly, I’m going to do what’s easy for the CPU (and efficient) because, now, I’m in the same domain.
The bottom line is cranking up the optimization level can get you a 2-5x win. Using memory efficiently can give you a 10-100x win.
Using memory efficiently can give you a 10-100x win.
Yes, it can. But why is this exclusive to assembly? What are you planning to do with your memory use in assembly that is not achievable in C++ or other languages? Memory optimizations are largely about data structures and access patterns. This is available to you in C++.
Also, if you don’t want 90% of the craziness of C++ then why not just code in C++ without 90% of the craziness? As far as I know what’s what a lot of performance-critical projects do. They operate with a feature whitelist/blacklist. Don’t tell me you have the discipline to work entirely in assembly and the knowledge to beat the compiler at the low level stuff that is not available to you in C++ but you can’t manage avoiding the costly abstractions.
I think it speaks volumes how rarely you hear about programs being programmed in assembly. It’s always this one game and never any meaningful way to prove that it would gain performance by not being written in C++ when using a modern compiler.
I shouldn’t have used C++ as the example. Even C would work. I agree with everything you’re saying, but the original premise. I think if you put ASM vs C, C++, rust, etc, performance would fall near 50/50.
I’m not the best assembly guy, and I’m not advocating we all write it. But I always felt that the compiler optimization assumption was wrong or weak. Everything would be aligned nicely for my sanity, not performance =]
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:
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.
#include <iostream> // because writing to the console is not included by default.
int main()
{
std::cout << "C++ is simple and fun ... you cretin\n";
return 0;
}
I had a machine language course in uni, parallel with a C++ course. Not a fun semester to be my wife, or a relative of any of my classmates. Best case our brains were in C++ mode, worst case you needed an assembler to understand us.
And yes I know my code format will piss people off, I don’t care, it’s the way I write when other less informed people don’t force me to conform to their BS “Teh oPeNiNg bracket shouwd bwee on teh sam line ass teh declawation”
Edit: added a \n for the sake of pedantry :)
std::cout << "C++ is simple and fun ... you cretin" <<std::endl;
You dropped something.
Well ackshually <<std::endl is not the preferred way to do it according to the C++ Core Guidelines https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rio-endl
So to be a good little lemming I’ve added a \n, but I refuse to flush!
Interesting… today I learned. But since I only ever use std::cout in my debugging code (i.e. DURING debugging) or for status outputs of the application (for small apps), and for everything else I use my own logging framework that uses printf & syslog udp messages… luckily nothing I need to refactor :D
Well worth it. The mobile version is amazing, that is to say, almost exactly the same as the original.
I guess i just found out there’s a mobile version.
Is there not a way to take assembly and automatically translate it to some higher level language?
Edit: Post-post thought: I guess that would basically be one step removed from decompilation which, as I understand it, is a tedious and still fairly manual process.
Your thought is correct. The basic problem is that higher level languages contain a lot of additional information that is lost in the compilation process.
But do we need this information then? E.g. shouldn’t it be possible to just write what the assembler is doing as a c++ code?
E.g. high level languages also support stuff like bitwise operators and so on.
Take for example Haskell. It’s a functionnal, typed language. In Haskell, at compile time, the compiler analyzes all the types of all your functions and if they all match, it drops them completely. There is no type information at all left in a compiled Haskell program, because the compiler can know ahead of runtime if it is correct.
Thank you. That is a good example.
You could, but there isn’t much benefit. The purpose of all that extra information is generally to make the program easier to understand for a human. The computer doesn’t need any of it, that’s why it’s not preserved in compilation. So it is possible to automatically translate assembly to C++, but the resulting program would not be much (if any) easier for a human to understand and work with.
To give a bad analogy, imagine some driving directions: turn left at 9th street, enter the highway at ramp 36, go right when you’re past the burger king, etc. These are translated into physical control inputs by the driver to actually take the car to its destination. Now we could look at the driver’s physical inputs and turn that back into a written list of instructions: turn the wheel left 70 degrees, turn it right 70 degrees, push the gas for 10 seconds, and so on.
All the street name references are now gone. There are no abstracted instructions like “enter the highway” or even “take the second left.” It would be quite difficult for a person to look at these instructions and figure out the trip’s destination. Let alone make some alterations to it because there is roadwork along the way and a detour is needed.
I get that. But the game is “finished”. there is no need for alterations. translating the assembler code into c++ in this way could serve to quickly get it in a format that is then compileable for other platforms.
If only that was the case. But there is no chance a game built for windows 95 could run unaltered on an android phone. Things like the rendering systems, input handling, and sound output will need to be adapted to work on a new platform.
This is also exactly why Nintendo chooses to ship an emulator with the original ROM for their classic games, it’s just that much easier, especially when they don’t make the emulator either.
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.
For every There Will Be Blood, there exists an Alien vs Predator: Requiem
I mean avp requiem is a cult classic because it’s so bad so maybe not a good example. You need a movie that is immediately forgettable which is difficult because I forgot their names…
People only remember the good stuff. They don’t usually think about all the software that sucked.
I reminisce for the days when spyware was cute 😞
Discord is garbage software lmao. Has been from the beginning. I can’t stand using it.
And I had to stop using vscode because of its ridiculous resource usage. I got tired of it filling up my home dir and just went back to vim.
An intern was using it, but I saw that he had set it up to run locally and connect to the ETX we were using and figured he had found a way to avoid that. Nope, turns out it runs a server on the ETX that also likes to fill up the home dir and he also just uses vim now.
Seconded. The only reason I have it installed is because my buddy refuses to answer his cell while we play games.
You want to… be on the phone for video game chat?
I cannot fathom this mindset.
I’d rather do a signal VoIP call than discord
I’d rather do a phone call on speakerphone while playing games…yes. I don’t wear headphones unless they’re wireless and I only put in one ear.
So like… do you play the game with no sound? Does your gaming partner hear everything coming through your speakers into your phone’s microphone?
I’m just struggling to understand how that could be a good experience for anyone, including you. Am I just missing something?
Edit: oh, I missed the wireless earphone on one side thing. Is that for your phone or for the game?
Headphone would be for the phone. And background noise cancellation is perfect now days so it’s not an issue with speakers playing at a reasonable level
Interesting. Can’t say that would ever work for my circumstances, but I at least get where you’re coming from a bit better. Thanks!
I’m not saying it’s phenomenal but it’s generally pretty well featured, running in a browser it’s not that heavy resource wise and the API/developer features are very good
A fucking calculator needs megabytes to run? And I’m not talking about a full fledged graphic scientific calculator. I’m talking about a basic one.
Gnome calculator uses 103m, it’s loading style sheets for themes, UI libraries that make it look nice and modern, scientific calculator features, keyboard shortcuts, nice graphical settings menu, touch screen and screen reader support etc
I don’t think in this day and age for all the niceties people are used to that’s unreasonable.
Also other calculators are available, some are bloated but I’m sure there’s a rust or C one out there somewhere that uses a fraction of that with the bare minimum feature set
bc is 91 kilobytes and can work with seriously big numbers.
You want to know what 2^99812 is? bc will tell you. Hint: the result is so big I could not paste it in here. bc does not care, bc just delivers.
Not saying there is anything wrong with a GUI calculator using 103m of RAM and looking fancy while only working with tiny numbers, just saying.
I mean personally if I need a heavy duty calculator I’ll just use python or something
Old=good is a great mentality specifically when standing the test of time is an important factor. For the most part, the old code that’s still used today is only still used because it’s proven good, whereas it’s a grab bag with newer code. And that’s the cause of the unwarranted nostalgia thay you’re rightfully criticising.
It’s like with music. “Oh, the X’s were the best decade for music, today’s music is garbage”. No, 90% of everything is crud but unless you’re an enthusiast, once enough time has passed, you’ll only ever be exposed to the 10% that isn’t. 50 years from now nobody is going to be listening to Cardi B.
I listen to music on a new music radio station - the good new music really stands out
Most people just like the (better bits of) stuff they listened to when they were young
That isn’t the whole picture. I was born in 1988. The sampling of music from the 70’s that I’ve been exposed to is completely different to the sampling of music from the same period that someone born in '58 was exposed to in their lifetime. They got to listen to a bunch of bad stuff (and probably some great stuff) that I don’t even know exists.
If you want to get a glimpse of the hate against Unix in the early 90’s, give “Unix hater’s handbook” a read. It’s a funny piece
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 feel like that’s only true if I was asked to “write the assembly for this c++ program.” If I’m actually implementing something big in assembly, I’m not going to do 90% of the craziness someone might be tempted to do in c++. Something that is super easy in c++ doesn’t mean it’s easy for the CPU. Writing assembly, I’m going to do what’s easy for the CPU (and efficient) because, now, I’m in the same domain.
The bottom line is cranking up the optimization level can get you a 2-5x win. Using memory efficiently can give you a 10-100x win.
Yes, it can. But why is this exclusive to assembly? What are you planning to do with your memory use in assembly that is not achievable in C++ or other languages? Memory optimizations are largely about data structures and access patterns. This is available to you in C++.
Also, if you don’t want 90% of the craziness of C++ then why not just code in C++ without 90% of the craziness? As far as I know what’s what a lot of performance-critical projects do. They operate with a feature whitelist/blacklist. Don’t tell me you have the discipline to work entirely in assembly and the knowledge to beat the compiler at the low level stuff that is not available to you in C++ but you can’t manage avoiding the costly abstractions.
I think it speaks volumes how rarely you hear about programs being programmed in assembly. It’s always this one game and never any meaningful way to prove that it would gain performance by not being written in C++ when using a modern compiler.
I shouldn’t have used C++ as the example. Even C would work. I agree with everything you’re saying, but the original premise. I think if you put ASM vs C, C++, rust, etc, performance would fall near 50/50.
I’m not the best assembly guy, and I’m not advocating we all write it. But I always felt that the compiler optimization assumption was wrong or weak. Everything would be aligned nicely for my sanity, not performance =]
or even opening a website that uses less than 10mb on initial load