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

WIP Feature: NewGRF Road Stops (Feature 14) #7955

Closed
wants to merge 1 commit into from
Closed

WIP Feature: NewGRF Road Stops (Feature 14) #7955

wants to merge 1 commit into from

Conversation

spnda
Copy link
Contributor

@spnda spnda commented Jan 22, 2020

Hey all,
After a few years of playing OpenTTD I very appreciated the addition of Road- and Tramtypes with NRT. Now, I feel like having the same bus and truck stops everywhere looks bad and plain. Now with Feature 14, this opens up the possibility of having custom bus and truck stops. I call this NotRoadStops or for short NRS. I would guess that this would be a very appreciated addition and would bring more customizability to the game.

Status

Currently I have Action0 and Action4 "done". There's still some properties that could be added to Action0. Action2 and Action3 are uncompleted, as I still don't really understand how they work yet :( I'll work on those tomorrow.
I have already updated the GUI for building bus and trucks stops. In this current build it is possible to select between classes and between different stops, though sprites are not shown correctly. I have tried to make it look like the Rail Station GUI, or at least as far as I could. This is not done at all and might take me a bit longer to do as well. I just want to put this draft here, to track my own progress (I have some checkmarks at the bottom) and have some feedback and reviews.

Progress Tracking

I'm constantly posting new stuff on my discord server or on the r/OpenTTD discord.

  • Fix and finish GUI
  • Sprite layouts and proper sprite rendering
  • Allow building of custom road stops
  • Add more Action0 properties
  • More layout properties
  • Update NML (separate PR)

image

Test GRF File

examplegrf.zip

@spnda spnda changed the title Feature: NewGRF Road Stops (Feature 14) WIP Feature: NewGRF Road Stops (Feature 14) Jan 22, 2020
@James103
Copy link
Contributor

James103 commented Jan 22, 2020

Do you want the interface to be similar to that for NewGRF rail station building (near-exact same layout in case of trams, or similar layout with 6 buttons in 3x2 layout for roads)? If so, that would be fine and ideal by me.

@spnda
Copy link
Contributor Author

spnda commented Jan 23, 2020

Do you want the interface to be similar to that for NewGRF rail station building (near-exact same layout in case of trams, or similar layout with 6 buttons in 3x2 layout for roads)? If so, that would be fine and ideal by me.

I'm trying to come as close as I can to the rail station building GUI. Of course I can't do this new GUI exactly the same, though it will only have slight changes. Trams will of course only have 2 directions selectable while busses and trucks have 6 views to select from.

On another note, I will upload a test GRF file today... I think I might have made some mistakes in the NFO code of that file, therefore it isn't showing in the build menus...

@nielsmh nielsmh added the component: NewGRF This issue is related to NewGRFs label Jan 24, 2020
@nielsmh
Copy link
Contributor

nielsmh commented Jan 24, 2020

Check if you need to bump the savegame version, even if you don't require any conversion to the new map data. Basically, that an OTTD version without NRS can load a savegame with NRS without anything breaking.

@spnda
Copy link
Contributor Author

spnda commented Feb 6, 2020

So, I've thought instead of having the trams just use bus and truck stations, give them their own stops. That way there'd be Bus, Truck, Tram and Freight Tram Stations.
This could allow for a bit more realism or variety, if someone wanted to have different stops for their trams entirely.
Is this a good idea or should it just be left as is, as a user can switch between the stations anyway?

@nielsmh
Copy link
Contributor

nielsmh commented Feb 6, 2020

I think that's definitely one of the things requested, stations specific for trams or roads.
Also consider whether you're shooting too low and should support special multi-tile stations with custom movements, and perhaps diagonal platforms support.

@spnda
Copy link
Contributor Author

spnda commented Feb 6, 2020

I kinda feel like having the stops differentiated by passenger or freight stops might be better, so that bus stops can also be used as tram stops.
I don't know, maybe we should have them split up for bus/trucks/trams/freight trams, but that would mean that a GRF might have to define multiple stations. For that, we could have a stop have define flags to be mapped onto one, some or all stops.

src/newgrf_roadstop.cpp Outdated Show resolved Hide resolved
src/newgrf_station.cpp Outdated Show resolved Hide resolved
src/rev.cpp Outdated Show resolved Hide resolved
src/station_cmd.cpp Outdated Show resolved Hide resolved
@spnda spnda marked this pull request as draft August 23, 2020 10:37
@TrueBrain TrueBrain added candidate: needs considering This Pull Request needs more opinions size: large This Pull Request is large in size; review will take a while needs review: NewGRF Review requested from a NewGRF expert labels Dec 14, 2020
@TrueBrain
Copy link
Member

Hi @spnda ; just a friendly reminder this Pull Request is still open in draft mode. Are you still interested in continue this work?

(disclaimer: I did not look into the PR itself; just noticed it was still open in draft)

Tnx :)

