No open-world is complete, without inhabitants ! Â Even in such a post-apocalyptic world, there has to be some survivors and interesting people to make the world believable. So enter the NPCâs:
From useless to useful
The first couple of NPCâs I had running around just, basically, ran around. I could track them and assign them a specific line of text when needed for missions, but other than that, they really were just filling to an empty world.
As the game grew, it became apparent that it was pretty easy to lose track of where you had to go for your next mission or find a specific item. So one of the nicest solutions I came up with, was having the NPCâs help you out (often in return for some payment in the shape of scraps).
The many uses of an NPC
When you walk up to an NPC, it will (in most cases) stop and look at you. You can then strike up a conversation, which will trigger a few things in the NPCâs brain.
First it will check to see if thereâs a specific item you might be looking for. It does this by looking at the open mission list, and checking any of the missions is requiring an item. If you donât have that item, the NPC will scan the buildings around it, and see if any of those buildings has such an item in itâs spawn list. If found, it will tell you it can help you find item X for Y amount of scraps. If you accept, you pay her the scraps, and the building with the item is revealed on your map!
If thereâs no mission requiring items, the NPC might check if there is a door entity with a myQuestID set. If so, thereâs a big chance you might want to visit that building to get your next story mission. So if such a building is found anywhere in the world, the NPC will tell you to âvisit X at Yâ and show you the location on your map. The X in this case is the name of the door-entity. Random doorâs will have ârandom buildingâ as name, but doors related to a story mission always copy the name of the avatar in the building. So in Gazâ Garage that door entity would be called âGazâ, or in the shop mission the door-entity is called âButchâ.
So if thereâs no open missions needing items, and there is no un-accepted mission found, the NPC will check if the nearest building (within a specific radius) has any specific level settings like levelDark, levelToxic, or levelSkellynest, etc.
If thatâs the case, it will spawn a warning message telling you the âbuilding is too dark for me!â or âoh no, a skelly nest inside, donât go there!â.
And finally, if all of those checks result in nothing, the NPC will either throw you a random line of text, or a simple âchit-chatâ text.
Kids are fun
Besides the main NPCâs, and to make the game even more lively, I decided to try and add some kids to the mix. Kid NPCâs are generated near normal NPCâs, and will link them selves to that entity, following it around when it moves.
Other than that, the kids have no other use (yet)! Â Just fun to create it and see if it would work and look nice.. you gotta have fun creating games!