Please disclose if your mod was created primarily using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
EntranceTeleportOptimizations
Mod to optimize EntranceTeleport scripts
| Date uploaded | 3 days ago |
| Version | 1.0.0 |
| Download link | mattymatty-EntranceTeleportOptimizations-1.0.0.zip |
| Downloads | 4587 |
| Dependency string | mattymatty-EntranceTeleportOptimizations-1.0.0 |
This mod requires the following mods to function
BepInEx-BepInExPack
BepInEx pack for Mono Unity games. Preconfigured and ready to use.
Preferred version: 5.4.2100README
This Mod is still in BETA
EntranceTeleportOptimizations
EntranceTeleportOptimizations is a focused on the performance of the EntranceTeleport system (FireExits & Main).
It improves performance during teleport usage and dungeon generation when using mods like Loadstone.
✱ Optimizations
• Cached Teleports
All EntranceTeleport instances are cached in an internal list upon spawn and removed on destroy.
This replaces expensive GetObjectsByType<EntranceTeleport>() calls with fast, direct list access.
• Smarter ExitPoint Lookup
- Normally,
EntranceTeleportsearches for itsexitPointon every use, which is costly.
This mod stops the search early if the teleport already knows its exit.
A reference to the exit script is cached and is used for sanity checks to avoid issues caused by runtime modifications from other mods. - Exterior teleports previously ran this search every frame while the moon was loading—this mod removes that overhead by assigning the exit after dungeon generation (After
RoundManager.SetExitIDs).
• ID Assignment Fix
Some custom interiors use incorrect prefabs for FireExits with already-assigned IDs ( should be ID 1 except main that should have ID 0 ).
This can cause issues like:
- The infamous "The entrance appears to be blocked."
- Warping to the wrong fire exit
This mod forces all interior teleports to use ID 1, so the vanilla game can assign IDs correctly.
• NRE Fix
The vanilla game sometimes creates an NRE spam when an enemy is destroyed without being removed from the internal SpawnedEnemyList
This mod adds a null check to prevent this exception
✦ Extra Features
🔸 Enemy Detection: [Near activity detected!]
- Exterior Detection:
Vanilla only checks enemies inside the facility—this mod optionally allows detection of outside enemies. - Configurable Range:
Detection ranges for both interior and exterior can be customized.
⚙️ Developer Features
🔸 Matching Teleport Names
If enabled, the mod renames interior EntranceTeleports to match their exterior counterpart, appending (Interior) for clarity.
📦 Installation
This mod is intended to be installed using a mod manager such as Gale.
Manual installation is not officially supported.
CHANGELOG
v1.0.0
- Update to v80
v0.0.5
- move cleanup code behind condition
v0.0.4
- improve logging for special situations
- fix infinite loop when a Null enemy is left in the list
v0.0.3
- Add shortcuts to
FindObjectsOfType&FindObjectsByTypeusing our managed list - make sure we always use our value if somebody else suppresses
FindExitPoint
v0.0.2
- use the right label for in Update transplier for the NRE fix
v0.0.1
- First Release