Creating an NRaas project Attn C# Devs: Overwatch

Talk nerdy to us here.
User avatar
Chain_Reaction
Site Admin
Reactions:
Posts: 7568
Joined: December 30th, 2011, 6:00 pm
Answers: 81
Contact:

Post by Chain_Reaction » January 24th, 2014, 7:24 am

Does that run when the game speed is changed? Do we know if there's adverse effects of changing an alarms context mid game? And how does one differentiate between alarms that are meant to be set to non-yield?

User avatar
JunJayMdM
Reactions:
Posts: 262
Joined: April 2nd, 2012, 6:00 pm

Post by JunJayMdM » January 24th, 2014, 7:36 am

Those are good questions, the very same I've been asking myself. I didn't want to bother the OnGameSpeedChanged event so no, it's only checked when the function runs. I can't cache them cos there's no way to compare timers accurately, cos the comparison is based solely on the the time and they have no string. How does this affect the game? I can't tell, the game runs but I have no clue what's going to do. I'll probably think about it some more and then eventually set it aside, too many questions unanswered.

User avatar
JunJayMdM
Reactions:
Posts: 262
Joined: April 2nd, 2012, 6:00 pm

Post by JunJayMdM » January 24th, 2014, 8:39 am

There are alarms set to run at a specific time though, a lot of them actually, like services, parties, careers, situations, etc... I can see how a late execution would result in atypical behavior. Probably not crashes or errors, but Sims missing work and getting fired or kids missing school and being punished, human sacrifice, dogs and cats living together, mass hysteria!
I'm basing all this on twallan's note anyway, maybe it was just an assumption or he actually experienced those errors and maybe that happens only if you let the game go at high speed for days. If my memory serves me well, doesn't Relativity have a similar warning about one of the options? I think it does, so maybe it would be safe to keep it in and just warn not to run the game at high speed for long durations.

User avatar
JunJayMdM
Reactions:
Posts: 262
Joined: April 2nd, 2012, 6:00 pm

Post by JunJayMdM » January 24th, 2014, 8:51 am

Aha, see here, the last line about reversing the time. It's just a note and nothing that actually IS in the mod, but it makes you think. If such adverse effects are best to be avoided, why would the Alarm Yielding for all would be any different?

User avatar
JunJayMdM
Reactions:
Posts: 262
Joined: April 2nd, 2012, 6:00 pm

Post by JunJayMdM » January 24th, 2014, 11:59 am

Right, the original code to yield all alarms definitely causes adverse effects. There were missing notifications and it tilted the Stuck Check process, and that was after 6 hours of running at high speed. However, with my code, there were no visible problems that I could see, all notifications showing fine and everything ran smoothly for a whole day running at high speed.

I'm uploading this one with the new code in a few minutes so further testing can be done by anyone who's interested, so we can see if my code has adverse effects too somewhere :)

User avatar
Chain_Reaction
Site Admin
Reactions:
Posts: 7568
Joined: December 30th, 2011, 6:00 pm
Answers: 81
Contact:

Post by Chain_Reaction » January 26th, 2014, 2:49 pm

I've had it running for a while and it seems fine. Admittedly I haven't actually "played" the game but nothing has blown up from my testing sessions.

While we are on the subject of yielding. Do you know what would cause the Sleep function to throw the Attempting to yield in a non-yielding context exception? I noticed someone uploaded a script error of Sims3.Gameplay.Services.SocialWorkerChildAbuseSituation.MoveSimDescriptionToNewHousehold throwing this error due to the sleep call there. They weren't using the latest Overwatch so it's not a side effect. I'm just curious.

User avatar
JunJayMdM
Reactions:
Posts: 262
Joined: April 2nd, 2012, 6:00 pm

Post by JunJayMdM » January 26th, 2014, 4:57 pm

@SimAd Yes, that's the right version, it's the one in the 113e zip file. There's no way to tell that, unless you remember where you got it from, or check if the YieldAllAlarms class matches the one on Chain's GitHub or mine.

I've been studying the Sleep() for months and I know when to use it and when not. As for knowing if it's a yielding context, all I know is that it's anything running under the Simulator. I didn't take my chances though, so in my mods I used Twallan's Sleep() (not the SpeedTrap one, the old one) to avoid problems, since it always checks for the context first. This leads me to believe that if he created it that way, he had his troubles figuring out exactly when it would be appropriate to run it. Probably the context can change depending on what the game is doing. So, that script error is caused by that, what SimAd said, it was trying to Sleep in a non-yielding context. Usually it's unimportant, cos everything will go on as nothing happened, so it can be ignored, especially if it's from EA code, since we can't do anything about it. Sometimes it might be placed in the middle of some function and it will halt it and all the consequences derived by that. Still, it doesn't always happen, so nothing to be alarmed about

Post Reply