Turret AP and HP ammo causes players to dynsc out of game when shot by turret

Version
2.5
Platform
Windows
when players are shot by turret ap or hp ammo they become dynsc from the game

*ammo type additions through tags seems to be the issue.

as of now internal hotfix by server owners is removing ap and hp ammo from being loaded into a turret untill the tags are corrected.
this mod made by cheese does exactly that.
https://www.nexusmods.com/7daystodie/mods/9401?tab=description

Screenshot 2026-01-16 102925.png
 
Reproduction Steps
easy to replicate set up turrets with ap or hp ammo and have a non ally player get killed by one
he/she will become dysnc from the game...
Link to Logs
https://discord.gg/ZfcsJU9TQC
Link to Screenshot/Video
https://discord.gg/ZfcsJU9TQC
From version 1.4 to 2.5 (+tags) was added to property of turrets "AmmoItem:..
verion 1.4:

Screenshot 2026-02-12 135814.png

version 2.5
Screenshot 2026-02-12 133816.png

the "AmmoItem" +tags i believe is what is causing the bug
 
Last edited:
Hapened to me yesterday players gettint shot by my turrets with standard ammo, getting desync we tried remove and replace ammo it seems to work
 
I got to a base to raid and it had turrets all the way around it I started getting shot for about 5 to 7 min and no damage I was invincible then all of a sudden my body was on the ground and I can see my body in 3rd person but I wasn't dead I belonged because I waited 10 min and nothing I can just see my body no death loop nothing just relogged and happened again same way
 
Technical Note: SMG / Auto Turret PvP Desync

The current issue is with the SMG / auto turret and how its combat behavior appears to synchronize between client and server during PvP.

Based on testing, the turret can appear to function normally from the player’s point of view while still failing to apply reliable damage. The turret may track, rotate, target, and visually fire, but the server/client combat state does not always resolve the hit or damage correctly.

The suspected failure path is:

1. The turret detects or tracks a player target.<br>2. The turret appears to fire at the target.<br>3. Client-side visual behavior and server-side combat validation do not stay fully aligned.<br>4. The turret shot does not consistently resolve as valid damage.<br>5. The player may take reduced, inconsistent, delayed, or no damage.<br>
This makes the turret unreliable as a PvP base-defense block.

This does not appear to be only a stat-balance issue. Changing XML values such as range, damage, ammo type, burst count, fire rate, recipes, loot, or trader entries can change how the turret is configured, but it does not necessarily fix the underlying turret combat behavior.

The important technical concern is that turret damage is not behaving like a simple server-authoritative damage event in all cases. If any part of the turret’s targeting, firing, raycast/projectile handling, animation state, or hit confirmation depends on client-side state, then a desync can cause the visual turret behavior and the actual server damage result to disagree.

Possible technical causes include:

client/server targeting mismatch<br>turret aim direction not matching server-side hit calculation<br>tile entity state not updating cleanly<br>turret fire event appearing client-side but not resolving server-side<br>hit confirmation failing after target movement<br>projectile or raycast validation disagreeing between client and server<br>turret ownership or powered state not matching at the moment of fire<br>loaded ammo state not matching expected turret ammo state<br>
The result is that a player can appear to be inside turret fire while the actual damage application is unreliable.

Testing also showed that directly modifying the autoTurret block definition is risky. Other turret blocks may inherit from or depend on the base auto turret definition. Heavy changes to the base turret block can unintentionally affect other turret types, including visibility, model behavior, ammo behavior, and block interaction.

This means that replacing, air-blocking, or heavily rewriting the base turret block through XML can create side effects beyond the original turret being targeted.

Placed turrets also carry persistent world data. A placed powered turret may include:

owner data<br>lock state<br>power connection data<br>rotation<br>targeting settings<br>loaded ammo<br>tile entity data<br>chunk state<br>
Because of that, forcing placed turret replacement in an active world is technically unsafe through XML alone. XML patches can change definitions, recipes, loot, and trader entries, but they cannot safely migrate every placed turret while preserving all live tile entity state.

A proper forced migration would require code that can scan world chunks, identify placed turret blocks, record their state, remove them, replace them, restore valid data, and log failures. Without that, live replacement can risk missing blocks, lost ammo, broken ownership, broken wiring, invisible blocks, or server errors.

The safest technical conclusion is:

The SMG / auto turret should be treated as unreliable for PvP defense.<br>The issue is likely tied to turret combat synchronization or turret tile entity behavior.<br>XML changes can reduce future exposure but cannot guarantee a true fix to the underlying desync.<br>Live-world forced replacement is risky because placed turrets contain persistent state.<br>Heavy edits to the base auto turret definition can affect other turret blocks.<br>
For long-term stability, the best technical direction is to avoid relying on the desync-prone turret behavior and move future PvP defense away from that turret path entirely.
The suspected failure path is:


1. The turret detects or tracks a player target.<br>2. The turret appears to fire at the target.<br>3. Client-side visual behavior and server-side combat validation do not stay fully aligned.<br>4. The turret shot does not consistently resolve as valid damage.<br>5. The player may take reduced, inconsistent, delayed, or no damage.</span>
 
Subject: Powered Turret Manual-Fire Desync and Ammunition Modifier Issue in V3.0 b259


Hello TFP,

I am reporting a powered turret issue observed on a V3.0 b259 dedicated multiplayer server.

Environment​

Game version: V3.0 b259
Server: Linux dedicated server
Mode: Multiplayer PvP
Turret type: Powered block turret
Custom turret base: shotgunTurret
Ammunition tested: AP ammunition

Our custom “Grandpa Turret” extends the vanilla shotgunTurret. We originally used the shotgun turret as the base because earlier versions appeared to process shotgun turrets more reliably on the server than SMG turrets.

In previous versions, we experienced turret-related multiplayer problems including:
Shots appearing to originate away from the turret
Hits occurring after a player moved behind cover
Turrets visibly aiming away from the player they damaged
Turrets failing to hit valid moving targets
Differences between what the turret operator saw and what other players saw
Unreliable damage during remote camera control

We are trying to determine which of those issues remain in V3.0.

Current player report​

A player reported that the Grandpa Turret can be loaded with AP ammunition but sometimes does approximately zero damage.

The most important distinction appears to be whether the turret is operating automatically or being fired manually through the turret camera interface.

Static code-audit findings​

A static audit of the V3.0 b259 managed assemblies indicates that the vanilla powered block turrets now share the same general system:
autoTurret
shotgunTurret extends autoTurret
m60Turret extends autoTurret

BlockRanged
TileEntityPoweredRangedTrap
AutoTurretController
AutoTurretFireController
The shotgun turret does not appear to use a separate firing-authority implementation from the SMG and M60 powered turrets.

Autonomous firing​

The autonomous firing path appears to be server-authoritative.

The server performs the ammunition decrement and receives the loaded ammunition type:
if (ConnectionManager.Instance.IsServer)
{
if (!TileEntity.IsUserAccessing())
{
if (!TileEntity.DecrementAmmo(out ammo))
return;
}
}
The server then performs the damaging raycast and hit processing.

This suggests that autonomous powered turret firing is now handled by the server for SMG, shotgun, M60 and derived powered turrets.

Manual camera firing​

Manual firing appears to follow a different path.

The turret camera interface calls:
XUiC_CameraWindow.Update()
→ AutoTurretFireController.PlayerFire()

The controlling client appears to be allowed to continue through the firing path while the turret has an active user:


if (!ConnectionManager.Instance.IsServer)
{
if (atc == null || atc.UserAccessingId == -1)
return;
}

This indicates that shot initiation, direction and hit selection during manual camera control may originate on the controlling client.

That could explain multiplayer symptoms involving latency or disagreement between client and server positions:
Apparent out-of-body hits
Hits after a target reaches cover
Turret rotation not matching the damaging shot
Different aim presentation between clients
Moving-target misses during latency or low server FPS

Suspected ammunition bug during manual firing​

The more serious issue is that the loaded ammunition appears to be resolved only in the server autonomous branch:
TileEntity.DecrementAmmo(out ammo);

During client-controlled manual firing, the local firing path may continue with:

ammo == null
If the actual loaded ammunition ItemValue is unavailable, the firing calculation may fall back to the block’s base properties instead of using the loaded ammunition’s passive effects.

Our custom turret currently has approximately:
<property name="EntityDamage" value="10"/>
<property name="RayCount" value="1"/>
The AP ammunition is expected to provide values similar to:
EntityDamage: 38
TargetArmor reduction: 50%
Entity penetration: 1
The suspected result is:
Automatic firing:
Server resolves the AP ammunition.
AP damage and modifiers are applied.

Manual camera firing:
Client does not receive or resolve the loaded AP ItemValue.
The shot falls back to the turret block’s base damage.
AP armor reduction and penetration may be absent.
Against an armored player, a base damage value of 10 without the AP armor modifier can appear to do almost no damage.

Suggested reproduction test​

  1. Place a vanilla powered turret or a powered turret derived from shotgunTurret.
  2. Load it with AP ammunition.
  3. Use a player wearing known armor as the target.
  4. Record the damage from one autonomous turret hit.
  5. Repair or reset the target’s health.
  6. Fire the same turret and ammunition manually through the camera interface.
  7. Compare the health loss.
  8. Repeat with standard ammunition.
  9. Repeat with the vanilla SMG, shotgun and M60 powered turrets.

A significant difference between autonomous and manual AP damage would support the ammunition-resolution issue.

Expected behavior​

Manual and automatic firing should use the same authoritative ammunition data:
Same loaded ammunition type
Same EntityDamage
Same armor modifier
Same penetration count
Same range
Same ray count
Same spread calculation
Same damage authority
The client camera should send an input or aim request, while the server should validate the ammunition, consume it, calculate the shot and apply the hit.

Actual suspected behavior​

Automatic firing:
Server consumes ammunition and calculates damage correctly.

Manual camera firing:
Client initiates the damaging firing path.
Loaded ammunition data may be null or unavailable.
Block fallback damage may be used.
AP modifiers may not be applied.
Shot direction may be based on the controlling client’s world state.

Requested review​

Please review the following areas:
AutoTurretFireController.Fire()
AutoTurretFireController.PlayerFire()
XUiC_CameraWindow.Update()
TileEntityPoweredRangedTrap.DecrementAmmo()
Powered turret target synchronization
Manual turret shot validation
Ammunition ItemValue synchronization
The preferred correction would be:
  1. Make manual powered-turret damage server-authoritative.
  2. Send the operator’s requested aim direction and fire input to the server.
  3. Resolve and consume the loaded ammunition on the server.
  4. Apply the actual ammunition ItemValue and all passive effects.
  5. Perform the damaging raycast on the server.
  6. Synchronize the resulting shot and visual effects to clients.
  7. Ensure automatic and manual firing use the same damage-calculation path.
This may affect all powered block turrets rather than only our custom turret, because the vanilla SMG, shotgun and M60 turrets appear to share the same controller classes.

The current evidence comes from static assembly inspection and player reports. A developer-side runtime test would be needed to confirm the complete network and damage flow.
 
Back
Top