More Awesome Than You!
Welcome, Guest. Please login or register.
2024 November 21, 20:38:56

Login with username, password and session length
Search:     Advanced search
540287 Posts in 18067 Topics by 6545 Members
Latest Member: cincinancy
* Home Help Search Login Register
+  More Awesome Than You!
|-+  Awesomeware
| |-+  Armoire of Invincibility
| | |-+  AwesomeMod!
| | | |-+  Code Fix for inactive slacker sims
0 Members and 1 Chinese Bot are viewing this topic. « previous next »
Pages: [1] 2 THANKS THIS IS GREAT Print
Author Topic: Code Fix for inactive slacker sims  (Read 19386 times)
twallan
Blathering Buffoon
*
Posts: 50


View Profile
Code Fix for inactive slacker sims
« on: 2009 July 18, 03:11:40 »
THANKS THIS IS GREAT

Greetings:

I've been encountering a problem regarding my inactive sims, where they simply don't go to school or work when not actively selected.  With AwesomeMod's "AllowInactivePerfGain" enabled, this tends to cause all my sims to eventually lose their jobs.

(Edit: Removed obsolete code, in favor of later posts)

Good day. Smiley
« Last Edit: 2009 July 25, 16:08:45 by twallan » Logged
J. M. Pescado
Fat Obstreperous Jerk
El Presidente
*****
Posts: 26288



View Profile
Re: Code Fix for inactive slacker sims
« Reply #1 on: 2009 July 18, 04:13:56 »
THANKS THIS IS GREAT

I provide this here for use by the El Presidente, if he so chooses.  It is not a perfect solution, but it does produce improved results over nothing at all.  I'm certain his most Malevolent will think up a better solution.
Uh...that's not a fix. In fact, you're not even in the right code. That function you're looking at? Isn't what controls whether inactive sims go to work when not selected. That's the fallback check in Supreme Commander. Furthermore, your code is based on an OLD version.
Logged

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
twallan
Blathering Buffoon
*
Posts: 50


View Profile
Re: Code Fix for inactive slacker sims
« Reply #2 on: 2009 July 18, 05:30:00 »
THANKS THIS IS GREAT

Quote
Uh...that's not a fix. In fact, you're not even in the right code. That function you're looking at? Isn't what controls whether inactive sims go to work when not selected. That's the fallback check in Supreme Commander. Furthermore, your code is based on an OLD version.

I am aware that it is not a true fix, simply a workaround to the core problem.  Until you have an official release of AwesomeMod that corrects the issue, it works for me.

The hooked code block is Sims3.Gameplay.Autonomy.Autonomy.RunAutonomy(), in which I found no AwesomeMod changes.  It did make use of a work handler that was available within AwesomeMod, because that was the effect I wanted (namely to push a "Go To Work" interaction on my sims).

If you could direct me to the actual location of the errant "Go To Work" process, I would be most grateful.  I would love to debug that process and find out why that system is not pushing my inactive sims to work or school. Smiley

The code is based on the official release of AwesomeMod, at least the one available via Mirror #1.  Since that is the only version I have available, I could not base the changes on anything newer.

Good Day. Smiley
Logged
J. M. Pescado
Fat Obstreperous Jerk
El Presidente
*****
Posts: 26288



View Profile
Re: Code Fix for inactive slacker sims
« Reply #3 on: 2009 July 18, 05:37:19 »
THANKS THIS IS GREAT

The actual go to work handler is buried someplace complex that I haven't found yet, something in the EAxis code involving alarms and whatnot. There are also lots of other things which could disrupt it, and other conflicting things.
Logged

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
twallan
Blathering Buffoon
*
Posts: 50


View Profile
Re: Code Fix for inactive slacker sims
« Reply #4 on: 2009 July 18, 05:46:22 »
THANKS THIS IS GREAT

Quote
The actual go to work handler is buried someplace complex that I haven't found yet, something in the EAxis code involving alarms and whatnot. There are also lots of other things which could disrupt it, and other conflicting things.

