-
Notifications
You must be signed in to change notification settings - Fork 85
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
default Timed traffic light #554
default Timed traffic light #554
Conversation
per lane type traffic light, separate lanes multi segment intersection, different road directions oneway roads introduce a problem: two sides are green rather than one/
Todo:Optimization and translations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The keys to translation strings are too long, too detailed and contain extra spaces and typos.
Make the string keys shorter and move the text into Crowdin English and English UK variants.
Does the code verify that when a Timed TL is created, the directions are actually possible? By checking the lane connectors, lane arrows? |
I call the LaneArrowManger.SeparateLanes() to setup turning lanes. This function does nothing on the segments that have the lane connector. If you try it, you will see that it works just fine. I did actually thought this through. If one puts a green light toward a direction that cannot be used: Note that at each step I give a green light to one of the connected road segments to go to all directions. So no change of logic is needed if lane connector is used. |
put better tooltip keys.
Updated strings from Crowdin. |
I added wiki documentation here: |
Been slightly confused. Is 554 (this) and 540 are the same problem but one is the issue and another is the pull request? Please add "Fixes #540" in the description, so when this is merged, the other one will be closed too. |
Was wondering about a way to make this algorithm testable |
do you mean as part of this PR or another one? |
This is just the first phase. There are more features discussed for example in #540 (comment)
Do you think we should continue working on those in the same issue (#540) or should I create a new issue? EDIT: tagging @aubergine10 @kvakvs |
I added in the translations. Is the code ready for approval? 😃 |
As you're steaming with new other ideas, i'm afraid once this is merged you won't have time to rework it and make it testable. Might as well consider that possibility now. If too complex i can let it slip for now, you might still want to do it later. The idea is that you make algorithm not call any game or TMPE code, take some data structures as inputs, and output some data structures which will then be applied by the TMPE code to the game. This will allow us simulate those inputs during the test and check the outputs as they are simple numbers and structures now instead of game data. For this to work you need to know beforehand which parts of the map the algorithm will read and pre-load them into some simple arrays or lists or dicts, but don't store entire nodes and segments, only store stuff that's relevant to your algorithm. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea how you created those translation files without building TM:PE Crowdin project, but they are wrong 😄 All translation file are generated, we don't touch those files manually. I will push new translation to your branch 😉
To resolve conflicts pull master branch and choose all translation files to overwrite yours. |
OK i resolved the merge conflicts as you said. |
I'll do some testing on this tomorrow.
|
❌ I'm not seeing the Ctrl+Click mentioned in the tooltip: ✔️ It is, however, mentioned in the adviser text. ❌ Upon ctrl+clicking an existing junction (that had traffic light and also junction restrictions), I got this error: Will try and gather more infos on the error (can't see anything of use in the logs yet). |
Tested on several more junctions:
Also, it doesn't seem to factor in lane connectors (maybe those could be covered by later PR?) |
Yes it does. Just like lane separation quick-edit feature it ignores noes/segments with lane connections (still puts the Timed traffic light but does not separate turning lanes). Maybe it can be more clever see #575 . But not in this PR. |
The English translation for for keybind was empty
Its was also empty in crowdin. I just added it: https://crowdin.com/translate/tmpe/24/en-en#8945 @aubergine10 @kvakvs @krzychu124 I do not know how to download translations the right way. Can anyone please help me? |
Again a matter of translation key being empty. TTL quick-setup is not supported here. There has to be at least 3 exits from the junction. In here just add a simple traffic light. I don't see the need for timed traffic light. If you do then comment on #575 I will add all the missing English translations to crowdin. then I will wait for help from someone to import them. |
@aubergine10 I do not support level crossing. I just added code to show error message regarding this unsupported scenario. see #575 |
You can download the .csv files and drop them in to the translations folder, then submit that to the PR - that's fine. Just be sure to leave a note in OP of PR listing which languages were changed and who changed them (so we can give credit in the change notes). However:
Note: I'm currently having some login issues with Crowdin (their support is investigating) so can't currently add languages or keys or approve translations. |
This is exactly what I did: #554 (comment) (If I understood correctly) but then @krzychu124 told me: #554 (review)
So @aubergine10 @kvakvs: can you please tell me what did I do wrong last time so that I can fix it this time? PS: Also later on somehow the English translation strings in crowdin got wiped out leading to the empty error messages you saw! One of life's mysteries! |
OMG I totally forgot about left hand traffic! I will fix it soon. |
Fixed it. |
@aubergine10 @krzychu124 @kvakvs The translations are in. This should be ready to merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From end-user perspective this LGTM 👍
Fixes #540
Fixes #5
Updates #324
I created this city to test my timed traffic light in all cases (that I could think of).