• MonkderVierte@lemmy.ml
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    1
    ·
    8 hours ago

    You should take a look into KSP and Rimworld modding. Adding emtirely new physics is only the cup of the cake there.

  • sp3ctr4l@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    60
    arrow-down
    2
    ·
    edit-2
    3 hours ago

    … Ok, that is legitimately impressive, from a technical standpoint.

    Lua is a high level, not exactly very ‘fast’, very performant language. It is designed to be very, very human readable, and coding noob friendly.

    Getting a 3D physics engine to work … in lua… is not something I would have thought possible.

    Usually you need to use a much lower level language to … actually do that.

    EDIT:

    A few other commenters have now pointed out that this is actually using LuaJIT… which passes Lua code to a C compiler, quickly translates and then compiles in C, and then runs in C.

    So, that makes much more sense, its functionally running in C, a lower level, compiled code language.

    Still impressive nonetheless!

    • gamer@lemm.ee
      link
      fedilink
      English
      arrow-up
      4
      ·
      2 hours ago

      Imma be the guy and drop an ackshually

      • Nothing about Lua would make it difficult to implement a physics engine in it compared to other languages
      • The hardest part would be integrating with Morrowind’s systems. If the engine doesn’t expose e.g. collision geometry to scripts in an efficient way, then you’ll run into some real challenges
      • Even without LuaJIT, there’s no reason to expect performance so bad you can’t implement realtime rigid body physics. Interpreted Lua is fast, but even if it wasn’t, a 60 fps performance target for physics is not tough to achieve at all
      • Zahille7@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 hours ago

        Project Zombie and GMod both use Lua scripts. GMod is also one of the best physics sandboxes imo, and has like the most mods on the workshop ever.

        • Leuthil@lemmy.world
          link
          fedilink
          English
          arrow-up
          1
          ·
          edit-2
          1 hour ago

          The physics in GMod isn’t implemented in Lua though. It was already part of the Source engine.

          Unless GMod isn’t referring to Garry’s Mod.

    • everyonesconnected@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      8
      ·
      5 hours ago

      So from what I can read, the Morrowind Script Extender uses LuaJIT instead of regular lua, which does tracing just-in-time compilation. Meaning, and I’m just paraphrasing wikipeda here, it compiles frequently executed sequeneces of operations into machine code.

      • sp3ctr4l@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        2
        ·
        edit-2
        4 hours ago

        Now, that is a very relevant detail!

        I did not know LuaJIT was even a thing.

        Still probably not as performant as … C++ or Rust or something, that is totally precompiled… but that would explain how this is even possible, a 3D Lua based physics engine.

        Yeah, looks like LuaJIT passes a bunch of the Lua code into C, just good ole C, and then dynamically compiles it, then runs the ‘translated’ C code.

        That makes a lot more sense lol.

      • sp3ctr4l@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        4
        ·
        edit-2
        6 hours ago

        I haven’t benchmarked anything in a while, so it is possible Lua is more performant now than it once was… but in my (out of date) experience, python is faster than Lua, and nearly every language that is actually compiled is… one or two or three orders of magnitude faster.

        Though it is also worth mentioning that Lua is fairly simple to plug in to some kind of database language, which can result in reasonably good performance in situations involving say… dynamically spawning or unspawning tons of inventory style minor items, or containers with them.

        Lua has been fast enough to handle a simple 2D physics engine… but this is the first time I am hearing of it handling 3D.

    • datavoid@lemmy.ml
      cake
      link
      fedilink
      English
      arrow-up
      28
      arrow-down
      1
      ·
      14 hours ago

      It is designed to be very, very human readable, and coding noob friendly

      As someone who can’t wrap my head around lua syntax, I will have to assume I simply have too much coding experience

      • gradual@lemmings.world
        link
        fedilink
        English
        arrow-up
        2
        ·
        5 hours ago

        Yeah, I remember using LUA back in the day for gmod.

        Hands down one of the shittiest languages I ever touched, right down there with PHP.

        Really puts into perspective how stupid developers can be when deciding the tools that they use.

      • sp3ctr4l@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        2
        ·
        6 hours ago

        I know what you mean lol, but Lua is very noob friendly… it goes fairly far out of its way to make many common functions and data types as compatible with each other as possible… so thats another way it is generally more slow, but also more forgiving, won’t just totally error out and be frustrating to a beginner coder.

  • 🇰 🌀 🇱 🇦 🇳 🇦 🇰 🇮 @pawb.social
    link
    fedilink
    English
    arrow-up
    27
    ·
    edit-2
    22 hours ago

    While awesome for just the technical aspect, I actually would find this to be a downgrade in the way I play, since it would mean no longer being able to make staircases out of books and pillows, as they would actually fall if they had physics. 🤣

    • LogicalDrivel@sopuli.xyz
      link
      fedilink
      English
      arrow-up
      6
      ·
      edit-2
      12 hours ago

      Cyrodillic Brandy has no physics and wont fall. Staircase away, my friend. Especially if you know how to dupe. (its ridiculously easy)

  • redhorsejacket@lemmy.world
    link
    fedilink
    English
    arrow-up
    27
    ·
    23 hours ago

    Does anyone recall what wound up becoming of the RTX tech demo which applied Ray traced lighting to Morrowind? The old axiom holds true, any mention of Morrowind results in at least one person reinstalling it, and it appears im the guy this time.

    • Quetzalcutlass@lemmy.world
      link
      fedilink
      English
      arrow-up
      26
      ·
      22 hours ago

      *peers suspiciously at username* Hmmmm…

      Anyway, OpenMW is amazing and the best way to play the game these days. The only bad thing I can say about it is the expanded draw distance shows how tiny the world map actually is, but that’s both not their fault and extremely minor considering how content dense Morrowind is.

        • sp3ctr4l@lemmy.dbzer0.com
          link
          fedilink
          English
          arrow-up
          3
          ·
          3 hours ago

          Also… isn’t the base game’s level of fog… more or less canonically justifiable, due to most of Morrowind taking place in… a swamp/bog type of biome?

          That or a volanic death zone that could just be said to have lots of gas plumes and such?

        • Quetzalcutlass@lemmy.world
          link
          fedilink
          English
          arrow-up
          7
          ·
          22 hours ago

          It should be compatible with most mods, or it was when I last played several years ago. Major overhaul packs have engine tweaks included that aren’t compatible and the script parser in OpenMW is/was stricter than vanilla’s so one or two poorly written mods might need typo fixes in their scripts, but other than that it seemed to work just fine.

          • justastranger@sh.itjust.works
            link
            fedilink
            English
            arrow-up
            2
            ·
            45 minutes ago

            There’s a growing catalogue of Lua mods for MWSE that aren’t cross-compatible and neither set of devs seem interested in a unified Lua API.

            • Quetzalcutlass@lemmy.world
              link
              fedilink
              English
              arrow-up
              1
              ·
              29 minutes ago

              That’s good to know, thanks! I was mainly thinking about traditional esp/esm mods; the script extender never even crossed my mind.

          • bogosort@discuss.tchncs.de
            link
            fedilink
            English
            arrow-up
            4
            ·
            22 hours ago

            I played Morrowind for the first time a few weeks ago and installed OpenMW, as I saw it being recommended.

            I don’t know anything about the game/engine, but after completing the setup and being told to walk to the next city I came across small enemies, and it tooks about 3 minutes to kill them as my hits didn’t seem to connect. Am I missing something or did I mess something up during installation?

            Sorry to ask you randomly here, but you seem to have experience :D

            • PumpkinSkink@lemmy.world
              link
              fedilink
              English
              arrow-up
              2
              ·
              5 hours ago

              I’m gonna guess your fatigue was low from running. Paying attention to your fatigue (and some kind of melee weapon as a major skill) makes the game much less of a drag in the first few levels.

            • Quetzalcutlass@lemmy.world
              link
              fedilink
              English
              arrow-up
              14
              ·
              edit-2
              22 hours ago

              That’s just how low levels work in Morrowind, unfortunately. The first few Elder Scrolls took heavy inspiration from tabletop games like Dungeons & Dragons, including making you roll for everything. Internally the game rolls after each swing to see if your attack hits, so you need to both hit an enemy physically and win a dice roll based on your skills.

              You’ll want to make sure your character starts with at least one weapon skill at as high a level as your class and race allow. At 40+ skill you’ll hit most of the time rather than whiffing 90% of your attacks. There is also a massive penalty to hit chance when your fatigue is low, so spamming attacks will get you nowhere.

              (I believe there are mods to make it work more like Oblivion and Skyrim where you only need to hit them physically and skills only affect damage, but I don’t know the names of those mods off the top of my head.)

            • jjjalljs@ttrpg.network
              link
              fedilink
              English
              arrow-up
              4
              ·
              19 hours ago

              Morrowind’s combat system is… if you’re feeling generous: weird. if you’re not: bad.

              You click on an enemy and it rolls dice to see if you hit. Your chance to hit is determined by your skills and stats, and your fatigue. yes, fatigue. If you’ve been sprinting and your fatigue is empty, you’ll probably miss more. This combos badly with the glacial movement speed of the game.

              You also want to hold the attack button a little longer to do more damage.

              If you start with a good axe skill (like 50), you can often hold to attack and knock people over, then finish them off. You might want to set “always use best attack” to true in the options- weapons typically have like a few moves, but one is usually better.

              The “bound weapon” spells are also good- they’re kind of cheap, and give you a high damage weapon that also boosts your skill by 10. There’s a merchant that sells a couple weapons that turn into bound weapons in Balmora.

              Blocking is also just a dice roll. I think it’s better to just get a giant two-hander and kill them faster, but opinions differ.

              Also fun: If you damage someone’s strength to 0, they can’t move. If you have a spear, your reach is probably longer than theirs. You can kill almost anything this way.

              also, while i’m here, the native leveling system is bonkers. You gain levels when your major skills improve. You get three stat increases based on any skills that went up. You can get up to +5 for each stat increase. This is not retroactive. If you level up and pick a +2 in strength, that’s what you get. This creates some utterly bizarre incentives. People would pick skills they don’t want to use as their major skills so they can control leveling, and pay trainers to bump skills tied to stats they want to increase. It’s horrible. You can kind of ignore it, but you’ll be much weaker than you would be if you play into it.

              • altkey@lemmy.dbzer0.com
                link
                fedilink
                English
                arrow-up
                4
                ·
                15 hours ago

                also, while i’m here, the native leveling system is bonkers… It’s horrible. You can kind of ignore it, but you’ll be much weaker than you would be if you play into it.

                The only roadblock here are guild requirements to get to the top of the hierarchy. Gameplay-wise, I can’t remember any time I had regrets over a borked leveling in the past or something. In spite of Morrowind’s system sounding utterly weird, it didn’t implement autoleveling to such a degree that it matters. Comparatively, I got frustrated with Skyrim and completely dropped Oblivion the last time I tried to revisit them. The latter directly tied enemies and their equipment to your base level, so it punished you greatly in the middle of the game if you pick something weird, and you can’t just sink money to correct that.

                • jjjalljs@ttrpg.network
                  link
                  fedilink
                  English
                  arrow-up
                  5
                  ·
                  edit-2
                  13 hours ago

                  The level scaling in Oblivion and Skyrim are worse, true. It’s kind of impressive how bad an idea and execution the level scaling in Oblivion was. They place enemies based on your total level, so if you leveled up from non-combat skills then you’ll have a bad time. It makes exploring kind of pointless, because you’ll never find anything interesting. And then there were the bandits wearing thousands of GP worth of equipment mugging you for 100gp.

                  one of the original developers recently came out and said it was a huge mistake: https://www.rockpapershotgun.com/elder-scrolls-4-oblivions-level-scaling-was-a-mistake-says-designer-so-why-is-it-in-the-remaster

                  In morrowind, not much scales with you so it matters less. You can’t raise a skill above its stat, so you can kind of paint yourself into a corner with bad leveling. (Though I think you can use fortify-attribute to get around that at trainers)

    • gradual@lemmings.world
      link
      fedilink
      English
      arrow-up
      3
      ·
      5 hours ago

      Controllers kind of work.

      They let you control the cursor. Actual support would be better, of course.

    • Quetzalcutlass@lemmy.world
      link
      fedilink
      English
      arrow-up
      13
      ·
      22 hours ago

      I’m shocked someone hasn’t grabbed the files from the Xbox release and used their implementation as a base. It wasn’t great, but it worked well enough on a controller considering how complicated Morrowind’s UI was.

      • Montagge@lemmy.zip
        link
        fedilink
        English
        arrow-up
        5
        ·
        22 hours ago

        I’m hoping the lua in OpenMW 0.49 willallow for it to be implemented. If I ever get free time I might try my hand at it.

  • Ephera@lemmy.ml
    link
    fedilink
    English
    arrow-up
    7
    ·
    21 hours ago

    But do they also randomly explode all over the place when you enter a room?

  • Quetzalcutlass@lemmy.world
    link
    fedilink
    English
    arrow-up
    8
    arrow-down
    1
    ·
    22 hours ago

    So now my thief can simply stack crates to get to a store’s unguarded second level instead of grinding the acrobatics skill? Nice.

    I know they try to remain faithful to the original design, but I can’t help but wonder how hard it would be for the OpenMW devs to integrate a full modern physics engine such as Jolt or PhysX into the engine. Probably much easier than building one from scratch in Lua of all things!

    • grue@lemmy.world
      link
      fedilink
      English
      arrow-up
      6
      ·
      21 hours ago

      I know they try to remain faithful to the original design, but I can’t help but wonder how hard it would be for the OpenMW devs

      I would love it if, after OpenMW hits 1.0, they set a new goal of feature parity with Skyrim (or Skywind).

      • CrackedLinuxISO@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        2
        ·
        41 minutes ago

        A post 1.0 goal is to be a general engine replacement for many Bethesda titles. OpenMW would be a platform for other projects to build OpenOblivion, OpenNewVegas, etc on.