Skip to content

Commit 90118db

Browse files
committed
cp
1 parent 64fbf00 commit 90118db

File tree

1 file changed

+4
-49
lines changed

1 file changed

+4
-49
lines changed

recipes/experiment/cogsguard.py

Lines changed: 4 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
AgentConfig,
3737
AgentRewards,
3838
AssemblerConfig,
39-
AttackActionConfig,
4039
ChangeVibeActionConfig,
4140
ChestConfig,
4241
DamageConfig,
@@ -49,7 +48,6 @@
4948
NoopActionConfig,
5049
ProtocolConfig,
5150
ResourceLimitsConfig,
52-
WallConfig,
5351
)
5452
from mettagrid.config.vibes import Vibe
5553
from mettagrid.mapgen.mapgen import MapGen
@@ -77,20 +75,23 @@
7775
Vibe("❤️", "heart"),
7876
]
7977

78+
8079
class PylonConfig(GridObjectConfig):
8180
radius: int
8281

82+
8383
class RoleStationConfig(GridObjectConfig):
8484
role: str
8585

86+
8687
class ExtractorConfig(GridObjectConfig):
8788
pass
8889

90+
8991
class ColonyConfig(GridObjectConfig):
9092
pass
9193

9294

93-
9495
class CogAssemblerConfig(CvCStationConfig):
9596
def station_cfg(self) -> AssemblerConfig:
9697
# gear = [("carbon", "decoder"), ("oxygen", "modulator"), ("germanium", "scrambler"), ("silicon", "resonator")]
@@ -136,23 +137,6 @@ def make_env(num_agents: int = 10) -> MettaGridConfig:
136137
),
137138
noop=NoopActionConfig(),
138139
change_vibe=ChangeVibeActionConfig(vibes=vibes),
139-
attack=AttackActionConfig(
140-
consumed_resources={"energy": 7},
141-
defense_resources={"energy": 0},
142-
weapon_resources={"weapon": 10},
143-
armor_resources={"shield": 15},
144-
loot=["heart"],
145-
enabled=False,
146-
vibes=["weapon"], # Attack triggered when agent has weapon vibe
147-
),
148-
transfer=TransferActionConfig(
149-
vibe_transfers=[
150-
VibeTransfer(vibe="battery", target={"energy": 50}, actor={"energy": -50}),
151-
VibeTransfer(vibe="heart", target={"heart": 1}, actor={"heart": -1}),
152-
VibeTransfer(vibe="gear", target={"damage": -100}, actor={"energy": -10}),
153-
],
154-
vibes=["battery", "heart", "gear"], # Transfer triggered for these vibes
155-
),
156140
),
157141
agent=AgentConfig(
158142
inventory=InventoryConfig(
@@ -212,39 +196,10 @@ def make_env(num_agents: int = 10) -> MettaGridConfig:
212196
"default": {"carbon": 255, "oxygen": 255, "germanium": 255, "silicon": 255},
213197
}
214198
),
215-
"market": MarketConfig(
216-
terminals={
217-
# Terminals are keyed by the direction the agent enters the market from.
218-
"north": MarketTerminalConfig(sell=False, amount=1), # buy
219-
"south": MarketTerminalConfig(sell=True, amount=1), # sell
220-
},
221-
inventory=InventoryConfig(
222-
initial={
223-
"battery": 10,
224-
"weapon": 10,
225-
"shield": 10,
226-
"gear": 4,
227-
},
228-
),
229-
currency_resource="heart",
230-
),
231199
"carbon_extractor": CarbonExtractorConfig().station_cfg(),
232200
"oxygen_extractor": OxygenExtractorConfig(efficiency=200).station_cfg(),
233201
"germanium_extractor": GermaniumExtractorConfig().station_cfg(),
234202
"silicon_extractor": SiliconExtractorConfig().station_cfg(),
235-
"barrier": WallConfig(
236-
name="barrier",
237-
render_symbol="🪨",
238-
build=BuildConfig(vibe="barrier", cost={"energy": 50, "silicon": 25}),
239-
demolish=DemolishConfig(
240-
cost={"energy": 100},
241-
scrap={"silicon": 12},
242-
),
243-
aoe=AOEEffectConfig(
244-
range=1,
245-
resource_deltas={"damage": 1},
246-
),
247-
),
248203
},
249204
)
250205

0 commit comments

Comments
 (0)