Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: A few questions about collision  (Read 724 times)

EspritFort

  • Bay Watcher
    • View Profile
A few questions about collision
« on: September 03, 2010, 03:55:55 pm »

1. Is all furniture collision-free, i.e. can I build it anywhere without obstructing movement?

2. Is there any kind of inter-dwarf-collision or movement-penalty? I.e. do 100 dwarfs running in opposite directions cross a 2 tile wide corridor faster than a 1 tile wide one?
Logged

SpuneDagr

  • Bay Watcher
    • View Profile
Re: A few questions about collision
« Reply #1 on: September 03, 2010, 04:18:17 pm »

1. Some furniture is collision-free. Beds and cabinets do not restrict movement, but statues do.

2. Yes, but not for the reason you think. Your ENTIRE GAME will move slower if you have many dwarves trying to get through a 1-tile wide corridor. The pathfinding calculations for each dwarf will bring the game to a crawl.
« Last Edit: September 03, 2010, 04:19:52 pm by SpuneDagr »
Logged

Proteus

  • Bay Watcher
    • View Profile
Re: A few questions about collision
« Reply #2 on: September 03, 2010, 04:25:13 pm »

Regarding 2:
Well, if 2 dwarves moving into opposite directions meet in a narrow corridor,
one of them drops to ground, so that the other one can climb above him...
thatīs probably what SpuneDagr observes as slowing down of the computer,
as in a crowded narrow corridor with many dwarves, multiple calculations have to be done,
about which dwarf drops to ground and which one is allowed to pass.
Aside from slowing down your computer, it, of course, also slows down the movement speed of the dwarves ;)
Logged

EspritFort

  • Bay Watcher
    • View Profile
Re: A few questions about collision
« Reply #3 on: September 03, 2010, 04:40:51 pm »

The same applies to stairs, I suppose? Because until now I never understood why people would build multi-tile stairways instead of a simple 1x1 stair.
Logged

Shoku

  • Bay Watcher
    • View Profile
Re: A few questions about collision
« Reply #4 on: September 03, 2010, 04:53:21 pm »

In wider hallways there is still considerable slowdown from dwarves walking around each other. Unless you have super heavy traffic a 3 wide hallway is wide enough for a dwarf to move diagonally and out of the way of another dwarf without getting in the way of a new one but even so they've got to recalculate their path to do this. Multiple that by a constantly flow of dwarves going the opposite direction and this means the one poor sap will be trying to figure out how to get where he's going dozens of times before he gets through a long hall.

If for some reason you find your dwarves getting out of the way so often that they get in the way of dwarves that were getting out of the way you'd want a 4 wide hallway, and perhaps a translator, but there is some advantage to a five wide hallway: you can make everyone walk to the right.

This takes a strange configuration-
█______..._______█
__██___..._██____
█__██__...__██__█
____██_...___██__
█______..._______█
You also need to designate some high traffic spaces to get them to actually use this appropriately but if all works out well they will zip along without any traffic headed the other way.

However, depending on fort layout it may be easier to just make use of the one way ramp glitch.
*place a constructed floor over a ramp then remove it. Ramp goes up but not down.

Edit: Yup, same applies to stairs. I go to the trouble of alternating ups and downs so they don't all try to go through the same corner tile every time.
Well, that's sort of a lie, I avoid central shafts altogether because of how pathing works. They have to look in every square until they find a way to get to their target. This means that while they look up one floor they are also looking sideways on the floor before it. As such the space they are looking expands in three dimensions instead of just the normal two. A lot of people strongly disagree with me about this making the game run faster because they want to think that shorter distances automatically means less work for the computer but ultimately it depends on how compact your fort is. If you've got so much stuff on one level that a dwarf never needed to leave it you'd be better off just having stairs at the edges with a zig zag path up but if you only have single rooms right next to a 3x3 stair-shaft then it is almost definitely faster.
« Last Edit: September 03, 2010, 05:02:06 pm by Shoku »
Logged
Please get involved with my making worlds thread.

EspritFort

  • Bay Watcher
    • View Profile
Re: A few questions about collision
« Reply #5 on: September 03, 2010, 05:10:00 pm »

Thanks a lot.
Logged

Shoku

  • Bay Watcher
    • View Profile
Re: A few questions about collision
« Reply #6 on: September 03, 2010, 05:51:02 pm »

There's something else worth noting about collisions though- the re-pathfind they do is simpler than the normal one, in an attempt to make this not quite so much of a problem.

If they have to decide how to go around someone they ignore things like high/low traffic areas and that sort of thing. This means some danger if you did things like making a restricted path full of dangerous doom (invaders also ignore traffic designations,) and having a side entrance that your dwarves really use.

It is however, useful for training swimming. Normally you have to make a pool with some 3/7 and 4/7 deep water to get them to go through it, as 4/7 is needed for training but they know they can't walk in that. They only do it in the first place because what they thought was 3/7 suddenly becomes 4/7. Having a 1 wide path for them to patrol back and forth through with the water an alternative way to get there means you can make many dwarves swim around so long as just a couple are blocking up the dry route.
Logged
Please get involved with my making worlds thread.

EspritFort

  • Bay Watcher
    • View Profile
Re: A few questions about collision
« Reply #7 on: September 03, 2010, 06:01:46 pm »

If they have to decide how to go around someone they ignore things like high/low traffic areas and that sort of thing. This means some danger if you did things like making a restricted path full of dangerous doom (invaders also ignore traffic designations,) and having a side entrance that your dwarves really use.

I noticed this when I tried to prevent the spread of a blood smear in a heavily used corridor with traffic areas. It spread anyway :(
Logged

Shoku

  • Bay Watcher
    • View Profile
Re: A few questions about collision
« Reply #8 on: September 04, 2010, 12:15:56 pm »

If you make them walk over grates I'm pretty sure the smears won't pass. Not sure if you need to channel out the floors under them or not.
Logged
Please get involved with my making worlds thread.

Gearheart

  • Bay Watcher
    • View Profile
Re: A few questions about collision
« Reply #9 on: September 04, 2010, 12:18:29 pm »

It's a good idea to always make main corridors and stairways 4 tiles wide.
Logged

Proteus

  • Bay Watcher
    • View Profile
Re: A few questions about collision
« Reply #10 on: September 04, 2010, 12:52:31 pm »

If you make them walk over grates I'm pretty sure the smears won't pass. Not sure if you need to channel out the floors under them or not.

Yep, most of the time I use grates therefore at the entrance of my well rooms and farms (with channeled out floors).
Unfortunately a lot of blood comes from my main enrance...
as soon as my dwarves walk over the passageway leading to my main entrance, they wade knee deep in beak dog, goblin and troll blood, thanks to the huge masses of beak dog, troll and goblin corpses (and skeletons) that litter this area (remains from the past goblin sieges...most of them slain by the traps that are located at said passageway)
« Last Edit: September 04, 2010, 12:59:55 pm by Proteus »
Logged

Shoku

  • Bay Watcher
    • View Profile
Re: A few questions about collision
« Reply #11 on: September 04, 2010, 01:41:47 pm »

I haven't tried washing smears away so I don't have any idea if that works or not.
Logged
Please get involved with my making worlds thread.

Sphalerite

  • Bay Watcher
    • View Profile
    • Drew's Robots and stuff
Re: A few questions about collision
« Reply #12 on: September 04, 2010, 01:52:41 pm »

If you make them walk over grates I'm pretty sure the smears won't pass. Not sure if you need to channel out the floors under them or not.
This is no longer the case.  Smears/spatter/pools of blood act like objects, and will sit on a grate without falling through just like any other object.  They will also be deposited on grates just as they will n floors.

I haven't tried washing smears away so I don't have any idea if that works or not.
It works, sort of.  Moving water will push pools of blood just like it will every other object.  The problem is that this doesn't destroy the blood, just moves it around, and if the water exits through a grate the blood will just pile up on the grate without going through.  It also appears that blood can be multiplied this way, if water carrying blood spreads out from one tile into multiple it seems the blood will end up in every destination tile, so water pouring down on a patch of blood from above will spread out and create a much larger area of blood-contaminated tiles.
Logged
Any intelligent fool can make things bigger and more complex... It takes a touch of genius --- and a lot of courage to move in the opposite direction.

Shoku

  • Bay Watcher
    • View Profile
Re: A few questions about collision
« Reply #13 on: September 04, 2010, 06:07:56 pm »

A: I said the one way ramp thing wrong. You build a ramp under a constructed floor tile then remove the floor.

B: Pushing blood with water still works fine then. You just have to hook the grates to a lever and dump the blood down to some gate flooding cistern or maybe even another set of grates that are out of the way in the hopes that somebody will go clean it.

I'm pretty sure that pumps won't move blood-objects around so you'll always be cleaning your auto-wash hall with untainted water at least. I doubt it's worth the effort though.
Logged
Please get involved with my making worlds thread.