[OPEN] GlobalResolver Error

by leroidetout
Reply

Original Post

[OPEN] GlobalResolver Error

[ Edited ]
★★★★★ Apprentice

Product: The Sims 4
Platform:PC
Which language are you playing the game in? English
How often does the bug occur? Occasionally (10% - 49%)
What is your current game version number? 1.89.214.1030
What expansions, game packs, and stuff packs do you have installed? All of them except for a few kits
Steps: How can we find the bug ourselves? There doesn't seem to be much consensus on how this error occurs, but it does seem to be coming from multiple sources. These include things like Trash Diver Sims going dumpster diving (but not when a player actively goes dumpster diving). That doesn't seem to be the only source of the error, however.
What happens when the bug occurs? From where in the code the error occurs, I would presume that the exception prevents the Sim from doing whatever they were attempting to do. Also from what I've seen and heard, this error is kind of spammy, so it likely results in game lag as well.
What do you expect to see? No exception
Have you installed any customization with the game, e.g. Custom Content or Mods? Not now. I've removed them.
Did this issue appear after a specific patch or change you made to your system? Yes
Please describe the patch or change you made. This is an error that has started occurring since the most recent patch, 1.89

Truthfully, I wish I could say more about this one, but it seems to be pretty intermittent, unfortunately. I even tried to force my Sim to be in one of the "situations" that I've seen cause it before in one person's error, and it didn't seem to cause problems for me.

 

I'm mostly posting this so that others with this error can talk about what was going on when the error occurred.

 

All exceptions take the following form, and often come in sets of 3 or 4 at a time:

Exception in Sim Timeline: Exception running Element (ValueError: Trying to use GlobalResolver with type that is not supported by GlobalResolver: ParticipantType.Object)

Note: The participant type isn't always Object.

 

Edit By Crinrict: Added Tag to Title

Message 5 of 21 (2,736 Views)

Global Resolver Error

★★★ Novice

.GlobalResolver object

 

I keep getting this message " Exception in Sim Timeline: Exception running Element (ValueError: Trying to use GlobalResolver with type that is not supported by GlobalResolver: ParticipantType.Actor), CategoryID: resolver:377" and I don't know how to fix it. Does anyone have any idea what is causing this?

Message 1 of 21 (2,934 Views)

Re: Global Resolver Error

Hero
@angela2878 Do you also have save issues ?

Do you just get this error or does anything bad happen in the game ?

Happy Gaming
Crin

Trennlinie

I don't work or have any association with EA. I give advice to the best of my knowledge and cannot be held responsible for any damage done to your computer/game.
Please only contact me via PM when asked to do so.



Important Threads


Message 2 of 21 (2,870 Views)

Re: Global Resolver Error

★★★ Novice

I just get a BE error. I can still play my game but it lags really bad and my sim will just stand there. Nothing major happens to my game. I want to fix it so my sim will stop standing there for such a long time not listening to me.

Message 3 of 21 (2,847 Views)

Re: Global Resolver Error

[ Edited ]
Hero

@angela2878 This seems to be a new LE happening with the patch. Might be best if you report this in the bug forum

 

 

Someone else made a bug report now so I merged your post.

Happy Gaming
Crin

Trennlinie

I don't work or have any association with EA. I give advice to the best of my knowledge and cannot be held responsible for any damage done to your computer/game.
Please only contact me via PM when asked to do so.



Important Threads


Message 4 of 21 (2,829 Views)

Re: GlobalResolver Error

[ Edited ]
★★★★★ Apprentice

Product: The Sims 4
Platform:PC
Which language are you playing the game in? English
How often does the bug occur? Every time (100%)
What is your current game version number? 1.89.214
What expansions, game packs, and stuff packs do you have installed? All but a few kits
Steps: How can we find the bug ourselves? Place a dumpster outside of your home lot. The dumpster likely needs to be at least filled enough that your player Sim can dive into it.
What happens when the bug occurs? An exception pops up
What do you expect to see? No exception and NPCs able to trash dive
Have you installed any customization with the game, e.g. Custom Content or Mods? Not now. I've removed them.
Did this issue appear after a specific patch or change you made to your system? Yes
Please describe the patch or change you made. Update to latest patch

Update: I am successfully been able to get the error to trigger by having a dumpster outside my Sim's house and sleeping through the night. When the game tries to schedule the "random NPC comes by to dumpster dive" situation, the game attempting to determine if the situation can occur caused the error.

 

