# AI and NPCs

## Theory

* NPCs in the game world are spawned via two different ways:
  * Crowd NPCs
  * Community NPCs

### Crowd NPCs

* Crowd NPCs are as the name suggests spawned as part of the regular crowd that walks the street, they are not fully understood yet

## Community NPCs

* Community NPCs are all the other NPCs, that includes everyone from the shopkeepers, quest NPCs, enemy NPCs to NPCs hanging out in specific spots
* Communities allow to define a wide combination of things, allowing for very dynamic setups (E.g. NPC type, amount and spot depending on the time of day):
  * What NPCs
  * When should they spawn
  * How many
  * Where should they spawn
  * Setups such as making them patrol along a spline

{% hint style="success" %}
Communities can not only be used for spawning an placing NPCs, but anything that has a TweakDB record, e.g. Vehicles
{% endhint %}

## Guides

* [Placing AISpot nodes](https://wiki.redmodding.org/cyberpunk-2077-modding/modding-guides/world-editing/ai-and-npcs/placing-aispot-nodes): These serve as markers for NPCs, defining a workspot to be used
* [Creating Communities](https://wiki.redmodding.org/cyberpunk-2077-modding/modding-guides/world-editing/ai-and-npcs/creating-communities): Explains how to create a community, and make it's NPCs use AISpot's


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.redmodding.org/cyberpunk-2077-modding/modding-guides/world-editing/ai-and-npcs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
