Jump to content

NPCs (technical)


Magusdl

Recommended Posts

First, just to make clear, I'm not asking for NPC's, I want their brain. :P

 

I just read again Lemmy's explanation on why NPC's aren't being fully worked on, and being a programmer, I fully understand him.

 

http://www.youtube.com/watch?v=YsL_7xQnCSA (very old PZ AI video)

Ever since I watched this video, back in 2011 (2012?), I have been itching to play with their code. I go back to that video every now and then, it's just so awesome, I could watch it all day.

 

@Lemmy

Now, I would like to know what exactly is the issue with the current NPC progress, I remember reading something about the pathfind on the streamed cells, which (understandably) made things ALOT harder. The sledgehammer, carpentry and modding don't help at all in setting up manual waypoints (if that's the way your heading), so I thought you could be trying a neural network so they could kind of build it themselves. In Quake 2, a bot (not sure the name, I think it was Eraser Bot) would use the players positioning to "know" if a place was good, after some gameplays, the bots would start going after the unusual item spawns players liked to pick, and in CTF they would defend the most used routes. Maybe the issue is making the NPC's AI work well with the other metagame events. I'm totally lost to what is happening behind the curtain. :(

 

There is anywhere I could get more information on what approach you are using? With code it would be even better. I would surely like to help think on solutions for these issues, maybe even find a different approach that could work with the metagame system. I just want to play with their brains (not AI, meh, boring word :P) for so many years now, that it's urging me to post this, so sorry if it sounds like any sort of distrust.

Link to comment
Share on other sites

Guest easy AI opponent

+1

 

I am not sure if i understand correctly but your suggestion is that the behavior (routes their take, safehouses their build, etc.) from the player (in SP/MP) is transferred to the NPCs as a backbone behavior. From there, they response to random encounters according to their scripted personality/skills.

 

I dont know if this is feasible but i think its a pretty neat idea!

Link to comment
Share on other sites

Keep in mind this is not a suggestion thread, it's an attempt to finally be able to "play" (for me, it's fun) with the NPC's AI.

 

Yeah, basically the idea behind a neural network is that the AI "learns" from their experience, it can even learn from players since they (usually) know what they are doing. It's like they analize the surroundings to know what is a wall, then remember that so they don't have to do it everytime (save the path they should go when near that place, if stuck re-analize). You can also get frequently used routes by players, and make NPC's do the same, since players usually avoid dangerous spots. But it was a guess, I'm actually trying to find out what technique they are going for.

 

PZ used to have a single cell (a map square, the map in the video), then they implemented a map "streaming" where the cells are loaded as you get closer to them (this is usually used in MMO's). It allowed a HUGE map increase (scary huge, can be infinite in theory), but also screwed up any sense of continous path (coordinates-wise, X, Y). Now you have a bunch of cells grouped together, and it's MUCH harder to make NPC's make their traveling around.

 

But the main issue (just guessing, I'm not involved) is the metagame, which is basically what happens when no player is around, and that cell is not loaded. This is used to control zombie migration (they don't show up out of nowhere just because you made noise, like in State of Decay), and what NPC's do when nobody is nowhere near (interaction with each other, looting missions, zombie encounters).

Link to comment
Share on other sites

Guest easy AI opponent

To me it sounds fun as well, hope for you get a response!

If it is possible to retrieve all the routes/behaviours of players from SP and/or MP then there would be a pretty huge pool of behaviours available for NPCs to choose from.

If i understand right, the map size increases could potentially screwed up NPC development as it complicates their traveling?
 

Maybe, if we are lucky then they will reveal something on todays mondoid ;-)

Link to comment
Share on other sites

I'm not sure they are recording player behaviour, probably not at this stage. Increasing the map wouldn't screw NPC development, it's a matter of finding the best way to make them deal with this never-stop-growing map. Imagine a square, the top left is coordinate 0,0 (x,y), then he goes left and now is on another cell, at coordinate 500,0 (making up a cell size of 500), he has changed his cell, so the coordinates can't be applied to the previous cell. Scale it up (like, traveling 10 cells) and things get more complicated. You have to find a "generic" way of dealing with this, since you don't know how big the map is gonna be (from the programmers view, who's not involved with map creation).

 

