RimWorld

RimWorld

Better VPE Skipdoor Pathing
120 Comments
Arira 6 Aug @ 5:40am 
I'm not a modder in anyway, but MultiFloors have dev branch on the workshop. They have "ladders" that lets pawn traverse between "floors" automatically.
I would guess it can be implemented in some way as a solution.
Corbald 2 Aug @ 9:12pm 
Yes, but you could bake some of the logic/pathes into a list, to reduce overhead. Not sure exactly what, without actually writing the mod myself. Unfortunately, this is always going to come at a cost, as pathfinding usually does.
Monarch 2 Aug @ 4:07am 
corbald wouldnt that cause increasingly intense lag with every new skipdoor?
VerenManta 31 Jul @ 7:37am 
I need this mod in 1.6 so bad. Hope Corbald his suggestion is a fix!
Corbald 30 Jul @ 7:33pm 
Since most jobs that I can think of require moving to either the relevant item, or a workstation, I think you could just put a job in there that checks the distance between the pawn and the target thing/building/pawn, via checking the IEnumberable list iteratively until a pathfind is discovered, and compare that to the distance to the skipdoor. If such a thing is found, then add a job to travel to the closest skipdoor, or the relevant linked door to that first one. I really feel like attacking pathfinding itself is the wrong way to approach this. Toils are MUCH easier to work with, but I don't know what's changed in Rimworld since I last did any modding for it, and that was a WHILE ago, and I used a pre-decompiled source at the time.

Looks like yeah, it's fully possible to intercept and modify the toils, as well as to see if they have pathfinds and how far they are, or at least to run your own if they have 'destinations', and check the cost then.
Corbald 30 Jul @ 7:33pm 
Yeah, here we go! Looking around, I found:
'''
Patching JobDriver_MakeNewToils: Most JobDrivers have a MakeNewToils() method which defines the sequence of actions a pawn takes for that specific job. You can use Harmony (a popular Rimworld patching library) to intercept this method and inject your Toil(s) at the beginning of the returned IEnumerable<Toil>.
'''
Corbald 30 Jul @ 6:45pm 
Why is it you need to hook into pathfinding in the first place? If a pawn already has to pathfind for every job, why not just hook into the job (toil?) system, instead? If a pawn gets a job, before acting on that job, see if the destination is closer to a skipgate than the pawn, and if so, just pathfind to the closest skipgate and activate it, as a 'pre-job' before the rest of the toil fires. IIRC the toil system already identifies the closest pawn to a job, and you could hook off that, maybe. I'd really like to help, if you can point me to a decompiled source on github, or instructions to do it myself. (for Rimworld, not this mod)
RippedG 30 Jul @ 5:27pm 
1.6
Church.exe 26 Jul @ 2:52pm 
@ImmortalTechnique I don't think that mod actually does anything like this, in the description it specifically says that it has no pathing, which leads me to believe that it basically just has the lifter pick something up, go in a random direction (possibly just back the way it came?) then instantly teleport to the target.

In other words I don't think it actually paths at all, it just arbitrarily lets the lifter magic it's way over to where it wants to be.
ImmortalTechnique 25 Jul @ 5:50pm 
@Ender Wiggin

out of curiosity, does this mod help at all with figuring out a solution?

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3493717994&searchtext=teleport
BorisTheAnimal 24 Jul @ 1:31pm 
hmm theres also the auto blink mod that came out a while back, it allows pawns to blink along their chosen path with a cooldown, maybe that could be modified to have the start and end points of a blink be skipdoors, thus bypassing the N*N-1 pathfinding issue of the teleportdoor mod? this way the logic would be "if path longer than x, check distance to nearest skipdoor then distance of target to its nearest skipdoor, if the sum of these distances is larger than the original distance, go to position A (skipdoor 1), do a blink from A to B (skipdoor 2) then proceed to target". this way it would add "only" 2 extra pathfinding passes plus whatever processing the autoblink mod uses for its functionality
Ender Wiggin  [author] 24 Jul @ 12:27am 
@Tyrant: Just looked at that mod - it is indeed good approach. It could (should?) be included into some general lib that everyone uses with slight modifications to allow mods to leverage its approach to pathing cost modification.
But unfortunately, this does not help with modifying how pathfinding works - it just allows to make some cells more/less costly to traverse, but I need to modify how game checks where pawn can go from specific cell.

@BorisTheAnimal: while this approach _may_ work, it would be even more disastrous to performance than replacing whole of pathfinding with not-optimized code as each time pawn tries to move it would need to calculate path extra (N*N-1) times where N is number of Skipdoors.
Tyrant 23 Jul @ 6:17pm 
A new mod has come out which shows how to do path avoidance in a performant way for 1.6: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3530140490
BorisTheAnimal 22 Jul @ 2:36pm 
idk much about pathfinding and modding in general, but wouldnt it be feasible to rework this in such a way that it adds a check when a pawn tries to pathfind to someplace else where it checks the length of the calculated path, and if its above a minimum threshold it tells the pawn to check the distance to the nearest skipdoor, then the distance of the target to its nearest skipdoor, and if their sum is lower than the original distance the pawn paths to the skipdoor instead, whereupon a mechanic like the teleportdoor mod kicks in and actually does the teleport?
L. Velociraptor 22 Jul @ 1:53pm 
If it's dampening an entire category of mods, maybe asking Ludeon if they could do something about it would help? Maybe they could provide some kinda hooks or something into the pathfinding system for modders, should be something they would care about. The system itself being multithreaded is new, after all, so these kinda growing pains are to be expected somewhat.

So I guess my suggestion is: Ask Ludeon. Best case, they have an answer for you. Mid case, they decide to toss the problem in the problem-hopper and get to making pathfinding moddable again eventually. Worst case, silence.
Reshiram 20 Jul @ 1:52am 
The burst compilation of the pathfinding really puts a dampener in patching it, only real solution might be replacing the method entirely, but that has severe compatibility and maintenance risks. I suppose the pathfinding could also stop being burst-compiled, but that would severely hinder performance too. I am thinking of some ways and looking with a friend, but it does look bleak, not just for this, but for pathfinding-altering mods in general.
Galahad 19 Jul @ 6:21pm 
I do hope you somehow manage to update this it’s such an awesome addition to my games
Akry 19 Jul @ 5:12am 
disaster! disaster!
We should start a petition Tynan to do something.
I cant live without my skipdoors :(
Ender Wiggin  [author] 18 Jul @ 10:08am 
@Caz - the problem is not with pathfinding as such - the problem is in the way new optimization works - it basically prevents patching of pathfinding. And I currently do not see any performant way to bypass that.

As for alternatives - try TeleportDoor mod (https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3002753890) - it is different, but may be good enough. Just try not to spam too many of those doors - each time pawn walks through one such door it does pathfinding checks from all other doors to destination to see if there's closer door to teleport to, so with many doors it may introduce significant lag. But having a door near entrance and in stockpile/freezer should be fine and not laggy. You can even add such door temporarily near far away mining spots to help with that, though it would need some power source.
Monarch 18 Jul @ 12:35am 
hope this gets an update or alternative at some point i miss my skipdoor spam
VitaKaninen 17 Jul @ 11:18am 
I don't think OwlChemist has been active in several years. Most of his mods have been continued by other modders.
Caz 17 Jul @ 11:14am 
Maybe Owl Chemist or Mlie could help with figuring it out? I know Owl Chemist did a pathfinding mod in the past. And Mlie seems to just know how every mod for this game works. lol

Even if you're not able to update, you made an awesome mod. Don't let it get you down. (says the dude who gets discouraged easily lol )
Akry 17 Jul @ 10:33am 
Noooooooooo
Disasteeer!
Ender Wiggin  [author] 17 Jul @ 10:24am 
I really want to update this mod - I made it primarily for myself - but, unfortunately, at the moment I have no idea how to do this. Ludeon implemented improved compiling for pathfinding that significantly boosts performance, but also makes it impossible to patch those methods. Or at least I don't know how to do it. And if I try to replace their code completely - it won't have that performance boosting compiling active and will make it significantly slower, not to mention will be highly incompatible with other mods trying to modify pathfinding.
Akry 16 Jul @ 3:27pm 
Thats it. I cant play without this mod.
I'm shelving Rimworld untill this gets updated.
Caz 14 Jul @ 12:01pm 
I'm still playing on 1.5, since I'm still running a save with a LOT more I want to do in it (1.6 will likely break some key mods for the save). This is a game changer for this psycast. This is how I expected skipdoor to actually work. I was just ignoring this psycast, but now I actually have a reason to use it!

Hope you're able to get this working for 1.6. But even if not, glad I found this while I can still use it! Cheers!
Zamaza 14 Jul @ 9:53am 
I'm not above bribery if that'll help you update. I've legit planned bases around this mod before!
Ender Wiggin  [author] 14 Jul @ 3:34am 
Unfortunately, updating this to 1.6 would be very difficult, if at all possible - there's a lot of optimization changes to path finding that prevent me from patching-in my custom code. I'll look into alternatives - saw seemingly similar mod working on 1.6: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=3002753890 will check if that approach would work here.
Akry 11 Jul @ 9:09am 
I refuse to start my 1.6 game untill this is updated :D
marccharlton4 10 Jul @ 7:02pm 
1.6 please. Huge bases are impossible without this mod
VitaKaninen 19 Jun @ 2:40am 
If you plan to update this mod, can I make a suggestion? I would like for hauling animals to be able to use the skipdoors for pathing between areas.

If I have 2 separate areas that the animals are allowed to be in, and they are connected by a skipdoor, my animals will ignore the zone restriction to get to the other allowed area, but they will not use the skipdoor, which puts them in danger when they leave the base.
Shalashalska 16 Jun @ 1:25pm 
This mod seems to have issues with SOS2. After taking off, with a single skipgate left on the map I started on, all colonists on the ship were unable to move, with a flood of errors about pathfinding. After removing the mod, or destroying the skipgate before takeoff, I was able to take off in the same situation with no issues.
lRey 12 Jun @ 7:59pm 
Since this mod assumes VPE, it would be helpful if you could include VPE in the <loadAfter> tag in the About.xml, even if it is in your spare time.
HelleboreFlower 8 Jun @ 12:18am 
Does zones make certain areas "un-reachable without skipdoors"? i have a room that can be entered by going outside while also having a skipgate in that room and in a room deep in my base. But when a manhunter pack came i made a zone that kept them inside but also added that room that cant be reached unless you go outside or use the skipgate. Is it possible for them to use the gate to get there instead of walking outside to reach the zoned room?
FestiveEdge 15 May @ 11:21pm 
Option to enable un-reachable without skipdoors pathing?
猫雷Kiss 4 Apr @ 8:16pm 
TPS drop
Arky 6 Jan @ 3:38pm 
Warning; This mod reduces around 100tps on my colony with two gates :/
GATC 27 Dec, 2024 @ 2:30am 
This mod is SO good to enhance my colony efficiency!
Lovhes 21 Dec, 2024 @ 6:18am 
this is an amazing mod. logistic for large bases are simplified with this mod! now if only the VFE insectoid 2 bugs would use the gates. but eh, not that big of a loss
Similar 25 Nov, 2024 @ 8:53pm 
Amazing mod. I played for a bit without it and skipdoors seemed a bit useless. Then I installed this mod and now my colonists and mechs zip to the other end of the map and back without me having to do anything.
Eidolan 8 Oct, 2024 @ 8:35pm 
So is the no animal's using the skip doors for balance or because of how their AI handles path-finding as an animal?
sidfu1 29 Sep, 2024 @ 2:29pm 
can we get a setting hwere its colonist+ slaves
Shariul 30 Aug, 2024 @ 4:55am 
Id say colonists only should be defoult setting. For all the enemies knows, it might lead streight to the oven...
foobled 29 Jul, 2024 @ 8:55am 
@Xenogray animals aren't meant to use the skipdoor, desc says 'Only pawns with intellect of Humanlike or ToolUser can use skipdoors freely'
Xenogray 26 Jun, 2024 @ 12:40pm 
Not working with animals though :) Great mod nonetheless
Just Coda 12 Jun, 2024 @ 8:33am 
to the comment before this one:
" Also, for performance reasons if spot is un-reachable without skipdoor pawns won't path to it. "
Cool Person 12 Jun, 2024 @ 5:08am 
Hi, i have some interesting behavior: Pawns don't use skipdoors when structure is enclosed without doors
Irrelephant 19 Apr, 2024 @ 2:39pm 
Waited to play 1.5 until this updated
Giggles 16 Apr, 2024 @ 8:09pm 
Thanks for 1.5! Love this mod!
marccharlton4 8 Apr, 2024 @ 10:02am 
1.5 please