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

NPCs in city-less worlds really slow the game down #22270

Closed
Coolthulhu opened this issue Oct 27, 2017 · 5 comments
Closed

NPCs in city-less worlds really slow the game down #22270

Coolthulhu opened this issue Oct 27, 2017 · 5 comments
Labels
Code: Performance Performance boosting code (CPU, memory, etc.) NPC / Factions NPCs, AI, Speech, Factions, Ownership

Comments

@Coolthulhu
Copy link
Contributor

As reported in http://smf.cataclysmdda.com/index.php?topic=15122.0

"Wild" NPCs look for shops and houses to loot. When those don't exist, they fail to find something to do, meaning that their next action will be looking for something to do (ie. scanning for shops and houses to loot).
The radius for this scan is whooping 5 overmap widths - (180*5)^2=810000 tiles to check. And the per-terrain check is a string comparison.

@Coolthulhu Coolthulhu added NPC / Factions NPCs, AI, Speech, Factions, Ownership Code: Performance Performance boosting code (CPU, memory, etc.) labels Oct 27, 2017
@Coolthulhu Coolthulhu changed the title NPCs in city-less worlds really lag the game down NPCs in city-less worlds really slow the game down Oct 27, 2017
@Kole6738
Copy link
Contributor

Could we drop it down to 1 overmap width as a stopgap measure? That's still quite a large area to scan (32400) to allow AI behavior and would cut down processing by a significant factor.

@ZhilkinSerg
Copy link
Contributor

Could we drop it down to 1 overmap width as a stopgap measure?

It will decrease slowdonw, but won't really help as there are still no shops and houses in 1 overmap radius.

I suggest npcs should traverse field overmap terrain in worlds with CITY_SIZE = 0.

@stale
Copy link

stale bot commented Aug 21, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not 'bump' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

@stale stale bot added the stale Closed for lack of activity, but still valid. label Aug 21, 2019
@anothersimulacrum
Copy link
Member

Fixed in #30288?

@stale stale bot removed the stale Closed for lack of activity, but still valid. label Aug 21, 2019
@mlangsdorf
Copy link
Contributor

Fixed in 30288, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code: Performance Performance boosting code (CPU, memory, etc.) NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

No branches or pull requests

5 participants