Entity spawning
This page was last verified for Vintage Story version 1.19.8.
Entities such as wolves and butterflies have fairly complex conditions for when and where to spawn.
Data
Each entity has spawn conditions detailed in a document you can access on your computer. By default, the files are installed to %AppData%\Roaming\Vintagestory\assets\survival\entities
. The file type is .json
and Notepad++ is one example of a free program that can read and edit this file type.
JSON
JSON is a text format for storing and transporting data. While it's not necessary to study JSON to glean useful information from .json files, it may be beneficial to outline a few basic terms to be used throughout this article.
JSON syntax is derived from JavaScript object notation syntax. The JSON syntax is a subset of the JavaScript syntax. Basic rules:
- Data is in name/value pairs
- Data is separated by commas
- Curly braces
{}
hold objects - Square brackets
[]
hold arrays
A name/value pair consists of a field name (in double quotes), followed by a colon, followed by a value. Example: "name":"John"
. This might not matter much when reading, but any edits must be careful about punctuation.
The musk ox entity belongs[1] to the same biological family[2] as goats, and its characteristics are defined in the goat.json file.
Within goat.json we can see 11 species of "goat" defined, as distinct "types." Later, when the file assigns properties "ByType" it will be to one or more of these 11 types. Asterisks serve as wildcards: *-adult-* refers to an adult of any species in this file, while *-muskox-* refers to an ox of any age/gender.
"variantgroups": [ { "code": "type", "states": ["angora", "ibexalp", "ibexnub", "markhor", "mountain", "muskox", "nubian", "sirohi", "takingold", "turdag", "valais" ] }, { "code": "gender", "states": ["male", "female"] }, { "code": "age", "states": ["adult", "baby"] } ],
Ctrl+F lets you search within a document for a specific word. A search within goat.json for "spawnconditions" yields a fairly lengthy entry with two main sections: "worldgen" and "runtime".
- Worldgen: creatures spawn as you explore the undiscovered areas of the map
- Runtime: creatures spawn in your vicinity (loaded chunks) and may have a check of distance to player
If you scroll down within goat.json, there's a "spawnconditionsByType" entry that breaks down the climate preferences for each species.
"goat-muskox-*-adult": { "climate": { "minTemp": -30, "maxTemp": -10, "minRain": 0.0, "maxRain": 0.8, "minForestOrShrubs": 0.0, "maxForest": 0.4, "maxShrubs": 0.8, "minY": 0.9, "maxY": 1.2 }, "worldgen": { "triesPerChunk": { "avg": 0.003, "var": 0 } }, "runtime": { "maxQuantityByGroup": { "code": "goat-*", "maxQuantity": 4 } } },
Climate conditions
Using the command /wgen pos climate
in the chat box will display the climate characteristics at that position.
Temperature
The minTemp and maxTemp for an entity's spawn conditions refer to annual average temperature. With C the player can view the current temperature, but that's not particularly useful for determining whether a location is a valid spawn for a particular entity. Instead, check /wgen pos climate
.
Musk ox can spawn in areas where the annual average temperature is no lower than -30°C but no higher than -10°C (and where other spawn conditions are met). Comparing with the table below, they can't be found in default Temperate climates.
Starting climate | Annual average |
---|---|
Hot | 28 to 32°C |
Warm | 19 to 23 °C |
Temperate | 6 to 14 °C |
Cool | -5 to 1 °C |
Icy | -15 to -10°C |
Rainfall
Forestation
Shrub
Elevation
Sequence
When a new chunk is discovered and begins to load, creatures are among one of the last features to be added. 93.GenCreatures.cs shows relevant details and some plain-English commentary.
Musk ox get 0.003 triesPerChunk. Bears will be significantly more common (0.015 triesPerChunk), and wolves even more so (0.07 triesPerChunk).
The file serverconfig.json includes a line that affects how many entities will spawn if there are multiple players sharing a world: "SpawnCapPlayerScaling": 0.5,
History
Notes
- Bees are particles, not entities. Their spawn details can be found elsewhere.
- Grasshoppers and cicadas are probably particles.
See also
References
Wiki Navigation | |
---|---|
Vintage Story | Guides • Frequently Asked Questions • Soundtrack • Versions • Controls |
Game systems | Crafting • Knapping • Clay forming • Smithing • Cooking • Temperature • Hunger • Mining • Temporal stability • Mechanical power • Trading • Farming • Animal husbandry |
World | World generation • Biomes • Weather • Temporal storms |
Items | Tools • Weapons • Armor • Clothing • Bags • Materials • Food |
Blocks | Terrain • Plants • Decorative • Lighting • Functional • Ore |
Entities | Hostile entities • Animals • NPCs • Players |
Miscellaneous | List of client commands • List of server commands • Creative Starter Guide • Bot System • WorldEdit • Cinematic Camera • Adjustable FPS Video Recording • ServerBlockTicking |