Speed up your Civ V games with LUAJIT dll

After I changed the file to this new lua-whatevr, I've tried three times the following already:

Every time I press F12 (is it a screenshot?) the game now crashes. My game has never crashed & i play a lot. F12 isn't important key for me, i actually tried Civilopedia which is F1 of course but pressed it by mistake. Now that I think, I haven't yet pressed any other F-keys than F1 and this F12. I'm gonna tell, is some other keys make my game crash. I'm too lazy to change it immediately back to the previous .dll, so I'll give this a chance for a while.

Just to make you guys know. And say if F12 crashes your games too. It actually says something like Dir11 runtime error, if I remember it correctly. But never has my game crashed before, as I said.
 
This deal greatly inscreased my *.705 version speed. Now there's no lags at all!! Feels like I'm playing the very first fresh vanilla install. Thanks alot!
 
I'd advise not to try it on 64 bit machines.
From luajit site:
Make sure you use luaL_newstate. Avoid using lua_newstate, since this uses the (slower) default memory allocator from your system (no support for this on x64).
So, unless you have access to Civ V source code, since you don't know which lua_newstate they call, you should avoid luajit on 64 bit platforms because it may crash your program.

Personally, I've been trying to use luajit at work to speed up our own lua code. It's indeed faster. I suppose Civ 5 could get up to 5% faster performance at best, since most of the code is actually rendering stuff on the map and C++ stuff.
But luajit has a few issues, and in particular the 64 bit version just does not work with the default way people integrate lua programs. So if you play 32 bit, it may help you, but the 64 bit version does stuff with pointers that simply shouldn't be done, so you may want to avoid it.
 
It was definitely faster however it broke my mods and all my towns were on red alert when there were no enemies. So i couldn't used it sadly. And i also had up the top UI couldn't load.
 
@ LDiCesare.

That's totally opposite of what I'm experiencing. I run Win 7 64-bit and that .dll completely eliminated lag when clicking on city, research etc. It sped up AI turns about 300% times. I'm into 500 turns into a game and not once my game crashed.

It breaks your save files. However, if you start a new game with mods like RED and CivUp it will work fine with them.
So, as with mods, finish your game before swapping this .dll.
 
@ LDiCesare.

That's totally opposite of what I'm experiencing. I run Win 7 64-bit and that .dll completely eliminated lag when clicking on city, research etc. It sped up AI turns about 300% times. I'm into 500 turns into a game and not once my game crashed.

It breaks your save files. However, if you start a new game with mods like RED and CivUp it will work fine with them.
So, as with mods, finish your game before swapping this .dll.

I am also running win 7 64 It seems to work okay with mods if you start up a new game but dosent work to well with save games. So i am going to start a new game because i know it will be worth it.
 
I found that this is braking some mods, like Ingame Editor and Cultural Expansion.... might be one of the reasons it is speeding up....
I will give a look into why IGE breaks with this. Now IGE does not consume anything when it's closed, so there cannot be any performance gain because of this.

That's totally opposite of what I'm experiencing. I run Win 7 64-bit and that .dll completely eliminated lag when clicking on city, research etc. It sped up AI turns about 300% times. I'm into 500 turns into a game and not once my game crashed.
It all depends on whether you use big mods like total conversions. Because the only thing the JIT can improve in the base game is the UI CPU consumption and I do not think it amounts to a lot.
 
I will give a look into why IGE breaks with this. Now IGE does not consume anything when it's closed, so there cannot be any performance gain because of this.


It all depends on whether you use big mods like total conversions. Because the only thing the JIT can improve in the base game is the UI CPU consumption and I do not think it amounts to a lot.

As I stated before *.705 version introduced an unimaginable UI lag and it even somehow somewhat affected my FPS. That JIT made it COMPLETELY disappear and it even increased AI turn speed.

You can argue all you want, but in my case the facts say otherwise. Maybe my 64bit Win7 on 2720QM, HD6970 and Crucial SSD create magical symbiosis with that .dll.
 
After thoroughly testing the mods i found out it wasn't the have fun mod it was the unofficial patch for GK with the error ui failed to load. Anyone know a work around for this.
 
I think this DLL lacks some functions of civ5's default lua.

R.E.D. WWII can't be used with it.
 
@ LDiCesare.

That's totally opposite of what I'm experiencing. I run Win 7 64-bit and that .dll completely eliminated lag when clicking on city, research etc. It sped up AI turns about 300% times. I'm into 500 turns into a game and not once my game crashed.

It breaks your save files. However, if you start a new game with mods like RED and CivUp it will work fine with them.
So, as with mods, finish your game before swapping this .dll.

As I said, it depends on how the coders implemented the link between lua and C/C++.
If it runs, it's great. But as others point out, some mods don't work because luajit is not a perfect lua port. I suppose Civ V doesn't use custom memory allocators, or at least doesn't pass objects allocated this way to lua.
So do try it, but be warned it's not perfect.

I'd be interested in knowing the speed boost you get if you can measure that. I'm thinking around 10% but that's a really wild guess.
 
Hi guys,

Been lurking here for years, but bumped into this thread and thought I'd contribute for once... :) I noticed the Luajit version that was compiled into a DLL was an old one (1.1.6), so I compiled two new ones based on:
- 1.1.8
- 2.0.0 b10 - Supposedly, the 2.0.0 version (compared to 1.1.8) has (LUA-wise) even more performance enhancements.

You can find these here: http://rapidgator.net/file/44883061/luajit-compiled-dll.zip.html

I've been playing a game with the 2.0.0 version and can confirm it seems to work find as a drop-in remplacement, but CivUP is still broken with 2.0.0b10 and so is IGE. If you disable those though, you'll find you have a pretty darn smooth gaming experience.. I've tried to debug a little using firetuner but since I don't know the first thing about LUA scripting I won't try any further.

If anyone feels up to doing some actual performance testing to see if this actually does increase performance, go ahead - I won't be. My gut feeling tells me it works better than the standard LUA interpreter, and if I at least perceive it that way, it makes me just as happy as a real performance improvement. ;-)

Good luck & have fun..
 
Oh by the way, it is very easy to compile these yourself if you don't trust it, especially if you have visual studio.

The Luajit distribution includes a batch file that you can simply run using the VS command line utility. It does all the work for you!
 
I think this DLL lacks some functions of civ5's default lua.
R.E.D. WWII can't be used with it.
It's *supposed* to do everything lua can even if it's not all compiled (http://wiki.luajit.org/NYI). The issue is more likely that it's still beta code (the dll is a compiled version of LuaJIT 2.0.0-beta10 — 2012-05-09).
I have been using this dll for a couple of months now (on a wintel 7 x64 high end pc, as stated previously) and the only bug I encountered *when playing without mods* was that yield display sometimes disappears in a square area (although this may be a bug in civ V itself, which I had not encountered before)
 
Didn't see performance improvements with windows 7 64-bit (I know someone said you shouldn't use this with 64-bit but I just wanted to check it out).
 
I would like to try this out, but I am getting a "404 not found" error. Is the link broken for anyone else?
 
Top Bottom