Skip to content

Persisting projectile on client side when shooting at host player #519

@Tacokeet

Description

@Tacokeet

🐛 Description

Projectiles fired by clients persist on the client's screen after hitting the host player, despite the hit being registered (displacement occurs). The projectile continues flying without exploding on the client side, while the host/server sees the correct behavior (explosion and projectile removal).

Steps to reproduce

  1. Set up a forest brawl example with 2 instances
  2. Use instance 1 to host a game
  3. Use instance 2 to join as a client
  4. From the client (instance 2), shoot a bomb projectile at the host player
  5. Observe the behavior on both screens
Forest.brawl.persisting.bomb.projectile.mp4

Expected behavior

  1. The projectile should hit the host player on both screens
  2. An explosion should appear at the impact location on both screens
  3. The projectile should be freed/removed from both the host and client screens
  4. Displacement effect should occur on both screens

Observed behavior

On Client (shooter) screen:

  1. The projectile hits the host player
  2. Displacement on the target player occurs correctly
  3. No explosion visual appears
  4. The projectile continues flying and is not freed

On Host screen:

  1. Everything works correctly - explosion appears and projectile is removed

Logs from the session:

[DBG][@2240][#1321665129][_][netfox.extras::NetworkWeapon] Calling after fire hook for Bomb Projectile 0oihuio37p6h
[INF][@2241][#1321665129][_][netfox.extras::NetworkWeapon] Accepting projectile 0oihuio37p6h from 1
[WRN][@2246][#1321665129][_][netfox::DiffHistoryEncoder] Reference tick 2242 missing for #1 applying 2247
[DBG][@2247][#1][_][fb::Displacer] Created explosion at (1.735605, 1.500955, 3.618552)@2246
[DBG][@2270][#1321665129][_][fb::Displacer] Created explosion at (12.80797, 1.500955, 4.475404)@2269

Versions

  • Godot version: 4.5
  • netfox version: main branch - commit hash 7c1e9eff915bc46cef5b433398c9801367446071

MRE

The issue can be reproduced using the official forest-brawl example with the setup described above (2 instances, one hosting, one as client, client shoots at host).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions