Skip to content

Bug: AutoDeployManager cannot consume entries on certain situation #111

Description

@dnqbob

On ModularBot, we can find


		// Called by the host's player creation code
		public void Activate(Player p)
		{
			// Bot logic is not allowed to affect world state, and can only act by issuing orders
			// These orders are recorded in the replay, so bots shouldn't be enabled during replays
			if (p.World.IsReplay)
				return;

			IsEnabled = true;
				});
			......
		}


		void ITick.Tick(Actor self)
		{
			if (!IsEnabled || self.World.IsLoadingGameSave)
				return;

			using (new PerfSample("bot_tick"))
			{
				Sync.RunUnsynced(Game.Settings.Debug.SyncCheckBotModuleCode, world, () =>
				{
					foreach (var t in tickModules)
						if (t.IsTraitEnabled())
							t.BotTick(this);
				});
			}
				});
			......
		}

which means BotTick can only run when:

  1. game is not a replay
  2. game is not on loading save game
  3. related bot trait must be enabled

so when AutoDeployManager running on a game that cannot satisfy those (it use BotTick), it loses the ability to consume entries add by AutoDeployer that binded on actors, so the entries expands and eat away many RAM when the replay is long enough.

I think you may need a way to stop AutoDeployer send entry to AutoDeployManager when BotTick is not working, especially for replay and loading save game.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions