[1.2] Big raids create terrible lag and pawns teleporting in tunnels

Started by Reverie, April 16, 2021, 06:58:39 PM

Previous topic - Next topic

Reverie

Initially I thought it was a mod bug, but not this time, it seems.

I've launched Rimworld with just Harmony and HugsLib and the issue persists.

I made a fresh colony and God-Mode built a base to generate some wealth, set the threat scaling to 500%, then summoned a tribal raid. Here's the result: https://www.youtube.com/watch?v=CQm81m7fXow

The pawns overlap and don't stop it after hitting a trap (using a mortar against them has the same result - as in, they stay in the big ole pawnball, overlapping). Then, at some point, the narrow tunnel forces the pawnball to decompress and all lag hell breaks loose.

Running Dubs Analyzer with the lag points to path finding somewhere idk, Verse.AI:Pathfinder:FindPath, VerseAI.Pawn_PathFollower:PatherTick

Canute

Many thing cause many work. It is like you are saying your FPS drop down when you double your screenresulotion because your videocard need to calculate 4 times so many pixels.
That isn't a bug, just potential for improve the code.
But since pathfinding is a very calculation intensive and constant changing thing it is allways a heavy issue.
Similar happen when you have alot of animals which seek for gras to eat.

The teleport thing is an old thing.
https://ludeon.com/forums/index.php?topic=52787.0
Many expierence it more other less.

Reverie

As you can see in that topic, not everyone could recreate that bug and they asked for it in controlled conditions.

Well here, the conditions as are controlled as they get. It's a default map size, fresh test colony with no baggage, clean tunnel, clean settings, and a raid of simple tribals - around a 100 of them, which is not an outlandish amount of tribals for a raid at all.

It's also very likely the thing would happen with less of them, perhaps to a somewhat lesser extent since there would be fewer of them to unpack.

I've been playing heavily modded Rimworld for like a year now, and I've not had this happen before.

Canute

Me either, while other encounter it more.
Maybe i don't use much tunnel killbox anyway, but it even can happen at none tunnel situations.
On an infestation i let 3 hvy armored pawn tank a doorway, while the range fight are behind.
And it happen that small bugs pass through the 3 tanks.

Basicly i think it is because the devs decide that only 1 pawn can stay at one tile, but when pawns move it can happen that multiple pawns move over 1 tile.
When these crowded got attack and they don't move anymore, rimworld move the pawns to the next free tile, which even can be behind defences/walls.
Similar behavior are when you burn corpse at the crematorium, the burning process autostrip the corpse and the appareal appear all around the crematorium.
But the logic to find the next free tile is pretty simple, it just look for the straight line and don't check for path blocking things. So the stuff can appear behind the wall which is maybe a 100+ tile long pathway for a pawn.
Similar to find table for eating just look for the nearest table in straight line, that the pawn need to path far around it doesn't recognize.

The logic/algorithm behind that is just simple, and got alot room for improment.
IMO i wouldn't call it a bug, just a request for improment.
But the devs need to decide, just wait for Pheanor (a rare bugtracker who works for the devs) what he say about it.


Madman666

I might be misremembering, but this kind of thing didn't happen earlier and i ve been using those crappy trapped hallways througout the alphas to this day. I also was getting huge tribal raids, so it shouldn't be the size issue. I clearly remember similar situations unfold a lot differently, they were filtering into trapped tunnel one by one or however many free tiles the hallway allowed for.

I checked myself and in my game currently it happens in exactly same way, both modded and unmodded - they funnel in the tunnel, then when first of them comes out and gets shot, they all go combat mode, try unstacking, but can't as there is no free tiles for them to stand on, 1 per tile. And this basically pushes the game into turn based mode with a constant insane spam of failed pathing calculations.

Reverie

A big thing is also, the enemies will re-stack after de-stacking for whatever reason. For instance:

1. spawn a big raid
2. send in a pawn to fight them and die/set some turrets on the way to be killed and to damage enemies (or both)

Any of these things will cause the enemies to de-stack and stop forming a ball. But then once they kill the pawn/the turrets, now they actually will stack again and get into the tunnel as a pawnball, where they will start to decompress again causing massive lag (and possibly causing unpredictable colony wipes if they just torpedo into the base side all at once, depending on one's setup).

Canute

QuoteI might be misremembering, but this kind of thing didn't happen earlier and i ve been using those crappy trapped hallways througout the alphas to this day.
Not sure which alpha, but at the past you could with some micromanagment arrange your pawns that they all stay at the same tile. Like at the edge of the wall and then shoot behind the cover.
But this don't work anymore. They get pushed to the next free tile, so there are never 2 standing pawn's at the same tile.

Madman666

No, i dont mean your colonists standing on the same tile. That was there for ages, there is even a mod that lets your pawns stay on the same tile (or was one in b18 at least). I mean this buggy, laggy behavior with pawns entering hallways en masse, then breaking the crap out of PatherTick. That wasn't a thing earlier.

Pheanox

What you are seeing here are the rules changing.  When pawns are approaching in a large group they are allowed to cluster together very closely in big clumps.  However, once they enter the range of your pawns or they activate as hostile, the rules that require pawns to not share spaces are suddenly enforced, which creates the appearance of teleporting as the game corrects pawn placement for combat purposes.  In other words, this is working as intended.  Thank you for the report though, and if you have any follow up information please feel free to post it here.