Skip to main content

Known patch points

These are the game methods that working mods already patch, so you know they're good hooks and who else is on them. It covers our own mods (TavernLib, TavernEssentials, Steady, Canary, Rover, Lens and ATT-Optimizations' Cave Performance and Forest Performance) and the public mods in the TavernMods index that patch the game. Community mods are listed by their index id (Owner.Repo).

How to read the tables:

  • Kind: Pre prefix, Post postfix, Fin finalizer, Trans transpiler. "skips" means the prefix returns false, so the game's method doesn't run: always, or only in the case described.
  • Side: where the patch has an effect. A patch applied with attributes is installed on both sides even when only one side ever calls the method.
  • Types with no namespace are top-level types in Root.Township. Pathfinding.*, AstarPath and Seeker are the A* Pathfinding Project, compiled into Root.Township.
  • MoveNext rows patch a compiler-made state machine (<Name>d__N), found by name at run time.

Methods that more than one mod patches are listed at the end, under Methods patched by more than one mod.

note

Some targets, like ServerPlayerConnectionHandlerOld, ServerHandler.PlayerLimit, StreamerManager.SaveWorld, ServerCacheManager and most of the console command modules, only exist in the server build. That's the build every Tavern install runs, and what att-stubs is made from. The original client download doesn't have them. See Finding your way around.

How each mod patches​

ModTypeHow it applies patchesSide
TavernLibMelonPlugin[HarmonyPatch] attributes, applied as the plugin loads. Console command fixes by hand in OnLateInitializeMelon, plus one MonoMod detour.Installs everything on both sides; most targets only run on one.
TavernEssentialsMelonModBy hand in OnInitializeMelon, one Harmony id per feature (tavernessentials.board and so on), each feature in its own try.Decides with ApplicationManager.IsHeadless or /start_server.
SteadyMelonModBy hand in OnInitializeMelon through a helper that skips missing targets. Each fix has a MelonPreferences toggle; several step aside when ATT-Optimizations does the same job.Most fixes server only (/start_server).
Cave Performance, Forest PerformanceMelonModBy hand in OnInitializeMelon. Refuse to start unless Root.Township's MVID is the one for server 0.0.39.2. Modules have their own Harmony ids and toggles.Only when Application.isBatchMode, which a headless bot client also is.
RoverMelonPluginBy hand: early patches in OnPreInitialization, the rest at OnApplicationLateStart.Bot clients only. Does nothing on a server but add console commands.
LensMelonModBy hand in OnInitializeMelon through a helper.Clients with graphics only.
CanaryMelonModIts profiler patches methods while canary profile runs, 25 a frame, and takes them off after.Server.
Nyx12012.CookingLibMelonModBy hand, server only, in feature groups.Server.
Cheeto35.CheetosOreSpawnFixMelonModAttributes; bodies check for a server and the config.Server in effect.
CG-Nik.CustomRecipesAPIMelonModOne patch by hand in OnLateInitializeMelon.Both.
CG-Nik.DyeingAPIMelonModBy hand inside a ServerHandler.Initialized handler.Meant for the server.
Circl-NoE.ATTMateriaLibMelonModAttributes.Both.
TheRavenSeb.hydrateordiedrateMelonModBy hand with its own Harmony id, server or client patches by /start_server.Both, different patches.
calebv2.Portal-GunMelonModAttributes, in separate client and server DLLs.Client in effect.

Start-up, VR and settings​

MethodKindModSideWhat it does
Alta.XRLoaders.XRUtility.GetCommandXRMode() (Alta.XRManagement)Pre, always skipsRoverClientAnswers NoVR, so no VR runtime loads. Patched in OnPreInitialization.
DeviceControllerFactory.CreatePre, always skipsRoverClientReturns Rover's own input device.
Alta.Utilities.GameSettings.IsUsingSmoothLocomotion, TouchLocomotionMode, PressLocomotionMode, SmoothLocomotionRunMode, IsInvertingSmoothWalkAndRun (getters)Pre, always skipsRoverClientForces smooth locomotion, head-relative stick, hold to run, no walk/run swap.
DarknessReader IInitializeAsLocalPlayer.InitializeAsLocalPlayer (explicit interface)FinRoverClientSwallows the throw from the compute shader with no GPU, which otherwise skipped the rest of PlayerController.LinkToPlayer.
Discord.Discord constructor (long, ulong), found by namePre, throwsRoverClientMakes the Discord link fail the way it does on a PC without Discord, so a bot doesn't take over the PC's Discord status.
ApplicationStartupManager.RunStartupActions()Pre, skips with TavernLib's join-local argumentTavernLibClientJoins a local server straight from the command line.
MenuSettings.LocalGameServerInfo(int)PostTavernLibClientPoints the local test server at loopback and the port from the command line; forced scene index.
JoinedServerGameMode constructor (GameServerInfo)PostTavernLibClientForces the tutorial (1) or Quest (4) scene from the command line.
ApiAccess.IsConnectedToInternetInternalPostTavernLibBothAlways answers that there's internet.
StatManager.Awake() (private)PreTavernLibBothRenames the cripple damage protection stat (hash 44538) from damageprotection to crippledamageprotection. In the game's assets both it and the Damage Protection stat are named damageprotection, so anything that looks a stat up by name could get the wrong one.

Joining a server: the client​

MethodKindModSideWhat it does
JoinServerPipeline.AttemptToConnectToServerPre, skips when handing overTavernLibClientQuits for the launcher to install missing mods when you rejoin a server that just refused you for them.
JoinServerPipeline.OnServerRejectedRequest(Connection, ConfirmJoinMessage)PreTavernLibClientOn a mod-mismatch refusal, writes last_rejection.json for the launcher, marks it JoinRejected so the game doesn't retry, and rewrites the message.
samePostRoverClientReports the refusal and quits the bot.
Alta.Networking.Servers.JoinResult.ErrorMessage (getter)PostTavernLibClientShows TavernLib's refusal text instead of the game's fixed line.
samePostTavernEssentialsClientShows the server's own refusal reason.
JoinResult.IsRecoverableFailure (getter)PostTavernEssentialsClientStops retrying (24 times over two minutes) a refusal that waiting won't fix.
GameServerInfoExtensions.JoinServerAsync(GameServerInfo) (static, async, found by name)PostTavernEssentialsClientFor community-list servers, runs the port 1762 handshake first and puts its token in the join.
JoinServerPipeline.ConnectionApprovedByServer(Connection) (private)PreTavernEssentialsClientSets the logged-in user id to the one in the join token before the join message is built.
Alta.Networking.Servers.ConnectToServerUtility.SetupConnectionToServer(Connection)PostTavernEssentialsClientRegisters its own message handler on each new connection.
samePostTheRavenSeb.hydrateordiedrateClientRegisters a handler for its message type 40 and says hello to get the thirst level.
ServerElement.SetupForServer(GameServerInfo)PostTavernEssentialsClientMarks servers where friends were seen with a *.

Joining a server: the server​

MethodKindModSideWhat it does
Alta.Networking.Servers.ServerPlayerConnectionHandlerOld.InitializeConnection(Connection)Pre, always skipsTavernLibServerPuts TavernLib's join filter on RequestJoin: fly-camera check, account token, mod parity, blacklist and whitelist, then the game's own check.
ServerPlayerConnectionHandlerOld constructor (ServerHandler)PostTavernLibServerRaises TavernLib's player-left console event from the handler's UserLeft.
ServerPlayerConnectionHandlerOld.CheckIfPlayerIsAllowedCustom(...) (async)Pre, always skipsTavernLibServerReads the token's single UserId and Username, refuses a mismatch, refuses once the server is past PlayerLimit ("Reached player limit of: N"), and maps users.json roles to the game's subscriber statuses. Never asks Alta, and skips the game's version and allow-list checks.
samePostTavernEssentialsServerJoin guard: logs, or with refuse mode refuses, a join whose token id differs from the player id.
Alta.Networking.ConfirmJoinMessage constructorPostTavernLibServerLogs every refusal.
Player.InitializePlayerOnServer(...) (async)PostTavernLibServerRaises the player-joined console event. Runs at the method's first await.
samePostTavernLibServerSends the player their roles (TavernLib message ReceiveRoles).
Alta.Networking.Servers.ServerHandler.PlayerLimit (getter)PostTavernLibServerPlayer limit from server_settings.json's max_players (24 when it's missing or 0). TavernLib's join check enforces it.
ServerHostingGameMode.OnStartSucceededPostTavernLibServerLoads all cosmetics into memory once the server is up.
UserInfoAccess.SearchForUserAsync() (private, async)Pre, skips when nobody matchesTavernEssentialsServerNames players from connections and TavernLib's accounts, never Alta.

Messages and networking​

MethodKindModSideWhat it does
Alta.Networking.Internal.MessageProcessor.ProcessSingleMessageFromData(...)Pre, always skipsTavernLibBothReads the message type in 8 bits instead of 5, so there can be 256 types. Both ends need it.
samePostRoverClientCapture mode: records every message received.
Alta.Networking.Internal.OutgoingPacketManager.StartSerialize(Connection, MessageType)Pre, always skipsTavernLibBothWrites the type in 8 bits.
OutgoingPacketManager.StopSerializePostRoverClientCapture mode: records every message sent.
Alta.Networking.Socket constructorPostTavernLibBothRaises TavernEvents.SocketCreated.
Alta.Networking.EntitySerializer.SerializeDataInternal (private)Pre, PostRoverClientCapture mode: which entity each record belongs to.
Every INetworkSerialized.Serialize implementation seen (explicit interface, found through the interface map)Pre, PostRoverClientCapture mode: bit ranges of each behaviour's record.
EntitySerializer.IsEntitySpawnedFor(IPlayer)Pre, skips when it can answerSteadyServerAnswers from the chunk's HashSet of players instead of a LINQ scan, for every entity, connection and send.
Alta.NetworkingTransport.MessageReceivePool.Put(byte[]) (Alta.NetworkTransport.Runtime)Pre, always skipsSteadyBothKeeps up to 400 receive buffers instead of 100, so bursts don't allocate.
Alta.Networking.Internal.SceneSerializer.SerializeWrite, EntitySerializer.WriteDataIntoStream, Alta.Networking.NetworkTransform.Serialize, Alta.Networking.Connection.Send(ConnectionChannel, StreamWriter, int) and InternalSendPre, FinCave Performance (combat diagnostics)ServerLogs how cave creatures' updates are packed and sent. Observation only.
Alta.WebServer.WebServerThread constructor (int)PreTavernLibServerMoves the web server off 1761 to tavern_server.json's web_port.
Alta.Console.WebSocketRemoteConsole.StartTransTavernLibServerSwaps the hard-coded 1760 for console_port.

Alta's web API and the store​

Alta's servers are gone, so each of these would wait for a timeout. Steady's AltaCutoff prefixes run last (Priority.Last) and step aside when another mod already answered.

