smurfs / src /config.py
BolyosCsaba
initial commit
82fa936
"""
Game Configuration Constants
"""
# World settings
WORLD_WIDTH = 800
WORLD_HEIGHT = 1000
FPS = 30
# Smurf lifecycle (in ticks at 30 FPS)
BABY_TO_CHILD_AGE = 3000 # ~1.5 min
CHILD_TO_ADULT_AGE = 6000 # ~3 min
ADULT_TO_ELDER_AGE = 19000 # ~9.2 min
ELDER_DEATH_START = 14000 # ~7.3 min
# Reproduction settings
SOCIAL_INTERACTIONS_FOR_BABY = 5
BABY_SPAWN_CHANCE = 0.05 # Per tick after threshold, was 0.0005
# Resource settings
RESOURCE_REGENERATION_RATE = 0.01
RESOURCE_SPAWN_THRESHOLD = 15
RESOURCE_SPAWN_CHANCE = 0.01
# Building settings
BUILDING_MIN_DISTANCE = 80 # Minimum distance between buildings
AUTO_BUILD_THRESHOLDS = {
"storage": 30,
"workshop": 60,
"townhall": 100,
"extra_house": 80
}
# AI settings
AI_DECISION_INTERVAL = 90 # Ticks between decisions (3 seconds)
ENERGY_DRAIN_RATE = 0.2
ENERGY_REGEN_RATE = 0.8
HAPPINESS_DECAY_RATE = 0.05
HAPPINESS_REGEN_RATE = 0.1
HAPPINESS_SOCIAL_BOOST = 0.35
# Needs system settings - BASE values (individual smurfs will have variations)
NEED_DECAY_RATES_BASE = {
"hunger": 0.0015, # Per tick when active (10x slower: was 0.015)
"energy": 0.02, # Per tick when active (10x slower: was 0.2)
"hygiene": 0.008, # Slower decay
"health": 0.05, # Very slow, only when sick
"happiness": 0.05 # Already exists, keep same
}
NEED_REGEN_RATES_BASE = {
"hunger": 0.0, # Only restored by eating
"energy": 0.8, # Already exists
"hygiene": 0.0, # Only restored by using bathroom
"health": 0.1, # Slow natural regen when needs met
"happiness": 0.1 # Already exists
}
# Thresholds - BASE values (individual smurfs will have variations)
NEED_CRITICAL_THRESHOLD_BASE = 20.0 # Below this = critical
NEED_LOW_THRESHOLD_BASE = 40.0 # Below this = low
NEED_HIGH_THRESHOLD_BASE = 80.0 # Above this = satisfied
# Eating decision threshold - BASE value (individual smurfs will have variations)
# AI decides to eat when urgency > 50, which happens around this hunger level
EATING_DECISION_THRESHOLD_BASE = 50.0
# Food restoration values
HUNGER_PER_FOOD = 30.0 # How much hunger one food item restores
HEALTH_PER_FOOD = 15.0
ENERGY_PER_FOOD = 10.0
HAPPINESS_PER_FOOD = 8.0
HYGIENE_PER_FOOD = -5.0 # Gets worse (eating is messy)
# Initial need values
INITIAL_HUNGER = 50.0
INITIAL_ENERGY = 100.0
INITIAL_HYGIENE = 50.0
INITIAL_HEALTH = 100.0
INITIAL_HAPPINESS = 50.0
# Individual variation ranges (as multipliers or offsets)
# Each smurf gets a random variation within these ranges
NEED_DECAY_VARIATION = 0.2 # ±20% variation in decay rates
NEED_THRESHOLD_VARIATION = 0.15 # ±15% variation in thresholds
EATING_DECISION_VARIATION = 0.2 # ±20% variation in eating decision threshold
# Care mistakes system
CARE_MISTAKE_THRESHOLD = 5 # Mistakes before consequences
CARE_MISTAKE_CHECK_INTERVAL = 60 # Check every 2 seconds
CARE_MISTAKE_GROWTH_PENALTY = 0.5 # Growth rate multiplier
CARE_MISTAKE_SOCIAL_PENALTY = 0.3 # Social acceptance penalty
# Stats system
STAT_BASE_VALUE = 10
STAT_MAX_VALUE = 100
STAT_MIN_VALUE = 1
STAT_GROWTH_RATE = 0.01 # Per training action
# Sprite sizes
SMURF_BASE_SIZE = 32
RESOURCE_SIZE = 32
BUILDING_BASE_SIZE = 64
GRAVE_SIZE = 32
# Logging settings
LOGGING_ENABLED = False # Set to True to enable logging to file and console