civilization IV players hate this!
the thing you came foryou like civilization 5, huh? well, now you can enjoy it even more. this one weird trick makes civilization's processing go brrrrr. faster as light. lickety split. instructions in the linked webpage.
wait, what the heck?Civilization V, like Civilization IV before it, uses a Lua interpreter to load information into the game, to build, and execute AI decision trees, and to execute routines. the diplomacy system? controlled by a .Lua file. the menu system? controlled by Lua. this allowed development of the game to occur very quickly in a collaborative setting without having to constantly build and deploy new versions of the game -- a Lua file is a plain-text file, easily shared. Lua interfaces are not exactly uncommon. It's a very powerful scripting language, one that open source projects like Minetest use to enable users to create and distribute modifications. An entire game-making engine, LOVE2D, is built on it.
Interpreted languages like Lua can be performant, but not nearly as fast in executing instructions as native programs. Enter the JIT. Just-in-Time compilers/interpreters convert script into machine language, making the exact same script execute dozens if not hundreds of times more quickly. JITs sometimes omit or rewrite how functions work; some JITs keep variables in memory after a function is completed, for example.
LuaJIT, the gold standard, is built to Lua 5.1 specifications. However, LuaJIT has not received a complete stable release in years. So, as open source projects are wont to do, someone forked it. MoonJIT received one stable release before the maintainer quit – but the stable release did include some significant performance upgrades over LuaJIT.
Civilization V players have been using JITs for a while. Well, some of them. The version used by those who do is LuaJIT 2.0.5, which is positively ancient now.
So. Needing a new, faster performing Lua interpreter, what’s a person to do but compile moonJIT from source code?
And that’s what I did.
It works beautifully.