diff --git a/evaluation_script.py b/evaluation_script.py index 24d8172..dc32dad 100644 --- a/evaluation_script.py +++ b/evaluation_script.py @@ -37,7 +37,7 @@ BLOCKED_ACTIONS_CONSTRUCTION = [ '!equip', '!followPlayer', '!getBlueprint', '!getBlueprintLevel', '!goToBed', '!help', '!modes', '!moveAway', '!newAction', '!placeHere', '!putInChest', '!restart', '!searchForBlock', '!searchForEntity', '!setMode', '!stay', '!stfu', - '!stop', '!takeFromChest', '!viewChest' + '!stop', '!takeFromChest', '!viewChest', '!craftRecipe', '!smeltItem' ] def analyze_json_file(file_path): diff --git a/profiles/tasks/task_construct.json b/profiles/tasks/task_construct.json index aeda84b..6598675 100644 --- a/profiles/tasks/task_construct.json +++ b/profiles/tasks/task_construct.json @@ -20,16 +20,16 @@ {"role": "assistant", "content": "Great the last level is complete, let's check the whole blueprint just to be sure. !checkBlueprint"} ], [ - {"role": "assistant", "content": "I've got stone. What about you?"}, + {"role": "user", "content": "andy: (FROM OTHER BOT) I've got stone. What about you?"}, {"role": "assistant", "content": "I have a door and planks. Great we have everything we need from the blueprint. Let's start building the first level! !checkBlueprintLevel(0)"}, {"role": "system", "content": "Level 0 requires the following fixes:\n Place stone at X:100, y: -60, Z:-179\n Place stone at X: 99, Y: -60, Z:-179\n Place stone at X: 98, Y:-60, Z:-179..."}, {"role": "assistant", "content": "Looks like the first level requires only stone, why don't you build that since you have stone?"}, - {"role": "assistant", "content": "Ok, let me see what needs to be done for level 0. !checkBlueprintLevel(0) "}, + {"role": "user", "content": "andy: (FROM OTHER BOT) Ok, let me see what needs to be done for level 0. !checkBlueprintLevel(0) "}, {"role": "system", "content": "Level 0 requires the following fixes:\n Place stone at X:100, y: -60, Z:-179\n Place stone at X: 99, Y: -60, Z:-179\n Place stone at X: 98, Y:-60, Z:-179..."}, - {"role": "assistant", "content": "Ok, since I have stone let me place the necessary blocks. !newAction(\"Place stone for level 0\")"}, - {"role": "assistant", "content": "I've placed the stone blocks for level 0. Let's check if it is done! !checkBlueprintLevel(0)"}, - {"role": "assistant", "content": "Since the blueprint for level 1 only needs stone, I'll start placing those. !newAction(\"Place stone blocks for level 1.\")"}, - {"role": "assistant", "content": "jill: I'll place the planks for level 2. !newAction(\"Place planks for level 2.\")"} + {"role": "user", "content": "andy: (FROM OTHER BOT) Ok, since I have stone let me place the necessary blocks. !newAction(\"Place stone for level 0\")"}, + {"role": "user", "content": "andy: (FROM OTHER BOT) I've placed the stone blocks for level 0. Let's check if it is done! !checkBlueprintLevel(0)"}, + {"role": "user", "content": "andy: (FROM OTHER BOT) Since the blueprint for level 1 only needs stone, I'll start placing those. !newAction(\"Place stone blocks for level 1.\")"}, + {"role": "assistant", "content": " I'll place the planks for level 2. !newAction(\"Place planks for level 2.\")"} ] ] } \ No newline at end of file diff --git a/src/agent/task_types/construction_tasks.js b/src/agent/task_types/construction_tasks.js index 459deae..b6667a1 100644 --- a/src/agent/task_types/construction_tasks.js +++ b/src/agent/task_types/construction_tasks.js @@ -278,12 +278,12 @@ export class Blueprint { const placement = level.placement; // Update bounds - minX = Math.min(minX, baseX); - maxX = Math.max(maxX, baseX + placement[0].length - 1); + minX = Math.min(minX, baseX) - 15; + maxX = Math.max(maxX, baseX + placement[0].length - 1) + 15; minY = Math.min(minY, baseY); maxY = Math.max(maxY, baseY); - minZ = Math.min(minZ, baseZ); - maxZ = Math.max(maxZ, baseZ + placement.length - 1); + minZ = Math.min(minZ, baseZ) - 15; + maxZ = Math.max(maxZ, baseZ + placement.length - 1) + 15; // Loop through the 2D placement array for (let z = 0; z < placement.length; z++) { @@ -299,9 +299,9 @@ export class Blueprint { // Calculate a position nearby the blueprint but not in it const nearbyPosition = { - x: maxX + 5, // Move 5 blocks to the right + x: Math.floor((maxX + minX)/2), // Move 5 blocks to the right y: minY, // Stay on the lowest level of the blueprint - z: minZ // Stay aligned with the front of the blueprint + z: Math.floor((maxZ + minZ)/2) // Stay aligned with the front of the blueprint }; return { commands, nearbyPosition }; diff --git a/src/agent/tasks.js b/src/agent/tasks.js index 59851cc..076b81a 100644 --- a/src/agent/tasks.js +++ b/src/agent/tasks.js @@ -422,7 +422,7 @@ export class Task { const commands = result.commands; const nearbyPosition = result.nearbyPosition; console.log("nearby position", nearbyPosition); - bot.chat(`/tp ${this.name} ${nearbyPosition.x} ${nearbyPosition.y} ${nearbyPosition.z}`); + bot.chat(`/tp @a ${nearbyPosition.x} ${nearbyPosition.y} ${nearbyPosition.z}`); for (const command of commands) { bot.chat(command); } diff --git a/tasks/construction_tasks/generate_multiagent_construction_tasks.js b/tasks/construction_tasks/generate_multiagent_construction_tasks.js index 7b0c6a9..efd3d54 100644 --- a/tasks/construction_tasks/generate_multiagent_construction_tasks.js +++ b/tasks/construction_tasks/generate_multiagent_construction_tasks.js @@ -69,6 +69,10 @@ function createInitialInventory(blueprint, agents, evenlySplit = true) { } } + for (let i = 0; i < agents; i++) { + inventories[i]['dirt'] = 128; + } + return inventories; }