|
| 1 | +# Implementation Plan |
| 2 | + |
| 3 | +- [x] 1. Extend BiomeType enumeration with WATER constant |
| 4 | + - Add WATER to the BiomeType enum in BiomeType.java |
| 5 | + - Verify getDisplayName() returns "water" for the new type |
| 6 | + - _Requirements: 5.1_ |
| 7 | + |
| 8 | +- [x] 2. Add water configuration to BiomeConfig |
| 9 | + - Add TEXTURE_SEED_WATER constant (value: 98765) |
| 10 | + - Add WATER_BASE_COLOR constant (deep blue: 0.1, 0.3, 0.6, 1.0) |
| 11 | + - Add WATER_LIGHT_COLOR constant (light blue: 0.3, 0.5, 0.8, 1.0) |
| 12 | + - Add WATER_DARK_COLOR constant (dark blue: 0.05, 0.2, 0.4, 1.0) |
| 13 | + - Add WATER_NOISE_THRESHOLD constant (value: 0.75 for ~15% coverage) |
| 14 | + - _Requirements: 1.4, 5.4_ |
| 15 | + |
| 16 | +- [x] 3. Implement water texture generation in BiomeTextureGenerator |
| 17 | + |
| 18 | + - Create generateWaterTexture() method |
| 19 | + - Implement addWaterWaves() helper method for wave patterns |
| 20 | + - Implement addWaterReflections() helper method for surface reflections |
| 21 | + - Implement addWaterDepth() helper method for depth variations |
| 22 | + - Use BiomeConfig water color constants |
| 23 | + - _Requirements: 1.1, 1.3_ |
| 24 | + |
| 25 | +- [x] 3.1 Write property test for water texture generation |
| 26 | + |
| 27 | + - **Property 2: Water color distinctiveness** |
| 28 | + - **Validates: Requirements 1.3** |
| 29 | + |
| 30 | +- [-] 4. Extend BiomeManager to support water biome generation |
| 31 | + |
| 32 | + - Implement isInWaterPatch() method using multi-octave noise |
| 33 | + - Update getBiomeAtPosition() to check for water first (priority: Water > Sand > Grass) |
| 34 | + - Add water texture generation to generateAndCacheTextures() |
| 35 | + - Ensure water doesn't spawn within 1500px of spawn point |
| 36 | + - _Requirements: 1.2, 1.4, 1.5, 4.1_ |
| 37 | + |
| 38 | +- [x] 4.1 Write property test for biome type exhaustiveness |
| 39 | + |
| 40 | + |
| 41 | + - **Property 1: Biome type exhaustiveness** |
| 42 | + - **Validates: Requirements 1.2** |
| 43 | + |
| 44 | +- [x] 4.2 Write property test for biome distribution |
| 45 | + |
| 46 | + |
| 47 | + - **Property 3: Biome distribution convergence** |
| 48 | + - **Validates: Requirements 1.4** |
| 49 | + |
| 50 | +- [x] 4.3 Write property test for water contiguity |
| 51 | + |
| 52 | + |
| 53 | + - **Property 4: Water contiguity** |
| 54 | + - **Validates: Requirements 1.5** |
| 55 | + |
| 56 | +- [x] 4.4 Write property test for biome determinism |
| 57 | + |
| 58 | + - **Property 10: Biome calculation determinism** |
| 59 | + - **Validates: Requirements 4.1, 4.2, 4.4** |
| 60 | + |
| 61 | +- [x] 5. Checkpoint - Ensure all tests pass |
| 62 | + |
| 63 | + - Ensure all tests pass, ask the user if questions arise. |
| 64 | + |
| 65 | +- [x] 6. Implement water collision detection in Player class |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + - Extend wouldCollide() method to check biome type at target position |
| 70 | + - Use player center point (x+32, y+32) for biome lookup |
| 71 | + - Return true if biome type is WATER to block movement |
| 72 | + - _Requirements: 2.1, 2.2, 2.3_ |
| 73 | + |
| 74 | +- [x] 6.1 Write property test for water collision blocking |
| 75 | + |
| 76 | + |
| 77 | + - **Property 5: Water collision blocking** |
| 78 | + - **Validates: Requirements 2.1, 2.3** |
| 79 | + |
| 80 | +- [x] 6.2 Write property test for collision consistency |
| 81 | + |
| 82 | + |
| 83 | + - **Property 6: Collision consistency** |
| 84 | + - **Validates: Requirements 2.4** |
| 85 | + |
| 86 | +- [x] 6.3 Write property test for adjacent movement freedom |
| 87 | + |
| 88 | + |
| 89 | + - **Property 7: Adjacent movement freedom** |
| 90 | + - **Validates: Requirements 2.5** |
| 91 | + |
| 92 | +- [x] 7. Add biome validation to tree spawning system |
| 93 | + |
| 94 | + - Locate tree spawn logic in MyGdxGame or relevant class |
| 95 | + - Add isValidSpawnLocation() check before spawning trees |
| 96 | + - Verify biome type is not WATER before spawning |
| 97 | + - Implement retry logic to find alternative location if water detected |
| 98 | + - _Requirements: 3.1, 3.5_ |
| 99 | + |
| 100 | +- [x] 8. Add biome validation to stone/rock spawning system |
| 101 | + |
| 102 | + - Locate stone spawn logic in MyGdxGame or relevant class |
| 103 | + - Add biome type check before spawning stones |
| 104 | + - Verify biome type is not WATER before spawning |
| 105 | + - Implement retry logic to find alternative location if water detected |
| 106 | + - _Requirements: 3.2, 3.5_ |
| 107 | + |
| 108 | +- [x] 9. Add biome validation to item spawning system |
| 109 | + |
| 110 | + - Locate item spawn logic (apples, saplings, wood stacks, etc.) |
| 111 | + - Add biome type check before spawning items |
| 112 | + - Verify biome type is not WATER before spawning |
| 113 | + - Implement retry logic to find alternative location if water detected |
| 114 | + - _Requirements: 3.3, 3.5_ |
| 115 | + |
| 116 | +- [x] 10. Add biome validation to puddle creation system |
| 117 | + |
| 118 | + - Locate puddle creation logic in PuddleManager |
| 119 | + - Add biome type check before creating puddles |
| 120 | + - Verify biome type is not WATER before creating puddles |
| 121 | + - Skip puddle creation if location is water |
| 122 | + - _Requirements: 3.4_ |
| 123 | + |
| 124 | +- [x] 10.1 Write property test for resource spawn exclusion |
| 125 | + |
| 126 | + |
| 127 | + - **Property 8: Resource spawn exclusion** |
| 128 | + - **Validates: Requirements 3.1, 3.2, 3.3, 3.4** |
| 129 | + |
| 130 | +- [x] 10.2 Write property test for spawn retry success |
| 131 | + |
| 132 | + |
| 133 | + - **Property 9: Spawn retry success** |
| 134 | + - **Validates: Requirements 3.5** |
| 135 | + |
| 136 | +- [x] 11. Checkpoint - Ensure all tests pass |
| 137 | + |
| 138 | + |
| 139 | + - Ensure all tests pass, ask the user if questions arise. |
| 140 | + |
| 141 | +- [x] 12. Write integration tests for complete feature |
| 142 | + |
| 143 | + - Test multiplayer synchronization (two clients see identical water locations) |
| 144 | + - Test resource spawning (verify no resources in water over 1000 attempts) |
| 145 | + - Test player movement (verify cannot walk into water, can walk parallel) |
| 146 | + - Test puddle system (verify no puddles in water during rain) |
| 147 | + - _Requirements: 1.1, 2.1, 3.1, 3.2, 3.3, 3.4, 4.1_ |
| 148 | + |
| 149 | +- [x] 13. Write unit tests for backward compatibility |
| 150 | + |
| 151 | + - Verify grass biome still functions correctly |
| 152 | + - Verify sand biome still functions correctly |
| 153 | + - Verify existing biome zones remain unchanged |
| 154 | + - _Requirements: 5.4, 5.5_ |
| 155 | + |
| 156 | +- [x] 14. Tune biome distribution thresholds |
| 157 | + |
| 158 | + - Run distribution measurement with current thresholds |
| 159 | + - Adjust WATER_NOISE_THRESHOLD if needed to achieve ~15% water coverage |
| 160 | + - Verify sand threshold (0.45) still produces ~35% sand coverage |
| 161 | + - Document final threshold values in BiomeConfig |
| 162 | + - _Requirements: 1.4_ |
| 163 | + |
| 164 | +- [x] 15. Final checkpoint - Ensure all tests pass |
| 165 | + - Ensure all tests pass, ask the user if questions arise. |
0 commit comments