Ludeon Forums

Ludeon Forums

  • May 26, 2022, 04:15:29 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 3 [4] 5 6 ... 8

Author Topic: [1.3] [KV] Path Avoid [ModSync RW]  (Read 62360 times)

sanovskiy

  • Muffalo
  • *
  • Posts: 1
  • Refugee
    • View Profile
Re: [A18] Path Avoid (Preferred Works Again!)
« Reply #45 on: December 20, 2017, 12:04:53 AM »

I wonder why this mod not working with roads?

After picking slug

I have "Prefer" regions on my roads.

What's wrong with this pawns?

Logged

Kiame

  • Planetologist
  • ****
  • Posts: 1541
  • Refugee
    • View Profile
Re: [A18] Path Avoid (Preferred Works Again!)
« Reply #46 on: December 20, 2017, 02:02:52 AM »

PathAvoid is really not meant for macro-scale endeavours and is more for micro-scale (room to room) tool. This is more an underlying problem with how the base game's pathfinding works and I welcome you to try different values and see if something else works.

In-depth for Path Avoid's hints: each tile can have a 0 to 255 value of 'difficulty'. W/o this mod every tile has a value of 0 and as things like grass, mud, trees, rocks, etc get put on a tile the difficulty goes up. This mod increases the base value to 10. Preferred becomes 0. From there dislike, hate, strong go 50, 150, 250 (iirc just going off memory). So surrounding the non-roads with 'strong' will probably give a stronger 'hint' to the pawns to use the roads but the pawns could very well ignore that too (especially for longer distances).

Workaround: In the mod's options you can click 'advanced' and you can put in your own values for each path avoid type. I have not personally tested it with other values with this release. Setting Normal to 50 might give a stronger hint to the pawns. Again though, especially for longer distances, your pawns will probably ignore path avoid.
Logged

BTAxis

  • Drifter
  • **
  • Posts: 50
  • Refugee
    • View Profile
Re: [A18] Path Avoid (Preferred Works Again!)
« Reply #47 on: December 20, 2017, 02:43:31 AM »

Even over shorter distances sometimes you don't get what you'd expect though:





That said you also sometimes do. Like I said before, it's a bit erratic at times.
« Last Edit: December 20, 2017, 02:46:54 AM by BTAxis »
Logged
"The megasloth ducked behind the nearest piece of cover"

Kiame

  • Planetologist
  • ****
  • Posts: 1541
  • Refugee
    • View Profile
Re: [A18] Path Avoid (Preferred Works Again!)
« Reply #48 on: December 20, 2017, 03:57:57 AM »

yes this is by no means perfect. Just a means to help the pathfinding do better. In the case of the room this is definitely the pathfinding - it appears to be favoring the shorter path over the easier one. You may try making both sides of the blue workbench strong to emphasize even more not to go that way (basically an up-side-down T of strong)
Logged

BTAxis

  • Drifter
  • **
  • Posts: 50
  • Refugee
    • View Profile
Re: [A18] Path Avoid (Preferred Works Again!)
« Reply #49 on: December 20, 2017, 04:28:38 AM »

Actually what I think is happening here is that the pawn initially tries to walk directly toward his destination, but then encounters an obstacle and paths around it at the last minute. I've seen that happen in other situations as well. It just seems odd that it's quite THAT short-sighted, because this path gets chosen even if it starts from the position shown in the screenshots.
Logged
"The megasloth ducked behind the nearest piece of cover"

CannibarRechter

  • Colonist
  • ***
  • Posts: 784
  • Dericious
    • View Profile
Re: [A18] Path Avoid (Preferred Works Again!)
« Reply #50 on: December 20, 2017, 07:14:42 AM »

> your pawns will probably ignore path avoid.

What would be useful is having the "strong" region be like a constructed item (like a sleeping spot), and then have it set to impassable=true, but only for your own pawns. The game would definitely honor that.

Logged
CR All Mods and Tools Download Link
CR Total Texture Overhaul : Gives RimWorld a Natural Feel
CR Moddable: make RimWorld more moddable.
CR CompFX: display dynamic effects over RimWorld objects

BTAxis

  • Drifter
  • **
  • Posts: 50
  • Refugee
    • View Profile
Re: [A18] Path Avoid (Preferred Works Again!)
« Reply #51 on: December 22, 2017, 09:35:32 AM »

Yeah, this one has me stumped. Behold this path:


And my pathing mask:


It's avoiding even going NEAR the "strong" tiles, it seems. When I set the stockpiles back to normal it becomes:


At this point I'm starting to think the unpredictability of this mod is rather defeating its purpose.
Logged
"The megasloth ducked behind the nearest piece of cover"

Kiame

  • Planetologist
  • ****
  • Posts: 1541
  • Refugee
    • View Profile
Re: [A18] Path Avoid (Preferred Works Again!)
« Reply #52 on: December 22, 2017, 12:26:26 PM »

The low res makes it difficult to see. Is that an x in the doorway? If so that's why he's going around.

As for why he's not going through the base, the doors have a weight to them as well. What the pathfinding probably found is that the longer way around was less weighted than going through multiple doors. This path would have been found w/ or w/o this mod
« Last Edit: December 22, 2017, 12:28:16 PM by Kiame »
Logged

BTAxis

  • Drifter
  • **
  • Posts: 50
  • Refugee
    • View Profile
Re: [A18] Path Avoid (Preferred Works Again!)
« Reply #53 on: December 22, 2017, 12:55:18 PM »

Yeah, the door is forbidden. It originally pathed through there, so I wanted to see if forbidding it would improve the pathfinding. Instead, it made it worse.

And no, it would not have found the same path without the mod, because removing the weighting on the stockpiles changed the path it found. I made it choose a new path several times in a row, and it would always go the long way around until I did that.

(Enough for the fact that that long path goes through MORE doors than the short one.)
« Last Edit: December 22, 2017, 12:58:02 PM by BTAxis »
Logged
"The megasloth ducked behind the nearest piece of cover"

wwWraith

  • Colonist
  • ***
  • Posts: 432
  • ...
    • View Profile
Re: [A18] Path Avoid (Preferred Works Again!)
« Reply #54 on: December 22, 2017, 02:50:52 PM »

I'm experiencing the same issues. Look at the attached picture. Vasques is going to haul fine meal and Gruenfelder is going to research (I repainted their pathways with green lines for better visibility). The path through my dinner/rec room would be shorter, has less doors, doesn't include soil, bushes and darkened areas, and even includes more of "preferred" section. If I remove the pathing preferences in dinner/rec room, my pawns often will crawl through that row of arcades as i painted with purple line.

I think it's mostly issue of the vanilla pathfinding algorithm, because the same situations can happen in vanilla, it's just harder to create conditions for it. Sometimes pawns choose decently good paths. I have a suspicion that the game somehow chooses (probably dynamically, that's why it can't be reproduced reliably) only some tiles (or groups of them) to calculate, so it becomes like "if I can't go exactly that tile, I won't mind going anywhere near it". Probably it can also explain some "vacillations" like those I showed with blue circles and worse situations when pawns go from the good strict road to climb some tree nearby just to return on that same road again after that. And/or there could be something weird with the whole calculation of movement cost for obstacles.

[attachment deleted by admin: too old]
« Last Edit: December 22, 2017, 02:54:02 PM by wwWraith »
Logged
Think about it. Think around it. Perhaps you'll get some new good idea even if it would be completely different from my words.

Harry_Dicks

  • Planetologist
  • ****
  • Posts: 1675
  • Chilean Helicopter Pilot
    • View Profile
    • Harry Dickle's Fuzzy Pickle
Re: [A18] Path Avoid (Preferred Works Again!)
« Reply #55 on: February 19, 2018, 03:26:27 PM »

Trying to get this pawn to take the patch up through the preferred area. She's taking wood from that little enclave you see at the bottom right, down across the bottom, and the up the left side of the screen, before finally taking it to the top right of the frame. I tried making this path so that they would stop walking through the forest going slow as dirt, but it seems like I can't get her to stick to the area I've designated as preferred.

Before I painted any of these cells, the pawns kept taking horrible paths. Now, they just taking a long way around the horrible paths :P

Logged

Kiame

  • Planetologist
  • ****
  • Posts: 1541
  • Refugee
    • View Profile
Re: [A18] Path Avoid (Preferred Works Again!)
« Reply #56 on: June 23, 2018, 12:18:29 AM »

Update for 1.0:
https://github.com/KiameV/rimworld-pathavoid/releases/download/1.0/PathAvoid.zip

Use ModSync RW to know if/when there's an update

"Normal" has been removed. Use "Prefer" to revert paths to their base value.
Fixed a bug where there would be an error if the pathing was dragged off the map.
Logged

Bones

  • Drifter
  • **
  • Posts: 67
  • Annoying Refugee
    • View Profile
Re: [1.0] [KV] Path Avoid
« Reply #57 on: June 23, 2018, 07:20:28 AM »

Can't the value be less than zero?

EDIT: If everything starts with zero, then the only way to make a path that the pawn will prefer is to have a value below zero.

One hack would be to put the whole map on a given number like 50 or 100 for example, and then you remove the path you prefer, this way you can have a 'use this path' using this mod. It might confuse the pawn however on paths that costs a lot since the max is 255 so a lot of things could reach the max now when they couldn't before so the pawn won't differentiate them.

EDIT2:



« Last Edit: June 23, 2018, 08:06:41 AM by tiagocc0 »
Logged

Kiame

  • Planetologist
  • ****
  • Posts: 1541
  • Refugee
    • View Profile
Re: [1.0] [KV] Path Avoid
« Reply #58 on: June 23, 2018, 10:39:32 AM »

The game uses unsigned bytes for this information so the supported numbers are 0-255

The B18 version of this mod with 'Prefer' and 'Normal' worked off the idea of all tiles had a '10' weight (as opposed to 0). Normal was thus 10 and Prefer was 0.

The pathing is not the greatest in this game; specifically for longer paths. I'm not an expert but the last time i looked at the pathing code itself there is a kill-switch in the code to prevent it from costing too much for the CPU. Something like if the pathing hits a square that has a high enough weight it will try to find a better path with a BFS of a depth of 8 iirc. If it's unable to find a better path at depth 8 it cuts out and draws a straight line instead of using any intelligence in pathing.

The 1.0 version removes Normal and makes everything 0 to help prevent the above kill-switch from triggering as often (it still will in many cases though)

Remember, this mod is not a replacement for the base game's restricted zones. This is simply a way to give the pathing system 'hints' as to the best path to take.
« Last Edit: June 23, 2018, 10:43:03 AM by Kiame »
Logged

Bones

  • Drifter
  • **
  • Posts: 67
  • Annoying Refugee
    • View Profile
Re: [1.0] [KV] Path Avoid
« Reply #59 on: June 23, 2018, 05:50:23 PM »

Kiame, have you checked what would have a 255 value? Maybe the game is coded in a way that a high enough value is used to determine a threat instead of just a very costly path and so using a value so high for the higher tier of this mod might not be the best since it could cause pawns to not only avoid the tile but around the tile as well. That's the only explanation I could think of.
Logged
Pages: 1 2 3 [4] 5 6 ... 8