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.
The physics in GMod isn’t implemented in Lua though. It was already part of the Source engine.

Yeah, was gonna say this.

If you actually do use Lua to significantly alter the actual physics, shit gets fuckywucky really, really fast… its quite inefficient and laggy.

I know, because I’ve tried to implement custom physics manipulations in Gmod via Lua… the netgraph, and server side lag, becomes absolutely absymal, really fast, if you’re trying to use it for more than just a few objects/interactions at a time.

Like the uh… Armored Combat Framework?

That tries to use Lua to allow you to construct your own custom tanks and what not?

That tries to do things like penetration/ricochet calls on physics and collision hulls… through Lua?

Astoundingly inefficient and laggy in pretty much any situation with more than 3 or 4 vehicles operating and engaging each other at the same time.

You have to have an unusually powerful server to be able to handle more than that, and its still gonna chug as you scale up conflict sizes.