feat: Introduce a new modular bot AI system for decision-making, movement, and actions.

This commit is contained in:
Yogi Wiguna
2026-03-02 15:32:50 +08:00
parent 78634d6421
commit c16a0043bc
3 changed files with 13 additions and 17 deletions
+2 -17
View File
@@ -400,23 +400,8 @@ func _find_tile_to_grab(tiles_needed: Array) -> Dictionary:
print("[BotController] %s found HOLO tile %d at current pos." % [actor.name, item])
result = {"position": actor.current_position, "type": item}
# Check adjacent cells
var neighbors = enhanced_gridmap.get_neighbors(actor.current_position, 0)
# print("[BotController] %s has %d walkable neighbors" % [actor.name, neighbors.size()])
for neighbor in neighbors:
var cell = Vector3i(neighbor.position.x, 1, neighbor.position.y)
item = enhanced_gridmap.get_cell_item(cell)
norm_item = _normalize_tile(item)
# print("[BotController] %s checking neighbor %s. Item: %d" % [actor.name, neighbor.position, item])
if norm_item in tiles_needed:
print("[BotController] %s found NEEDED tile %d (normalized %d) at neighbor %s!" % [actor.name, item, norm_item, neighbor.position])
return {"position": neighbor.position, "type": item}
if item in HOLO_TILES and not result.position:
result = {"position": neighbor.position, "type": item}
# Refined: Only grab at current position (per user request)
# Removed neighbor check to prevent bots from "sucking" tiles from 1-tile away
return result