Entity spawning

From Vintage Story Wiki
Revision as of 08:45, 23 August 2024 by Barrowisp (talk | contribs) (added json section with ox example)

This page was last verified for Vintage Story version 1.19.8.


UnderCon icon.png

This page is under construction.
This page is being created, or is in the process of extensive expansion or major restructuring. Until this notice is removed, please do not translate this page. Expect the content of this page to change significantly.


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"

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, 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 }
	}
},

Spawn conditions

Temperature

Rainfall

Forestation

Elevation

Sequence

History

Notes

  • Bees are particles, not entities. Their spawn details can be found elsewhere.
  • Grasshoppers and cicadas are probably particles.

See also

References

  1. "The Bovidae comprise the biological family of cloven-hoofed, ruminant mammals that includes cattle, yaks, bison, buffalo, antelopes (including goat-antelopes), sheep and goats." From Wikipedia
  2. Wikipedia


Wiki Navigation
Vintage Story Guides[[::Category: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