haskell game dev

haskell is one of the best languages you could choose to implement multiplayer games in for a variety of reasons. it's also good for modeling game business logic, in particular because it has lots of functional reactive programming (FRP) implementations available. you also get a good c FFI so you can use c++ libraries for 3d rendering, physics, etc

Thalidomide Vintage Ad Shirt $22.14

Black Rifle Cuck Company, Conservative Humor Shirt $21.68

Thalidomide Vintage Ad Shirt $22.14

  1. 3 weeks ago
    Anonymous

    Games are complex state machines
    Haskell attempts to be stateless
    Therefore, haskell attempts to be gameless.
    QED

    • 3 weeks ago
      Anonymous

      you can express in-game actions as pure functions with type GameState -> GameState thoughbeit

      • 3 weeks ago
        Anonymous

        You can write a pure function in C++ just as well, but with better and easier access to the actual state of the game.

        • 3 weeks ago
          Anonymous

          purity in c++ won't be enforced by the compiler, which is important when the code needs to be pure (e.g. for multiplayer netcode)
          also c++ has no advantage over haskell in terms of accessing record fields or whatever

          • 3 weeks ago
            Anonymous

            Only in terms of speed, and the ability to use state in complex state machines, and a better compiler, and the fact that saying "XYZ needs to be pure" has never been true and usually works better without arbitrary enforcement of stupid shit.

            • 3 weeks ago
              Anonymous

              >saying "XYZ needs to be pure" has never been true
              if you don't want side effects, then it needs to be pure

              • 3 weeks ago
                Anonymous

                Nice reverse definition moron.

            • 3 weeks ago
              Anonymous

              >fact that saying "XYZ needs to be pure" has never been true
              it's true for rollback netcode though, and for lots of other use cases

              • 3 weeks ago
                Anonymous

                >you can't write this in a non-pure way
                Always false
                >you are better off writing this in a pure way
                Sometimes true
                Note how you ignored the always false statement which I made, and instead responded to your own delusions.

              • 3 weeks ago
                Anonymous

                >>you can't write this in a non-pure way
                >Always false
                it's true for rollback netcode though. sorry you're wrong

              • 3 weeks ago
                Anonymous

                So why is all netcode in every popular game written in the same language as the game, usually C++ or C#?

              • 3 weeks ago
                Anonymous

                because they're moronic
                isn't that obvious?

              • 3 weeks ago
                Anonymous

                Nice dunning kruger, my moronic friend.

                idk but it probably explains why multiplayer games are relatively uncommon. writing and debugging good netcode in those languages would be a massive pain in the ass

                >multiplayer games are relatively uncommon
                What universe are you living in? They're by far the most popular games around.

              • 3 weeks ago
                Anonymous

                i live in this universe homie
                for every multiplayer game that exists, there are thousands of singleplayer games out there, in part because lots of game devs can't figure netcode out. (i mean look at toby undertale for example)

              • 3 weeks ago
                Anonymous

                This is true, but the games people actually play for long periods are mostly multiplayer.
                While I'm sure there's some autist out there with 2000 hours in Undertale 2, there's 30000x the amount of people with 2000 hours in CSGO or CoD or some other random multiplayer game.
                Singleplayer is the second class in modern gaming

              • 3 weeks ago
                Anonymous

                there are lots of singeplayer games though. good ones, too, ranging from AAA titles like wolfenstein to indie games like FTL or whatever.
                singeplayer games also predate the internet and have a better ability to survive when the community is small

                Jesus fricking Christ OP, you are at peak of mount stupid. Haskell is never going to work for real time systems.

                pretty much the only potential problem is gc latency and you can set --nonmoving-gc to deal with that

              • 3 weeks ago
                Anonymous

                >there are lots of single player games
                Non-sequitur.
                Even if it had any weight, all it does is again reduce the need for haskell as per that one morons argument.

              • 3 weeks ago
                Anonymous

                Most hours are spent into old games with strong mapping/modding community. Games like Doom 2 and Morrowind/Oblivion/Skyrim.

              • 3 weeks ago
                Anonymous

                tsmt most game devs just reach for the first engine they see, which is unity or unreal
                the best ones love haskell though: john carmack liked it and tim sweeney hired simon haskell to work at epic games and build another pure language for scripting

              • 3 weeks ago
                Anonymous

                idk but it probably explains why multiplayer games are relatively uncommon. writing and debugging good netcode in those languages would be a massive pain in the ass

          • 3 weeks ago
            Anonymous

            >purity in c++ won't be enforced by the compiler
            What is a const function?

            >usually works better without arbitrary enforcement of stupid shit.
            About the stupidest statement on immutability and purity ever. If you think those are arbitrary useless shit you really don't understand these concepts at all.

            • 3 weeks ago
              Anonymous

              >What is a const function?
              not a pure function lol

          • 3 weeks ago
            Anonymous

            >saying "XYZ needs to be pure" has never been true
            if you don't want side effects, then it needs to be pure

            Or you could just... write pure functions yourself?

      • 3 weeks ago
        Anonymous

        LMAO, can you imagine doing a COW of the entire game state multiple times per frame? Enjoy your 1 FPS game.

        • 3 weeks ago
          Anonymous

          Which is why you use CoW data structures.

        • 3 weeks ago
          Anonymous

          that's not how haskell works you fricking imbecile

      • 3 weeks ago
        Anonymous

        It should be (Action, State) -> State, dummy

        • 3 weeks ago
          Anonymous

          the Action was implied, dummy

          • 3 weeks ago
            Anonymous

            okay, I'm sorry :c

    • 3 weeks ago
      Anonymous

      >purity means stateless
      found the moron

    • 3 weeks ago
      Anonymous

      Perfect for artsy walking simulators then.

  2. 3 weeks ago
    Anonymous

    Haskell's static type system is of course desirable for any application as complex as a game, but with all IO-like types you somewhat muddy/lose this property so I do not think that heavy user input and network input programs would perform well.

    • 3 weeks ago
      Anonymous

      What about F#?
      Seems to be the best of both worlds and even works in Unity with some hackery.

      • 3 weeks ago
        Anonymous

        fsharp is better than csharp but still misses out on the "big improvements" that haskell presents.
        fsharp has no way to enforce immutability, which sucks for stuff like netcode and even simple stuff like transactional memory

        • 3 weeks ago
          Anonymous

          >fsharp has no way to enforce immutability
          Just don't use the mutable keyword dummy

        • 3 weeks ago
          Anonymous

          >fsharp has no way to enforce immutability
          That's the whole point.
          Lets are immutable by default but can be mutable for performance if needed.
          That's what makes it a better choice for game development.
          In addition to the vast corpus of existing .NET code.

  3. 3 weeks ago
    Anonymous

    If it's so good, where are the games?

  4. 3 weeks ago
    Anonymous

    Jesus fricking Christ OP, you are at peak of mount stupid. Haskell is never going to work for real time systems.

    • 3 weeks ago
      Anonymous

      Haskell works fine for realtime systems and has ever since hugs got replaced with ghc

  5. 3 weeks ago
    Anonymous

    OP is surely trolling, but Haskell might actually be useful for programming some tools for editing something that involve editing/configuring things, because having undo/redo for everything for free by design is a nice thing, also systems where you create something based on branching from prefab and then changing some subset of properties can also work well because of how in purely functional data structures everything is build by sharing and inductively layering data constructors on top of existing data structure instances (ie list with extra element contains previous version of list, tree with extra element contains previous version of tree, etc).

    • 3 weeks ago
      Anonymous

      >ie list with extra elements contains previous version of list
      You can already (kinda) do that in C# with Enumerable.Concat(), it's almost always a terrible idea both for performance and correctness.
      >inb4 why C#
      Because that's what every game made in Unity uses.

      • 3 weeks ago
        Anonymous

        > Enumerable.Concat
        Bruh, wtf, I'm talking about normal linked list,
        you really don't know even highschool tier basics of data structures?
        This is something you're supposed to implement in highschool as a homework in C.

        • 3 weeks ago
          Anonymous

          >write "list"
          >mean "linked list"
          Cnile moment.
          Also linked lists are horrendous for performance because of linear time traversal + one indirection and memory access per element, basically the same problems of .Concat() but magnified to the worst possible degree.

          • 3 weeks ago
            Anonymous

            If you try to put there millions of entries of geometry data, it sure will suck, if you're working with short lists of properties of objects, it will probably not be a concern at all.
            But this persistent linked-pointers format is very convenient in a lot of applications.
            Also, I've seen people in FP use really smart optimizations for lookup when it's needed, by "baking" structures into some cache of optimized lookup structures.
            In the most simple case it can be an array for a linked list, for example. So if you're accessing a specific Cons pointer that has entry in a cache, you know that entry is array corresponding to this list and perform lookup there.
            It's all rarely needed, and very application specific, but there are tons of smart optimizations like this you can do.

            • 3 weeks ago
              Anonymous

              >actually linked lists are good because the compiler can optimize them into array
              Epic bait

  6. 3 weeks ago
    Anonymous

    So where are all the games that use it?

  7. 3 weeks ago
    Anonymous

    haha yes, when I need high performance and bit twiddling, I will pick a memelang that nobody ever uses.

  8. 3 weeks ago
    Anonymous

    what the frick does "modeling game business logic" even mean?

    • 3 weeks ago
      Anonymous

      Obviously stuff like computing final damage through 10 layers of magical effects and modifiers.

    • 3 weeks ago
      Anonymous

      office drones bringing their meaningless corporate buzzwords into their weekend hobby

  9. 3 weeks ago
    Anonymous

    Jesus Christ. Imagine falling for the meme of FP in 2024

  10. 3 weeks ago
    Anonymous

    I many times started various projects in Haskell, including stuff for gamedev too. I was really excited for some time, but those projects always were very ambitious and indirect (like involving creating (E)DSLs, then optimizing them etc) and I just abandoned them all eventually when my enthusiasm faded. Haskell has many great things and can be useful for many kinds of projects, but using it my way was definitely a failure for me personally. Nowadays I'm being more self-aware of neuromediator dynamics in my brain, and I plan for fading enthusiasm early.

  11. 3 weeks ago
    Anonymous

    I write all my games in CobolScript.

  12. 3 weeks ago
    Anonymous

    >there isnt a haskellchad gamedev that completely dominates the industry by making gaems 10 times faster
    This tells you its no possible because someone would have done it already

  13. 3 weeks ago
    Anonymous

    wtf

  14. 3 weeks ago
    Anonymous

    Why would I use Haskell instead of Prolog?

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