Is It Possible To CACHE MP scripts ... Or Speed Up MP Access Of Them?

Hi All,

I am in the process of testing The Scroll in MP mode.

During the process, I have noticed that there can be a very slight delay for players when they click an action. From what I learned a few months ago now, I recall that MP clients use the scripts that are on the server and not any copies they may have locally to their computer.

I was wondering if there was any way to have these scripts respond more quickly, either by (a) caching them for clients somehow, or (b) placing the scripts in some location on a clients computer that may allow them to be called and used more quickly?

Of course, what I am asking may be impossible due to the nature of the way MP works, but ask in case there is something that can be done to help improve overall performance. EDIT: It may not be essential, but is just something I would do if possible.

Many Thanks, Lance.

There is a “cached script” option in the module properties window (in the toolset), but it seems to do nothing when you click the Add button.
Perhaps it’s a leftover from NWN1 and not really intended for NWN2.

If possible, you should just try to improve the code and make it more efficient by itself.
I can give a hand with parts of that as well, if a scripts slows down too much.

I think it’s more a latency issue, rather than a script optimization issue : if the script was poorly optimized, your server process would hang for a few milliseconds / more and every player would have rollbacks.

There are server-side script optimization tools, like Skywing NWScriptAccelerator nwnx4 plugin, but it will probably make no difference.

The best solution (or workaround) is to rely as much as possible on client-side GUI callbacks like UIButton_Input_ShowObject / UIObject_Misc_SetLocalVarString / UIText_OnUpdate_DisplayLocalVar / … , rather than UIObject_Misc_ExecuteServerScript

Hi All,

Thanks for the replies.

Clangeddin: I agree … I think that “cached script” may well be a leftover from NWN1.

CromFr: This is something that I will have to look into then, as I believe there may be a particular UIObject_Misc_ExecuteServerScript that is doing a lot of callbacks.

I have also considered some coding aspects that may be more demanding in MP compared to SP, and may try some “disable and retry” to see if it makes much difference.

I will see how the sessions go when we start to play proper (most likely August) after people being away on vacations. If the fractional delays cause too much interference, then I will definitely have to start more investigation.

Thanks, Lance.