@TrueBrain TrueBrain removed the needs review: NewGRF Review requested from a NewGRF expert label Dec 21, 2020
@spnda
Copy link
Contributor Author

spnda commented Dec 21, 2020

@TrueBrain It is still in draft mode because it isn't ironed out and it's missing one or two features.
I'm working on other projects and I've lost a bit of interest in it, but I hope I can pick it up sometime again.

@TrueBrain TrueBrain added the work: still in progress (draft) This Pull Request is a draft label Dec 21, 2020
@spnda
Copy link
Contributor Author

spnda commented Feb 1, 2021

So uh, picked this up after nearly a year again.
I know of one issue, that the default road sprites dont get rendered on custom bus and truck stops (NRT roads do get rendered fine)
Everything else seems fixed, including the regression tests and AIs.
I've also added a few newgrf variables (of which two still need implementation). Aswell as let it inherit all variables from the BaseStation, making them cargo aware.

  • view (The view from 0..5 of the stop)
  • current_roadtype (Needs implementation)
  • terrain_type
  • build_date (Needs implementation)
  • town_zone

Any suggestions are welcome.

screenshot

screenshot2
(Roads from U&Ratt, stops by Chris / Erato)

@Wahazar
Copy link

Wahazar commented May 31, 2021

I propose to add custom road underlay for Drive-through stops. Currently they are defined only for Drive-in, while Drive-through are utilising standard straight pieces. Which is not welcome in case of wide roads/roads with barriers etc, also real stops have often special pattern painted on asphalt (which would be also convenient in transparent mode, if visible).
Such feature would be optional - to avoid breaking compatibility with existing newgrfs.

@kevinfields777
Copy link

I'm looking forward to seeing this finished and implemented. :)

@TrueBrain TrueBrain added candidate: yes This Pull Request is a candidate for being merged and removed candidate: needs considering This Pull Request needs more opinions savegame upgrade labels Sep 25, 2021
@spnda
Copy link
Contributor Author

spnda commented Sep 25, 2021

I'm looking forward to seeing this finished and implemented. :)

@kevinfields777 The implementation itself is pretty much good to go. I have, however, no current intentions to look into saveload and properly implement it for this feature, which is currently the only big issue with this PR. Another bug is that default roads are not being drawn with custom roadstops, if anyone wants to tell me why or fix it, see this function.

Otherwise, I'm not really going to work on this properly but I'm happy for anyone else to PR onto my fork with fixes/additions. I will only go through some compiler warnings, fix those, and then go on to other projects for now.

And so nobody asks, the NML implementation is fully functional and I (and others) have already used it to write NewGRFs.

@2TallTyler
Copy link
Member

Superseded by #10144 -- but this is a huge contribution and @spnda should be recognized in the release notes whenever the feature is released. Thanks for this.

@2TallTyler 2TallTyler closed this Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
candidate: yes This Pull Request is a candidate for being merged component: NewGRF This issue is related to NewGRFs size: large This Pull Request is large in size; review will take a while work: still in progress (draft) This Pull Request is a draft
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants