Project Zomboid

Project Zomboid

PZNS NPC Framework
 This topic has been pinned, so it's probably important
{5LINE}Cows with Guns  [developer] 13 Jul, 2023 @ 2:44pm
Technical Details: Why I no longer actively work on SS/SSC
Someone had the patience to read and follow the technical details I laid out in a discord channel... so I'll post the summary here if anyone cares.

SS/SSC has a Serious Data Management Problem with Loose Mod Files
This mainly comes from the number of loose files that can be found in the mod folder under
C:\Program Files (x86)\Steam\steamapps\workshop\content\108600\<SS/SSC workshop ID>.

SS did not have a clean up function to remove loose files, even for NPCs that are dead or no longer in the game.
Manually removing said files also causes SS to break because the core function(s) expects there to be a file based on the number of NPCs and number of groups, rather than by tracking NPCs data.
Eventually, there will be too many files to load and make the game unbearably slow to load and play.

The SS AI code is entangled between Tasks and "General AI"
Yes, some of you may have noticed in SS your NPC workers basically lets themselves get killed while working when attacked. That is because SS did not have a clear distinction between their job actions, threat assessment, and attacking actions.
Some actions terminate early and prevents further actions from happening -OR- they queue up so many times the NPCs freeze or becomes stuck (Such as Reloading).
In my own view at this point, rather than go through 6000+ lines of code of actions and "AI-Manager" code, it was far easier to start from scratch with a coherent logic flow.
Last edited by {5LINE}Cows with Guns; 13 Jul, 2023 @ 2:45pm
< >
Showing 1-15 of 16 comments
NRG-UNX 25 Jul, 2023 @ 4:10am 
well ... it is what it is .. can u work on it when build 42 comes out .. bc it will contain AI .. code .. which can modified for human npcs
{5LINE}Cows with Guns  [developer] 25 Jul, 2023 @ 12:31pm 
Originally posted by stally U GOT CONTROLLERED:
well ... it is what it is .. can u work on it when build 42 comes out .. bc it will contain AI .. code .. which can modified for human npcs

Hence I said this is a preview. Come B42 I expect changes that will likely force a rewrite or change to how the framework calls the APIs.

The data management code, I hope will be fine. But until B42 is released, I won't know.

Regardless, the performance issues plaguing SS/SSC won't be an issue with PZNS if I can help it.
NRG-UNX 30 Jul, 2023 @ 11:17pm 
why are the devs taking tooooooooo much time ... amazing modders like u can make npcs in game ... but not the game devs ... tbh that this point they lazy .. working on farming .. who the F needs farming .. they are not foucing on the main plan which is npcs .. just overhauling stupid ui .. no one asked for ... they take years to just .. release a simple update ... just focus on the damn npcs .. not the other stuff
NRG-UNX 30 Jul, 2023 @ 11:21pm 
i am just waiting for a game called ... nysunder .. its PZ but in first person with amazing graphics or even starfeild
Originally posted by stally U GOT CONTROLLERED:
i am just waiting for a game called ... nysunder .. its PZ but in first person with amazing graphics or even starfeild

necro bc i gotta know what stally thinks of starfield

@dev has anything revealed about B42 so far been interesting to you?
{5LINE}Cows with Guns  [developer] 7 Sep, 2023 @ 1:38pm 
Originally posted by rat wizard (rat individual):
necro bc i gotta know what stally thinks of starfield

@dev has anything revealed about B42 so far been interesting to you?

No, not really.

Until B42 goes live and I/any other modder can see how and what TIS implements for animals and NPCs.

Given my current (and limited) understanding, "Full" NPCs are simply not realistic in the current build until TIS implements background simulations for NPCs and improves cache clearing/memory management.

Here are 2 examples I've found after working with
- Off-screen NPCs can and will cause the game to crash (because the square the NPC is on is unloaded).
- https://github.com/shadowhunter100/PZNS/issues/34#issuecomment-1676499971

- Non-zombified dead bodies are NOT (and NEVER) removed from the game world in single player - but for whatever reason, the option is enabled for multiplayer.
- https://github.com/shadowhunter100/PZNS/issues/34#issuecomment-1682692477
Olav 7 Oct, 2023 @ 12:23pm 
Originally posted by stally U GOT CONTROLLERED:
why are the devs taking tooooooooo much time ... amazing modders like u can make npcs in game ... but not the game devs ... tbh that this point they lazy .. working on farming .. who the F needs farming .. they are not foucing on the main plan which is npcs .. just overhauling stupid ui .. no one asked for ... they take years to just .. release a simple update ... just focus on the damn npcs .. not the other stuff

