Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Bug [1.0.0-pre.15] Editor behavior not same with runtime build

Discussion in 'NetCode for ECS' started by optimise, Feb 6, 2023.

  1. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,046
    At 1.0.0-pre.15 release, I found that at editor when u try to cast some skills it will failed to cast properly and need to cast it again to make it work. And also when I will some skill that has projectile, sometimes it will failed to collide with enemy and just pass through enemy with no collision detection. But when I try to build server runtime and editor as client connects to the server runtime and try it again, it works nicely. Not really sure but maybe it's caused by some kind of simulation rate at editor for server world has been reduced to make editor run faster when at play mode to play the game with client world and server world running together at editor?
     
    Last edited: Feb 6, 2023
  2. NikiWalker

    NikiWalker

    Unity Technologies

    Joined:
    May 18, 2021
    Posts:
    241
    Without more details (e.g. code and ideally a video too) we'll be unable to determine the cause of this. Ideas:
    • Is casting spells a predicted action?
      • Have you confirmed that the server is correctly receiving these spell cast commands?
    • Are the spell projectiles themselves predicted?
    • Is collision predicted on the client, or handled exclusively serverside?
    • How is collision replication handled? Is the projectile destroyed? I.e. Is that replication working correctly?
    • What network simulator settings do you use in the editor?
    • Are projectiles fast moving? Physics 'tunnelling' gets more frequent with faster moving projectiles.
    • How are projectile physics collisions detected?
     
  3. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    806
    One things that can be affecting the collision behaviour "badly" is the server loop batching.
    By default, in the editor we batch up to 4 ticks in one if the server tick rate is low. This is to keep perf in the editor in check. However, it can introduce this kind of effects.
    As a test, you may want to the change the ClientServerTickRate

    MaxSimulationStepsPerFrame to 4
    MaxSimulationStepBatchSize to 1

    That would make the FPS lower but the simulation will do the correct things all time.