MethodKindModSideWhat it does
System.Net.Http.HttpClientHandler.SendAsync, HttpMessageInvoker.SendAsync (not the game)Pre, skips for Alta's hostsSteadyBothFails any request to townshiptale.com or Alta's AWS endpoint at once, the way a timeout would. HttpClient.SendAsync alone catches nothing on Mono.
Alta.Api.Client.HighLevel.UserApiClient.RefreshLoginAsync()Pre, always skipsTavernEssentials, SteadyClient (TE), both (Steady)No login refresh. Without it, leaving a server could end on a black screen.
Alta.Api.Client.HighLevel.ServicesApiClient.GetPublicIpAddressAsync()Pre, always skipsTavernEssentials, Steadyas aboveAnswers 0.0.0.0.
ServerUtilities.GetPublicIPAddress() (static, async)Pre, always skipsRoverClientAnswers 0.0.0.0 instead of waiting a minute.
UserApiClient.IsUserVerifiedAsync()Pre, always skipsTavernEssentialsClientTrue, so no email popup.
Alta.Api.Client.LowLevel.LowLevelApiClient.EnqueueAnalyticsEvent(AnalyticsEventData)Pre, always skipsTavernEssentials, Steadyas aboveDrops analytics.
ATT.Analytics.AltaAnalyticsDispatcher.OnAnalyticsEvent (protected override)Pre, always skipsSteadyBothStops posting area visits, challenges, unlocks and tutorials.
Alta.Api.Client.HighLevel.StatusAPI.GetStatus()Pre, always skipsTavernEssentials, Steadyas aboveEmpty inbox (TE shows its own welcome once).
Alta.Api.Client.HighLevel.PlayerReportsClient.ViewAllReports(...)Pre, always skipsTavernEssentials, Steadyas aboveEmpty list.
PlayerReportsClient.ReportPlayer(int, ReportType, int)Pre, always skipsTavernEssentialsClientReports go to the server instead.
Alta.Api.Client.HighLevel.ServerApiClient.HasPermissionsInServer(...)Pre, always skipsTavernEssentials, Steadyas aboveFalse. TE's settings board decides who sees the bubble.
ServerApiClient and OfflineServerApiClient: GetPublicServersAsync, GetOpenServersAsync, DiscoverServers, GetJoinedServersAsyncPre, skips once the list has loadedTavernEssentialsClientThe menu's server boards show the community server list.
Alta.Api.Client.HighLevel.JoinedGroupManager.LeaveGroup()Pre, skips for TE's groupsTavernEssentialsClient"Leave server" removes it from My Servers.
Alta.Api.Client.HighLevel.RecentPlayersClient.RecordInteractionAsync, GetAllAsyncPre, always skipsTavernEssentialsClientRecent players kept in a local file.
UserApiClient.GetAllCosmeticsPresets, CreateCosmeticsPreset, DeleteCosmeticPresetPre, always skipsTavernLibClientCosmetic presets saved as local files.
LowLevelApiClient.ValidateIdentityTokenPre, always skipsTavernLibServerAlways valid: there's no central validator.
Alta.Customization.PurchasedList.UpdateCurrentRotation() (static, async)Pre, always skipsTavernEssentialsClientEmpty store rotation, so the customizer opens at once. TavernLib has a method for this too, but it has neither a Prefix name nor [HarmonyPrefix], so Harmony never applies it.
PurchasedList.ValidatePlayersOwnedItemsPre, always skipsTavernLibServerEvery cosmetic is allowed.
PurchasedList.RefreshPre, always skipsTavernLibBothOwned and available are just the free-for-all set.

Console and commands​

MethodKindModSideWhat it does
Alta.Console.CommandService.HandleMatchedCommand(CommandSearchResult) (static, async)Pre, skips on an empty player listTavernLibServerA command given players that matched nobody fails with a message instead of answering Success.
samePostTavernLibServerWraps the Task to unwrap TargetInvocationException, so the console shows the command's own error.
PlayerListConverter.ConvertFromPostTavernLibServerRemembers what was typed, for that message.
Alta.Console.CommandPart.RequirementsAreMetPostTavernLibServerLimits what a named console token can run and see.
ServerConsoleManager.ValidateConsoleTokenPre (always skips), PostTavernLibServerTavernLib's own console token check; the postfix keeps its verdict.
Alta.Console.WebSocketCommandHandler.ProcessAuthorizationPre, FinTavernLibServerMarks a login as coming through port 1760, and from where.
WebSocketCommandHandler.TryLogConsoleCommandExecutionWithEventStreamPreTavernLibServerLogs each 1760 command and keeps token text out of the event.
WebSocketCommandHandler.GetCurrentServerPermissionsForLoggedInUserPre, always skipsTavernLibServerAnswers Console permission without asking Alta.
Alta.Console.CommandResult.LogPre, skips for token commandsTavernLibServerKeeps token text out of the trace log.
ServerConsoleManager.StartRemoteConsolePostTavernLibServerCloses the game's extra remote console at once.
ATT.Character.QuickAccessMenu.CommandSync.RouteCommand(string, Action)Pre, always skipsTavernLibBothDrops wrist-menu commands: the game runs them straight away on a server and sends them to the server from a client. TavernLib's own comment isn't sure this is needed.
CommandSync.SyncCommand(IPlayer, Stream) (async void)PostTavernEssentialsServerLogs that a board command row was pressed.
TimeCommandModule.Set, SettingsCommandModules.ListPossivleValues (the game's spelling), SelectionCommandModule.MovingModule.Exact, RotatingModule.Exact, WackyCommandModule.DestroyPre or PostTavernLibServerThrow a real error where the game answered Success having done nothing. Applied in OnLateInitializeMelon.
WorldCommandModule.CaveCommandModule.CaveTeleportPre, always skipsTavernLibServerTeleports to a cave layer even when it already exists, and says who moved.
SelectionCommandModule.FindObjects (private static)MonoMod Hook, not HarmonyTavernLibServerselect find without throwing on a player with no body.

TavernLib also replaces time ofday with its own command object, which isn't a patch.

Server settings and the wrist menu​

MethodKindModSideWhat it does
ATT.Character.QuickAccessMenu.ServerSettingsSync.IsServerSyncPermitted(IPlayer)PostTavernLibServerOnly owners and moderators may change settings; the game lets anyone.
ServerSettingsSync.SaveServerSettingsFromClient(IPlayer, ServerSettings) (async void)Pre, always skipsTavernEssentialsServerStaff only, and only the board's own fields, applied through ServerConfig.SetAllSettings.
ServerSettingsSync.Initialize(), UpdateMenuSettingsValue (private), RequestSettings(IPlayer, Stream)Post; Pre always skips; Pre always skipsTavernEssentialsServerWhether the board is available, and the real settings sent to staff only.
Alta.QuickAccessActions.SettingsQuickAccessMenu.IsIgnored (getter), Run(Controller)PostTavernEssentialsClientShows the settings bubble to staff only; logs its rows.
Alta.QuickAccessActions.ReturnToMainMenuAction.LetGoValid() (async void)Pre, always skipsTavernLibClientEating the leave orb quits the game (for the launcher).
samePre, always skips, and unpatches TavernLib'sTavernEssentialsClientLeaving goes back to the main menu instead.

All client side unless marked.

MethodKindWhat it does
Alta.QuickAccessActions.ShowNames nested NameBoardHandler.Activate() (private, by reflection)PostTurns a friend's name board green.
Alta.Meta.UI.ServerManagement.FriendsRequestsPanel.RefreshData() (async void)Pre, PostFlags the main menu's requests panel for TE's friends list.
RecentPlayerActionPage.Setup, MakeFriendRequest, ReportPlayerPost; Pre, skipsThe tablet's recent players page without Alta.
RecentPlayerActionPage.SyncSocialTabletAction(IPlayer, Stream, ...) (private async void)Pre, skips when reading on the serverServer: handles tablet reports itself (the game's waits on Alta and never fires its event).
Alta.Meta.UI.ServerManagement.RecentPlayersListPanel.AddPlayerAsFriend, ReportPlayerPre, skipsPopups explaining friends and reports on community servers.
FriendSelector.SyncFilter(IPlayer, Stream) (private)Pre, FinKeeps away friends on the postbox wheel.
PostboxSender.SetupForPlayer(IPlayer)PostServer: fills the postbox wheel with friends.
PostboxSender.Send(int, int) (async void)Pre, skips when the check failsServer: only sends to friends whose account matches.
SettingsPanel.Start() (private)PreAdds a Mods board to the settings panel.
AchievementBoard.UpdatePlayer, FestiveFeature.ModifyPostHides achievement boards.
AchievementEffectHandler.CallEffect (static)Pre, always skipsNo achievement popup.
Discord.ActivityManager.UpdateActivity (Discord SDK)PreRich presence with the community server name.
DiscordController.Start() (private)Pre, always skipsServer: never connects to Discord.

Players, cosmetics and the character room​

MethodKindModSideWhat it does
Player.SyncCosmetics(IPlayer, Stream)Pre, always skipsTavernLibBothThe game's sync, plus: refuses a player changing someone else's look, and on the server sends saved cosmetic bytes as they are.
Alta.Customization.CosmeticCustomizationManager.ExitCustomizationRoom(), PlayerScreenFader.CustomFade, Alta.PlayerStates.CustomizationState.Sync (private)PreRoverClientDebug tracing of the character room exit.

Moving and teleporting​

MethodKindModSideWhat it does
Teleporter.TeleportStartedSound (private)FinRoverClientSwallows the throw from the sound without audio. Patching Teleporter too early breaks the login UI.
SmoothLocomotion.ApplyMovement(Vector3, bool)Precalebv2.Portal-GunClientCarries the local player through a portal.
SmoothLocomotion.HandleTeleport (private), RepositionCharacter(float), CheckForInfiniteFall (private), IsCloseToGround (private)Pre, skip while crossing a portalcalebv2.Portal-GunClientStops the game's recentring, head-in-wall, fall and ground checks during the crossing.

Items, docks, damage​

MethodKindModSideWhat it does
Alta.Inventory.PickupDock.Awake() (protected virtual)PostRoverClientTurns docks' pickup range back on, which the game switches off when headless.
PickupDock.ItemDockedSound, ItemUnDockedSound, DockHoverSoundFinRoverClientSwallows the sound throws that dropped items mid-grab.
Pickup.EnsureBestGrabFound(Interactor)Pre, skips for the guncalebv2.Portal-GunClientA fixed grip for the portal gun.
DurabilityModule.UpdateMaterial(PhysicalMaterial), ISavable Load, IEntityReplaceHandler.ReplacedWith (explicit interface)PostCircl-NoE.ATTMateriaLibBothBase durability from material multipliers, kept after loads and replacements.
Alta.Impact.DelayedImpactResolver.Update() (private static)Pre, Fin (swallows)SteadyBothDrops hits whose tool has no entity, and keeps one bad frame from stopping all held-item damage until a restart.
Alta.Impact.ImpactDetector.OnToolHit, Alta.Impact.ImpactTool.OnDestroy (private)Pre; PostSteadyServerLets go of destroyed objects the game keeps referencing (memory).
HealthObject.ReceiveDamage(float, float, DamageData) (virtual)Pre, FinCave Performance (combat diagnostics)ServerLogs health around hits from tracked cave creatures. PlayerHealth calls base, so player hits are seen.

Food, drink, cooking and liquids​

MethodKindModSideWhat it does
Alta.Cooking.CookingPot.InitializeAsServer(SpawnData)PostNyx12012.CookingLibServerTracks pots for its cookables.
CookingPot.StartWarmingUpStage(bool), LoadAtCurrentStage() (private)PreNyx12012.CookingLibServerKeeps the stew base once ingredients are in; resumes a stew after a reload.
Alta.Cooking.StewManager ISavable Load (explicit interface)Pre, PostNyx12012.CookingLibServerDrops unknown saved ingredients, refills slots.
StewManager.CreateContentWithTint(Color) (private)Pre, PostNyx12012.CookingLibServerRecipe and dye tints, per-stage liquids.
StewManager.CheckForValidRecipe(), HandleNewStewStage(NetworkEntity) (private)Pre, PostNyx12012.CookingLibServerRaises its stew events.
Alta.Cooking.StewRecipe.FindStewRecipeForIngredients (static)PostNyx12012.CookingLibServerRetries with Water when a water-like base matched nothing.
StewRecipePageProvider.GetRandom(), EdiblePageProvider.GetRandom()Pre, always skipsNyx12012.CookingLibServerRandom recipe and food pages leave out its own.
Alta.Pages.GlobalPagesManager.AddPage(int, uint)Pre, skips for its itemsNyx12012.CookingLibServerNo journal pages for its ingredients.
Alta.Cooking.Cookable.InitializeAsServer, SpawnCookedVersion(), SwapToBurntVersion() (private)Pre, Post, FinNyx12012.CookingLibServerRoasting rules: temperatures and cooked or burnt results.
EdibleObject.StartEat, ConsumptionManager.HandleConsumptionEffects (internal), CanConsumeEdiblePre, PostNyx12012.CookingLibServerEating events, and refusing its own edibles when docked or full.
PlayerDrinkingMouth.LiquidAmountChanged (private)Pre (Priority.First), Post (Priority.Last)Nyx12012.CookingLibServerRaises a drank event.
samePreTheRavenSeb.hydrateordiedrateServerAdds thirst for what was drunk.
PlayerDrinkingMouth.Initialize()PostNyx12012.CookingLib, TheRavenSeb.hydrateordiedrateServerEach adds a liquid filter to the mouth (refuse a drink).
Alta.Liquid.LiquidContainerTrigger.OnTriggerEnter(Collider)Post (Priority.Last)Nyx12012.CookingLibServerInfusions: an item dropped in a liquid changes it.
samePostCG-Nik.DyeingAPIServerDyes an item that enters a matching liquid.
Alta.Liquid.LiquidData.SerializeEffectsArray(Stream) (private), LiquidData.Load (twice)Pre, Fin; PostNyx12012.CookingLibServerKeeps server-only effects off the wire, and restores them after loads.
Alta.Networking.PrefabManager.PrepareSpawnSetups() (static)PostNyx12012.CookingLibServerKnows when the prefab map is ready.

Crafting and smelting​

MethodKindModSideWhat it does
SpawnHelper.Spawn(NetworkPrefab, SpawnData, Chunk, Vector3, Quaternion, SpawningCallback) (static overload)Pre, changes position and rotationCG-Nik.CustomRecipesAPIServer in effectOffsets smelter outputs for its items. It reads the call stack on every call to this overload, anywhere in the game.

Populations, ores and creatures​

MethodKindModSideWhat it does
Alta.Populations.PopulationSample.CheckSpawned()TransCave Performance (Wyrm population)ServerLowers the spawn target of wyrm-only cave populations.
samePostCheeto35.CheetosOreSpawnFixServerRecords the group.
PopulationSample.Initialize, Destroy, SpawnRandom (private), LoadTime, CheckPopulation (private), AddEntity(NetworkEntity, int)Pre, Post, FinCheeto35.CheetosOreSpawnFixServerOre groups, custom respawn amount and timing, relinking saved crystals.
Alta.Populations.PointsPopulationValue.GetRandom, GetPoint(int); PopulationDefinition.IsPositionValid, TickFrequency and MaxPopulationGrowth (getters)Pre (skips), PostCheeto35.CheetosOreSpawnFixServerEven spawning over free points, respawn times.
Alta.Caves.Displays.ClusterGenerator.Generate(SpawnData), PositionChild (private)Pre, PostCheeto35.CheetosOreSpawnFixServerPicks a cluster's ore; nudges sunk boulders out of rock.
Alta.Caves.PluginInstance constructor, RenderChunk(MapChunk) (iterator)Post; Pre, skipsCheeto35.CheetosOreSpawnFixServerMined crystals respawn, totems don't.
Alta.Intelligence.Agent.InitializeAsServer(SpawnData)Pre, PostCave Performance (search, queue and combat diagnostics)ServerLinks creatures to their navigator and cave. Patched three times by the same mod.
Agent.UpdateHurt() (private)PostSteadyServerPrunes destroyed targets now and then.
Agent.FireChannelEvent, SyncEvent (private)Pre, FinCave Performance (combat diagnostics)ServerLogs creature actions.
Alta.Pathfinding.Walker.Start() (private)Pre, FinCave PerformanceServerTies a walker's first navmesh snap to its cave.
Alta.Pathfinding.Navigator.NavigateTo, Wander (private overload), WanderTo (private), a Wander lambdaPre, Post, FinCave PerformanceServerTies path requests to the cave they're in; saves wanders for replay.
Navigator.OnPathFindFailed (private), CancelRequest (private)Pre, PostCave Performance (navigation recovery)ServerClears flags the game leaves set after a failed path, and retries after 2 s.
Navigator.PathFound, Seeker.OnPathComplete (private)Pre, FinCave Performance (queue diagnostics)ServerLogs path results.

Chunks, streaming and saving​

MethodKindModSideWhat it does
Alta.Chunks.LocationChunk.InitializePostRoverClientApplies the master-terrain chunk effect a headless client skips, so the mine's terrain goes away as it does for players.
Alta.Chunks.ChunkPrefabPointer.PointerInstance.Spawned (setter)PostLensClientHides grass tufts as a chunk's props spawn.
ForestChunk, Alta.Chunks.CaveLayerStreamer, Alta.Chunks.StaticCaveChunk: explicit IProceduralGenerationStreamer.LoadDynamic(bool) (async)Post, replaces the TaskSteadyServerReleases chunks' saved entities over several frames within a time budget.
ForestChunk LoadDynamicPost, replaces the TaskForest PerformanceServerOne saved-entity batch per frame.
CaveLayerStreamer LoadDynamicPre, Post, replaces the TaskCave PerformanceServerSame, and opens a 60 s window for its timing diagnostics.
Alta.Chunks.DynamicChunkContentManager.LoadEntities(ChunkSaveFormat, bool) (private)Pre, FinSteady, Cave Performance (twice)ServerTimes entity loads (Steady); links creatures to their cave (Cave).
Alta.Chunks.Chunk.ForceUnloadAndSave()Pre, FinCave Performance, Forest PerformanceServerReleases pending batches before a forced save.
Chunk.IsForceLoaded (setter)Pre, skips for pinned levelsCheeto35.CheetosOreSpawnFixBothKeeps levels pinned by its orefix load loaded.
StreamerManager.SaveWorld(bool)Pre, FinSteady, Cave Performance, Forest PerformanceServerNotes an instant save (Steady saves everyone at once then); releases pending batches (ATT-Optimizations).
Player.SaveAll() (static)Pre, skips during autosavesSteadyServerSaves players over several frames instead of one.
Alta.Saving.SavingSystem.Write(...) (private static)Pre, skips for bit streamsSteadyServerSerializes each component once instead of twice. Same bytes.
Alta.Utilities.ChunkSaveFormat.WriteTo(Stream, CancellationToken)Pre, skipsSteadyServerDoesn't rewrite a chunk file that hasn't changed. Runs off the main thread.
Alta.Serialization.StreamWriter.Dispose(), StreamReader.Dispose() (Alta.Serialization.Runtime)PostSteadyBothGC.SuppressFinalize, one less finalizer per saved entity and message.
Alta.Networking.NetworkEntity.InitializeWithChildrenAsServer, Alta.Chunks.StreamerHelper.LoadSetupRecursive, Alta.Networking.ServerSpawnManager.SpawnInternal(uint)Pre, FinCave Performance (timing)ServerLogs slow calls around cave loads.

Forest and cave generation​

MethodKindModSideWhat it does
Alta.Static.InstructionSet.ExecuteInternal(object, Task, int) (private iterator)Pre, skips for the forestSteadyBothPaces forest generation steps within a per-frame budget.
samePre, lowers the per-frame countForest PerformanceServerForest instructions per frame down from 10 to 1.
InstructionSet <ExecuteInternal>d__N.MoveNextPre, Trans, FinForest PerformanceServerCounts every forest instruction toward the batch.
Alta.Forests.ForestGenerator.Wipe(int) (async)Pre (Priority.Last), always skipsForest Performance (reset fix)ServerReplaces the forest reset with an ordered one.
Alta.Forests.ForestGenerator.Wipe(int) (async)Pre, skips unless another mod also replaces itTavernLibServerQueues the reset for the next start: clears the forest's chunks now, keeps the running seed, saves the new one.
ForestGenerator's ISavableSave<ForestGeneratorSaveData>.Save and ISavable<ForestGeneratorSaveData>.Load (explicit interface methods)PostTavernLibServerSave writes a queued seed. Load deletes cache files named after any other seed.
WorldCommandModule.ForestCommandModule.ResetPre, always skipsTavernLibServerRuns the reset and says what happened.
Alta.Forests.RiverGenerator.GetGenerationAsyncPreForest Performance (reset fix)ServerClears failed river tasks and supplies terrain on the main thread.
ServerCacheManager.CleanCache(string) (async)Pre (Priority.Last)Forest Performance (reset fix)ServerRemoves failed cache entries first.
ForestChunk LoadStatic, LoadDynamic; ForestGenerator.RequestStatic, RequestDynamic, GenerateTerrain, GenerateAsync, GenerateInternalAsync; Alta.Forests.ForestGeneration.SortNodes and its lambdas; TerrainAccess.ApplyHeights, ApplySplat, SampleSplat (state machine MoveNexts and methods)Pre, FinForest Performance (step diagnostics)ServerLogs slow forest steps.
Alta.Caves.GenerationBase.UpdateRendering() (private)Pre (skips over budget), Trans, FinCave PerformanceServerOne shared per-frame budget for all cave generators.
GenerationBase <Render>d__N.MoveNextPre, FinCave Performance (step diagnostics)ServerLogs slow cave render steps.
Alta.Chunks.CaveLayerStreamer.GeneratePathfinding() (iterator)Pre, always skipsSteadyServerIts own scan, one cave at a time, with retries, so two layers loading together don't break each other's navmesh.
samePost, wraps the iteratorCave Performance (navigation recovery)ServerUp to 3 attempts with the failed graph removed between.
CaveLayerStreamer.NeedToGeneratePathFinding (getter)PostCave Performance (navigation recovery)ServerTrue until a scan really finished.
StaticCaveChunk.GeneratePathfinding() (private iterator)Pre, always skipsSteadyServerAs above, and always lets the chunk finish loading.

Pathfinding (A* Pathfinding Project)​

All server side: clients have no navmesh.

MethodKindModWhat it does
AstarPath.InitializePathProcessor() (private)PreSteady, Cave PerformanceSets the number of path threads before the processor is built.
AstarPath.GetNearest(Vector3, NNConstraint, GraphNode)Pre (Priority.Last), skipsSteadyNearest graphs first, skipping ones that can't hold a closer node.
samePre, Post, FinCave PerformanceLimits the search to the creature's own cave graph, falling back to the full search.
Pathfinding.NNConstraint.SuitableGraph(int, NavGraph) (virtual)Pre, skipsSteady, Cave Performance, Forest PerformanceA* tests graph bits modulo 32, so cave graph 32 matched masks meant for graph 0. All three fix it, in different cases.
AstarPath.ScanAsync(NavGraph[]) (iterator)Pre; Post, wrapsSteady (local area fill), Cave PerformanceDistrusts area labels on a scan (Steady); pauses path threads before the first scan step (Cave).
AstarPath <ScanAsync>d__N.MoveNextTransSteadyRemoves the full GC.Collect() after every scan (2 to 3 s on a busy server).
samePost; Pre, FinCave Performance (search, navigation recovery, step diagnostics)Marks graphs fully scanned.
<ScanGraph>d__N, RecastGraph <ScanInternal>d__N and <ScanAllTiles>d__N MoveNextPre, FinCave Performance (step diagnostics)Times scan steps.
Pathfinding.GraphUpdateProcessor.FloodFill() (internal type)Pre (skips), FinSteadyFaster area labelling (union-find), or only the swapped tiles; same result.
samePre, FinCave Performance (queue diagnostics), Forest Performance (connectivity)Timing; counts full fills.
AstarPath.FloodFill()TransForest PerformanceRoutes the fill through its local relabel, with the full fill as fallback.
Pathfinding.NavmeshBase.ReplaceTile(int, int, int, int, Int3[], int[])Pre, Post, FinSteady, Forest PerformanceRecords nodes around a cut tile swap.
Pathfinding.WorkItemProcessor.AddWorkItemPreSteady, Forest PerformanceNotes work that could change areas.
WorkItemProcessor.ProcessWorkItems(bool), EnsureValidFloodFill, IWorkItemContext.QueueFloodFillPre, FinForest Performance, Cave Performance (queue diagnostics)Tracks nesting; timing.
Pathfinding.Util.TileHandler work-item lambdas (4, found in the IL)Pre, FinForest PerformanceMarks known tile work.
Pathfinding.RecastGraph IUpdatableGraph.UpdateAreaPost (explicit interface)Pre, Post, FinSteadyRecords the forest update's tile swap.
sameTransForest PerformanceTells tile cutting about the rebuilt tiles only, not the whole graph.
same, with UpdateAreaInit and UpdateAreaPre, FinCave Performance (queue diagnostics)Timing.
Pathfinding.NavmeshUpdates.NavmeshUpdateSettings.OnRecalculatedTiles(NavmeshTile[]) (internal nested)Pre, changes the argumentSteadyThe same fix as Forest Performance's transpiler: re-cut only rebuilt tiles. Re-cutting all about 19,000 froze the server 2 to 3 s per forest chunk.
Pathfinding.NavmeshUpdates.ForceUpdate()Pre, always skipsSteadyWalks navmesh cuts once a frame instead of twice.
GraphUpdateProcessor.ProcessPostUpdates() (private)PreSteady; Cave Performance (timing)Trusts labels again after a graph update's own fill.
GraphUpdateProcessor.ProcessGraphUpdates, ProcessRegularUpdates; PathProcessor.Lock, Unlock, TickNonMultithreaded; PathReturnQueue.ReturnPaths; AstarPath.FlushWorkItems (both)Pre, Fin, two TransCave Performance (queue diagnostics)Timing; the transpilers swap a wait for a timed copy of the same wait.
AstarPath.StartPath(Path, bool) (static), Pathfinding.Path.Reset(), ABPath.Prepare(), ConstantPath.Prepare(), Path IPathInternals.AdvanceState, ReturnPath; ABPath and ConstantPath Initialize, CalculateStep, CleanupPre, FinCave PerformanceTies each path to its cave while start and end nodes are looked up (on path threads); diagnostics.
Pathfinding.Recast.RecastMeshGatherer.CollectTerrainMeshes (found by name)Pre, PostRoverCuts terrain triangles over terrain holes from Rover's own scans. Client.

Physics, garbage collection and timing​

MethodKindModSideWhat it does
GarbageCollectTimer.Start() (private)PreTavernLibServerSets the forced collection interval from garbage_collection_timer.
samePre, always skipsSteadyServerNo forced collection at all (each was a 0.2 to 3 s pause).
Alta.Utilities.DynamicPhysicsTimeSet.SettingsChanged (private)PreSteadyServerStops each settings reload stacking another physics-rate updater.
DynamicPhysicsTimeSet.Update(), Disable() (private)PostSteadyServerOptional cap on the physics rate.
UnityEngine.SetupCoroutine.InvokeMoveNext, UnitySynchronizationContext WorkRequest.Invoke (Unity internals, by name)Pre, FinCave Performance (timing)ServerLogs slow coroutine steps and Task continuations.
Every Update, FixedUpdate, LateUpdate, collision and trigger method, and every other mod's patched methodPre (Priority.First), Post (Priority.Last)CanaryServerWhile canary profile runs: times them, then unpatches.

Rendering (Lens)​

All client side, and only with graphics.

MethodKindWhat it does
OptimizationManager nested QualitySetting.Apply, Township.PostProcessing.Windows.WindowsPostProcessController.OnSettingsChangedPostPuts Lens's quality settings back after the game's own.
PostProcessVolume.OnEnable (Unity's post-processing package), WindowsPostProcessController.ResetPostBloom on or off on every volume.
Alta.ScreenshotCamera.HandCamera.VisibilityUpdatedPre, skips for other players' camerasKeeps other players' camera viewfinders from rendering.
ExposurePlayerScreenFader.Awake, PlayerController.UpdateCameraCullingPostView distance and small-object cull distance.
DistanceLODGroup.GetLevel(float)Pre, changes the distanceTree detail distance. Only patched once set, since it runs for every tree.
Alta.Environmental.Atmosphere.DayTimeManager.Awake, PooledFireEffect.UpdateSettingsPostSun, moon and fire shadows.

Logging​

MethodKindModSideWhat it does
NLog.LoggerImpl.Write (internal, by reflection)Pre (Priority.First)TavernEssentials (LogGuard)ServerScrubs join tokens and passwords from every game log line.
TavernLib.TavernLogger.Log (private, by name)PreTavernEssentials (LogGuard)ServerThe same for TavernLib's own lines.

TavernLib also drops refused-token lines with an NLog filter rather than a patch.

Methods patched by more than one mod​

Most of these work together. The ones that clash, or that make another mod's patch pointless, are marked.

MethodModsHow they combine
GarbageCollectTimer.StartTavernLib, SteadySteady stops the timer unless garbage_collection_timer is set to something other than 30 (the default every launcher writes), or its own ForcedGc is on. Then TavernLib's interval applies.
ForestGenerator.WipeTavernLib, Forest PerformanceTavernLib steps aside when another mod also prefixes it, so Forest Performance's reset runs.
ReturnToMainMenuAction.LetGoValidTavernLib, TavernEssentialsReplaced on purpose. With board_leave_orb=1, TE removes TavernLib's quit prefix and returns to the menu. It removes it again after each mode change, since TavernLib's may land later.
PurchasedList.UpdateCurrentRotationTavernLib, TavernEssentialsTavernLib's method is never applied (no prefix name or attribute), so only TE's runs.
JoinResult.ErrorMessageTavernLib, TavernEssentialsBoth postfixes. TavernLib only replaces the text when it doesn't already contain its own line, so TE's line, which quotes it, stays.
JoinServerPipeline.OnServerRejectedRequestTavernLib, RoverCompatible (prefix and postfix). Rover also tries to block TavernLib's last_rejection.json by patching JoinRejectionRecorder.WriteRejectionFile, but current TavernLib has no such method (it writes through Save), so that guard no longer applies.
ServerPlayerConnectionHandlerOld.CheckIfPlayerIsAllowedCustomTavernLib, TavernEssentialsTavernLib's prefix replaces it; TE's postfix still runs after and can only turn an accept into a refusal. The game reaches this method on every TavernLib server: the join filter hands over to CheckApproved, which calls it because the server's id is -1.
MessageProcessor.ProcessSingleMessageFromDataTavernLib, RoverTavernLib replaces it; Rover's capture postfix reads what it did. TE checks TavernLib's prefix is there before using message types over 31.
ConnectToServerUtility.SetupConnectionToServerTavernEssentials, TheRavenSeb.hydrateordiedrateBoth postfixes, different message types (TE 35, hydrate 40).
The seven Alta API methods marked "TavernEssentials, Steady" aboveTavernEssentials, SteadySteady's prefixes run last and step aside when TE (or TavernLib) already answered. On a server, where TE's Backend doesn't run, Steady's answer stands.
NNConstraint.SuitableGraphSteady, Cave Performance, Forest PerformanceSteady leaves it to Forest Performance when its navigation_fixes is on. Cave and Forest act on different cases and are tested together in both orders.
AstarPath.InitializePathProcessorSteady, Cave PerformanceSteady steps aside when Cave's path_workers is on.
AstarPath.GetNearestSteady, Cave PerformanceSteady's runs last, so Cave's cave-only search goes first.
GraphUpdateProcessor.FloodFill, NavmeshBase.ReplaceTile, WorkItemProcessor.AddWorkItemSteady, Forest Performance, Cave PerformanceSteady's local fill is off when Forest's connectivity_updates is on. Both fall back to the full fill when unsure, and Forest's fallback still goes through Steady's prefix.
RecastGraph UpdateAreaPost and NavmeshUpdateSettings.OnRecalculatedTilesSteady, Forest Performance, Cave PerformanceSteady and Forest fix the same thing in two places; when Forest's transpiler has already passed only the rebuilt tiles, Steady's prefix sees no whole-graph array and does nothing.
AstarPath.ScanAsync and its MoveNextSteady, Cave PerformanceSteady's transpiler and Cave's prefixes and postfixes stack. Steady logs if the GC.Collect() it removes is already gone.
InstructionSet.ExecuteInternalSteady, Forest PerformanceSteady steps aside when Forest's forest_instructions_per_frame is on.
CaveLayerStreamer.GeneratePathfindingSteady, Cave PerformanceSteady steps aside when Cave's navigation_recovery is on. Otherwise Steady's prefix replaces the iterator and Cave's wrapper never sees the game's.
The three LoadDynamic methodsSteady, Cave Performance, Forest PerformanceSteady leaves the forest one to Forest and the cave layer one to Cave when their separate_entity_loads is on. StaticCaveChunk is always Steady's.
DynamicChunkContentManager.LoadEntities, StreamerManager.SaveWorld, Chunk.ForceUnloadAndSaveSteady, Cave Performance, Forest PerformancePrefix and finalizer pairs that don't skip. They stack.
PopulationSample.CheckSpawnedCave Performance, Cheeto35.CheetosOreSpawnFixA transpiler and a postfix that only records. Compatible.
PlayerDrinkingMouth.LiquidAmountChanged, PlayerDrinkingMouth.InitializeNyx12012.CookingLib, TheRavenSeb.hydrateordiedrateNeither skips; each adds its own filter. Compatible.
LiquidContainerTrigger.OnTriggerEnterNyx12012.CookingLib, CG-Nik.DyeingAPIBoth postfixes. DyeingAPI runs first and sees the liquid before CookingLib's infusion can change it or destroy the item.
Agent.InitializeAsServer, Navigator.Wander and several pathfinding methodsCave Performance, several timesThe same mod's modules stacking.
Chunk.IsForceLoaded and Chunk.ForceUnloadAndSaveCheeto35.CheetosOreSpawnFix; Forest Performance's reset sets IsForceLoadedA level pinned with orefix load ignores the reset's attempt to unpin it.

See also​