Yes, still being a neophyte to this particular code-base, I was perhaps too overly impressed with myself when I got my sims actually back to work.

I shall await your future Awesomeness in this regards, and just continue remerging my personal changes with your new versions, at least until you state a fix has been located.

Good Day. Smiley

----

Update:

Code:
protected virtual void RegularWorkDayTwoHourBeforeStartAlarmHandler()
{
    DateAndTime queryTime = SimClock.CurrentTime();
    queryTime.Ticks += SimClock.ConvertToTicks(3.1f, TimeUnit.Hours);
    if (this.ShouldBeAtWork(queryTime))
    {
        Sim createdSim = this.OwnerDescription.CreatedSim;
        if ((createdSim != null) && (this.mCurLevel != null))
        {
            if ((!createdSim.IsSelectable || !this.mbCarpoolEnabled) || !this.mCurLevel.HasCarpool)
            {
                queryTime = SimClock.CurrentTime();
                float num = ((this.mCurLevel.StartTime - queryTime.Hour) + 24f) % 24f;
                float time = num - this.AverageTimeToReachWork;
                if (time < 0f)
                {
                    time = 0f;
                }
                this.mRegularWorkDayGoToWorkHandle = AlarmManager.Global.AddAlarm(time, TimeUnit.Hours, new AlarmTimerCallback(this.RegularWorkDayGoToWorkHandle), "Career: time to push go to work", AlarmType.AlwaysPersisted, this.OwnerDescription);
            }
            else
            {
                StyledNotification.Format format = new StyledNotification.Format(Localization.LocalizeString("Gameplay/Objects/Vehicles/CarpoolManager:CarpoolComing", new object[] { createdSim }), ObjectGuid.InvalidObjectGuid, createdSim.ObjectId, StyledNotification.NotificationStyle.kTip);
                StyledNotification.Show(format, this.CareerIconColored);
            }
        }
    }
}

After further investigation, I found that the RegularWorkDayTwoHourBeforeStartAlarmHandler alarm was being fired 2.25 hours before work.

However the ShouldBeAtWork() check at the beginning of the routine originally only allowed for a 2.1 hour tolerance.

Changing the tolerance to 3.1 hours resolved my issue, without the need of any other code changes.

Yes, this is yet another workaround for an error further down in the system, but I did not investigate further into why the alarm was fired early.

Good Day. Smiley
« Last Edit: 2009 July 23, 04:07:33 by twallan » Logged
twallan
Blathering Buffoon
*
Posts: 50


View Profile
Re: Code Fix for inactive slacker sims
« Reply #5 on: 2009 July 24, 15:45:58 »
THANKS THIS IS GREAT

Further to this issue.

Though the 3 hour tolerance corrected the problem with the inactive sims going to work, it is still possible for them to bounce and drop the interaction.

So in addition, it was necessary to reapply the alarm to give the sim another chance to actually work.

Code:
        public static void RegularWorkDayGoToWorkHandle(Sims3.Gameplay.Careers.Career career)
        {
            Sim createdSim = career.OwnerDescription.CreatedSim;
            if (((createdSim != null) && ((AutonomyRestrictions.GetLevel() >= AutonomyLevel.Two) || createdSim.IsNPC)) && !createdSim.InteractionQueue.HasInteractionOfType(career.WorkInteractionDefinition))
            {
                // Update the HoursUntilWork()
                career.SetHoursUntilWork();

                VisitSituation.AnnounceTimeToGoToWork(createdSim);
                createdSim.InteractionQueue.AddNext(career.CreateWorkInteractionInstance());
            }
        }

The embedded code is a personal function called by Career::RegularWorkDayGoToWorkHandle.  The addition is a call to SetHoursUntilWork().

Normally SetHoursUntilWork() would be updated by the Autonomy::Update call, but my suspicions are that some sims are not being updated fast enough.  Perhaps I have too many and updating them all takes several sim-hours.  I will have to look into this further.