In specific, the get_weighted_situations method of the WeightedSituationsWeeklySchedule class

Spoiler
@staticmethod
    def get_weighted_situations(cls, predicate=lambda _: True):
        resolver = GlobalResolver()  # global resolver is used, so cannot use tests that refer to objects

        def get_weight(item):
            if not predicate(item.situation):
                return 0
            if not item.tests.run_tests(resolver):
                return 0
            return item.weight_multipliers.get_multiplier(resolver)*item.situation.weight_multipliers.get_multiplier(resolver)

        weighted_situations = tuple((get_weight(item), (item.situation, dict(item.params.items()))) for item in cls.weighted_situations)
        return weighted_situations

And an exert from the dumpster object XML:

Spoiler
<V n="situation_scheduler_component" t="enabled">
      <U n="enabled">
        <V n="object_based_situations_schedule" t="enabled">
          <U n="enabled">
            <T n="consider_off_lot_objects">False</T>
            <T n="schedule_immediate">True</T>
            <V n="situation_schedule" t="weighted_situations">
              <U n="weighted_situations">
                <L n="schedule_entries">
                  <U>
                    <U n="days_available">
                      <T n="0 SUNDAY">True</T>
                      <T n="1 MONDAY">True</T>
                      <T n="2 TUESDAY">True</T>
                      <T n="3 WEDNESDAY">True</T>
                      <T n="4 THURSDAY">True</T>
                      <T n="5 FRIDAY">True</T>
                      <T n="6 SATURDAY">True</T>
                    </U>
                    <T n="duration">4</T>
                    <T n="random_start">True</T>
                    <U n="start_time">
                      <T n="hour">18</T>
                    </U>
                    <L n="weighted_situations">
                      <U>
                        <T n="situation">224194<!--SingleJobSituation: situation_TrashDiver--></T>
                        <L n="tests">
                          <L>
                            <V t="state">
                              <U n="state">
                                <T n="value">99560<!--ObjectStateValue: Trash_Rummagable_CanRummage--></T> <!-- this test is not allowed because it runs in the context of a GlobalResolver -->
                              </U>
                            </V>
                          </L>
                        </L>
                      </U>
                      <U>
                        <T n="situation">77411<!--WalkbyNobodySituation: situation_walkby_nobody--></T>
                        <U n="weight_multipliers">
                          <T n="base_value">2</T>
                        </U>
                      </U>
                    </L>
                  </U>

Unfortunately, I do not know how this can be solved. This is something that EA would have to fix.

Attachment
Download this attachment
Message 6 of 21 (2,693 Views)

Re: GlobalResolver Error

[ Edited ]
★ Apprentice

Product: The Sims 4
Platform:PC
Which language are you playing the game in? Español
How often does the bug occur? Often (50% - 99%)
What is your current game version number? 1.89.214
What expansions, game packs, and stuff packs do you have installed? All
Steps: How can we find the bug ourselves? I'm not sure
What happens when the bug occurs? Exception
What do you expect to see? No exception
Have you installed any customization with the game, e.g. Custom Content or Mods? Yes
Did this issue appear after a specific patch or change you made to your system? Neutral/Not Sure 

I'm having the same problem, is there any way to avoid it or what exactly causes it? It is very annoying because I am playing a new game that never gave me problems and now this exception keeps appearing

Message 7 of 21 (2,609 Views)

Re: GlobalResolver Error

★ Apprentice
After reading about the containers I opened my game and I noticed that in my lot, downloaded from the gallery, there was a large container from the EcoLife Style expansion misplaced with moveobjects, I deleted it and put another small one and at the moment I'm playing without problem .

Is it possible that the exception is caused by sims trying to rummage through an inaccessible container? Something similar has happened to me in other constructions with objects placed with move objects where the sims attacked each other trying to use them
Message 8 of 21 (2,551 Views)

Re: GlobalResolver Error

[ Edited ]
★★★★★ Apprentice

