why I go to other shard, I will loss my creeps?
-
This is the path to other shard, cross shard for 16 times.
cross shard is mean : pass through portal from shardA to shardB ,A != B
This is my path for cross shard From shard3_W20N10 to shard3_E30N40 { path: [ { shard: 'shard3', roomName: 'W20N10', x: 40, y: 16 }, { shard: 'shard2', roomName: 'W20N10', x: 39, y: 33 }, { shard: 'shard1', roomName: 'W20N10', x: 41, y: 9 }, { shard: 'shard0', roomName: 'W29N10', x: 1, y: 19 }, { shard: 'shard0', roomName: 'W30N30', x: 43, y: 43 }, { shard: 'shard1', roomName: 'W20N20', x: 38, y: 12 }, { shard: 'shard0', roomName: 'W30N39', x: 40, y: 1 }, { shard: 'shard0', roomName: 'W19N40', x: 1, y: 6 }, { shard: 'shard0', roomName: 'W20N50', x: 43, y: 29 }, { shard: 'shard1', roomName: 'W10N30', x: 10, y: 13 }, { shard: 'shard0', roomName: 'W19N60', x: 1, y: 4 }, { shard: 'shard0', roomName: 'W20N70', x: 39, y: 38 }, { shard: 'shard1', roomName: 'W10N40', x: 8, y: 25 }, { shard: 'shard0', roomName: 'W20N79', x: 35, y: 1 }, { shard: 'shard0', roomName: 'E10N80', x: 36, y: 18 }, { shard: 'shard1', roomName: 'E10N40', x: 33, y: 6 }, { shard: 'shard0', roomName: 'E20N82', x: 29, y: 48 }, { shard: 'shard0', roomName: 'E70N80', x: 33, y: 8 }, { shard: 'shard1', roomName: 'E40N40', x: 40, y: 19 }, { shard: 'shard0', roomName: 'E80N69', x: 5, y: 1 }, { shard: 'shard0', roomName: 'E40N71', x: 28, y: 48 }, { shard: 'shard0', roomName: 'E50N70', x: 14, y: 38 }, { shard: 'shard1', roomName: 'E30N40', x: 8, y: 33 }, { shard: 'shard2', roomName: 'E30N40', x: 13, y: 29 } ], }
my body part : [ MOVE ]
number of creeps : 500
tick between for spawn : 30tick
The shard touch in per step (my origion logs) it is mean that how many creep will touch in the path index which I give in the first for example : index 3 mean my creep touch the step { shard: 'shard0', roomName: 'W29N10', x: 1, y: 19 } s0 index3:490 index4:490 index6:484 index7:484 index8:484 index10:480 index11:480 index13:472 index14:472 index16:464 index17:464 index19:457 index20:457 index21:457 s1 index2:492 index5:486 index9:480 index12:476 index15:470 index18:459 index22:454 s2 index1:494 index23:451 s3 index0:500 index24:448
finally cross shard the creeps touch it mean the only cross shard step ,how many creep touch finally if my creeps has not cross shard , they will not loss. so i just collect all step which is cross shard index1:494 index2:492 index3:490 index5:486 index6:484 index9:480 index10:480 index12:476 index13:472 index15:470 index16:464 index18:459 index19:457 index22:454 index23:451 index24:448(kill by someone finally. it should be 449)
I send 500 creeps, but finally ,I should receive about 449 creeps,
about loss 10% of creeps
we define P as the probability of loss ceep ,
we have Math.pow(1-P,16) = 0.9
P = 0.007
for each time I will loss about 0.7% creep ?
is it bug?
(my creeps` name is always unique)
finally ,while I pass through portal I have 0.7% loss my creeps
-
My English is not good, if you don't understand, you can ask questions
-
I don't cross shard much, so I may be incorrect. I have heard of a few gotchas when hopping shards.
The biggest being you need to keep your ticks going on both sides to get reliable transfers. An empty shard will often go to sleep and stop ticking.
Another problem is sometime the shards will have difficulty talking to each other. This can cause creeps to stuck in limbo for hours. As far as I've heard they all eventually arrive often in a single clump.
You may have stopped tracking your creeps too soon and the lost creeps are still in transit.
-
@deft-code said in why I go to other shard, I will loss my creeps?:
The biggest being you need to keep your ticks going on both sides to get reliable transfers. The biggest being you need to keep your ticks going on both sides to get reliable transfers.
for this problem .
the data transfer may not reliable, i think i should check it
- i check it out,it is reliable in this case ( except last creep,but cannot lots of creep loss)
I set the min tick keep the data transfers to :
if a creep lost for 4 hour , it is still working.
global.CORSS_SHARD_TIME_OUT = 5000 // it about 5 hours (86400/3.7/5000 )
This can cause creeps to stuck in limbo for hours.
for this problem . I have never stop tracking my creeps ,
still now ,not any new creep i has found.
An empty shard will often go to sleep and stop ticking.
I send creep for per 30 tick ,so there are always has creep in s0 ,and s1
i have lifetime,i send my creep to s2 to make pixels ,the tick is never sleep in s3 and s2(but s2 and s3 cross shard also has loss creeps
-
Wow that's a lot of portals in one path!
If some of the shards aren't normally ticking then you may well be running into the issue where the creep arrives but it takes ages for your code to wake up and start ticking.
One trick you might find helpful to avoid this is to add a construction site for a road into a wall (so noone can step on it and destroy it) in the portal rooms. This is enough to keep that shard ticking.
How do you know your creep names are unique? If your naming is at all based on checking what you already have you might find that it's creating creeps with a name that's already been used on a creep that's gone to another shard.
-
Some of your creeps seem to be sitting around in the portal room until they die: https://screeps.com/a/#!/history/shard2/W20N10?t=32797633
-
This post is deleted!
-
Some of your creeps seem to be sitting around in the portal room until they die: https://screeps.com/a/#!/history/shard2/W20N10?t=32797633
i have lifetime,i send my creep to s2 to make pixels
there are always 2-3 creep around in the portal.
still now , you can see there are 3 creep in there .
and i test twice ,in the first time, my code is wrong .This will repeat the counter. I fix it,so i send about 1500 creep
-
One trick you might find helpful to avoid this is to add a construction site for a road into a wall (so noone can step on it and destroy it) in the portal rooms. This is enough to keep that shard ticking.
this is a good idea
How do you know your creep names are unique? If your naming is at all based on checking what you already have you might find that it's creating creeps with a name that's already been used on a creep that's gone to another shard.
as you can see ,my creeps' name is increasing,
global.t = Math.random *1000000 (i simplify the code ,it never same in twice road the code)
let name = game.time + t ; t++
If some of the shards aren't normally ticking then you may well be running into the issue where the creep arrives but it takes ages for your code to wake up and start ticking.
this is a problem but i always has more than 20 creep in s0 ,and about 5 creep in s1
-
@systemparadox My test may not be accurate, you can also test it yourself