Community Patch and LUAJit

Lukeroge

Warlord
Joined
Jun 28, 2014
Messages
166
Recently I've come across LuaJIT, a modified version of the lua dll for Civ V that increases the speed of lua code quite a bit by using JIT compilation. It works fine with vanilla, but some of the more complex modded lua code out there fails because of changes in the lua system.

So that got me thinking, since we are breaking support for a lot of unmodified third-party lua mods anyway, would it be a good idea for us to officially support something like this to get better performance out of the game? I have no idea if this is possible or practical, but it seems like it might work!
 
I've been using luaJit on and off for some time now and it does exactly what it says on the box.

The thread you might want to look at is this one.
Take particular notice of the points about how the 'arg' variable should be used. Took me only a few minutes to change the lua in CEP to be able to use luajit.

nb. I am using the statically-linked version which doesn't need the MSVC11 redistributable mentioned early in that thread.
 
I've been using luaJit on and off for some time now and it does exactly what it says on the box.

The thread you might want to look at is this one.
Take particular notice of the points about how the 'arg' variable should be used. Took me only a few minutes to change the lua in CEP to be able to use luajit.

nb. I am using the statically-linked version which doesn't need the MSVC11 redistributable mentioned early in that thread.

Awesome. I'm not a Lua developer myself so I can't do much with it, but hopefully one of you guys can check the current code out and make sure it all works at some point :)

I think it would be a nice upside for the project!
 
Seeing the install method, it's not something that could be included with the mod, but if it's possible to maintain compatibility with LuaJIT, I think that would be a nice thing to have.
 
Luajit is a handy tool to have and I am sure all the lua in use in this mod will be compatible.
Keep in mind though that most of the lua will be stock stuff from Firaxis, as this is a DLL mod most of complex lua that was, for instance in CEP, isn't needed as those functions are now in the DLL.
End result is, there will be minimal lua used and what is used will just work with luaJit.:D
 
Back
Top Bottom