• Wilzax@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    5 months ago

    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.

      • Wilzax@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        5 months ago

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

  • einlander@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    5 months ago
    • 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

  • Gork@lemm.ee
    link
    fedilink
    English
    arrow-up
    1
    ·
    5 months ago

    Shifts bit to the left

    Um what am I doing

    Shifts bit to the right

    program crashes

      • addie@feddit.uk
        link
        fedilink
        English
        arrow-up
        1
        ·
        5 months ago

        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.

  • Valmond@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    5 months ago

    try writing it it in Assembly

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

    • Capt. Wolf@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      5 months ago

      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.

  • mtchristo@lemm.ee
    link
    fedilink
    English
    arrow-up
    0
    ·
    5 months ago

    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.

    • sushibowl@feddit.nl
      link
      fedilink
      English
      arrow-up
      1
      ·
      5 months ago

      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.

      • CrazyLikeGollum@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        5 months ago

        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.

        • sushibowl@feddit.nl
          link
          fedilink
          English
          arrow-up
          1
          ·
          5 months ago

          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.

        • Cethin@lemmy.zip
          link
          fedilink
          English
          arrow-up
          1
          ·
          5 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.

        • BigDanishGuy@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          1
          ·
          edit-2
          5 months ago

          #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 :)

    • flashgnash@lemm.ee
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      5 months ago

      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

      • lorty@lemmy.ml
        link
        fedilink
        English
        arrow-up
        0
        ·
        5 months ago

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

        • Lennny@lemmy.world
          link
          fedilink
          English
          arrow-up
          1
          ·
          edit-2
          5 months ago

          For every There Will Be Blood, there exists an Alien vs Predator: Requiem