//top\\ - Anno 1404 Stadt Layout
class LayoutOptimizer: def (self, width: int = 50, height: int = 50): self.grid = np.zeros((width, height), dtype=int) # 0=empty, 1=road, 2=building self.buildings = [] self.resource_zones = {}
Monument Progress: Cathedral foundations: 28% (need 12 more noble houses) # Building stats extracted from game files (simplified) BUILDING_DATA = "peasant_house": "size": (2,2), "residents": 8, "tax": 2, "requirements": ["market"], "market": "size": (3,3), "coverage": 20, "cost": 500, "wood": 10, "tools": 5, "wheat_farm": "size": (4,4), "output": "wheat", "cycle": 60, "field_required": True, "bakery": "size": (3,3), "input": ["wheat"], "output": "bread", "cycle": 30, anno 1404 stadt layout
def place_residential_cluster(self, center: Tuple[int, int], size: int = 10, tier: str = "peasant"): """Place optimized housing block with infrastructure""" cluster = "houses": [], "market": None, "pub": None, "church": None # Calculate number of houses that can be covered by 1 market (radius 20 tiles) houses_per_market = 35 # empirical value from Anno 1404 houses_per_church = 40 houses_per_pub = 45 # Grid placement algorithm (5x5 blocks with 1-tile roads between) for i in range(size): for j in range(size): x = center[0] + i*2 y = center[1] + j*2 if self.is_valid_position(x, y): self.add_building("peasant_house", (x, y)) cluster["houses"].append((x, y)) # Add supporting buildings at optimal positions market_pos = self.find_optimal_position(cluster["houses"], radius=20) self.add_building("market", market_pos) return cluster class LayoutOptimizer: def (self, width: int = 50,