But that is just guessing cell pathfinding is an issue, it might be some more specific issue like a Java issue or something, that's why I'm asking for clarification.

Link to comment
Share on other sites

Guest easy AI opponent

It would be maybe nice if their yould take advantage of recorded player behavior in the future (on a voluntary basis maybe?) for that purpose.

 

Hope you get the clarification you want as you sound like somebody who likes to contribute some knowlegde/advice which could be benefical for all.

Link to comment
Share on other sites

I personally would like to know if they are going for a community type of NPCs or lone wolf type in the first implementation that will be in the game.

For me NPC that lives on it's own can be in the game even now. If I find him stupid/buggy, I will limit my interaction and eventually outlive him. That would give me some free loot of whatever he managed to gather in his safehouse or on him.

Link to comment
Share on other sites

The thing is, I don't think that NPCs in the metaverse will need pathfinding in a sence that they will be avoiding walls etc. I think it is rather calculated in the basis of what's in the cell/area they are.

 

At least whit zombies when they aren't in the streamed world they only exist in numbers in cells and aren't actually in any specific place. Then with meta events those numbers move from one cell to another and "react" to whatever there is in their way, such as breaking windows etc. After the movement between cells and reaction to existing static things in a cell you can add calculations in the basis of what is possible to happen in that specific cell for that number of zombies and add more things for the zombies/NPCs to react to.

 

Also the devs have said that, in addition to existing areas(seperate buildings etc.) and cells, that the zombies can react to, they are going to add larger areas. For example a row of houses or a stretch of a street.

 

Here's a quote from Lemmy if you haven't already read it, which I think you have though. ;)

 

 

Our plan to develop the meta-game a lot more solidly, quickly, and easily, is that we are quite literally developing the META game. A game outside the game, using java and the PZ engine for easy portability. We’re using very simple network code and developing a test-bed that’ll allow us to play the meta-game system as a turn-based board game of sorts – using all the same meta-game events that the game would use. We’ll be simulating noise generated, for example, with ‘tokens’ and keeping everything rooted in the physical world – despite being wholly virtual.
The idea behind this is that we’ll be able to balance and polish the meta-game system to produce a solid and elegant systems that were otherwise going to get complex and muddy. We’re positive that it will result in a much, much, much better system

 

Here's how I personnally think it might play out:

Legend:

Blue square=streamed area, so no meta-events here.

black grid=cell borders (300x300 tiles in game btw)

Orange blocks=Larger area (a block of houses, stretch of street etc.)

Red blocks=houses

metamap1_zps7f90bef6.png

Behold my awesome paint skills!

 

Inside every cell there is a number, repesenting the amount of zombies, NPCs, Creatures etc. From there the amounts can be moved to another cell or to a specific area inside the cell, either a larger area or a single house. Inside that area there is a possibility of certain things to happen which are determined by the area type itself and what it contains. For example: a block can be built close so that a zombie cannot enter that block, and a house has designated rooms which the NPCs can react to. Also inside those rooms there are room-dependant containers that the NPCs can loot.

 

So let's say we have an amount of 150 zombies in the cell and 1 NPC in a house in that cell, to your left and a meta event triggers a shotgun shot inside the cell left to that. The 150 number starts moving into the next cell and therefore the amount drops in that cell and rises in the other. Now since we have the possibility of zombies moving into areas within the cell we have a part of that 150 trickle to those areas. Now we have eg. 6 zombies inside the street area and 16 inside a block of houses. From there they can move back to the main cell or interact with what's inside that area, which is for example buildings. So 6 of those 16 move to a house and interact with a window that is in front of them, which ofcourse causes it to be broken and the zombies move into that house.

 

Now.

 

When the player enters that cell left to him and walks to the street, he will be greeted by 6 zombies randomly streamed inside that area. After sneaking by and going to a block of houses, he sees 10 straggling zombies. After that the house streams in and we have a broken window and 6 zombies inside a house. Getting inside the house he notices a few dead zombies and our NPC pal scratched and sleeping on a couch. He also notices that the fridge is empty and after ruthlessly murdering our sleeping friend with a pillow, he finds some groceries on him.

 

