Author Topic: Time advancement  (Read 489 times)

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Time advancement
« on: January 23, 2013, 07:59:21 pm »


               For some reason on our module, time does not advance. It is stuck at month 6, day 1, hour 13. Does anyone know what factors could cause this?

Also when I load the mod locally time does move forward, but for some reason on the server it doesn't.
               
               

               
            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
Time advancement
« Reply #1 on: January 23, 2013, 08:54:24 pm »


               This can happen if your server load gets high. The server diverts processing time from less-important tasks (like updating the clock). If you have NWNX, the nwnx_fixes plugin takes care of it. If you don't, you can add the following to your module's OnHeartbeat script:

SetTime(GetTimeHour(), GetTimeMinute(), GetTimeSecond(), GetTimeMillisecond());

               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Time advancement
« Reply #2 on: January 23, 2013, 10:09:49 pm »


               Thanks Monk, I may give that a try. Does that plugin still require NWNX_Core_2.7_Beta_4 (nwnx-module.dll)?
               
               

               
            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
Time advancement
« Reply #3 on: January 23, 2013, 10:22:02 pm »


               IIRC, yes. I use the 2.8 core, though, so I can't say from experience.
               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Time advancement
« Reply #4 on: January 24, 2013, 12:52:46 am »


               Hmm well I am trying nwnx_fixes right now, and no effect. Is there a specific ini setting I need to enable?

And on a side note is there a core 2.8 for Windows? I can't seem to find it.
               
               

               
            

Legacy_virusman

  • Sr. Member
  • ****
  • Posts: 448
  • Karma: +0/-0
Time advancement
« Reply #5 on: January 24, 2013, 12:57:58 am »


               As I said in another thread, unfortunately, the Windows version of NWNX Fixes is outdated and doesn't contain the time advancement fix.
               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Time advancement
« Reply #6 on: January 24, 2013, 08:58:49 pm »


               Thanks for the info virusman. If the fix does get ported to windows, I would happily use it.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Time advancement
« Reply #7 on: January 24, 2013, 09:47:23 pm »


               

Squatting Monk wrote...

This can happen if your server load gets high. The server diverts processing time from less-important tasks (like updating the clock). If you have NWNX, the nwnx_fixes plugin takes care of it. If you don't, you can add the following to your module's OnHeartbeat script:

SetTime(GetTimeHour(), GetTimeMinute(), GetTimeSecond(), GetTimeMillisecond());


Everything there is a NWN function,  It will work without nwnx.
               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Time advancement
« Reply #8 on: January 24, 2013, 10:19:17 pm »


               We don't use a heart beat script, but if I made one as simple as this:
void main()
{
SetTime(GetTimeHour(), GetTimeMinute(), GetTimeSecond(), GetTimeMillisecond());
}

Would that work?
               
               

               
            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
Time advancement
« Reply #9 on: January 24, 2013, 10:35:55 pm »


               Ayup.
               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Time advancement
« Reply #10 on: January 24, 2013, 10:43:49 pm »


               I was told heartbeat scripts on the mod can cause lag, but I will give it a shot and see what happens. Thanks everyone.
               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Time advancement
« Reply #11 on: January 25, 2013, 04:01:50 am »


               Well in case anyone is interested, we are using this now as our module event heartbeat script, and so far have not experienced any lag because of it.
               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Time advancement
« Reply #12 on: January 29, 2013, 08:32:46 am »


               I stand corrected. Although it's true we have not gotten any lag due to this, but this HB scripting solution seems to have resulted in:

spawns not rendering, party members not rendering, maps not getting explored, rest timer acting wonky, and restart times being extended way beyond the scheduled interval

I do not recommend this solution to anyone who has near the big or complex of a module as we have... It might work ok for a less complex mod, but I can not vouch for that.
               
               

               
            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
Time advancement
« Reply #13 on: January 29, 2013, 10:47:37 pm »


               This is how large, complex modules handled the issue before NWNX fixed it. I doubt these results are simply from updating the clock OnHeartbeat.
               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Time advancement
« Reply #14 on: January 30, 2013, 05:46:42 am »


               My apologies, you are correct, this doesn't seem to have caused the problem after all. We recently just changed to a new server, and apparently are having technical difficulties.