BTFO

Ganker BTFO

Thalidomide Vintage Ad Shirt $22.14

Black Rifle Cuck Company, Conservative Humor Shirt $21.68

Thalidomide Vintage Ad Shirt $22.14

  1. 1 week ago
    Anonymous

    first they came for the if statements
    now they're coming for my switch statements
    how the frick am I supposed to check for a condition now bros

    • 1 week ago
      Anonymous

      1000 layers of abstraction and overloading that no mere mortal can parse

    • 1 week ago
      Anonymous

      if you aren't writing branch statements in assembly you aren't a real programmer.

      • 1 week ago
        Anonymous

        any "real" programmer wouldn't be rotting in his room trying to make fricking videogames

        • 1 week ago
          Anonymous

          I took a 4 year computer science degree in college and I think I never met a real programmer
          What do they look like?

    • 1 week ago
      Anonymous

      Checking for conditions is patriarchal. You need to build in consensus building daemons that go and poll POC and leave the decisions to them.

    • 1 week ago
      Anonymous

      You’re supposed to use OOP

    • 1 week ago
      Anonymous

      It really doesn't matter tbh. If you're making small scale shit like undertale, you can even use if else if you want to. It won't have any effect with performance.
      What matters more with shit like this is code readability when working with other people or for debugging and again, if you're working alone like toby fox, it's not really a problem if you at least understand your own code you're typing. Sometimes simple shit like 1000+ switch cases is a lot easier to debug compared to making logic hierarchies that ultimately won't matter with the output.

    • 1 week ago
      Anonymous

      jump table

    • 1 week ago
      Anonymous

      Don't check conditions just use dynamic dispatch with virtual calls.

    • 1 week ago
      Anonymous

      Store your dialogues in another file

    • 1 week ago
      Anonymous

      Make half-assed projects in unreal engine for 10 years and never publish a game

  2. 1 week ago
    Anonymous

    It depends on the game but this is actually pretty clean way to make it as it's dialogue heavy game.

    • 1 week ago
      Anonymous

      Good morning sir

      • 1 week ago
        Anonymous

        your arrogance is showing

  3. 1 week ago
    Anonymous

    What should this look like optimally? I have no idea.

    • 1 week ago
      Anonymous

      hashtable

      • 1 week ago
        Anonymous

        >bloating with no advantage

    • 1 week ago
      Anonymous

      The switch is actually fine but having all the game's dialogue formatted like that is kind of psychotic, making any alteration to the script would be a huge pain in the ass and localization would be a nightmare. Life would be a lot easier if the dialogue lived in its own data structure, or better yet was further separated based on location or character or whatever is intuitive to you

    • 1 week ago
      Anonymous

      if there was only one developer and no localization efforts were needed you'd probably do a jump table like what the other posters said. This is a nightmare to make changes or localize, so otherwise you'd store data in a json file, for instance, acting as a database for text. You'd then read the dialogue from the file as needed

      quick reference that looks like what I'd expect

    • 1 week ago
      Anonymous

      You should not give a FRICK about optimally.

      But before you even consider that, ask Optimally for what?

      Run speed?
      Load speed?
      Memory load?
      Readability?
      Error checking?
      Robustness?
      Easy to Debug?
      Expansion?
      Flexibility?
      Flexibility in branching?
      Flexibility in dynamic decisions?
      Maintainablility?
      Ability to be worked on by some dumbass?
      Time to code?

      Yeah, multiple languages is going to be a pain in the ass.

      lmao how the frick do you localize this

      Line by line. And some of the dumb shit with localization might make more sense now.

      • 1 week ago
        Anonymous

        So basically to translate you need to actually publish a completely different game because the text is just hardcoded in like that

    • 1 week ago
      Anonymous

      optimally it looks like you releasing a finished product instead of something you slave over for years because nig/g/ers would find something to complain about and nitpick anyway.

  4. 1 week ago
    Anonymous

    >your arrogance is showing

  5. 1 week ago
    Anonymous

    are Black folk going to come in this thread and ramble about what would be the optimal way of doing that switch statement? lmao dude made bank with that shit

  6. 1 week ago
    Anonymous

    Shitcode isn’t shit if it works
    But it only works for so long before you frick up something that actually matters, like GTAV parsing a 10 MB string 60,000 times and adding like 15 minutes to their load times

  7. 1 week ago
    Anonymous

    It's still O(1), so it's fine brews trust me

    • 1 week ago
      Anonymous

      Just werks and is O(1). Am senior dev, if it works it's good code, only amateurs obsess over arbitrary rules Uncle Bob invented in his book.

      >O(1)
      It depends. The compiler might turn this into a jumptable and it might not. Worst case it's O(n), which in this case would still be fine. The actual problem with this code is how fricking hard it would be for anyone else besides Toby to work on it. At a glance I have no idea what "case 737" actually means. Which character? Which encounter? I have no clue.

      He should have made a "dialogue" class with instance variables that point to a json file or something. Then every character could have an instance of the class as a component. Would make it much easier to write/change dialogue.

  8. 1 week ago
    Anonymous

    >dialogue heavy linear short game with gay characters that nags you for not being a good dog
    >goty
    why are gaymers like this

  9. 1 week ago
    Anonymous

    I'm not Ganker but isn't switch statements fine? I think it's only nested if statements that are moronic. How else are you even supposed to implement something that responds to hundreds of different cases?

    • 1 week ago
      Anonymous

      the compiler fixes everything and trying to be clever is more likely to frick it up than anything

    • 1 week ago
      Anonymous

      Ifs are perfectly fine when utilized correctly, namely short checks *if* one thing fulfills a certain condition and returns whatever you might branch off with. Switches are best used when you're expecting exactly one thing to happen. The problem here is that Toby shouldn't have used if/else or switches for handling all the dialog in the game.
      Even if this is decompiled code, it's a dogshit solution.

    • 1 week ago
      Anonymous

      the compiler fixes everything and trying to be clever is more likely to frick it up than anything

      in this case the "compiler" Toby used back in the day doesn't optimize switch statements, so it is in fact not fine

  10. 1 week ago
    Anonymous

    >Undertale is GOTY to zoomers
    Games have fallen

  11. 1 week ago
    Anonymous

    Just werks and is O(1). Am senior dev, if it works it's good code, only amateurs obsess over arbitrary rules Uncle Bob invented in his book.

  12. 1 week ago
    Anonymous

    >setting array values by explicit index number
    gross

  13. 1 week ago
    Anonymous

    lmao how the frick do you localize this

  14. 1 week ago
    Anonymous

    It's cool that you have to generate an executable for each translation

  15. 1 week ago
    Anonymous

    There are also games that never finish because the codebase is such a mess that adding new features to it is like pulling teeth.

  16. 1 week ago
    Anonymous

    Its not about performance morons, its about maintainability, of course a short shitty game can get away with it, but in any serious project it will take exponentially more hours trying to change/update/localize any line the more lines you have

  17. 1 week ago
    Anonymous

    Is a spaghetti mess? Yes but it's works and nobody gonna give some maintenance.

  18. 1 week ago
    Anonymous

    at the end of the day if the code works nobody gives a shit

  19. 1 week ago
    Anonymous

    >undertale
    >"game of the year"

  20. 1 week ago
    Anonymous

    >script is stored in plain text
    >game loads the text file into a string variable when a new game begins
    >strings are pulled based on ID from within the stringvar'd file based on the string ID when you go to talk to someone
    >certain things like text box size and other things are also handled on a per-string basis in the event you need to shrink/expand them individually
    Not my game, but a game I translated. I liked this setup a lot since it made the translation process quicker and easier than other alternative arrangements.

    • 1 week ago
      Anonymous

      Anon you can put that file into excel and mark as '/' delineated to put it into a spreadsheet format. That's literally a spreadsheet file, and that is normally how that kind of thing is done for localization/configuration of things like that.

      Don't tell me you did this all in .txt format? holy shit why

      • 1 week ago
        Anonymous

        I did it all in .txt format straight in Notepad++, yes.

        how many gangrape scenes did you translate

        I don't work on coomer games.

        • 1 week ago
          Anonymous

          >I did it all in .txt format straight in Notepad++, yes.
          Bro... Next time just convert it to a spreadsheet it's in the right format

    • 1 week ago
      Anonymous

      how many gangrape scenes did you translate

  21. 1 week ago
    Anonymous

    any monkey can write code, but not everyone has it in them to be an auteur and actually make a game.

    • 1 week ago
      Anonymous

      anyone can make an earthbound ripoff

  22. 1 week ago
    Anonymous

    If it works it works, I guess. I wouldn't want to work on a project like that. I'd at least separate dialog by level.

  23. 1 week ago
    Anonymous

    the trick is to store all your text in json or yaml and then perform adhoc translations by sending the level's text file to an LLM with the requested language

  24. 1 week ago
    Anonymous

    Did any of you armchair programmers even consider the fact that this shit could be generated code? You're looking at a very small snippet of a decompilation.

    • 1 week ago
      Anonymous

      Good code wouldn't have string literals loaded at compile time

  25. 1 week ago
    Anonymous

    he's 100% right
    >t. IT graduate doing hobby gamedev

Your email address will not be published. Required fields are marked *