All of those areas are of course dealt as numbers as in cell 3,5 and inside that house 4 and room type kitchen or something similar.

 

Note again, that this is only how I have decided to interpret the information given to us bit by bit.

 

Link to comment
Share on other sites

As someone with a degree part-majoring in AI, I must say I find this thread rather... confusing.

 

It seems that both the OP and several posters have no real grasp on the basic logistics of AI within a free-roam cell based video game, and by loosely linking ideas explained from other sources have come up with some kind of meta-physical mind melt of ideas. It seems a bit like trying to push the square block through the round hole on those child's toys. (Keep trying, I have heard with enough pressure and friction the square can be worn down to a cylinder)

 

At first I thought the OP was requesting access to be able to mod the NPC AI routines (which still do not currently exist), so he could have a play around with them himself.

Then it seemed to take a turn toward the OP just wanting to know what kind of algorithms and techniques will come into play with the NPC AI.

After that it twisted into a bit of illogical discussion on pathfinding across persistent map cells, until the realisation that the map itself is streamed and therefore there are no 'actual' items, obstacles, or locations in existence beyond a short distance past the player's viewport.

 

What is it exactly that you are wanting to be able to do, or learn more about, OP?

There is a wealth of players here that have been following development closely enough, and with enough technical knowledge to adequately explain specifics that have been revealed to us over the past couple of years (and a vast majority of players who kind of vaguely follow the gist of things, but don't understand the how's and why's).

Not to mention, if you ask for specifics then it's more likely the Devs will jump in with a direct answer, rather than consuming time reiterating concepts they have presented and explained in the past.

 

Edit: My apologies. Reading through my own post, it seems a little bit... badly worded and possibly belittling. I don't intend it to be taken that way, but rather as a post pointing out how hard I was face-palming while reading through it all, and hoping you can be more specific about what it is you request, and/or what you already have figured out.

Edited by Realmkeeper
Link to comment
Share on other sites

Guest easy AI opponent

Edit: My apologies. Reading through my own post, it seems a little bit... badly worded and possibly belittling. I don't intend it to be taken that way, but rather as a post pointing out how hard I was face-palming while reading through it all, and hoping you can be more specific about what it is you request, and/or what you already have figured out.

 

No offense, but in pointing out how "hard you were face-palming when reading through the posts" your apology sounds a bit badly worded/ belittling as well....

Link to comment
Share on other sites

First, I'm not an expert on AI, my job is not even game-related (well, some kinect interactions *could* be considered a game, but a very very simple one when it comes to game mechanics), I'm just an enthusiast who has done alot of experimenting on AI programming and found it extremely fun (albeit frustrating sometimes).

 

Suomiboi had graciously pointed out I was way off track with my assumptions. I realized I had to do a in-depth research on techniques used for dealing with un-streamed cells, as I would end up making a bad system with horrible performance. Indeed I should have done so before starting a thread to ask for information, the last thing I want is to consume time from devs without being able to really help.

 

Well, to update the thread, I'm studying the subject to make a new testbed so I can try to replicate the current situation here. I have been away for too long so I also have to dig more what the devs said about this since then. Never tried this kind of AI dev so I need to get it working first, before going for a complex project like PZ has become, sorry for confusing people. I'll see if I can have a go at the zombie's AI first, since I should be able to try it ingame already (didn't really see if it's modable or hardcoded).

 

RealmKeeper, if you are in a bad mood, please take it out somewhere else. If you believe my thread is counter-productive there are many ways of saying so, without mocking anyone. Anyway, it's your opinion and I understand why you thought it was not a productive thread (or a toxic thread, as it seems).

 

This thread can be closed as I completely lost the desire to discuss this here (I'm worried to post my findings, or experimental code, until I get it working), never ocurred to me people could be that aggressive in these forums (step-by-step mocking, comparison with a child who can't get his toy to work and is trying to force it dumbly). I'll find an appropriate place for this that won't bother anyone. Thanks to everyone who support my "quest", specially Suomiboi for his friendly and instructive post, thanks again for your time. :)

Link to comment
Share on other sites

