# Logical road barricades

**URL:** <https://discourse.cataclysmdda.org/t/logical-road-barricades/9097>\
**Category:** The Bunker\
**Created:** [March 9, 2015, 7:31am UTC](https://discourse.cataclysmdda.org/t/logical-road-barricades/9097 "2015-03-09T07:31:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Valiant](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/valiant/32/4788_2.png) [@Valiant](https://discourse.cataclysmdda.org/u/Valiant)\
**Post date:** [March 9, 2015, 7:31am UTC](https://discourse.cataclysmdda.org/t/logical-road-barricades/9097/1 "2015-03-09T07:31:44Z")

</div>

Is there a way to detect road direction when placing road barricades, so they will not be placed like this?

 ![](http://i.imgur.com/vyAhhXr.png)

---

<div class="post-metadata">

**Author:** ![Zero](https://avatars.discourse-cdn.com/v4/letter/z/a88e57/32.png) [@Zero](https://discourse.cataclysmdda.org/u/Zero)\
**Post date:** [March 9, 2015, 2:53pm UTC](https://discourse.cataclysmdda.org/t/logical-road-barricades/9097/2 "2015-03-09T14:53:09Z")

</div>

Maybe those barricades were set up to expedite evacuation? Cars can pass, cops and national guard can prevent enemies and civilians on the side from overrunning the road?

---

<div class="post-metadata">

**Author:** ![Valiant](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/valiant/32/4788_2.png) [@Valiant](https://discourse.cataclysmdda.org/u/Valiant)\
**Post date:** [March 9, 2015, 3:06pm UTC](https://discourse.cataclysmdda.org/t/logical-road-barricades/9097/3 "2015-03-09T15:06:19Z")

</div>

I’ve seen barricades that looked something like this:

Building |c . c| Building  
Building |a . a| Building  
Building |r . r| Building

where “|” is the barricade. Don’t know who or what they wanted to stop 🙂

---

<div class="post-metadata">

**Author:** ![KA101](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@KA101](https://discourse.cataclysmdda.org/u/KA101)\
**Post date:** [March 10, 2015, 12:40am UTC](https://discourse.cataclysmdda.org/t/logical-road-barricades/9097/4 "2015-03-10T00:40:44Z")

</div>

Barricade author here, and not without calling functions normally used in overmap-generation, so I don’t know how cost-effective they’d be. So perhaps the barricades were moved aside, perhaps the cars were parked on the roadside, etc. Was aiming for a reusable layout there.

---

<div class="post-metadata">

**Author:** ![saltmummy626](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/saltmummy626/32/300_2.png) [@saltmummy626](https://discourse.cataclysmdda.org/u/saltmummy626)\
**Post date:** [March 10, 2015, 1:00am UTC](https://discourse.cataclysmdda.org/t/logical-road-barricades/9097/5 "2015-03-10T01:00:07Z")

</div>

I always assumed the cars were the blocking portion of the blockade and the barricades where just there to call attention to it.

---

<div class="post-metadata">

**Author:** ![Coolthulhu](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/coolthulhu/32/2446_2.png) [@Coolthulhu](https://discourse.cataclysmdda.org/u/Coolthulhu)\
**Post date:** [March 10, 2015, 2:35am UTC](https://discourse.cataclysmdda.org/t/logical-road-barricades/9097/6 "2015-03-10T02:35:34Z")

</div>

> [@KA101](#):
>
> Barricade author here, and not without calling functions normally used in overmap-generation, so I don’t know how cost-effective they’d be.

Hacky solution would be like 15 (not including compilation time) minutes of work - just re-get the neighbors and check if the road is N-S or W-E and then alter the numbers if it’s N-S.

A more proper solution would be moving mapgendata construction from map::draw\_map to map::generate and then passing it (the mapgendata) both to ::draw\_map and to ::add\_extras. Then doing the above check for N-S.  
This would be like 30 minutes of work, but would also help with ::draw\_map having like 12 parameters and make it possible to easily add more advanced (location-dependent) extras.

---

<div class="post-metadata">

**Author:** ![KA101](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@KA101](https://discourse.cataclysmdda.org/u/KA101)\
**Post date:** [March 10, 2015, 5:28am UTC](https://discourse.cataclysmdda.org/t/logical-road-barricades/9097/7 "2015-03-10T05:28:06Z")

</div>

> [@Coolthulhu](#):
>
> [quote=“KA101, post:4, topic:9097”]Barricade author here, and not without calling functions normally used in overmap-generation, so I don’t know how cost-effective they’d be.

Hacky solution would be like 15 (not including compilation time) minutes of work - just re-get the neighbors and check if the road is N-S or W-E and then alter the numbers if it’s N-S.

A more proper solution would be moving mapgendata construction from map::draw\_map to map::generate and then passing it (the mapgendata) both to ::draw\_map and to ::add\_extras. Then doing the above check for N-S.  
This would be like 30 minutes of work, but would also help with ::draw\_map having like 12 parameters and make it possible to easily add more advanced (location-dependent) extras.[/quote]

I originally considered the hacky solution but rejected it as I wasn’t sure how much processing-time it’d take to call those functions for a map\_special (which are randomly generated during play, not during mapgen). I have lagbursts when pileups spawn, FWIW, so that sort of thing tends to make me twitchy.

---

<div class="post-metadata">

**Author:** ![Chaia](https://avatars.discourse-cdn.com/v4/letter/c/a88e4f/32.png) [@Chaia](https://discourse.cataclysmdda.org/u/Chaia)\
**Post date:** [March 12, 2015, 3:22pm UTC](https://discourse.cataclysmdda.org/t/logical-road-barricades/9097/8 "2015-03-12T15:22:50Z")

</div>

Why not make two barrier entries for construction, one N-S and another E-W? Or let one entry for road barrier, but ask in a pop-up in which direction it should be placed
