Page 1 of 2

changing time in worldtime component of DaggerfallUnity entity while game is running makes unity freeze

Posted: Mon Apr 30, 2018 11:20 am
by Nystul
Hi Interkarma!

I just realized that changing time in worldtime component of DaggerfallUnity entity while game is running makes unity freeze.

This never happened before and must be caused by some more or less recent changes.
It makes testing the game harder now since one can no longer easily change time.

can you reproduce the freeze or does it work on your system?

Re: changing time in worldtime component of DaggerfallUnity entity while game is running makes unity freeze

Posted: Mon Apr 30, 2018 11:39 am
by Interkarma
Thanks for letting me know! I'll take a look tomorrow when I can.

Re: changing time in worldtime component of DaggerfallUnity entity while game is running makes unity freeze

Posted: Mon Apr 30, 2018 12:38 pm
by Interkarma
Edit: Just to confirm, are you editing the time directly from the Inspector panel or changing through code somewhere?

Re: changing time in worldtime component of DaggerfallUnity entity while game is running makes unity freeze

Posted: Tue May 01, 2018 1:44 pm
by Nystul
i try to change it directly via inspector

Re: changing time in worldtime component of DaggerfallUnity entity while game is running makes unity freeze

Posted: Thu May 03, 2018 8:05 am
by Interkarma
I can confirm this one Nystul, although haven't been able to track it down yet. Problem seems to occur when time is set to something below the current time. One of the time-sensitive systems is trying to do a catch-up process or something and going into a very long loop that shuts out rest of game.

To help work around this and return some of the editor functionality, I've removed the ability to edit WorldTime in Inspector and added a "RaiseTimeInSeconds" value instead. This will immediately step forward time by that number of seconds then reset to 0. Raising time doesn't seem to encounter this problem.

I know this isn't perfect, but it should give you the ability to pass time in accurate increments. For example, just set to 3600 to raise time by an hour, 86400 to raise time by a day, 604800 for a week, and so on.

I hope this at least helps you test what you need to for now. I'll take another look at this bug in future.

Re: changing time in worldtime component of DaggerfallUnity entity while game is running makes unity freeze

Posted: Thu May 03, 2018 8:49 am
by Nystul
thanks, yeah that is a suitable workaround ;)

Re: changing time in worldtime component of DaggerfallUnity entity while game is running makes unity freeze

Posted: Wed May 09, 2018 7:09 pm
by Hazelnut
Could be some of the time tracking code Allofich added maybe? Just a thought...

Re: changing time in worldtime component of DaggerfallUnity entity while game is running makes unity freeze

Posted: Wed May 09, 2018 9:57 pm
by Interkarma
Yeah, setting time backwards would probably throw those catch-up loops for a six. I don't mind though, real gameplay is much more important than mucking about with time in editor while game is running. Just being able to advance time in seconds is enough to work around problem and still gives some manual control over progress of time for testers. It just means time can only go forwards during normal play.

Re: changing time in worldtime component of DaggerfallUnity entity while game is running makes unity freeze

Posted: Thu May 10, 2018 4:15 pm
by Nystul
Interkarma wrote: Wed May 09, 2018 9:57 pm It just means time can only go forwards during normal play.
which is a reasonable decision anyway. otherwise you open pandora's box... or said differently you make the grandfather's paradoxon happen

Re: changing time in worldtime component of DaggerfallUnity entity while game is running makes unity freeze

Posted: Thu May 10, 2018 9:30 pm
by Interkarma
For sure. The more real game systems that come in, the more time-sensitive they become. I think the current means of just stepping forward time is a pretty good compromise for now, in addition to being able to set timescale from console.