PTR Changelog 2018-11-01: Creep.pull()
@keenathar this is for players to handle. I have a couple of implementations (so I know it's possible), but I'd not spoil it because players should have their own wonderful discoveries.
Orlet last edited by
When several creeps trying to move onto the same tile, the priorities are: creep having follower, creep that being pulled, creep that pulls someone, creep with best moves/weight ratio
Does this mean we can use
Creep.pull()to prevent other creeps from squeezing in-between attacker-healer pair creeps? Assuming attacker
pull()s the healer along?
@orlet not guaranteed, just most likely.
ObamaLlama last edited by
@orlet You would still be able to move past them diagonally if they were next to each other diagonally but you could probably make them create a solid line but it would slow down how fast you can get to places
Orlet last edited by
I see. Well, that's still useful and something to consider. Might actually implement a trio train squads, melee-healer-ranger mini choo choo train
Tigga last edited by
One thing that seems quite counter-intuative about this design is that pulled creeps' movement parts only decrease fatigue on that pulled creep. It seems like it'd be more intuative for the fatigue transfer to be reduced by any fatigue reduction past zero on the pulled creep.
keenathar last edited by
I agree with Tigga. I was reading the conversation in Slack about this and was really surprised this isn't how it works.
In general terms I'd expect all move parts in a "train" to contribute to reducing fatigue, but just the remaining fatigue ending up with the front "locomotive" instead of regular behavior.
@tigga That makes sense. We scheduled rework of pull.
PTR updated with new version of
pull(): now excess thrust of MOVE parts participate in the movement. So creep being pulled will use his MOVE parts to decrease his own fatigue, if he has it; otherwise, his MOVEs will be used together with MOVEs of the puller.
Every time I read the documentation page that mentions "creeps resembling towers or fortresses", or look at my harvesters with their wasted MOVE parts I've felt that something is missing. I always thought there should be some way to build a creep at a location, but this idea opens up even more possibilities.
Good job! Looking forward to making use of this
How does pull work across room boundaries and portals?
keenathar last edited by
@systemparadox Let's call them "train" and "wagon" for sake of convenience. "Puller" and "pulled" looks too similar.
- Train moves on exit tile, wagon is adjacent to exit.
- Train changes rooms, wagon stays adjacent to exit in original room
- Train changes rooms back to the original room, swaps positions with wagon (position swap is possible with
Wagon is now on exit tile in original room, train is adjacent to exit in original room.
- Wagon changes to new room, train moves to exit tile in original room.
- Wagon changes to original room, train changes to new room.
- Train moves off exit tile in new room, wagon changes back to new room
- Train pulls wagon off exit tile.
@systemparadox this is a bit tricky. I had a couple of solutions when testing this feature so it's definitely possible, but I won't disclose the solution, just to let you guys have the same fun.
@keenathar point 3 is not quite correct. When something walks to an exit tile, it's being teleported to the new room instantly, on the tick it calls
.move(). So if 'train' is at the exit tile of an original swaps position with wagon next to it, next tick the wagon will be at the edge of the new room, the train is near the edge of the original room.
UPD: you know that they're at PTR waiting for someone to write code for, right?
I did try this on PTR and I did manage to move the wagon to the next room, but it was pretty fiddly. Is this how it is intended? Maybe there is no better solution? It's a shame because it makes trains with more than one wagon impractical.
Maybe it's an issue with my code but so far I haven't been able to move the wagon off the exit tile in the new room. Despite
moveboth returning 0, the wagon teleports back to the first room instead of moving with the train.
@systemparadox Weird, could you please provide some details? Room, positions, calls, arguments, return values, all that?
Just checked it myself at ptr, everything is working as expected.
It was a bug in my code! I've got it working now. Thanks.
I think I've found both solutions, and for both of them it's 6 ticks to move both creeps from fully inside room1 to fully inside room2 (e.g. with neither creep on an edge tile). With a lone creep the same movement would take 3 ticks.
For a creep pulling two wagons, I can do it in 9 ticks (a lone creep would take 4 ticks).
If anyone can do it faster I'd love to know!