# Smart Gates, Dynamic Parking and Safety Buffers (SGSB) v4.2.5-09526
"The House That Code Built"
**Enjoying the mod?** Please consider giving it a 👍 Like, ⭐ Favorite, and 🔔 Subscribe to stay updated on future releases!
---
## A Note from the Developer
This project is dedicated to the glory of God. Every mile driven and every line of code written is an expression of gratitude for the journey. May this mod bring a little more order, peace, and grace to the virtual highways we all travel.
*— Built by a driver, for drivers.*
[Full Release Log & Source Code](https://github.com/insanity35/Smart-Gates-Parking-and-Safety-Buffers)
---
### 🛑 The Problem: "Gate Lag" & Sterile Truck Stops/Yards
For long-haul truckers across American Truck Simulator, immersion is everything. Nothing shatters the flow of a meticulous delivery faster than "gate lag"—that frustrating hitch at the yard threshold where you wait for a sluggish barrier to crawl open while your multi-ton rig idles out. Couple that with sterile, ghost-town truck stops, parking lots and getting flagged down at 60% of weigh stations. With that long-haul pacing takes a heavy hit.
---
### ✅ The Solution: SGSB
Smart Gates, Dynamic Parking and Safety Buffers (SGSB) is an environmental and traffic modification for American Truck Simulator designed to enhance the realism of rest stops, loading zones, and world gate interactions.
### 🚦 Smart Gate & Infrastructure Overhaul
Gate logic is key here. I have scanned every dlc for gate and gate properties. Unless it's a dumb prefab gates (see bottomfor examples). A guard house or toll gate to enter a yard or drop off those bad boys should already be open. From 17-25m on guard gates, border checks to 125-135m on every other gate.
* **Extended Trigger Ranges:** Increased activation distances (125m for panoramas, custom industrial ranges) so gates open smoothly as you roll up, protecting your momentum.
* **Collider Fixes:** Repointed broken base-game geometry files to proper colliders so multi-axle setups and heavy loads pass through without clipping.
* **Streamlined Logic:** Purged legacy references, entirely focusing on automated gate routines, security checkpoints, and border crossings across all map DLCs.
### 🚛 Advanced Dynamic Parking System
Immerse yourself in a living roadside ecosystem. Parking lot, Rest stops and yards/drop off parked vehicle code has been completely rewritten. Everything will feel more realistic. As in no empty truck stops with two trucks at night or parking lots with one car in it are gone. 4.2 introduces a massive expansion across 39 granular industrial, commercial, and rural sectors:
* **Context-Aware Spawning:** Lots reflect their local environment—populating grain co-ops with farm pickups and classic sedans, marine ramps with trailer-towing haulers, and oilfields with heavy-duty service rigs.
* **Hybrid Temporal Scheduling:** Banishes the "mass-extinction" pop-in effect. Personal vehicles utilize controlled dawn and dusk bleed-over, while commercial and industrial fleets use strict deterministic shift separation.
* **Operational Graveyard Shifts:** Municipal fleets—including street sweepers and garbage trucks—truly own the overnight hours before clearing out for daytime traffic.
* **Optimized VRAM Performance:** Industrial yards and truck stops are densely populated without frame-rate hits, leveraging forced low-poly background rendering (`low_poly_only: true`).
* **Precise Physical Alignment:** Unattached yard trailers and heavy wreckers utilize strict `rear_align: true` protocols, ensuring assets lock securely onto pads without floating.
### ⚖️ Weigh Station Flow Control
* Scale house check probabilities have been dropped from the base-game default (60%) down to a realistic **20% check frequency** for smooth, uninterrupted long-haul pacing.
---
## ⚠️ Important Developer Notices & Load Order
### Recommended Load Order
To ensure the custom safety buffer parameters take priority over world geometry data, organize your Mod Manager as follows:
* **--- TOP ---**
* Background Maps
* **Smart Gates, Parking and Safety Buffers (SGSB)** *(Notice: Needs to be ABOVE SoundFixes to keep hookups from being erased)*
* SoundFixes
* Global Traffic & AI Density Mods
* Map Expansion Mods (ProMods, Reforma, etc.)
* **--- BOTTOM ---**
### Prefab Limitations (The "Hardcoded" Gates)
Values on prefab/hardcoded gates cannot be modified without native map editor asset re-compiles. Example:
* Army Gate next to O'Hare Airport (IL)
* Union Pacific Gate Albuquerque
* DOW Gate (IL)
* Newmont (Houma, Louisiana)
*Note: Toll booths are part of `tollgate.sii` and `gate_trigger.sii`. Editing these causes gates to fail opening, so toll booths remain stock.*
**Conflict Notice:** This is a standalone global logic override. It will conflict with other mods that attempt to modify the same global gate animation or trigger definitions (`animated_gate` blocks).
---
## 🐛 Bug Reporting & Support
If you encounter a specific yard, toll plaza, or logistics depot anywhere on the map that still feels "off" or doesn't trigger correctly, please drop the **City and Company Name** in the comments section. Feedback will be logged and prioritized for upcoming maintenance hotfixes.
---
## 🛠️ Credits & Technical Acknowledgments
* **Development Group:**
Smoke Show Studios, Smoke Show Creations & Harambes Children
* **Lead Developer & Tester:** meanshadows35
* **Technical Consultant:** Overdrive
* **Tester:** mrh368
* Developed natively on Ubuntu 26.04 LTS
* Mod extraction powered by sk-zk Extractor
* Built using the official SCS Uploader tool running under Proton