The consequence is that the HoursUntilWork member can be grossly incorrect (one sim was over three hours off).  And since it is used in WorkInRabbitHole.Definition::Test(), any attempt to push that interaction will fail.

Good Day. Smiley

( Edit: Updated intent of post entirely )
« Last Edit: 2009 July 24, 19:08:07 by twallan » Logged
Motoki
Lord of the Nannies
Uncouth Undesirable
****
Posts: 3509


View Profile
Re: Code Fix for inactive slacker sims
« Reply #6 on: 2009 July 26, 18:47:24 »
THANKS THIS IS GREAT

Since Pescado's usage and modification policy is "meh" can you post your version or at least tell us how to modify ours?

I am sick and tired of my god damned neighborhood sims never going to work or school.  Angry
Logged

In communist China Peggy's hairs cut you!
twallan
Blathering Buffoon
*
Posts: 50


View Profile
Re: Code Fix for inactive slacker sims
« Reply #7 on: 2009 July 26, 19:48:33 »
THANKS THIS IS GREAT

Since Pescado's usage and modification policy is "meh" can you post your version or at least tell us how to modify ours?

I am sick and tired of my god damned neighborhood sims never going to work or school.  Angry

(Download removed...  AwesomeMod version 28-07-2009 incorporates its own fix)

Here you go.  An modified copy of AwesomeMod version 23-7-2009.

Remove your "awesome.package" and replace it with the "updated_awesome.package".

If you are having the same issue as myself, then this should fix the problem.  If not, then you will need to wait until Pescado determines a solution.

My apologies in advance if the link doesn't work properly...  This is first time I've attempted this type of file sharing.

If it all works out in the end, I'd love to know.

Good Luck. Smiley

(Edit: corrected names of packages)

(Edit: Download removed...  AwesomeMod version 28-07-2009 incorporates its own fix)

« Last Edit: 2009 July 28, 19:00:40 by twallan » Logged
Motoki
Lord of the Nannies
Uncouth Undesirable
****
Posts: 3509


View Profile
Re: Code Fix for inactive slacker sims
« Reply #8 on: 2009 July 26, 20:09:35 »
THANKS THIS IS GREAT

Cool. I will try it out.

You did mention a whole mess of kids at the school in the morning. Have you had any issues with the zergswarming to all get into the tiny rabbit hole at the same time?

I followed someone's suggestion in the other thread and edited one of the ini's to let the sims walk through each other. Tongue
Logged

In communist China Peggy's hairs cut you!
twallan
Blathering Buffoon
*
Posts: 50


View Profile
Re: Code Fix for inactive slacker sims
« Reply #9 on: 2009 July 26, 20:35:54 »
THANKS THIS IS GREAT

You did mention a whole mess of kids at the school in the morning. Have you had any issues with the zergswarming to all get into the tiny rabbit hole at the same time?

I followed someone's suggestion in the other thread and edited one of the ini's to let the sims walk through each other. Tongue

I too have turned the DynamicAvoidance to 0.0 on my game.

Though prior to doing so, I still didn't note anything untoward regarding their school work...  Even if a couple chose to stand outside for several hours, they usually corrected it the next day by not being the last in that time around.

Good Day. Smiley

(Edit: Hit enter too early Tongue )
Logged
JBoat
Asinine Airhead

Posts: 43



View Profile
Re: Code Fix for inactive slacker sims
« Reply #10 on: 2009 July 26, 22:47:54 »
THANKS THIS IS GREAT

I too have turned the DynamicAvoidance to 0.0 on my game.
I simply cut the values in half (from defaults) which is quite realistic enough, and alleviates most of the traffic jams I see in-game.
Logged

cheriem
Horrible Halfwit
**
Posts: 383



View Profile
Re: Code Fix for inactive slacker sims
« Reply #11 on: 2009 July 27, 11:27:09 »
THANKS THIS IS GREAT