I personally find it interesting enough to follow you findings and your quest to dig out some sort of information and maybe even response. As nasKo said - don't let one person discourage you from your sharing your thoughts by pushing you sideways not really adding anything to the discussion.

 

 

 

I personally would like to know if they are going for a community type of NPCs or lone wolf type in the first implementation that will be in the game.

Both.

 

The only thing I'd be worried with that kind of approach is the behaviour of individual members of that society. If you won't make every single person do what you wan't to do it will look and act stupid (hence it was removed in the first place?).

 

What I think should (and will?) happen is adding some simple characters to the game. Like a spawn of a character that's only purpose in life would be to use hammer in his pocket (nails, and boards - yes spawned with him) to board up the house, and then fight of any zombie that heard his rumbling and decided to join the party.

 

For me that would create a house surrounded with zombies, with some of them inside, blood everywhere and a lot of dead bodies (mentioned in one of mondoids?).

 

At later stage another survivor that's only purpose in life would be to ransack entire house looking for food and living for x amount of time, then dying of starvation... later on someone that would be able to gather supplies from houses in his domain (x radius within his spawning place), eventually dying as well.

 

What I think is that they should first implement and fix any problems with the simplest things, before moving forward.

 

What I would hate is to see a well thriving society and staying with them the whole day just to learn what are their habits and good places to search for stuff (as a new player), only to notice that either some stuff magically appear in their shelves and fridges or them dying off ... because all of the magic is done off-line/screen with some probability stuff of cells.

 

So my expectation is to first see some lone survivors that are programmed to do one and only thing in life and then die, without any option to interact with that character, except for maybe "piss off", before seeing other - more complex behaviours.

 

EDIT: How I think non-interaction can be logically done - either fear with character running away from player (scared if him being a zombie) or attacking a player if he comes near (and preparing when within mid range, and ignoring if away the max interaction circle).

Link to comment
Share on other sites

RealmKeeper, if you are in a bad mood, please take it out somewhere else. If you believe my thread is counter-productive there are many ways of saying so, without mocking anyone. Anyway, it's your opinion and I understand why you thought it was not a productive thread (or a toxic thread, as it seems).

Hey, sorry again. With this paragraph directed at me, I feel I should respond with something.

 

After perusing the GD and suggestions forums for some time, and seeing the same old stuff over and over, it was refreshing to see something new (from the thread title), and I dived right in. Really, I should have been congratulating you on approaching a side of PZ not often touched or even considered by the majority of forum regulars (and newcomers). It just struck me as a bit of a jumble of not-quite-yet-complete ideas, that were on a topic I am quite passionate about (AI and stuff), but from a seemingly ill-informed (or perhaps just naive, in terms of you've never really had to, or tried to understand the inner workings before) standpoint.

 

That's all I'll say about that, I think.

My apologies for coming across as rude and arrogant, and all manner of other things I've been mentioned as, and I actually hope you can discover some new things about AI if you persevere and formally learn some AI techniques.

In fact, I think a thread on discussing the AI, and potentially even modding the AI (We'll wait until NPCs are officially out, and we know the extent of LUA integration with the AI side of things) would be a great idea - a compendium of thoughts and improvements.

Link to comment
Share on other sites

Thank you nasKo, this means alot, I really shouldn't let people put me down. But it didn't turn me off from my goals, just made me wary of exposing myself again.

 

@Kurruk

Thanks for the encouraging words too. I think harakka meant they will only be put in when lone survivors and groups are working properly (or at least well enough). The issue with putting in NPC's in a crude state, is that they can potentially break your game (used to happen, NPC entering your safehouse and blowing your head up after telling you to go away).

 

I remember them saying that you can become the leader of a group, and give them orders (like going out on looting missions, patrol the safehouse, etc). They will probably have a very hard time surviving anyway, since the game has to be unforgiving and some of them are there just to give a dynamic story to the places you go. Like finding a safehouse barricated that got overwhelmed (and you know it could have been avoided, if you were there before it happened).

 

I doubt there will be any magical resource showing up or anything, they will always get it from somewhere (well, spawning with basic items sounds reasonable and needed). If you are the leader of the group, you'll be able to tell them to stay safe while you take risks (or bring someone with you when going for looting missions). But if you are not the leader... well, people make mistakes, so it would actually be realistic if a "dumb" leader made poor decisions that got everyone killed. Even you could make the group starve if trying to keep everyone too safe.

 

There will be personalities (like aggressive, friendly, suspicious) which will be the core of their decisions, so we can be pretty sure it will be logical decisions based on "how they think". Then there is the "states" (like angry, scared, seeking refuge, protecting safehouse). An aggressive NPC could be "scared" and "seeking refuge" (maybe his group of raiders died, he's out of weapons) and willing to join up with others, only to be an asshole and disrupt your group's unity when he has those needs satisfied. A friendly NPC might be hostile if you get too near his safehouse, as a safety measure. Even in it's crude form, they had personalities and would act according to them (telling you to "fuck off!" and going for the kill if you didn't listen, others would be willing to join you, often forgetting to tell you they were bitten).

 

Anyway, like I said, there used to be some complaints about NPC's ruining games randomly (there was very little interaction with them), so I believe they are trying to avoid that now (with alot more players, could result in alot more complaints). And as much as I would love to see them in even if with a very simple AI, I think they should be careful with their brand above all. TIS is the real deal, they are honest, they truly listen to the community, they don't plan on making a half-baked game to sell DLC's later on. We have to trust them and be patient when they are being cautious, because that's the right approach, I believe.

 

 

@Realmkeeper

I understand your passion and reaction, I agree it would have been a waste of time if Lemmy came here to explain step-by-step what he is doing. I don't hold any grudge, I was just really surprised because I never expected this in PZ forums, and thought I overestimated the friendliness (and changed my mind about discussing it here). I'm looking forward to sharing ideas with you in the future, as I learn more about AI development. I'm not so clueless as it seems when it comes to AI dev, but I did rushed out assumptions and theories without proper information on the meta-game. Surely we could make a proper thread about this, I would certainly appreciate.

Link to comment
Share on other sites

Hey Magusdl.

Thanks again for sharing your thoughts and knowledge on this topic. You are right that at the very end we have to trust them to include that once they feel safe to share them.

 

... but then again if they keep them under the hood, not really exposing themselves to any suggestion or larger testing group, they might not have enough information to know if their "improved" behaviour would be better for larger audience or not. Just like with any improvement, they could create a branch whose sole purpose would be for ppl to share their experience with interacting NPCs that could potentially be on the side track even for a year or so, until they will be ready to include it to the main branch.

 

As for the exposing it to LUA and modding purposes, even with initial phase it might be difficult to do it as not all rules will be in place, the whole thing might potentially change 180' from one fix to another. I mean I joined the forum after playing the game for a while, because I do enjoy it and want to make it better, that is the reason I poke around, try to break stuff and then share my findings in hope they will be eventually fixed for everyone. Same thing will apply to NPC once they'll arrive, even if I would have to create a copy of config, saves and everything else in order to seamlessly switch from one branch to the other.

 

I might not have enough knowledge and/or time to spend it on working on them in a mod, but I do have a bit of it every now and then to either try and play a character to enjoy the game or scout around looking for problems (or check if the ones I've reported were fixed in new build or not).

 

Anyways, don't close this topic, and please do share your thoughts and findings, who knows some of them might prove to be a spark devs were waiting for.

Link to comment
Share on other sites

I can only imagine how tough it must be to build this AI. The video showing the fight-or-flight AI seems very good and intelligent. But that's just one page of the book. PZ has grown in complexity by including farming, carpentry, camping - not to mention metagaming. And soon hunting too. The impact of this on AI I think is huge because each opportunity becomes instantly apparent to humans beings, but to AI it requires some keen and intelligent decision making, not to appear stupid in our eyes.

 

So basically what I'm thinking is that the AI is extremely complex to build if trying to avoid the NPCs to act like dorks in a survival game. It's very interesting to see what the devs come up with.

 

I know jack about AI. I heard about different approaches too it, and I have yet to try and build one that isn't just a long series of if-conditions. 

Link to comment
Share on other sites

Non-programmer here.

 

Can anyone think of a game with NPCs similar to what PZ is trying to achieve? Sims 3 is the closest. Interacts with others, driven by needs, and virtualizes characters that are off-screen.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...