Morrowind modders continue to astound, add object physics with 'pure lua' to a 23-year old game

https://lemmy.ca/post/44048900

Morrowind modders continue to astound, add object physics with 'pure lua' to a 23-year old game - Lemmy.ca

Lemmy

… 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.

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
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.

Project…Zombie?

Do you mean Zomboid?

If so, Zomboid isn’t … the physics aren’t done in Lua.

The base of the game is written in C++, and then certain parts of that are exposed to modders via an API that works with Lua.

expertbeacon.com/is-project-zomboid-java/

The physics engine is written in C++.

Because Lua is waaay too slow, and even compiled Java is about 4x as slow as C++.