1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Speed up your Civ V games with LUAJIT dll

Discussion in 'Civ5 - General Discussions' started by bc1, Jul 27, 2012.

  1. bc1

    bc1

    Joined:
    Jan 12, 2004
    Messages:
    1,209
    There is now a Just-in-time (JIT) compiler for Lua which seems compatible with Civ V (used for some time on a fairly high end Win 7 x64 machine), which seems to speed up the game (noticeably when running lua intensive mods or map scripts or very large maps)

    At your own risk:

    1/ download the following file from its open source repository:
    https://github.com/malkia/ufo/blob/master/bin/Windows/x86/luajit.dll?raw=true

    2/ in the Civ V application folder, rename existing lua51_Win32.dll to something else (or move it somewhere else), and replace with the downloaded file (which needs to be renamed to lua51_Win32.dll)

    3/ :goodjob: run the game as usual...

    Does this also work for you ?
     
  2. Frytak

    Frytak Chieftain

    Joined:
    Dec 27, 2011
    Messages:
    13
    No, there is no difference. Tried quick save from Large earth map

    Without your file first turn = 18 - 18,5 sec

    With your file the same first turn from the same quick save - 18 - 18,9 sec

    So no really difference.
     
  3. bc1

    bc1

    Joined:
    Jan 12, 2004
    Messages:
    1,209
    It's supposed to make the game run faster during lua script activity e.g. between turns & when generating maps, but not necessarily when loading / saving
     
  4. Kwami

    Kwami Emperor

    Joined:
    Oct 3, 2010
    Messages:
    1,357
    I didn't notice any improvement on my huge continents map. It was a game on epic speed, somewhere around turn 1100, and the turn times were more than one minute with both DLLs.
     
  5. bc1

    bc1

    Joined:
    Jan 12, 2004
    Messages:
    1,209
    :eek: over one minute ? :hmm: did you turn animations off ? :run: that's the first thing to do if you want to speed up your game...
     
  6. Babri

    Babri Emperor

    Joined:
    Apr 16, 2010
    Messages:
    2,449
    Location:
    Pakistan
    Hmm... I'll try it. Maybe this one would do the magic. :please:
     
  7. gozpel

    gozpel Couch-potato (fortified)

    Joined:
    Jan 3, 2002
    Messages:
    4,381
    Location:
    Australia
    I'm on XP, and by turning off some graphics, then use quick movement and quick combat, I still hold on, on a huge map.

    36 cities, and I decided to use "let the workers go rampant"!

    It saves a lot of managing, and the workers do their job pretty well so far. :)
     
  8. woodshadows

    woodshadows King

    Joined:
    Jan 12, 2011
    Messages:
    717
    Location:
    Newfoundland
    I play exclusively in strategic view, I can't stand the game load times and I've gotten so used to strategic view now that the normal view just seems cluttered and difficult to see what's going on.
     
  9. JtW

    JtW Prince

    Joined:
    Aug 23, 2010
    Messages:
    575
    Location:
    Poland
    Same here! The only problem I found is that with Gods and Kings, I cannot see the religious details of cities in strategic view. Have you found any workaround?
     
  10. Kwami

    Kwami Emperor

    Joined:
    Oct 3, 2010
    Messages:
    1,357
    I turned combat animations off, but I enjoy the movement animations. I've read that turning them off can improve performance. I did try that, but 1) it didn't improve performance by much, and 2) I hated seeing my units teleport around. So ugly!

    Anyway, I was just posting my results. I couldn't get exact times because I kept getting interrupted by AI nonsense, but I played about 8 turns with each DLL and the overall time was about the same.
     
  11. bc1

    bc1

    Joined:
    Jan 12, 2004
    Messages:
    1,209
    Thanks for the feedback :) But please also note the dll only affects the speed of pure lua scripting activity, and has no effect on speed of other activities such as graphics, native C code, and even C funtions called by lua... Also since lua is used a lot by the UI, it should also feel a bit more responsive.
     
  12. AlpsStranger

    AlpsStranger Jump jump on the tiger!

    Joined:
    Feb 8, 2009
    Messages:
    5,820
    Errr... I've scanned this and I can't get anything to flag it, but I'm pretty sure downloading this is a security risk.

    I guess I'll look and feel pretty stupid if this is some kind of malware.

    Then again, it's not the first EXE/DLL I've downloaded off here :crazyeye:

    EDIT: Interesting. When running UP(G&K) and Infoaddict it does seem to speed it up.
     
  13. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,079
    Location:
    Germany / Netherlands
    GitHub is a totally legit coding platform, well known under programmers.
    You can even download the source code to check if there's malicious code in it (theoretically). The user, who developed this .dll, has been active on GitHub since 2010, and I think this lowers the chance that he might be a malware author.

    Additionally we've uploaded the .dll to virustotal.com, and no malware scanner detects it as malicious.

    -> I guess it's safe :D.
     
  14. Sonereal

    Sonereal ♫We got the guillotine♫ Supporter

    Joined:
    Mar 31, 2008
    Messages:
    14,790
    Seconded. I only go into normal view for screenshots these days.

    If you zoom in close to the cities, you can hover over them and it tells you the number of followers present in each city.
     
  15. mr_boogie

    mr_boogie Chieftain

    Joined:
    Sep 18, 2008
    Messages:
    6
    It works great on my PC..... turns reduced from 2 minutes to 20 seconds.... using some mods, which are intensive on Lua, so it is working it's magic....
    Also, CPU use went from 35% to 59%, avg, so guess the JIT compiler is doing it's magic....
     
  16. TheMeInTeam

    TheMeInTeam Top Logic

    Joined:
    Jan 26, 2008
    Messages:
    25,104
    Oh? If this works civ V might actually be playable. I'll give it a test when I have time. I'm sick of giving orders and then waiting a few seconds before the game lets me give another one or end turn, while playing in strategic view without animations.
     
  17. Ellye

    Ellye Warlord

    Joined:
    May 13, 2008
    Messages:
    243
    Same here, I play only on Strategic View. Quite faster, and I actually prefer this view mode.
     
  18. mr_boogie

    mr_boogie Chieftain

    Joined:
    Sep 18, 2008
    Messages:
    6
    I found that this is braking some mods, like Ingame Editor and Cultural Expansion.... might be one of the reasons it is speeding up....
     
  19. Kabloosh

    Kabloosh Warlord

    Joined:
    Jun 10, 2012
    Messages:
    182
    I've found that you really only need to micro manage at the very beginning and at strategic points at certain points of the game. Otherwise letting them run rampant works fine.
    Only change I would like to see is the removal of marshes from the "don't clear forest marshes" options. Marshes are just useless and its annoying being allowing to build crap over them. They don't provide something of equal or greater value like forests do compared to when they are cleared.
     
  20. Kwami

    Kwami Emperor

    Joined:
    Oct 3, 2010
    Messages:
    1,357
    The Dutch disagree!
     

Share This Page