Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traffic Lights not working sometimes feature #1499

Open
t1a2l opened this issue Mar 28, 2022 · 18 comments
Open

Traffic Lights not working sometimes feature #1499

t1a2l opened this issue Mar 28, 2022 · 18 comments
Labels
feature A new distinct feature TRAFFIC LIGHTS Feature: Traffic lights - toggle, timed, etc

Comments

@t1a2l
Copy link

t1a2l commented Mar 28, 2022

Describe your idea

  • Traffic lights stops working randomly (maybe affect by lightning or no electricity in the area).
  • cars and peds will act as if there are no traffic lights.
  • the user can setup yield and stop signs via a new mode.
  • police can be dispatched to manage the traffic instead of traffic lights:
  1. a police car will drive to the junction and park there.
  2. police officer will spawn in the middle of the junction.
  3. traffic lights will work in the background but when clicking on the junction yellow lights or no lights appear.
  • if no police service or until one gets to the junction, vehicles will yield and stop according to setup (if there is a setup).
  • a service maintiance vehicle will be spawned to the location.
  • service vehicle arrive at scene.
  • (maybe) a bar appear for fixing time.
  • traffic lights fixed. traffic returns to normall working order.

Screenshots?

image
image

Why

  • Adds realism
  • User deals with issues he cant control
  • Maybe a better traffic lights policy (high maintances for traffic lights - will break less).
  • Can open up an API for other traffic issues
  • Can be a seperate mod that depends on TMPE to work.
@t1a2l t1a2l added feature A new distinct feature triage Awaiting issue categorisation labels Mar 28, 2022
@Elesbaan70
Copy link
Contributor

I think the basic implementation strategy would be to keep the traffic light flags set on the roads so that the props are still visible, but then make the traffic AI think all segment ends have stop signs instead. Then it behaves like a four-way stop until fixed.

Or just make the AI think there are neither lights nor signs. This might create a situation more realistic to how idiot drivers handle this in real life. 🤪

What's the word for the flashing icon over a location in the city to indicate a problem there? One of those would need to appear over the node.

@t1a2l
Copy link
Author

t1a2l commented Mar 28, 2022

I agree, that should be the basic. the police thing is just for extra realisem. We can just add a TMPE service that dispatch vehicles to traffic lights. Or make it a feature that require the DLC.

@originalfoo originalfoo added TRAFFIC LIGHTS Feature: Traffic lights - toggle, timed, etc and removed triage Awaiting issue categorisation labels Mar 28, 2022
@originalfoo
Copy link
Member

Tagging #305 , #980 , #1039

@originalfoo
Copy link
Member

originalfoo commented Mar 28, 2022

Traffic lights stops working randomly

What about making the chance of broken lights inversely proportional to road budget slider:
image

High budget = less chance of lights breaking. Low budget = lights break more often. If user has Snowfall DLC, we could factor in road maintenance too, maybe?

As mentioned in #305 power cuts could cause broken traffic lights.

Or just make the AI think there are neither lights nor signs.

+1 ...although with some stuff that kryzchu is doing in #1229 that might result in traffic that's a bit too well behaved.

What's the word for the flashing icon over a location in the city to indicate a problem there? One of those would need to appear over the node.

Notification? Alert? ...what would user be expected to do upon discovering broken lights? Have lights fixed by a visiting road maintenance truck? If no Snowfall DLC, just have random time until lights automagically fix themselves?

@t1a2l
Copy link
Author

t1a2l commented Mar 28, 2022

Couple of options:
A. require the snow fall dlc for this feature to work.
B. if you have snowfall dlc - road maintenance will be used, otherwise the issue will be gone after a while.
C. New TMPE service "traffic lights maintenance depot" - fix traffic lights porblems.

@Elesbaan70
Copy link
Contributor

What about having traffic lights fail without power as the initial, vanilla implementation of this feature, then adding other triggers later? The nice thing about this approach is that it works in vanilla, and the mechanisms are already in the game for this problem to occur and to be resolved.

@t1a2l
Copy link
Author

t1a2l commented Mar 28, 2022

ok lets try it, traffic lights will need electricity to work. (checkbox to enable it ofcourse).

@Elesbaan70
Copy link
Contributor

I think we're on the right track with this approach, but there are still questions that have to be answered. How is power delivery done? Currently stoplights will work without any intentional delivery of power. Do we require power lines or powered buildings nearby?