Thank you for solving the biggest frustration of this game for me.  Everything else is working flawlessly in my game and this was driving me insane. Tongue
Logged

shadow
Horrible Halfwit
**
Posts: 383



View Profile
Re: Code Fix for inactive slacker sims
« Reply #12 on: 2009 July 28, 04:22:24 »
THANKS THIS IS GREAT

This disables the 'lifetimehappiness' cheat for more reward points.
Logged
Motoki
Lord of the Nannies
Uncouth Undesirable
****
Posts: 3509


View Profile
Re: Code Fix for inactive slacker sims
« Reply #13 on: 2009 July 28, 04:35:24 »
THANKS THIS IS GREAT

This disables the 'lifetimehappiness' cheat for more reward points.

I never used that one but you can still left click on the happiness points screen next to the treasure box to add more points as long as you have testingcheatsenabled set on in the awesomeconfig.
Logged

In communist China Peggy's hairs cut you!
twallan
Blathering Buffoon
*
Posts: 50


View Profile
Re: Code Fix for inactive slacker sims
« Reply #14 on: 2009 July 28, 05:27:12 »
THANKS THIS IS GREAT

This disables the 'lifetimehappiness' cheat for more reward points.

Interesting, though I don't see why.  I was very careful to only make the three necessary changes to the code-base required to correct the work/school issue.  Everything else should be as is in the 23-07-2009 version of AwesomeMod.

Using a properly defined aweconf.package and the "updated_awesome.package", I was able to use the "lifehappiness" command.  If you are having issues, it is probably related to something other than this mod.

Good Day. Smiley
Logged
Baron
Marhis
Terrible Twerp
****
Posts: 2145


ISTP. Officially male since she plays MUDs


View Profile
Re: Code Fix for inactive slacker sims
« Reply #15 on: 2009 July 28, 07:16:30 »
THANKS THIS IS GREAT

I already had the lifetimehappiness code not working, without this modification, so I think it's due to something else too.
Logged

I say that a wise, when he does not know what he is talking about, should know enough to keep his mouth shut. -- C. Collodi, Pinocchio.
------
The one and only Rhayden's AIDE. Accept no substitutes.
J. M. Pescado
Fat Obstreperous Jerk
El Presidente
*****
Posts: 26288



View Profile
Re: Code Fix for inactive slacker sims
« Reply #16 on: 2009 July 28, 11:47:22 »
THANKS THIS IS GREAT

I am applying a more brute-force solution: I am just changing it so that instead of using frequently rubbish cached data, HoursUntilWork will always actually calculate the value, as the calculation doesn't look all that intensive anyway.
Logged

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
alphagirl
Asinine Airhead

Posts: 7



View Profile
Re: Code Fix for inactive slacker sims
« Reply #17 on: 2009 July 28, 17:57:02 »
THANKS THIS IS GREAT

I too have turned the DynamicAvoidance to 0.0 on my game.
I simply cut the values in half (from defaults) which is quite realistic enough, and alleviates most of the traffic jams I see in-game.

Is there a chance you might share this in form of a mod? With nearly all other annoyances having been covered by now, this one still doesn't seem to have been covered, and kitchen crowds are driving me crazy.
Logged
Gastfyr
Horrible Halfwit
**
Posts: 392



View Profile
Re: Code Fix for inactive slacker sims
« Reply #18 on: 2009 July 28, 17:57:27 »
THANKS THIS IS GREAT

instead of using frequently rubbish cached data, HoursUntilWork will always actually calculate the value
Pes, is that why when I switch to my inactives it has been saying they are "missing work" but if I try to send them to work, it says "it is not your time to work come back in X hours?".
Logged

TS3: it's really cool if you don't look too closely! - bottles
Motoki
Lord of the Nannies
Uncouth Undesirable
****
Posts: 3509


View Profile
Re: Code Fix for inactive slacker sims
« Reply #19 on: 2009 July 28, 18:02:33 »
THANKS THIS IS GREAT

