Spaces:
Sleeping
Sleeping
File size: 14,228 Bytes
12d64f8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ HARVESTER AI - COMPARAISON AVANT/APRรS โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ AVANT CORRECTION - Harvester reste immobile
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโ
โ HQ (Spawn) โ
โ Position: โ
โ (200, 200) โ
โโโโโโโโโโฌโโโโโโโโโ
โ Produit Harvester
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Harvester spawnรฉ โ
โ โโ cargo = 0 โ
โ โโ gathering = False โ
โ โโ returning = False โ
โ โโ ore_target = None โ
โ โโ target = (220, 220) [RรSIDUEL!] โ โ
โโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โ Tick 1: update_harvester()
โ
โโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Condition de recherche minerai: โ
โ if not gathering AND not target: โ
โ โ
โ not False = True โ โ
โ not (220,220) = False โ โ
โ โ
โ True AND False = FALSE โ โ
โโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โ find_nearest_ore() JAMAIS APPELร
โ
โโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Harvester reste IMMOBILE โ
โ โโ ore_target = None โ
โ โโ gathering = False โ
โ โโ target = (220, 220) [BLOQUร] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โ Ticks 2, 3, 4, 5...โ
โ
๐ด RESTE IMMOBILE INDรFINIMENT
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
APRรS CORRECTION - Harvester cherche automatiquement
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโ
โ HQ (Spawn) โ
โ Position: โ
โ (200, 200) โ
โโโโโโโโโโฌโโโโโโโโโ
โ Produit Harvester
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Harvester spawnรฉ โ
โ โโ cargo = 0 โ
โ โโ gathering = False โ
โ โโ returning = False โ
โ โโ ore_target = None โ
โ โโ target = (220, 220) [IGNORร] โ โ
โโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โ Tick 1: update_harvester()
โ
โโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Condition de recherche minerai: โ
โ if not gathering AND not ore_target: โ
โ โ
โ not False = True โ โ
โ not None = True โ โ
โ โ
โ True AND True = TRUE โ
โ
โโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โ find_nearest_ore() APPELร
โ
โโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Minerai trouvรฉ! โ
โ nearest_ore = Position(1200, 800) โ
โโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โ Assignation automatique
โ
โโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Harvester activรฉ โ
โ โโ ore_target = (1200, 800) โ
โ
โ โโ gathering = True โ
โ
โ โโ target = (1200, 800) โ
โ
โโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โ Ticks 2-50: Mouvement automatique
โ
โโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ Harvester SE DรPLACE โ
โ Position: (200,200) โ (400,300) โ โ
โ (600,400) โ (800,500) โ โ
โ (1000,600) โ (1200,800) โ โ
โโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โ Distance < 20px
โ
โโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Rรฉcolte automatique โ
โ โโ cargo += 50 (ORE) ou +100 (GEM) โ
โ โโ terrain[y][x] = GRASS โ
โ โโ ore_target = None โ
โโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โ cargo < 180?
โ
โโโโดโโโโ
โ โ
OUI โ โ NON (cargo โฅ 180)
โ โ
Cherche Retourne dรฉpรดt
nouveau returning = True
minerai
(Retour
Tick 1)
โ
Dรฉpose au HQ/Refinery
credits += cargo
cargo = 0
target = None โ
โ
Retour Tick 1
(Cherche automatiquement)
๐ข CYCLE AUTOMATIQUE INFINI โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ TABLEAU COMPARATIF
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโ
โ รtape โ AVANT (โ) โ APRรS (โ
) โ
โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโค
โ Spawn depuis HQ โ target rรฉsiduel โ target rรฉsiduel โ
โ โ โ (mais IGNORร) โ
โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโค
โ Condition check โ not target โ not ore_target โ
โ โ = False โ โ = True โ
โ
โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโค
โ find_nearest_ore() โ JAMAIS appelรฉ โ Appelรฉ Tick 1 โ
โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโค
โ ore_target assignรฉ โ Non (None) โ Oui (1200, 800) โ
โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโค
โ gathering activรฉ โ Non (False) โ Oui (True) โ
โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโค
โ Mouvement โ Immobile โ Bouge vers minerai โ
โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโค
โ Rรฉcolte โ Non (bloquรฉ) โ Oui (automatique) โ
โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโค
โ Cycle complet โ Non (bloquรฉ) โ Oui (infini) โ
โโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ง CORRECTIONS APPORTรES (Code)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Ligne 530 - Nettoyage aprรจs dรฉpรดt:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
AVANT:
self.game_state.players[unit.player_id].credits += unit.cargo
unit.cargo = 0
unit.returning = False
unit.gathering = False
unit.ore_target = None
# target pas nettoyรฉ โ
APRรS:
self.game_state.players[unit.player_id].credits += unit.cargo
unit.cargo = 0
unit.returning = False
unit.gathering = False
unit.ore_target = None
unit.target = None # โ
AJOUTร
Lignes 571-577 - Condition de recherche:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
AVANT:
if not unit.gathering and not unit.target: # โ Vรฉrifie target
nearest_ore = self.find_nearest_ore(unit.position)
if nearest_ore:
unit.ore_target = nearest_ore
unit.gathering = True
unit.target = nearest_ore
APRรS:
if not unit.gathering and not unit.ore_target: # โ
Vรฉrifie ore_target
nearest_ore = self.find_nearest_ore(unit.position)
if nearest_ore:
unit.ore_target = nearest_ore
unit.gathering = True
unit.target = nearest_ore
elif unit.target: # โ
AJOUTร
unit.target = None # Nettoie rรฉsiduel si pas de minerai
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฏ RรSULTAT FINAL
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Le Harvester fonctionne maintenant comme dans Red Alert classique:
โ
Sort du HQ automatiquement
โ
Cherche le minerai le plus proche
โ
Se dรฉplace vers le minerai automatiquement
โ
Rรฉcolte automatiquement (ORE +50, GEM +100)
โ
Retourne au dรฉpรดt (HQ ou Refinery) automatiquement
โ
Dรฉpose les crรฉdits automatiquement
โ
Recommence le cycle automatiquement
โ
Continue indรฉfiniment jusqu'ร รฉpuisement des ressources
"The Harvester must flow... and now it does!" ๐๐ฐโจ
```
|