Because a modder can afford to make mistakes, such as file bloat, bugged AI, etc. He does it as a hobby, for fun, and no one has the right to complain if his mod has issues, that is how it should be. You are not a modder's client or consumer, you are downloading a volunteer product as is.

While a company, the devs, they must get things mostly right. They can't afford to make mistakes that will force them to rewrite the whole code in the future, they must get it at least 90% right at launch. Minor bugs is one thing, but a code breaking bug puts their product at risk and their name in bad shape. Coding a quality product takes time. Modders can do what they want, and they try to make it good. Devs can't afford to try, they need to make it right.
MariusTitus 8 Nov, 2023 @ 12:01pm 
Hey, since you're the only guy still working on some sort of npc-ery, what about checking out Aiteron's thing for inspiration/takeover? He had it going before he joined TIS, and there's still some part of it going around - https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3043776718
{5LINE}Cows with Guns  [developer] 8 Nov, 2023 @ 2:11pm 
I already have Aiteron's permission and I credited Aiteron for the inventory management code in one of the commits/PR and acknowledgements under special thanks.
https://github.com/shadowhunter100/PZNS#readme

Aiteron even made his project available on GitHub and I have included his GitHub project link.
https://github.com/aiteron/NPC

Frankly, I am not finding enough passion in myself to continue developing this on my own (plus this was more of a hobby/learning lua for me).
I have added a collaborator on the workshop and the GitHub - basically, I am (or trying) to hand the PZNS project off to people who actually care and have some know-how rather than continuously demand things for free. :execution:

Modding a game as a hobby doesn't pay the bills at the end of the month and I have been out of a job long enough. :spiffo:
MariusTitus 9 Nov, 2023 @ 3:44am 
It's alright man, passion is a fickle mistress, maybe it'll pull you back in after you're done, maybe not, you'll see. Focus on the job first, it's hard to code when you're homeless lol
blackhawk700 13 Dec, 2023 @ 2:27am 
Still appreciate your work- been going from SS/SSC and think I’ll use this framework you’ve made until that build is out (getting much better fps) only thing that sucks is no random spawns but I saw there were issues with that or something and was removed. Best of luck!
Milkshakes 12 Jan, 2024 @ 7:13pm 
I don't know if this is "small/low effort" enough to count as a fix you'd entertain, but currently if you perform a medical check on an NPC there is no "Hold Still" task to stop them from compulsively bandaging themselves.

Without it, they endlessly interrupt any advanced (stitches / glass / bullets) treatment the player attempts to give.

The old SS had one such AI Task, I tried to add it back myself but had no luck - however it might be quick to re-implement for someone with actual knowledge on the subject.
Levi (λ) 24 Feb, 2024 @ 7:40am 
"Eventually, there will be too many files to load and make the game unbearably slow to load and play."

Is there no method for the end-user to manually purge this?
{5LINE}Cows with Guns  [developer] 24 Feb, 2024 @ 8:33am 
Originally posted by Levi:
"Eventually, there will be too many files to load and make the game unbearably slow to load and play."

Is there no method for the end-user to manually purge this?

No, because if you delete the files manually, the mod breaks completely.

SS (Superb Survivors) literally scans the folder for the NPC files the mod itself has generated. Deleting an NPC file in SS basically guarantees an "file not found" error * number of files deleted.

I will be unsubscribing from this discussion - I am not returning to PZ anytime soon, your best bet is to wait for B42/43. :spiffo:
Levi (λ) 27 Feb, 2024 @ 8:46am 
2
...which means the mod is logging them...which, CAN be purged...but my question was more, can the end-user do it. Not easily I would assume, I hate Java, and Steam's method of mod subscriptions.

But, there is no, permanent logging of generated files, it is in relation to your saved games, or it's denoting, to itself, when a new NPC has been made, which means you'd need to reset that AND nuke the NPC files too.

So are you saying, there's some sort of data about the NPCs being stored completely out of reach? I'm asking you because ♥♥♥♥♥♥♥♥ I don't feel like doing coding puzzles in an unfamiliar language.

But you unsubbed from the discussion, mature, so.
< >
Showing 1-15 of 16 comments
Per page: 1530 50