Maybe we just assume that the stoplights have power because the roads obviously have power to light the streetlights. But even then, the power failures apply to sections of the city, and power delivery via roads, even for the limited case of stoplights, would have to be accounted for and incorporated into that algorithm.

I have a feeling requiring nearby power lines or powered buildings will end up being the most straightforward solution, but that's a fairly significant change to the gameplay. Of course this will need to be behind a feature toggle that defaults to disabled.

@originalfoo
Copy link
Member

If you want to see how the game does electricity coverage, check Quistar's Extended Managers Library (EML) source code as he was working on an 81 Tiles version of it prior to going AWOL. It's not just a simple case of "are there buildings / powerlines nearby" - the game seems to be able to do regional power brownouts if memory serves.

FYI I was thinking of adding a "Traffic Lights" group on the polices tab to group several existing traffic light related mod options so could possibly place new options there too? I've still got a bunch of work queued up regarding mod options (delayed due to illness IRL) that I need to resume at some point.

@Elesbaan70
Copy link
Contributor

the game seems to be able to do regional power brownouts if memory serves.

The whole point of this approach is for traffic lights to be impacted by those brownouts, by destroyed power lines, etc. That was my point. If we require a power connection for traffic lights as it is required for buildings, we should get that behavior for free if we do it right. If we try to implement this feature without adding the requirement that traffic lights be connected to power like buildings, we would have to figure out how to track when brownouts or power loss occur, and make traffic lights in the vicinity be impacted.

@originalfoo
Copy link
Member

Ah, sorry, I misread and thought you were thinking of scanning for nearby buildings and checking their powered status.

Yeah, if we can hook traffic lights in to same stuff the game does with buildings that would be great.

@Elesbaan70
Copy link
Contributor

Requiring traffic lights to be powered like buildings is weird, though. Would we require those high-voltage power lines to run alongside roads that aren't developed? Is there an existing mod or assets that provide lower-capacity power lines that are smaller and cheaper?

@t1a2l
Copy link
Author

t1a2l commented Mar 29, 2022

Traffic lights can have two main issues:

  1. No lights at all - electricty issue (usually means no electricty in the buildings around).
  2. Yellow blinking light - problem with the light controller, michrochip failure etc.

@originalfoo
Copy link
Member

Requiring traffic lights to be powered like buildings is weird, though. Would we require those high-voltage power lines to run alongside roads that aren't developed? Is there an existing mod or assets that provide lower-capacity power lines that are smaller and cheaper?

EML beta (see Update: 23 Jan changelog) mod apparently has some code for powered roads, and there's also Electric Roads mod by Klyte (apparently it causes in-game lag though).

However, that being said, how often are there going to be traffic lights at a junction in an area that's not built up? There are plenty of rural powerline assets, underground electricity, etc., that can be used if necessary. As long as feature is disabled by default it doesn't matter; users who enable the feature are committing to ensuring electricity reaches their traffic lights.

@t1a2l
Copy link
Author

t1a2l commented Mar 29, 2022

maybe we can do lighting strike cause no power.

@BuiIdTheBuilder
Copy link

BuiIdTheBuilder commented Apr 2, 2022

Maybe also integrate this with Real Time mod, so that lights can be turned off at certain times of day, and priority signs used instead? This would greatly reduce delay at many of my intersections. Also I don't think we need a new road maintenance depot for this, the existing one can be used for it.

@Elesbaan70
Copy link
Contributor

Elesbaan70 commented Apr 2, 2022

Maybe also integrate this with Real Time mod, so that lights can be turned off at certain times of day, and priority signs used instead?

It's a cool idea, but I think it's a different feature. TMPE's part in this would be an API with (1) a switch another mod can use to globally enable setting up both priority signs and traffic lights on a single intersection, and (2) another switch that such a mod would use to determine which one controls traffic at an intersection. I think Adaptive Networks would also need to change how it does the flags, to avoid showing traffic lights and priority signs on the same intersection.

I suppose a case could be made for fully implementing the feature in TMPE, independently of Real Time. But vanilla and TMPE traffic don't vary enough between day and night for this to really be usable. (Is Real Time compatible with TMPE anyway? I've never used it.)

@originalfoo
Copy link
Member

#980 tracks feature for time-of-day traffic lights

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new distinct feature TRAFFIC LIGHTS Feature: Traffic lights - toggle, timed, etc
Projects
None yet
Development

No branches or pull requests

4 participants