Product: The Sims 4
Platform:PC
Which language are you playing the game in? English
How often does the bug occur? Occasionally (10% - 49%)
What is your current game version number? 1.89.214
What expansions, game packs, and stuff packs do you have installed? All but a few kits
Steps: How can we find the bug ourselves? This specific version of the error involves holiday traditions. In the snippet below, it would appear to be "invite someone on a date" tradition.
What happens when the bug occurs? An exception pops up -- whatever drama node is supposed to occur (i.e. phone call, etc) doesn't get to happen also
What do you expect to see? No exception and the drama node being able to fire as expected
Have you installed any customization with the game, e.g. Custom Content or Mods? Not now. I've removed them.
Did this issue appear after a specific patch or change you made to your system? Yes
Please describe the patch or change you made. Update to latest patch

 

Spoiler
File 'T:\InGame\Gameplay\Scripts\Server\alarms.py', line 260, in _run [ self : <Alarm; HolidayDramaNode._run_pre_holiday.<locals>.<lambda>@219>, t : <scheduling.Timeline object at 0x00007FF492D99A10>]
File 'T:\InGame\Gameplay\Scripts\Server\holidays\holiday_drama_node.py', line 219, in <lambda> [ _ : <alarms.AlarmHandle object at 0x00007FF430E6B290>, self : customHolidayDramaNode:07:00:00.000 day:4 week:196]
File 'T:\InGame\Gameplay\Scripts\Server\holidays\holiday_drama_node.py', line 280, in _run_holiday [ self : customHolidayDramaNode:07:00:00.000 day:4 week:196, holiday_duration : 20.00 hours, active_household : Household Colour (854293161078643049): ; , holiday_tracker : <holidays.holiday_tracker.HolidayTracker object at 0x00007FF48D19D990>]
File 'T:\InGame\Gameplay\Scripts\Server\holidays\holiday_tracker.py', line 254, in activate_holiday [ self : <holidays.holiday_tracker.HolidayTracker object at 0x00007FF48D19D990>, holiday_id : 182140, holiday_service : holiday_service, tradition : <sims4.tuning.instances.holidayTradition_GoOnDate object at 0x00007FF47FA66B50>]
File 'T:\InGame\Gameplay\Scripts\Server\holidays\holiday_tradition.py', line 581, in activate_holiday [ self : <sims4.tuning.instances.holidayTradition_GoOnDate object at 0x00007FF47FA66B50>, sim_info : Cookie , buff : <class 'sims4.tuning.instances.buff_Holiday_Base_Active'>, resolver : <event_testing.resolver.GlobalResolver object at 0x00007FF44A74AD90>, sim_timeline : <scheduling.Timeline object at 0x00007FF492D99A10>, drama_scheduler : drama_schedule_service, drama_node : <class 'sims4.tuning.instances.dramaNode_NPCInvite_Date_Holiday'>]
File 'T:\InGame\Gameplay\Scripts\Server\drama_scheduler\drama_scheduler.py', line 488, in run_node [ self : drama_schedule_service, drama_node : <class 'sims4.tuning.instances.dramaNode_NPCInvite_Date_Holiday'>, resolver : <event_testing.resolver.GlobalResolver object at 0x00007FF44A74AD90>, uid : 736073807728508595, drama_node_inst : dramaNode_NPCInvite_Date_Holiday:None]
File 'T:\InGame\Gameplay\Scripts\Server\drama_scheduler\drama_node.py', line 894, in setup [ self : dramaNode_NPCInvite_Date_Holiday:None, resolver : <event_testing.resolver.GlobalResolver object at 0x00007FF44A74AD90>]
File 'T:\InGame\Gameplay\Scripts\Server\drama_scheduler\npc_invite_situation_drama_node.py', line 482, in _setup [ self : dramaNode_NPCInvite_Date_Holiday:None, args : (<event_testing.resolver.GlobalResolver object at 0x00007FF44A74AD90>,), __class__ : <class 'drama_scheduler.npc_invite_situation_drama_node.NPCInviteSituationDramaNode'>]
File 'T:\InGame\Gameplay\Scripts\Server\drama_scheduler\drama_node.py', line 753, in _setup [ self : dramaNode_NPCInvite_Date_Holiday:None, resolver : <event_testing.resolver.GlobalResolver object at 0x00007FF44A74AD90>]
File 'T:\InGame\Gameplay\Scripts\Server\event_testing\resolver.py', line 194, in get_participant [ self : <event_testing.resolver.GlobalResolver object at 0x00007FF44A74AD90>, participant_type : ParticipantType.Actor]
File 'T:\InGame\Gameplay\Scripts\Server\event_testing\resolver.py', line 377, in get_participants [ self : <event_testing.resolver.GlobalResolver object at 0x00007FF44A74AD90>, participant_type : ParticipantType.Actor]

