Skip to content

Zombie spawning can get a little out of hand in certain geometry #1

@Shigbeard

Description

@Shigbeard

What is the problem?

In certain edge cases where the map's geometry is... shall we say... bethesda quality (that is, with pieces of geometry hidden behind cliff faces or out of bounds), Zombies tend to spawn in very irregular spots, and can sometimes compromise bases that would otherwise appear to be zombie-proof.

This creates an issue for people looking to build themed bases, or bases that are pleasant to look at. Due to the erroneous nature of zombie spawning, in combination with the way zombies tend to harm players that appear to be protected by props, the only guaranteed safe building method is to build a box in the sky, with a ramp access.

What do I think is the cause of the problem?

I think the problem originates from the way the gamemode detects "walkable space". You see this issue as well in Meteor spawns, basically the game considers any flat surface or near flat surface with a minimum amount of height clearance as walkable, and this simply isn't an accurate means of detecting walkable space.

How do I think this can be fixed?

The Source engine has a feature for identifying walkable spaces as well as notable points on the map for AI to use. This feature is called a Nav Mesh, and Garry's Mod has a Lua library for interacting with this feature, with functions such as navmesh.Find. As it is quite simple to generate a nav mesh for most maps, it would be reasonable to require maps to have a generated Nav Mesh in order to play the gamemode.

This only becomes an issue when we contemplate the following details...

  • Generating a Nav Mesh is a resource intensive process, especially for larger maps.
  • Some large maps (think pripyat) have trouble generating a Nav Mesh due to the sheer size of the map combined with the complex ground displacements.
  • Garry's Mod is a 32-bit application, meaning it's not as good with large numbers and by extension large Nav Meshes.

In a few select circumstances, it may not be feasable let alone possible to generate a Nav Mesh for a map, which means that the gamemode would then simply not spawn zombies (or, on the other hand, fall back to erroneous code that can produce situations like this). This is why I propose another alternative, which would be harder to implement, more involved, and would ultimately rely on the player to play the game without abusing glitches such as surfing or bhopping.

This alternative would have the game actively map spaces that a player walks, naturally discarding data where the player has already been, where the player has been deep in water, where the player has been walking on a prop, etc. At first, this map of walkable space would be very incomplete and inaccurate, but over time it would hold more and more data for places where a player has stood, with their feet planted firmly on the ground, that the game could easily consider walkable.

The issue with this alternative is that the player may not move around the entire map, and so the data would almost always be incomplete, though it would be plentiful in regards to high traffic areas (such as around ore deposits, popular base locations, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions