Searching for the definitive guide on how to build platforms / ladders that allow NPCs to go up and down without problems

ul1sses

Terrarian
Usually they only go up, but never go down. Is this intended?

I know, why do i care if NPCs can teleport to their homes?
Well, apparently NPCs are able to "socialize" and this gives more life to the houses / villages. But this only works on horizontal constructions.
I would like to make them walk freely and "socialize" on vertical buildings too.

(Sorry for my English)
 
Last edited:
You can make Stairs out of Platforms. Place them in a diagonal pattern, then use the hammer to shape them this way. The NPCs will happily go up and down Stairs. :)

Here is a tutorial on how to do it with a hammer:

You can also try to do it by placing your cursor just right and holding down the placement button for the platform, to do it faster, but it's difficult to do correctly and can get very messy.
 
I'm assuming OP's problem is not how to make stairs, but how to get town NPCs be able to move up and down on them?

My obsevation is, that town NPCs try to walk up stairs, but they will fall off from them if it's a 5-6 or more blocks high, and has no blocks under the platform. So, with a standard 6 blocks tall room, and a stair with no blocks under it, the NPC will never go up the 2nd floor.

Capture 2020-01-06 14_56_38.png


For instence, the tavernkeep and the demolitionist will never go up the 2nd floor here.
NPCs also never go down stairs like this for some reason, so, the musician and the picklock will never end up in the floor below. That's just how their AI is, I guess.

However, in case there are solid blocks under the stairs...

Capture 2019-01-26 00_06_26.png


I built this as part of a large test town, and I tried to implement something here that NPCs seem to do, regarding stairs and their AI.

