[A16] Better Pathfinding (v1.5.2 update 2/22)

Started by Zhentar, October 02, 2016, 07:43:01 PM

Previous topic - Next topic

mabor0shi

seems like a great idea, but how can u stand to have that rainbow overlay covering half the map? that wud annoy the hell out of me. no thank you sir. jk i hope this isnt too much for my weak cpu, because in theory i love this. meybe i'll turn off plant sway, i hear that helps FPS
Cool Mod, Bro Everything in RimWorld doesn't have to be either brown or grey anymore: Now you can Pick a Color!

Zhentar

Quote from: deliveryservice on October 03, 2016, 10:10:04 PM
is the area colored in rainbow, means calculated area for optimal path?
So it's become narrower, then it means it's more memory friendly?

It does mean it was the area considered for the path. It actually doesn't mean it's more memory friendly, though - RimWorld actually always keeps a chunk of memory set aside that is the right size to search the entire map (it's only a few megabytes, and it helps performance quite a bit). It (very) roughly means more CPU friendly, but mostly I just want to show off that it's more clever :)

KTVSUN

Great mod, thank you.

I have noted some wierd behaviour sometimes.

Here is an example of a raider deciding to dig through various hills to escape.

https://dl.dropboxusercontent.com/u/10144/wierd%20path.jpg

Note: the first block he digged was a silver block and the raiders had decided to "pick whatever they can and flee". He actually grabbed the silver before fleeing. I dont know if there is a link there.

Cheers

Serenity

#18
That can happen in vanilla too.

I just had a case where sappers dug through distant hills where they spawned instead of digging into walls near by base. But I have no idea whether that's mod related.

kcirdor

Quote from: KTVSUN on October 06, 2016, 01:02:57 PM
Great mod, thank you.

I have noted some wierd behaviour sometimes.

Here is an example of a raider deciding to dig through various hills to escape.

https://dl.dropboxusercontent.com/u/10144/wierd%20path.jpg

Note: the first block he digged was a silver block and the raiders had decided to "pick whatever they can and flee". He actually grabbed the silver before fleeing. I dont know if there is a link there.

Cheers

That isn't typical fleeing, that looks like we've run out of time, and we are hungry and tired so lets go home fleeing.  That type of fleeing is bugged. I have had people "start" to flee after running out of time, but they were busy trying to beat down my door and I was sitting there repairing it cause I wasn't ready to take them on. They kept beating the door down for nearly half a day until I finally opened it and started shooting at them.  They then stopped beating the door  because I jarred them from their task they couldn't finish and started taking their sweet sweet time to leave the map. So I killed them with out any resistance.


marvin__

Quote from: KTVSUN on October 06, 2016, 01:02:57 PM
Great mod, thank you.

I have noted some wierd behaviour sometimes.

Here is an example of a raider deciding to dig through various hills to escape.

https://dl.dropboxusercontent.com/u/10144/wierd%20path.jpg

Note: the first block he digged was a silver block and the raiders had decided to "pick whatever they can and flee". He actually grabbed the silver before fleeing. I dont know if there is a link there.

Cheers

What mod is that on the colonist bar? The one that shows weapons.

kcirdor

Quote from: marvin__ on October 06, 2016, 03:08:25 PM

What mod is that on the colonist bar? The one that shows weapons.

ColonistBar.  Get the latest version on page fifteen, « Reply #219 on: September 22, 2016, 07:22:59 PM »

https://ludeon.com/forums/index.php?topic=20771.0

KTVSUN

#22
Quote from: Serenity on October 06, 2016, 01:12:07 PM
That can happen in vanilla too.

I just had a case where sappers dug through distant hills where they spawned instead of digging into walls near by base. But I have no idea whether that's mod related.

Ok thank you i was just about to post this screenshot with another raid. Their sapper did a beeline to my base digging everythign he could until they abandoned and left.
https://dl.dropboxusercontent.com/u/10144/digging%20again.jpg
Cheers

Serenity

#23
To be clear that happened with this mod! That's why I don't know if that's normal

But I've seen the tunneling while leaving thing in vanilla, so it wouldn't surprise me. Might warrant some further investigation though. If it happens too often it could be the mod. Usually sappers pick a good spot for their tunnels.

Zhentar

Thanks for reporting this; I'll take a look into it. Currently, it's supposed to use the vanilla logic for sappers (my fancy heuristic doesn't work for sappers), but there certainly could be a bug with that. And even if it is a Vanilla behavior, that's something I'd want to improve anyway.

14m1337

did you ever upload this mod to steam workshop ? I thought I had seen it ~3 days ago, and when I wanted to download it there today, it was gone.
Quick_Silver - The One And Lonely
My posts may sometimes be filled with (sarcastic) humor - it's up to you to find it out on your own.
Usually drunk on Mondays from 21:00 to 03:00 CEST.

Zhentar

I did not upload this to the Steam workshop, and do not plan to.


I can confirm there is a bug in my handling for sappers which makes them tremendously stupid about avoiding sapping. I'll have a fix up tomorrow.

Zhentar

#27
Alright, I haven't given this as much testing as I would like... but I'm sure at least some of you would rather I post it now and let you be the testers, so here you go.

Version 1.1: https://drive.google.com/open?id=0B_iRcVI-TJMZalNYSnNBaXhJOFU

  • Fixed sapper pathfinding bug so that they won't try to go straight through rock. They will now be moderately smarter about pathfinding than Vanilla. (still planning to tweak this a bit, but wanted to get the fix out now)
  • Fixed a bug that was causing the funny diagonal bits in some paths, as well as some other sub-optimal pathfinding. Unfortunately, this had a significant performance cost in some cases
  • Taught the heuristic about doors. This doesn't improve paths but significantly improves performance on paths through or near doors, especially if the shortest path would be through a door that is forbidden.
  • Improved heuristic handling of rough terrain, significantly improving performance in open, outdoor areas.
  • Other misc small optimizations.

Overall, this should significantly improve performance; in most cases it meets or significantly beats Vanilla performance, although there are still some cases I want to work on further.

KTVSUN

Great, thank you.

Installing now and will test tomorrow.

Cheers,

K

hiepbg