Another apparent cause of this error (whose stack trace should look similar but won't necessarily look the same -- the "drama node" being run may change) is issues related to the game attempting to handle Holiday Traditions.

 

Holiday traditions can have "drama nodes" associated with them -- basically the things that schedule stuff like phone calls from NPCs and such -- and in this case there's a problem testing whether or not the node should be run.

 

From holidays/holiday_tradition.py:

Spoiler
    def activate_holiday(self, from_load=False, from_customization=False):
        if self._state >= HolidayState.RUNNING:
            logger.error('Tradition {} is trying to be put into the Running state, but is already in {} which is farther along.', self, self._state)
            return
        self._deactivate_pre_holiday()
        self._state = HolidayState.RUNNING
        if self.holiday_buffs:
            services.sim_spawner_service().register_sim_spawned_callback(self.on_sim_spawned)
            for sim_info in services.sim_info_manager().instanced_sims_gen():
                for buff in self.holiday_buffs:
                    buff_handle = sim_info.add_buff(buff, buff_reason=self.holiday_buff_reason)
                    if buff_handle is not None:
                        self._buffs_added[sim_info.sim_id].append(buff_handle)
        for (key, event) in enumerate(self.events):
            self._create_event_alarm(key, event)
        if not from_load:
            resolver = GlobalResolver() # using the global resolver is the issue here
            for actions in self.lifecycle_actions:
                actions.try_perform(resolver, TraditionActivationEvent.TRADITION_ADD if from_customization else TraditionActivationEvent.HOLIDAY_ACTIVATE)
            if self.drama_nodes_to_score:
                sim_timeline = services.time_service().sim_timeline
                self._drama_node_processor = sim_timeline.schedule(elements.GeneratorElement(self._process_scoring_gen))
            drama_scheduler = services.drama_scheduler_service()
            for drama_node in self.drama_nodes_to_run:
                drama_scheduler.run_node(drama_node, resolver)

Using a GlobalResolver is problematic here because the DramaNode needs access to the Sim it's being run against in order to properly test itself, which is causing the error.

 

It's clear this is a systemic issue and while in theory modders could patch over some of this code, or even undo the code that caused these exceptions in the first place -- before it used to just fail silently (which is still not desirable as failing silently is not desirable, "working" behaviour) -- these errors exist in so many disparate places and to patch over them would involve a lot of futzing and wouldn't simply be a clean workaround like we can often do (which is to say, "inject" code around the problem) but would instead require entire rewriting of code. This is unfortunately problematic both because the code is subject to change -- a problem injecting largely gets around as it doesn't remove or alter the existing code but simply adds new conditions to it -- and the code we get from decompilation is fairly decent but not always correct and trusting the decompiled code to be correct is necessary in order to rewrite it.

All this to say, detailing where these issues happen will be a goal of mine, but being able to fix them, from a modder's end, is going to be very hard. Some instances of them likely can be curtailed but as this issue seems to be systemic, there are lots of places it might arise, and fixing them may be either practically or functionally impossible.

Message 9 of 21 (2,453 Views)

Re: GlobalResolver Error

[ Edited ]
★★★ Apprentice

[Edited to add spoiler]
To add onto this, it appears this bug may have been around for some time, but due to a change in the resolver code in the 1.89 patch, it's only just started causing errors. Deaderpool found that before the patch, it would simply return an empty value, but now it instead generates an LE, see below spoiler:

Spoiler

Before the 1.89 patch:

class GlobalResolver(Resolver):

    def get_participants(self, participant_type, **kwargs):
        result = self._get_participants_base(participant_type, **kwargs)
        if result is not None:
            return result
        if participant_type == event_testing.test_constants.FROM_EVENT_DATA:
            return ()
        logger.error('GlobalResolver unable to resolve {}', participant_type)
        return ()

After the 1.89 patch:

 

class GlobalResolver(Resolver):

    def get_participants(self, participant_type, **kwargs):
        result = self._get_participants_base(participant_type, **kwargs)
        if result is not None:
            return result
        if participant_type == event_testing.test_constants.FROM_EVENT_DATA:
            return ()
        raise ValueError('Trying to use GlobalResolver with type that is not supported by GlobalResolver: {}'.format(participant_type))

 

 

 

Message 10 of 21 (2,452 Views)