Desynced Breakdown: Miner Shufflers
Vložit
- čas přidán 5. 09. 2024
- This episode shows off the "Miner Shuffler" - the key behavior in my "antinomad" mining strategy.
It is the epitome of "Why Do it Right When You Can Do It Wrong".
Normal people would just use robots for their miners, but then they would miss out on the beauty of an autominer network form and decay as a node is mined to exhaustion.
As always, please let me know what you'd like to see next!
Shufflers
Regulate how many mine heads are active
Pickup unused miners
Place those miners near their mine head
Precondition - Manually set P2 to a resource type before starting.
if Match(P1, "Entity"):
SetToComponent(0, "Miner")
G = GetFromComponent("Deployer",2)
if G<1:
Need to pickup a miner
P4 = 0
with unlock:
for B,A in LoopSignalMatch(P2):
if A>10800:
P4 = SelectNearest(P4, B)
SetToComponent(P4, "Deployer", 1)
while Match(P4, "Building"):
pass
P4 = 0
else:
Have a miner, deploy it
First go to MineHead so we deploy near it.
MoveUnit(E=: GetLocation(P1))
while True:
Engage miner, this will drive the robot automatically
SetToComponent(P2, "Miner", 1)
I = GetSelf()
P4 = GetClosestEntity(P2)
P3 = Distance(P4)
if(P3 > 1):
Too far from resource
continue
K = GetLocation(I)
if not CompareNumber(P5, K):
Two position snapshots differ, robot is still moving.
continue
Location found!
Mine(0)
SetToComponent(P5, "Deployer",1)
while Match(C=:GetFromComponent("Deployer",1), "Building"):
pass
else:
Find a new Mine Head
with unlock:
for H,D in LoopSignalMatch(P2):
if D==10010:
P1 = H
Signal = P1
#P1 is a minehead we're trying to negotiate with. Check for response...
while True:
J = ReadSignal(P1)
DataTypeSwitch(J):
NoMatch:
#MineHead isn't communicating as expected, maybe it was deconstructed
break #all the way to the top level loop
Entity:
#It is talking to someone... is it us?
if not ResourceType(J):
if not CompareEntity(J,I):
Someone else was chosen
P1 = 0
else:
we were chosen! Go back to the top
pass
Default:
continue
DSC1Qf1Z8YXY1BtI6h2kj47Q0BRFqV288psh1E9RU00PrIFw1XR4cr3dOjvu2TnwEG2tF1St02BXxr0m2Lsr2Z2gCT4Q51Tl1XSBLk0c2WQe1ESMH01mZ9EN11Jkgj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