mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-07-23 08:25:19 +02:00
three agent pyramid
This commit is contained in:
parent
e20a932614
commit
074cbcf8f8
3 changed files with 707 additions and 6 deletions
|
@ -1054,6 +1054,7 @@ export function blueprintToTask(blueprint_data, num_agents) {
|
|||
}
|
||||
|
||||
let give_agent = 0;
|
||||
console.log("materials", blueprint_data.materials)
|
||||
for (const key of Object.keys(blueprint_data.materials)) {
|
||||
initialInventory[JSON.stringify(give_agent)][key] = blueprint_data.materials[key];
|
||||
give_agent = (give_agent + 1) % num_agents;
|
||||
|
@ -1063,7 +1064,7 @@ export function blueprintToTask(blueprint_data, num_agents) {
|
|||
type: "construction",
|
||||
goal: "Make a structure with the blueprint below",
|
||||
conversation: "Let's share materials and make a structure with the blueprint",
|
||||
agent_count: 2,
|
||||
agent_count: num_agents,
|
||||
blueprint: blueprint_data,
|
||||
initial_inventory: initialInventory,
|
||||
};
|
||||
|
|
699
tasks/construction_tasks/custom/pyramid_three_agents.json
Normal file
699
tasks/construction_tasks/custom/pyramid_three_agents.json
Normal file
|
@ -0,0 +1,699 @@
|
|||
{
|
||||
"pyramid_three_agents": {
|
||||
"type": "construction",
|
||||
"goal": "Make a structure with the blueprint below",
|
||||
"conversation": "Let's share materials and make a structure with the blueprint",
|
||||
"agent_count": 3,
|
||||
"blueprint": {
|
||||
"materials": {
|
||||
"polished_granite": 1,
|
||||
"gold_block": 27,
|
||||
"stone_bricks": 41,
|
||||
"polished_andesite": 34,
|
||||
"quartz_block": 16,
|
||||
"stone": 23,
|
||||
"polished_diorite": 21,
|
||||
"quartz_pillar": 2,
|
||||
"glowstone": 3
|
||||
},
|
||||
"levels": [
|
||||
{
|
||||
"level": 0,
|
||||
"coordinates": [
|
||||
-60,
|
||||
-60,
|
||||
6
|
||||
],
|
||||
"placement": [
|
||||
[
|
||||
"polished_granite",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"gold_block",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"gold_block",
|
||||
"quartz_block",
|
||||
"polished_andesite",
|
||||
"gold_block",
|
||||
"stone_bricks",
|
||||
"gold_block"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"stone",
|
||||
"polished_diorite",
|
||||
"polished_andesite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_diorite",
|
||||
"gold_block"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"polished_andesite",
|
||||
"stone",
|
||||
"polished_diorite",
|
||||
"polished_andesite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_diorite",
|
||||
"stone",
|
||||
"stone_bricks"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"gold_block",
|
||||
"polished_diorite",
|
||||
"polished_andesite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_diorite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_andesite"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"quartz_block",
|
||||
"polished_andesite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_diorite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"quartz_block"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"polished_andesite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_diorite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"polished_diorite",
|
||||
"stone_bricks"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"gold_block",
|
||||
"stone_bricks",
|
||||
"polished_diorite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"polished_diorite",
|
||||
"stone_bricks",
|
||||
"polished_andesite"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"stone_bricks",
|
||||
"polished_diorite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"polished_diorite",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"gold_block"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"gold_block",
|
||||
"gold_block",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"quartz_block",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"gold_block",
|
||||
"gold_block"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"level": 1,
|
||||
"coordinates": [
|
||||
-60,
|
||||
-59,
|
||||
6
|
||||
],
|
||||
"placement": [
|
||||
[
|
||||
"quartz_pillar",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"gold_block",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"quartz_block",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"gold_block",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"stone_bricks",
|
||||
"stone",
|
||||
"polished_diorite",
|
||||
"polished_andesite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"stone_bricks",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"polished_andesite",
|
||||
"polished_diorite",
|
||||
"polished_andesite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_diorite",
|
||||
"polished_andesite",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"quartz_block",
|
||||
"polished_andesite",
|
||||
"stone",
|
||||
"glowstone",
|
||||
"polished_diorite",
|
||||
"stone",
|
||||
"quartz_block",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"stone_bricks",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_diorite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"stone_bricks",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"polished_andesite",
|
||||
"stone_bricks",
|
||||
"polished_diorite",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"polished_andesite",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"gold_block",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"quartz_block",
|
||||
"stone_bricks",
|
||||
"polished_andesite",
|
||||
"gold_block",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"level": 2,
|
||||
"coordinates": [
|
||||
-60,
|
||||
-58,
|
||||
6
|
||||
],
|
||||
"placement": [
|
||||
[
|
||||
"quartz_pillar",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"gold_block",
|
||||
"stone_bricks",
|
||||
"quartz_block",
|
||||
"gold_block",
|
||||
"gold_block",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"stone_bricks",
|
||||
"polished_diorite",
|
||||
"polished_andesite",
|
||||
"stone",
|
||||
"polished_andesite",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"quartz_block",
|
||||
"polished_andesite",
|
||||
"glowstone",
|
||||
"stone_bricks",
|
||||
"quartz_block",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"gold_block",
|
||||
"stone",
|
||||
"stone_bricks",
|
||||
"polished_diorite",
|
||||
"stone_bricks",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"gold_block",
|
||||
"polished_andesite",
|
||||
"quartz_block",
|
||||
"stone_bricks",
|
||||
"gold_block",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"level": 3,
|
||||
"coordinates": [
|
||||
-60,
|
||||
-57,
|
||||
6
|
||||
],
|
||||
"placement": [
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"gold_block",
|
||||
"quartz_block",
|
||||
"gold_block",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"quartz_block",
|
||||
"glowstone",
|
||||
"quartz_block",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"gold_block",
|
||||
"quartz_block",
|
||||
"gold_block",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"level": 4,
|
||||
"coordinates": [
|
||||
-60,
|
||||
-56,
|
||||
6
|
||||
],
|
||||
"placement": [
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"gold_block",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
],
|
||||
[
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air",
|
||||
"air"
|
||||
]
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"initial_inventory": {
|
||||
"0": {
|
||||
"diamond_pickaxe": 1,
|
||||
"diamond_axe": 1,
|
||||
"diamond_shovel": 1,
|
||||
"polished_granite": 1,
|
||||
"polished_andesite": 34,
|
||||
"polished_diorite": 21
|
||||
},
|
||||
"1": {
|
||||
"diamond_pickaxe": 1,
|
||||
"diamond_axe": 1,
|
||||
"diamond_shovel": 1,
|
||||
"gold_block": 27,
|
||||
"quartz_block": 16,
|
||||
"quartz_pillar": 2
|
||||
},
|
||||
"2": {
|
||||
"diamond_pickaxe": 1,
|
||||
"diamond_axe": 1,
|
||||
"diamond_shovel": 1,
|
||||
"stone_bricks": 41,
|
||||
"stone": 23,
|
||||
"glowstone": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -23,23 +23,24 @@ bot.on('spawn', async () => {
|
|||
const xOffset = 10;
|
||||
const zOffset = 10;
|
||||
|
||||
const taskFilePath = '/Users/isadorawhite/izzy_mindcraft/mindcraft/tasks/construction_tasks/custom/pyramid.json';
|
||||
const task_name = "pyramid";
|
||||
const taskFilePath = '/Users/isadorawhite/izzy_mindcraft/mindcraft/tasks/construction_tasks/custom/pyramid_three_agents.json';
|
||||
const task_name = "pyramid_three_agents";
|
||||
|
||||
|
||||
setTimeout(async () => {
|
||||
let task_blueprint = await worldToBlueprint(startCoord, yOffset, xOffset, zOffset, bot);
|
||||
|
||||
for (const level of task_blueprint.levels) {
|
||||
for (let i = 0; i < task_blueprint.levels.length; i++) {
|
||||
// Perform operations on each level
|
||||
const level = task_blueprint.levels[i];
|
||||
console.log("Level coordinates:", level.coordinates);
|
||||
const new_coordinates = [level.coordinates[0], -60, level.coordinates[2]];
|
||||
const new_coordinates = [level.coordinates[0], -60 + i, level.coordinates[2]];
|
||||
level.coordinates = new_coordinates;
|
||||
console.log("New coordinates:", level.coordinates);
|
||||
}
|
||||
console.log("Blueprint generated:", task_blueprint.levels[0].coordinates);
|
||||
|
||||
const task = blueprintToTask(task_blueprint, 2);
|
||||
const task = blueprintToTask(task_blueprint, 3);
|
||||
const task_collection = {}
|
||||
task_collection[task_name] = task;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue