babylon.data.game

Game entity JSON data files.

Contains static game data (characters, classes, factions, etc.) migrated from XML format.

Usage:

from babylon.data.game import GAME_DATA_DIR, load_json

characters = load_json(“characters.json”)

Functions

list_data_files()

List all JSON data files in the game data directory.

load_event_templates()

Load event templates from the event_templates.json file.

load_json(filename)

Load a JSON file from the game data directory.

babylon.data.game.load_json(filename)[source]

Load a JSON file from the game data directory.

Parameters:

filename (str) – Name of the JSON file (e.g., “characters.json”)

Return type:

dict[str, Any]

Returns:

Parsed JSON data as a dictionary.

Raises:
babylon.data.game.list_data_files()[source]

List all JSON data files in the game data directory.

Return type:

list[str]

Returns:

List of JSON filenames.

babylon.data.game.load_event_templates()[source]

Load event templates from the event_templates.json file.

Parses the JSON file and converts each template dict to an EventTemplate Pydantic model.

Return type:

list[Any]

Returns:

List of EventTemplate objects.

Raises: