"Secure Area" Designation

In a world of mine, I found four houses set up in a square build around an intersection from roads that lead up from the bottom and went to the left; the other two roads stopped at the end of the houses. Seeing as I needed a base anyway and the cities were small and spread out, I decided to make this little cluster of homes a small fort. I already had most of the walls build for me. I secured the area with walls to connect the houses and made the only doors accessible across the road, with the intent to set up automated turrets by them. It should have been very secure and safe.

Except it wasn’t. The area was four map sectors large and several times I had zombies spawn inside of its perimeter, despite every door being closed and all blockades untouched. It’s like a zombie walked up and ghosted through the wall. This tiny fort was no more secure than somewhere out in the open.

There has to be a way to designate areas “secure” in the monster spawning mechanisms. Somewhere with absolutely no way in or out simply by pathing should be exempt from having monsters poof into reality inside of them.

Is there a way to do this?

If there is I hope it keeps out NPC’s too. I like playing with dynamic NPC spawn for several reasons, but I really hate it when an NPC suddenly spawns inside my current base and either steals my stuff or attacks me.

This is actually a really good idea - I could see myself actually trying hordes if something like this was in.

The mechanics underneath are probably a good bit more difficult than you realize, though. One big help on that would be having “secure” areas only be checked for in very specific situations, first and foremost being specific player action (“secure this area”, or somesuch) - if there’s no way out of the area (and the area would probably have to be under a certain size, as well, most likely), then it’s secure. Any time a wall is damaged/destroyed, it would have to be checked again, though. Doors opening might well trigger it too (ouch).

So yeah, it sounds great, but actual implementation is likely to be CPU intensive, which is bad. On the plus side, it would be possible simply mark some areas as secure during map generation, then take it away under certain conditions, so some places wouldn’t get hordes in them until the player (or perhaps a horde outside) opened them up, so that would be a good thing.

If you somehow created a secure area the size of the reality bubble, you could never be attacked by zombies again.

Well the important part of this idea is that it only stops zombies & other entities from SPAWNING not from walking through. As such you can probably get away with the player designating a “sealed” area secure, and then not letting any entities spawn there, or force them to spawn 1 map tile away or so. Then open doors and such wouldn’t have to be checked, because it only deals with spawn canceling.

But lets say you have a reality bubble sized secured area with a wall completely surrounding it just outside the bubble. How do the zombies cross the wall into the bubble? The game won’t process them destroying the door because it’s just outside the bubble, so they will never be able to cross.

The reality bubble moves. So if you managed to make a perfectly reality bubble sized wall, with a “designated clear” inside and then proceeded to stand perfectly in the middle, and not move in any direction for days on end… then what? Soon as you move 1 tile in any direction, all zombies along that wall can attack it if they want. When you get closer more zombies can attack the wall, when you move to one side or another to take care of zombies further along the wall zombies along the other sides can start attacking etc…

Of coarse all this is assuming that whatever system that gets worked out allows for a single area that big to be made. And it also does not take into account you leaving the “secured area” for whatever reason, say, looting. Leaving would mean that mobs are free to approach the secure area/attack walls/ walk in any openings as soon as they are in the reality bubble again, they just can’t spawn inside.

might have to take special consideration with hordes, to make sure they can’t “spawn” inside, but can still walk in once inside reality bubble.

The allowed size for any “secured area” also has not been taken into consideration. I don’t see why an area would be allowed to be any bigger than reality bubble sized, probably not even as big, and would probably be best if it forced open doors to extend the “secured area” or break upon original creation of “secured area” (not of the doors) This way a secured area could be multiple rooms. It would require all exterior doors to be closed, and at least one interior door to every room be open though. I am thinking some sort of easily craft-able flag, or other claim device, or object that can be (e)xamined to change/ delete the secured area or something.

So, a Fill or Pathfinding algorithm of sorts emanating from the player/object that designates a zone.

The zone which then prevents spawning within its boundaries?

The question is, should the ‘secured’ zone status remain after opening a door or breaking a window? (ie: do you have to re-designate the secured zone every time you come back from raiding?) If not it wouldn’t allow you to ‘lock the door behind you’ and not expect a random horde, zombear, or NPC waiting for you when you return.

The horde is only not allowed to spawn in. If you leave and horde outside reality bubble packs around the house and then you come home… they can bash their way in/ walk in though open windows/doors etc…