I too have turned the DynamicAvoidance to 0.0 on my game.
I simply cut the values in half (from defaults) which is quite realistic enough, and alleviates most of the traffic jams I see in-game.

Is there a chance you might share this in form of a mod? With nearly all other annoyances having been covered by now, this one still doesn't seem to have been covered, and kitchen crowds are driving me crazy.

It's not necessary. You modify the "DynamicAvoidance*" settings yourself in file C:\Program Files\Electronic Arts\The Sims 3\Game\Bin\Sims3.ini

Either half them from the defaults as JBoat did or just set them totally to 0 if you don't mind them completely walking through each other.
Logged

In communist China Peggy's hairs cut you!
alphagirl
Asinine Airhead

Posts: 7



View Profile
Re: Code Fix for inactive slacker sims
« Reply #20 on: 2009 July 28, 18:37:41 »
THANKS THIS IS GREAT



It's not necessary. You modify the "DynamicAvoidance*" settings yourself in file C:\Program Files\Electronic Arts\The Sims 3\Game\Bin\Sims3.ini

Either half them from the defaults as JBoat did or just set them totally to 0 if you don't mind them completely walking through each other.
That's great, and sounds easy enough. However there are several DynamicAvoidance entries. Do I set the Field Radius to 0.06 (if I want it halfed), or do I have to half all values?

Logged
Motoki
Lord of the Nannies
Uncouth Undesirable
****
Posts: 3509


View Profile
Re: Code Fix for inactive slacker sims
« Reply #21 on: 2009 July 28, 18:46:36 »
THANKS THIS IS GREAT

That's great, and sounds easy enough. However there are several DynamicAvoidance entries. Do I set the Field Radius to 0.06 (if I want it halfed), or do I have to half all values?

Yep. Just change all of them. Make a backup copy before you do just so you have the original values and in case the patch decides to get picky about modified files.
Logged

In communist China Peggy's hairs cut you!
alphagirl
Asinine Airhead

Posts: 7



View Profile
Re: Code Fix for inactive slacker sims
« Reply #22 on: 2009 July 28, 20:59:58 »
THANKS THIS IS GREAT

That's great, and sounds easy enough. However there are several DynamicAvoidance entries. Do I set the Field Radius to 0.06 (if I want it halfed), or do I have to half all values?

Yep. Just change all of them. Make a backup copy before you do just so you have the original values and in case the patch decides to get picky about modified files.

I have tested this for a few hours now, and the kitchen situation has definitely improved. Thanks a lot!
Logged
Entgleichen
Blathering Buffoon
*
Posts: 90


View Profile
Re: Code Fix for inactive slacker sims
« Reply #23 on: 2009 August 04, 16:47:53 »
THANKS THIS IS GREAT

My sims still don't go to work/school. This happens to be only in a certain savegame. Something must be corrupted in it. Is there anything I could try to fix this?
Logged
AlexanderMorgan
Asinine Airhead

Posts: 29



View Profile
Re: Code Fix for inactive slacker sims
« Reply #24 on: 2009 August 19, 08:50:27 »
THANKS THIS IS GREAT

Same here. Despite the newest update this 'slacker syndrome' has appeared yet again. I've been trying to figure out what was the cause but no luck. At first i thought it may be the usage of switching between households by holding CTRL and clicking on a sim or house and selecting "Select Sim" or "Switch to [household name]". But it's not that. Than i thought maybe the sacred tag might have something to do with it, but so far i've tagged many sacreds and in my new game the town is still alive and everyone is going to work and school.

Now that i think about it, this problem might have first started to appear when i was saving my game and i received that "something-something-something error 12". So i tried again, and again and again and finally the game saved. Maybe the savegame was corrupt in the process? Who knows...

Too bad this slacker problem happens.  It convulses the entire town after a while in a game. If we could only discover what was causing it, we could avoid the trigger. I'm open for any gameplay testing if necessary.
Logged
Pages: [1] 2 Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.087 seconds with 20 queries.