1Map Generation UI Task
2This task involves creating a comprehensive UI dialog for generating randomized map areas. The generator will allow users to create realistic map regions with various terrain, doodads, buildings, and roads.
3Task Requirements
4Create a MapGeneratorWindow dialog that:
5Allows selecting a region to fill (x1, y1, x2, y2, z)
6Provides layers of generation with proper ordering:
7Water (outer border)
8Ground/terrain
9Roads
10Buildings
11Trees/plants (doodads)
12Includes palette-like browsing for each category
13Utilizes existing functionalities like ACTION_BORDERIZE for automatic border generation
14Shows generation progress
15Technical Implementation Notes
16Apply
17Implementation Strategy
18Layer-based Generation:
19Start with water as the base layer
20Add ground terrain with proper borders
21Place roads as paths through the terrain
22Position buildings along roads
23Scatter doodads (trees, plants) in remaining open areas
24Utilize Existing Tools:
25Use BorderizeWindow approach for chunk-based processing
26Leverage ACTION_BORDERIZE for automatic border generation
27Use GroundBrush::reborderizeTile() for clean borders
28Brush Selection:
29Create mini-palette widgets for each category
30Allow multiple brush selection with probability weights
31Random Distribution:
32Implement noise-based distribution for natural-looking placement
33Ensure buildings have proper spacing and orientation
34Create road networks that connect buildings
35Technical Considerations
36Process in chunks to avoid UI freezing
37Use the Action system for undo support
38Ensure borders between different terrain types are handled properly
39Add options for different map styles (forest, desert, mountain, etc.)
40Provide randomization seeds for reproducible generation
41UI Layout
42The dialog should contain:
43A notebook with tabs for different generation layers
44Controls for region selection
45Mini-palettes for brush selection
46Generation settings (density, randomness)
47Progress tracking
48Generate and Cancel buttons
49Example Generation Workflow
50Apply to main_menubar...
51Integration with Main Application
52Add a new menu option in the MainMenuBar::OnGenerateMap section to open this dialog, allowing users to generate a full or partial map based on their specifications.
53Apply to main_menubar...
54This task will significantly enhance the map creation capabilities of the editor, allowing users to quickly generate realistic map regions while maintaining full control over the generation process.