DLL to Lua Event causing freeze, how to solve?

Discussion in 'Community Patch Project' started by Serp, Mar 28, 2021.

  1. Serp

    Serp King

    Joined:
    Apr 1, 2015
    Messages:
    650
    Hello,

    I already wrote here https://forums.civfanatics.com/threads/efficient-use-of-saveutilis.668750/#post-16061910 and here https://github.com/LoneGazebo/Community-Patch-DLL/issues/7510#issuecomment-808877363 , trying to find someone who is experienced in DLL modding.
    I guess the Community Patch devs are very experienced and maybe even already solved the underlying problem.

    Short summary:
    Like Pazyryk already discovered in 2011, calling "gDLL->GetScriptSystem()" in the DLL to send an Event to lua, can freeze/hang the game: https://forums.civfanatics.com/thre...lua-table-data-through-game-save-load.442249/
    I wonder if this problem was ever solved, because unlike Pazyryk wrote, this is not only true for the first autosave, it also happens randomly for other autosaves with his code.

    At CP github are quite a lot open/closed issues with "freeze", while many of them are "not reproducable", so maybe never solved.
    So it also might be in interest of Community Patch, to discuss this topic here, even if I use "my own" DLL.

    edit:
    I added more logs and it is "bool bResult = pkScriptSystem->CallHook(szName, args, value);" within CvLuaSupport.cpp instead, that is causing the random freeze when autosaving. Guess it has to do with the GameLock?
     
    Last edited: Mar 28, 2021
  2. Recursive

    Recursive Covets Lands That You Currently Own Moderator

    Joined:
    Dec 19, 2017
    Messages:
    2,691
    Gender:
    Male
    Hmm. DLL to LUA is far from my area of expertise. To my knowledge, @whoward69 and @Enginseer made major changes to the script and LUA systems.

    @Gazebo and @HungryForFood may also have valuable insights on this.
     
    Serp likes this.

Share This Page