Open kianzarrin opened 4 years ago
The vanilla game memorizes past road selections. To observe/prove this follow these steps: A) modify road selection on one road (screenshot 1) B) modify road selection on another road (screenshot 2) C) click on the section from step A (screenshot 3) Observe) game has remembered modifications from step A (screenshot 3)
The game does not memorize the state of the priority road toggle but rather recalculates it every time you select a road. to test this out follow these steps: A1) create a road network and disable all traffic lights on incoming roads. B1) select the road, observe that tuning the priority toggle on and off will insert/remove stop sings on incoming roads. (screenshot 1 and 2- its a bit tricky to get the nice info view state I have on this screenshot: I selected a minor road -> clicked the road selection button -> selected the main road -> clicked on the Junctions tab) C1) select another road, then re-select the road from step B1. D1) Observe that the priority toggle is on. This is not because of memory but rather because all incoming roads have stop signs. To prove this: A2) make another road selection. observe that the priority toggle is off. B2) manually enable stop signs on incoming roads (screenshot 3) . Observe that the Priority toggle is still off because CS has not recalculated it yet. C2) Select another road and the select the road from Step A2. Observe that the priority toggle is on now (screenshot 4). CS has recalculated it.
Perk: The paths cannot overlap. To observe this follow these steps: A) create a road network that allows overlapping paths (screenshot 1) B) make a road selection (screen shot 1) C) click on a segment outside of the current selection,. then modify road selection in a way that it overlaps with step B. (screenshot 2) D) click on the road selection from step B (screenshot 3) Observe) road selection has changed to exclude segments from step C (screenshot 3)
I think there's possibly some additional stuff going on here.
For example, if I create short road and name it "Steve", then I start extending that road, the new segments will often adopt the same road name, like the route is being automatically extended.
Roads can also be "joined", for example this scenario:
A B A
----- ----- -----
So if I've got a segment named A
, then one named B
, then another named A
; game sees 3 routes (A
, B
, and another A
). If I rename B
to A
the game now sees 1 route consisting of 3 x A
segments.
I notice this a lot when editing bridges (or tunnels, etc) on highways. For example, I bulldoze part of my highway to build new bridge or something, place bridge whch gets auto-named, the game sees break in the route due to change in road name. When I rename the bridge to same as highway, game now sees it all as one route again.
I see. So that is where all this is stored.
@aubergine10 So if I've got a segment named A, then one named B, then another named A; game sees 3 routes (A, B, and another A). If I rename B to A the game now sees 1 route consisting of 3 x A segments.
Can you please test this again to see if it works the same sense the Sunset Harbour update? If so please tell me how to reproduce this.
Doing quick test...
So... I have no idea how this is happening. Like, prior to SH, those would have become single road.
Is there now actually some internal store somewhere of 'roads' which allows adjacent but separate roads of same name to coexist?
It's like the "green line" thing is now the single source of truth for what a "road" is, rather than the segment names.
It might be worth doing some digging in to that green line thing if you have time, see what code it triggers. Because the game is definitely now remembering the green line (as far as I can tell from some basic testing).
Green Line is a single continuous line and cannot have branches. I was unable to change Road names without creating branch so maybe what really has changed is the mechanism to change Road names but this is just a speculation I should really read the code
It might be annoying to people (I for one don't care but I think @aubergine10 does) that the only way to adjust which portion of the road will the road selection panel affects is to change road names.
I guess in most cases it does not matter as people usually change rules for the whole road but what about the scenario where someone wants to change rules only for a portion of a named road? he has to change road name. (EDIT: I mean road name gets modified when he adjusts the green adjustment path).
I'm fine with it working based on road names (acutally, that's how I'd expect it to work).
I'm just confused by the fact that the green bar no longer seems to follow the road names.
More specifically, I am assuming there is at least a cache, perhaps even a persisted list/dictionary, that the green bars are using to remember which segments they applied to regardless of road name.
And if such a thing exists, maybe we could find use for it :) Also, I want to know why CO would make that sort of change - seems odd to do something like that just for the sake of it. It merits further investigation.
But in my digging so far, I've not found it. Which entry points should I be starting from to work out how that green bar is rememembering segments without the aid of road names?
It's like the "green line" thing is now the single source of truth for what a "road" is, rather than the segment names.
conducting some tests I can confirm that the behavior has indeed changed and its not due to a change in naming mechanism.
Have you found the entry point for where that green bar gets initialised? I've found pretty much all the stuff regarding naming but haven't found the green bar stuff yet. It will be interesting to see what it's using.
There are some bufffers on segments, etc., for temporary use, but they wouldn't facilitate multiple 'roads' that the green bar now seems to be remembering. So there must be some dictionary (or similar) that's collecting the segments associated with each "green bar" defined road.
And now I have three segments (left, ceter, right) all named Nancy Adams Street but the game is no longer seeing them as the same road.
Might custom name flag be at play here?
In #631 I implemented basic road selection panel:![Screenshot (346)](https://user-images.githubusercontent.com/26344691/74253989-7fec1480-4cf8-11ea-880f-c4843817f8c2.png)
Introduction
Request
The TMPE should take advantage of the fact that games memorizes road selections and remember the state of the buttons based on road selection. (it can create a dictionary of road selection -> button state). what I want is:
Discussion about more possibilities:
Consider this scenario