-
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
Update signs, props, etc., to reflect road customisations #49
Comments
Yup, using this simple definition we could support custom asset modpacks with ease. If I'll find a way to add/replace sign props to visualize junction priority setting... |
It could also allow me to replace road signs on vanilla roads with, for example, UK or US road signs. For example, in mod settings, I could choose from drop down which road sign pack I want. This could also be used to filter available speeds when setting speed limits. So if I have the UK pack installed, I only get speeds applicable to UK. |
Could be extended to roadside props, traffic lights, etc. |
Another useful thing would be some way to change speeds for roads (this is relating to mph vs. km/h: #13). For example, UK Roads Revived assets are using km/h values. So a 30mph road is actually 30 km/h. Having an option, when enabling mph speeds in TMPE, to bulk change those roads to the mph value would be useful (so the road becomes 30mph = ~50km/h). |
Currently, the Netlane prop rendering does not consider the configured speed limit when selecting the speed limit sign to render, resulting in an inaccurate road layout. Resolve by patching the NetLane prop rendering to replace any speed limit props being rendered with ones that more accurately reflect the actual speed limit. issue CitiesSkylinesMods#49
Hi, Quick question, is the envisioned end-state for this task supposed to include the addition of new props on a road, or just the replacement of existing props? |
Replacement of existing props would be a great place to start. Ultimately I assume people would want to be able to replace the existing props with other workshop props, eg. American style speed signs. |
One issue of the existing props is that they might not cover the full set of speeds that TMPE offers. Like the 5mph intervals, or 130km/h etc. As it seems you've got prop updating working, I wonder if now would be a good time to start thinking more about how prop definition packs could be implemented - at least now we know what signage would be required for both MPH and km/h speeds. |
The current method does support that as well, though since it's just attempting a match on the prop name, the final version would probably benefit from a more reliable mechanism for prop lookup. The main question I have right now is how much flexibility should there be in adding props when rendering. Right now, it'll only replace props that the game has decided to load, so no speed transitions, no appending extra props, etc. If that flexibility is desired, then a more substantial patching/complete replacement of the
That could be overcome by including a set of fallback props within the mod itself, but that's something that needs further discussion obviously. |
We'd need some way to handle props from other roads. For example, I use UK road assets which replace vanilla props with custom "essential" props. Having a tool that collates list of all props and dumps to log or some other file would be useful. I assume we can detect which props are being used for signage by checking the flags that determine whether they appear in the prefab?
That's the right approach IMO. For example, I often slow speed at sharp bends, and I wouldn't want speed signs suddenly popping up everywhere I did that. So I think just updating existing props, for now at least, is the right way to go. It would be cool if any existing 'parking' signs could update for parking restrictions changes, or 'no left/right turn' signs change when customising lane arrows/connectors. |
|
So I've been thinking about the prop availability issue for the fallback speed limit signs, and I was wondering if we can solve the issue of prop availability by simply generating props on the fly, though this seems like it's starting to get out of scope for the mod. |
Yeah, props on fly is potentially do-able, but is a bit overkill and could cause problems with other mods. IMO it would be easier to use prop packs from workshop. We can work with a few asset creators to get first few packs done, then post a spec for what assets are required if other creators want to do their own versions. |
Just to clarify:
|
Wow, I thought you were only swapping existing props. So with this we could slap any font on any sign? Could this be used in UI layer as well? I mean, it's just textures so I guess so? Like currently we have all these individual sprites for the signs - we could just have single background image and then font to overlay on top? And with the font, we could potentially map all the relevant number typefaces and other symbols in to a single font file (think along lines of FontAwesome or similar)... |
Yeah probably, the most recent revision uses the system Arial font, but it can be replaced with either another dynamic font loaded from AssetBundles (I guess reusing work done in #391) or using custom Font textures like PO(not a fan of that though, would be better to use regular
Yeah I think so, though there's a lot of not-performant operations, so dunno how well this works in real-time. |
I guess bulk of grindy code is conversion of font to texture, so for UI that only needs doing once per choice of signage style. |
Been pondering this for a while, I think the only way to achieve it would be mini "add-on mods" that tell TMPE, for a given road asset (or collection of assets), details about the road speed signs.
TMPE would come with a default list of vanilla speed signs; for any roads that aren't part of a
roadcollection
, TMPE will try vanilla sign.However, any roads using custom signage will have to provide the definition file that tells TMPE about the custom signs.
A template mod would be provided for asset authors (or users who use roads by other authors and want to get the signs working), and all they have to do is change some values and fill in an XML file then publish as mod to workshop.
As a rough mockup of the xml:
So, if user changes road speed, TMPE can find out what road group it's in (eg. "UKRoadsRevived") and from there work out the ids of speed signs for each speed.
It knows current speed and driving direction, so it can find existing speed sign on the relevant side of the road. It can then place a new speed sign (with height, rotation, etc of old sign) and hide/delete the old sign.
If no old sign is found, TMPE won't add a new sign. This prevents unwanted signs appearing.
The XML structure above should facilitate different types of signs at a later date. For example, we could add in toggling of Parking signs (or relevant roadside props) that can be toggled on and off when parking restrictions are applied.
The text was updated successfully, but these errors were encountered: