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
[Bug]: Map generation fails when no town buildable roads are available #10574
Comments
Can confirm. Most likely, that's because no town-buildable road type is available that early; therefore, map generation fails on town generation as it can't build any road to place housing on. Can also reproduce in the Scenario Editor:
|
Bug in the road-type NewGRF, no town-buildable road-types exist in 1900. |
version 13.0 everything works smoothly, it looks like something you will change. what is forbidden to use with the flag: bitmask(ROADTYPE_FLAG_HIDDEN, ROADTYPE_FLAG_TOWN_BUILD) |
Not something I've changed. Hidden types are meant for providing compatibility between otherwise incompatible types, not for placing on the ground. |
quick check |
It was changed here: #10546 |
#10574 works around RattRoads' issue, however with U&RaTT there are no town-buildable road types in 1900, even when hidden-but-town-buildable roads are allowed. This means that previously the game was reverting back to the first road type, completely ignoring all of its properties. |
You will be able to add a new feature, thanks to which some roads will be built only in cities inaccessible to players. But in the editor, the map is always available and even built by players. |
As #10546 prevented this, I don't see the need for a new flag to bring back the previous behaviour. |
The rationale (with no opinion from me for or against or any opinion at all)
|
Why is it desirable for the 'magic' roadtype to not be player-buildable? If it isn't, player alterations to town roads (e.g. to repair damage around other construction, improve bus routes, or just for aesthetics) will be mismatched or become so as the town roadtype changes. I do a lot of 'patching up' town roads like that, often just one or two tiles at a time. |
Don't let the player build the magic roadtype. Instead, have the town replace road with the magic roadtype when it grows. Of course, it's setting controllable. |
|
Apologies for being a bit late to the discussion, but perhaps I can shed some light on our perspective on this roadtype issue. The reason we NewGRF authors have been using the HIDDEN and TOWN_BUILD flags together is to define a roadtype which can be built by towns on map generation but are not meant to be built by the player. This is used to create a unique aesthetic at game start without cluttering the player's roadtype list with a useless roadtype for the rest of the game. For example, in RattRoads there are two early roadtypes: dirt and sett pavement. If either of these were set to be town buildable, then all towns big and small would exclusively use only that roadtype on map generation. In order to make early towns look a bit more interesting I introduced a third, hidden, roadtype which displays as dirt road in the outskirts of town, and sett pavement in large city centers. This "magic" roadtype is hidden because the effect it produces is 100% reproducible by the player during gameplay by using the other already implemented roadtypes, thereby making this "special" roadtype completely superfluous to the player. Apparently the other affected NewGRFs have followed suit using a similar effect, as seen in this ticket. Another example is Wasteland, where I use this same feature to generate "destroyed" roads on map generation, but since allowing the player to build new pre-destroyed roads during gameplay is completely nonsensical, I mark this special roadtype as hidden, again to avoid cluttering the build list with a useless roadtype. I'll be honest: removal of this ability is a relatively minor issue in the grand scheme of things, basically resulting in an extra useless roadtype being shown in the build list. But the real issue is that we've been using this feature exactly as it was (seemingly) intended for the last 4-5 years or so, and to have it suddenly ripped away, thus breaking our NewGRFs and the game without being given an obvious reasoning as to why, is a little irritating. Ultimately I don't care whether this patch is upheld or not - we can always make changes - but we would at least like to see the previously described behavior that we've been using all this time to be kept available in some form or another. |
Not that it directly affects the NewGRFs, though a game script has access to essentially all road types, even those you "declared" as "for town only". This as game scripts can build (some things) as owner town. I previously made a change to allow game scripts to only build road types that are visible to the user or buildable by towns, and enforcing that. As before that it could literally build road types that did not even exist. #10546 was built on top of that. I do not care whether it's ("user visible" and "town buildable") or only "town buildable" for determining whether a town may use the road. However, if it's only "town buildable", then game scripts will get ("user visible" or "town buildable") as filter to determine whether they are allowed to build that road. This as game scripts can build some things as town. |
My two cents: Also in my road set the type IMHO it is debatable to hide the |
It doesn't matter. OpenTTD can use 64 types.
Right. Similar to how U&RaTT has a "sequence" parameter in the "Used time epoch", a road that changes over time and none of them have the "TOWN_BUILD" flag set. Because the only reason why the "TOWN_BUILD" flag does not update roads automatically, except for creating maps and financing the repair of city roads. In case there are free roads by the end of the year, which will be tedious to lay around the city on a large map. Otherwise, in modern times, to say that dirt roads are being built in the city is ridiculous. Another option and could it be better ? Do you have a plan to redo the "TOWN_BUILD" flag to force the road to upgrade automatically? |
Nobody has been complaining since, so I assume so. |
Version of OpenTTD
20230316-master-g0bf6d80cd7 (Win10 64)
Expected result
Without failures of creating a new map
Actual result
Steps to reproduce
The text was updated successfully, but these errors were encountered: