Logical road barricades

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

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?

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 :slight_smile:

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.

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

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.

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.

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