Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New finder over-explores when unable to find a path to target entity #2730

Open
hkkongou opened this issue Jan 15, 2022 · 9 comments
Open

New finder over-explores when unable to find a path to target entity #2730

hkkongou opened this issue Jan 15, 2022 · 9 comments
Assignees
Labels
Help Request User needs help.

Comments

@hkkongou
Copy link

/version output

[18:17:38 INFO]: Checking version, please wait...
[18:17:39 INFO]: This server is running Paper version git-Paper-151 (MC: 1.18.1) (Implementing API version 1.18.1-R0.1-SNAPSHOT) (Git: 6663747)
You are 1 version(s) behind
Download the new version at: https://papermc.io/downloads
Previous version: git-Paper-407 (MC: 1.17.1)

/version Citizens output

[18:17:40 INFO]: Citizens version 2.0.29-SNAPSHOT (build 2448)
[18:17:40 INFO]: Website: http://www.citizensnpcs.co
[18:17:40 INFO]: Author: fullwall
[18:17:42 INFO]: [serveritem][give] Ha

Log file

https://paste.denizenscript.com/View/92230

config.yml

https://paste.denizenscript.com/View/92232

saves.yml

https://paste.denizenscript.com/View/92231

Profiler report

https://spark.lucko.me/rDZZKEsi3p

Description

using finder 1 is causing npc moving so strangely, so i used finder 2, but when i use finder 2, it have very serious lag spikes, you can see in the spark profiler.

@fullwall
Copy link
Member

Can you show a picture of the path?

@hkkongou
Copy link
Author

hkkongou commented Jan 15, 2022

Can you show a picture of the path?

the old one is like red and new one is like yellow
image

attached 2 video

use-new-finder: false
https://youtu.be/4_oxggWT-A0

use-new-finder: true
https://youtu.be/4R2j_gL0-J8

the reason why i try to use new finder is because old finder move very abnormal, so i use new, but new is laggy

@fullwall
Copy link
Member

Hm looks like you're flying and using NPC targeting which may account for some lag.

@hkkongou
Copy link
Author

Hm looks like you're flying and using NPC targeting which may account for some lag.

i am actually using sentinel guard

in the video ,indeed i was flying, but is the same when i walk on the ground, it just doesn't walk diagonally. (i have player tested , they can't fly)

@mcmonkey4eva
Copy link
Member

There are several config options in plugins/Citizens/config.yml that might help with pathfinding performance, notably:

npc:
  pathfinding:
    new-finder:
      iterations-per-tick: 5000
    maximum-new-pathfinder-iterations: 10000

tweaking those iteration counts to be lower counts to be lower can generally help with new finder performance.

Also, as you're using Sentinel, the Sentinel config option:

    # Whether to use Sentinel's entity chase pathfinder.
    # If set to 'false', will use the Citizens built-in one instead.
    workaround entity chase pathfinder: true

May be relevant. false might potentially have better performance, at the cost of the NPC being less effective at reaching and hitting the target.

@mcmonkey4eva mcmonkey4eva added the Help Request User needs help. label Jan 17, 2022
@hkkongou
Copy link
Author

There are several config options in plugins/Citizens/config.yml that might help with pathfinding performance, notably:

npc:
  pathfinding:
    new-finder:
      iterations-per-tick: 5000
    maximum-new-pathfinder-iterations: 10000

tweaking those iteration counts to be lower counts to be lower can generally help with new finder performance.

Also, as you're using Sentinel, the Sentinel config option:

    # Whether to use Sentinel's entity chase pathfinder.
    # If set to 'false', will use the Citizens built-in one instead.
    workaround entity chase pathfinder: true

May be relevant. false might potentially have better performance, at the cost of the NPC being less effective at reaching and hitting the target.

thank you, i just tuned down those two citizen config
and for the sentinel one is default false

i will see for some moment , thank you

@hkkongou
Copy link
Author

There are several config options in plugins/Citizens/config.yml that might help with pathfinding performance, notably:

npc:
  pathfinding:
    new-finder:
      iterations-per-tick: 5000
    maximum-new-pathfinder-iterations: 10000

tweaking those iteration counts to be lower counts to be lower can generally help with new finder performance.

Also, as you're using Sentinel, the Sentinel config option:

    # Whether to use Sentinel's entity chase pathfinder.
    # If set to 'false', will use the Citizens built-in one instead.
    workaround entity chase pathfinder: true

May be relevant. false might potentially have better performance, at the cost of the NPC being less effective at reaching and hitting the target.

hello
i just changed to new finder with the settings you provided, however there are still lag spikes, previously can cause a 1000-2000ms spike from spark tickmonitor and now can do a 500-700 spike, which is still, not good as compare with old finder, which have no spikes at anytime, what should i do?

https://spark.lucko.me/ujwlSQYGsT

@hkkongou
Copy link
Author

hkkongou commented Jan 19, 2022

image

https://spark.lucko.me/1WJUePvOfE

my tps just dropped to 1 with 30players , spark checked, is citizen lag

@fullwall
Copy link
Member

I believe it's because the sentinel is unable to find a path to the player. There are mitigation strategies I need to implement for this; I have not done it yet.

@fullwall fullwall changed the title new-finder causing lag spike and lag New finder over-explores when unable to find a path to target entity Jan 19, 2022
@fullwall fullwall mentioned this issue Feb 14, 2022
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Request User needs help.
Projects
None yet
Development

No branches or pull requests

3 participants