Would the game benefit from the introduction of "no through" zones?

Started by The Man with No Name, January 14, 2018, 03:29:29 PM

Previous topic - Next topic

The Man with No Name

There are many times that colonists will walk through areas where one doesn't want them to walk, such as walking through a freezer to get somewhere instead of using a corridor. I think the game would benefit from the introduction of a new zoning type, called something like a "no through" or "access only" zone. Colonists would not walk through these areas on their day-to-day business unless they had a job or some other reason that involved them being there. If drafted, a colonist would ignore these restrictions. Certain jobs, like firefighting duty, might also ignore them.

Here are some areas that it would be helpful to have such a zone for:

1) Freezers

Typically one will want at least two entrances to a freezer - one to to the kitchen and another towards wherever people will be bringing harvested crops and dead animals from. This means, though, that colonists will sometimes walk through the freezer instead of through an adjacent corridor to get some place, or to visit the kitchen to pick up a meal.

2) Storage rooms

Storage rooms are full of ugly stuff which is slow to walk through. Often these rooms can have multiple doors for easy access from any direction. This means that colonists will often walk through such rooms instead of walking in the adjacent stone tile corridors.

3) Bedrooms

Viewing sculptures and sitting at a table to eat would not be counted as activities that allowed access, so colonists would not, with access-only zones, be able to go into other colonists' bedrooms to view their sculptures/eat at their tables. They should be able to do so in their own designated bedrooms, though. An activity like cleaning, on the other hand, would be a reason for being there, and therefore allow the cleaner to have access to the room.

4) Prisoner rooms

For a similar reason to bedrooms - so colonists don't go in there to eat at tables or view art.

5) Bunkers

Sometimes colonists will walk through defensive bunkers rather than, for example, a base entrance. In the early part of my previous game, I built a 5x5 bunker with doors and sandbags in the outdoors between a couple of buildings a few dozen tiles apart. Instead of walking around the bunker through open space, the colonists would walk through it, climbing over sandbags and through two sets of doors to do so.

6) Corpse-dumping and other ugly areas

You'd want colonists hauling bodies to be able to go to such places, but if a colonist didn't need to be there, it would be better if they took an alternate route to their wherever their destination was.

7) Any time colonists take unrealistic routes

Pretty much any room type can feasibly have situations where colonists will walk through them, using them as thoroughfares, instead of using adjacent corridors, particularly when then these rooms have multiple entrances.

What are the thoughts of other Rimworlders? Can you think of any other areas where such a zone type might be useful? Would there be any potential drawbacks or unintended consequences?

Hans Lemurson

If a pawn could already tell whether it needed to go "through" some place or not when trying got get somewhere, then it wouldn't need to do any pathfinding.

What could be done is to be able to zone areas with a high virtual-pathfinding cost so that pawns wouldn't travel through such places unless it really was the much faster route.

(Also, I misread the title at first as "No Thought Zone", like you were asking for some sort of psi-proof bunker where you could send a pawn to be neither happy nor sad.)
Mental break: playing RimWorld
Hans Lemurson is hiding in his room playing computer games.
Final straw was: Overdue projects.

The Man with No Name

Quote from: Hans Lemurson on January 14, 2018, 04:08:44 PM
What could be done is to be able to zone areas with a high virtual-pathfinding cost so that pawns wouldn't travel through such places unless it really was the much faster route.

I'm not sure that would work every time. Take the freezer - if a colonist was on the opposite side of the freezer to the kitchen and wanted to grab a meal, it might technically be slightly quicker for them to walk through the freezer, although a player might prefer that they take the slightly longer route along the nice corridor, rather than unnecessarily opening the door to the freezer, and walking through a cold place full of ugly things.

Harry_Dicks

There is a mod out called PathAvoid and it let's you designate specific weighted values onto whatever cells you want to encourage pawns to take certain paths. I keep reading about how pathfinding all around is always an issue that can be worked on and improved upon, and it is also can be one of the biggest resource consumers especially for a lot of things going longs distances on dynamic maps with lots of stuff constantly changing that they are constantly having the recalculate huge operations and can slow down performance significantly. That's why there is never any full working 100% solution that everyone is satisfied with. There are really dozens and dozens of different algorithms that you can apply for different types of pathfinding, all of them with different pros and cons. You have some that might be really snappy but give you some bullshit sometimes where a pawn won't even walk in a straight line over say a 40-60 clear path point to point movement. Some people would prefer to do a very solid but processor intensive operation that doesn't have as many weird paths but this will affect performance so much that people with lower end systems will be screwed once they even get a mid size colony going. You have to draw the line somewhere, and try to please as many people as possible with what you have to work with.

The Man with No Name

Quote from: Harry_Dicks on January 14, 2018, 06:19:38 PM
There is a mod out called PathAvoid and it let's you designate specific weighted values onto whatever cells you want to encourage pawns to take certain paths. I keep reading about how pathfinding all around is always an issue that can be worked on and improved upon, and it is also can be one of the biggest resource consumers especially for a lot of things going longs distances on dynamic maps with lots of stuff constantly changing that they are constantly having the recalculate huge operations and can slow down performance significantly. That's why there is never any full working 100% solution that everyone is satisfied with. There are really dozens and dozens of different algorithms that you can apply for different types of pathfinding, all of them with different pros and cons. You have some that might be really snappy but give you some bullshit sometimes where a pawn won't even walk in a straight line over say a 40-60 clear path point to point movement. Some people would prefer to do a very solid but processor intensive operation that doesn't have as many weird paths but this will affect performance so much that people with lower end systems will be screwed once they even get a mid size colony going. You have to draw the line somewhere, and try to please as many people as possible with what you have to work with.

Thanks, I'll have a look at the mod.

Would the "no through" zone I suggested work much differently or be more taxing than the current Allowed Area zoning function, though? I think it would work the same, but with the addition of a bit of pre-logic relating to what action the colonist was about to take, and whether that action would allow it access to the zone.

Calahan

Moving this to suggestions (as that seems to me to be what it is).

Plus as Harry_Dicks mentioned, there is a mod available that adds a very similar feature to the game as the one suggested in the OP (meaning this thread is basically requesting that similar/same features be added to the vanilla game, making it even more of a suggestion).

Yoshida Keiji

+1

It is always annoying to see the Nudist characters walk through the freezer and complain that it is cold, when there's a clear path that isn't low temperature.


The "No Path" Zone would also benefit bases that are not Square shaped but look like a "U" or "L". So that colonists don't expose themselves in odd situations. The selection to "HOME" setting is inefficient every time a player builds something nearby and the zone gets auto-extended, which doesn't solve "SAFE" pathing due to the lack of a "No Path" Zone.

Also, I hated it when people come up with "-There is a mod for that-". Unless it is a Mod request, it is clear we are asking more features for Vanilla, so don't de-rail the thread.

Hans Lemurson

There is no point in trying to convince people that this is a good idea.  Nobody can possibly disagree on whether this would be useful or not.

The problem is that it is a technical challenge and can only be achieved by slowing down the game's calculations.  The pawns in the game already walk with a weird wiggle because the devs decided to use a faster but imperfect pathfinding algorithm.  Good FPS and good Pathfinding are mutually exclusive.

If there is a simple algorithm that can handle "Don't path through this zone unless your source and/or destination are within it." without slowing down a bunch, then I'd be happy to see it in action.
Mental break: playing RimWorld
Hans Lemurson is hiding in his room playing computer games.
Final straw was: Overdue projects.

CannibarRechter

> If there is a simple algorithm that can handle "Don't path through this zone unless your source and/or destination are within it." without slowing down a bunch, then I'd be happy to see it in action.

What you'd do is first test to see if the destination is in the zone. That's a low complexity order operation, a simple containment test. If the test fails, you treat the zone like a wall. You would only perform this calculation for colonists (because hostiles and animals would ignore the zone).

I think you are overstating the difficulty, here.

Also, Path Avoid won't really do what is described here. It's bad at this sort of thing, particularly if the distance between A and B is far.
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

jamaicancastle

Quote from: CannibarRechter on January 15, 2018, 07:24:12 AM
What you'd do is first test to see if the destination is in the zone. That's a low complexity order operation, a simple containment test. If the test fails, you treat the zone like a wall.
It's not quite that simple, because of how the pathfinding treats walls in the first place. Walls (and other impassable objects/terrains) split the map into regions that are cached and only updated when needed. The pathfinder can quickly walk through regions because all the data it needs is already generated for it; I suspect having to check whether a region is "allowed" would slow it down greatly.

You could have it store multiple region caches ("this is the list of adjacent regions" "this is the list of adjacent regions, ignoring ones in Area A"); that should run just as fast, because the toil or whatever that called the pathfinder would just tell it which one to use, but I have no idea how it would impact overhead.

Harry_Dicks

I try to build my workshops within my mountain bases like the picture attached. I use path avoid to make the whole workshop have a huge weight (with Path Avoid) on any pawns path trying to go into it, so hopefully they are only going in there to do work within in it. The idea is to contain pawns' movement within certain areas so they aren't cutting across and going through areas I don't want them to. But, I have seen clips where on very long distance pathfinding, it's like Path Avoid doesn't even really matter. I suppose it's like this because of the distance being so great, that the calculation would just be way too big or take too long for the pawn to be able to figure the (obvious to us) most efficient path in the time given.


patoka

nice idea, but if it is difficult to implement, only good for large sized bases and cpu heavy it might not be the most important improvement to the game.
it might be because i grew up playing games that are well known to have very low artificial intelligence and path finding and so on (age of empires and command and conquer)

one thing i and some others MIGHT appreciate though is having an option to turn on fast pathfinding or slow (but better) pathfinding. at least in the beginning people will be more efficient, then, when their base gets larger, they can still turn it off and play with the current pathfinding algorithm.
(as a sidenote i do play on an older low end laptop and do very much appreciate the efficiency of rimworld and the decisions tynan did to make it the way it is right now)
all that said, maybe add an option to recalculate paths if they are wavy (in a bad way. i know there are good/efficient wave patterns and others arent) if you paused the game and press a button on a pawn that you think could walk quicker.
surely you dont need to rebutcher corpses that you already half butchered if you leave the table to smoke a joint real quick?

Harry_Dicks

Quote from: patoka on January 27, 2018, 06:17:00 AM
one thing i and some others MIGHT appreciate though is having an option to turn on fast pathfinding or slow (but better) pathfinding. at least in the beginning people will be more efficient, then, when their base gets larger, they can still turn it off and play with the current pathfinding algorithm.
(as a sidenote i do play on an older low end laptop and do very much appreciate the efficiency of rimworld and the decisions tynan did to make it the way it is right now)
all that said, maybe add an option to recalculate paths if they are wavy (in a bad way. i know there are good/efficient wave patterns and others arent) if you paused the game and press a button on a pawn that you think could walk quicker.

I think this is actually a great idea.

Hypothetically, how hard would it be, to have an option with maybe at least 3 different settings to choose from. They would be different "flavored" pathfinding algorithms to choose from. Ranging from low CPU use, snappy, but crappy pathfinding to heavy CPU use, slower, but very efficient (walking time) pathfinding.

Can things like that be changed on the fly? Isn't that called runtime or something? ::) I'm just being silly about that part and it doesn't matter much whether I know it or not, but my main question still stands.

Also, I think it would be great because a lot of us in early game might be able to afford to have the heavy CPU pathfinding, but once our bases get so big late game we are willing to turn it down to save in some performance.

I'm always down for more options for the player if they want them, I think this would add so much value to the game if it is built into the base game, rather than having to rely on a mod that might work just sometimes if there even were one. Plus you would only ever get the modifications that the mod author has applied to fit their balance view, and nothing you can ever change to suit your own needs. I think that would be a nice idea for a mod, though, that would probably take a genius to make. A mod that would allow you to choose from multiple different algorithms, and options to modify whatever different aspects of pathfinding you can modify. A boy can dream, can't he?