the people on the ground floor (blacksmith & grome swordsmith) aren't able to get to the floor above. however the young brewer will go upstairs. the stairs on the 2nd floor have solid blocks under, which prevents the town NPC to jump off the stairs, and they will continue to go up, ending up on the next floor. Because they can't go down the stairs normally, this means they will spend the rest of the day there (which was my intentions here with this test, so the young brewer would be with his parents.)
At 7:30 PM, every NPCs try to return to their assigned house, and when they're returning home, they can fall though/jump off platforms, so he'll return there for the night.
(I don't remember but maybe the demolitionist can go up the stairs to the building too. I don't remember if it's low enough for that, or not.)

(So, while NPCs don't normally come down stairs, they actually do that when reassigned to a new place too. they will try to pathfind the shortest way to their new home and will jump off the closest platform, if their house is below. unfortunatelly... they don't seems to mind whether that actually will allow them to reach their new home... they will just jump off the closes platform regardless there that leads, so they will often end up stuck, or even worse, mindlessly jump into a lava trap because they thought that is the shortest way to their new home... well... I dunno...)

This is what I figured out. But I don't know how to make them walk down stairs when there are platforms as floor which they normally don't fall though. It could be interesting if they could do that to move around and be able to socialise more with their neighbors downstairs, or that NPCs who live upstairs could leave the house too to go around for a walk, much like how their downstairs neighbor does. (but, to do this, they probably would need a smarter AI, to not get lost, or end up jumping into lava traps and lakes...
 
Sora_92, on MY world though, they freely walk up and down long stairs with no solid blocks underneath just fine. (I'd provide a screenshot but I'm really busy and have moved a lot of my NPCs to other biomes so I currently can't capture it for you.)

The thing is, on my particular build, the stairs go straight to a solid floor, and there's no platform for them to go through on the way up or down. So maybe having a floorplan not involving a platform on top of the stairs, but a plain opening instead, may help?

Or, looking at your images... what if your issue is head-clearance? In the examples you list of the NPCs NOT going up the stairs and/or falling through, it looks like the ceiling (the floor above) may be preventing them from ascending or descending. Maybe their hit-boxes do something odd when on diagonal surfaces (taking up more room than they do visually)? As you can see there, the only staircase you listed with an NPC that'll ascend, is the one with no solid ceiling jutting halfway into the stairway's clearance.

NPCs' hit-boxes are different from that of the player. For example, water you can stand in without drowning may still drown NPCs. There may be other differences as well.

If you want to test both of these theories, all you'd have to do is temporarily 1) get rid of the platform over the staircases, to see if NPCs may go down them... and 2) remove several blocks from the floor over the stairwell to give those pixelly heads more room, and see if they may climb up further and/or stop falling through.

(A third consideration may be that, in the case of your blacksmith and swordsmith, the stairway leads to a door, so they may not see that as a valid floor to target for their walking path? Less likely, but I figured I'd bring it up anyway)
 
@ZaCloud That's actually very interesting!

Now that you say, I do think NPCs move up stairs if there's no platform floor above. Don't know if it's due to their hitbox colliding with a "ceiling", they normally can go through platforms - howeven they don't seem to descend through them, except when going to their assigned place, so, maybe their AI is coded in a way, to prevent them from going upstairs normally, where they would stuck there for the rest of the day.

Doors don't bother them though I think.
Also, yes, I know they can drown in less water too. That's very annoying, IMO. especially now that they seem to walk into water and then get stuck there or just loiter around long enough in the lake, to end up drowning.
 
I'm assuming OP's problem is not how to make stairs, but how to get town NPCs be able to move up and down on them?

My obsevation is, that town NPCs try to walk up stairs, but they will fall off from them if it's a 5-6 or more blocks high, and has no blocks under the platform. So, with a standard 6 blocks tall room, and a stair with no blocks under it, the NPC will never go up the 2nd floor.

View attachment 277071

For instence, the tavernkeep and the demolitionist will never go up the 2nd floor here.
NPCs also never go down stairs like this for some reason, so, the musician and the picklock will never end up in the floor below. That's just how their AI is, I guess.

However, in case there are solid blocks under the stairs...

View attachment 277072

I built this as part of a large test town, and I tried to implement something here that NPCs seem to do, regarding stairs and their AI.

the people on the ground floor (blacksmith & grome swordsmith) aren't able to get to the floor above. however the young brewer will go upstairs. the stairs on the 2nd floor have solid blocks under, which prevents the town NPC to jump off the stairs, and they will continue to go up, ending up on the next floor. Because they can't go down the stairs normally, this means they will spend the rest of the day there (which was my intentions here with this test, so the young brewer would be with his parents.)
At 7:30 PM, every NPCs try to return to their assigned house, and when they're returning home, they can fall though/jump off platforms, so he'll return there for the night.
(I don't remember but maybe the demolitionist can go up the stairs to the building too. I don't remember if it's low enough for that, or not.)

(So, while NPCs don't normally come down stairs, they actually do that when reassigned to a new place too. they will try to pathfind the shortest way to their new home and will jump off the closest platform, if their house is below. unfortunatelly... they don't seems to mind whether that actually will allow them to reach their new home... they will just jump off the closes platform regardless there that leads, so they will often end up stuck, or even worse, mindlessly jump into a lava trap because they thought that is the shortest way to their new home... well... I dunno...)

This is what I figured out. But I don't know how to make them walk down stairs when there are platforms as floor which they normally don't fall though. It could be interesting if they could do that to move around and be able to socialise more with their neighbors downstairs, or that NPCs who live upstairs could leave the house too to go around for a walk, much like how their downstairs neighbor does. (but, to do this, they probably would need a smarter AI, to not get lost, or end up jumping into lava traps and lakes...

So I discovered that NPC’s will go down steps if they are full block steps. I think they might even sometimes go down steps if the tops several are full blocks and the few bottom stepped platforms, but I’m not positive yet. Trying to better understand this; saw some atypical downward movement in my NPCs this past week with some different building setups
 
I'm necroing this thread because I did some testing myself and I think I figured something out: NPCs will headbonk on a platform and drop while climbing up stairs if the platform they bonk on is higher than the roof of their house. Otherwise, they'll keep climbing. So if you want an NPC to climb upstairs during the day and pass through a platform on the way, make sure that platform is lower than the roof of their house. Still testing, but I think this is how it works.
 
Back
Top Bottom