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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
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 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.

Loading

@spnda
Copy link
Contributor Author

@spnda 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...

Loading

@nielsmh
Copy link
Contributor

@nielsmh 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.

Loading

@spnda
Copy link
Contributor Author

@spnda 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?

Loading

@nielsmh
Copy link
Contributor

@nielsmh 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.

Loading

@spnda
Copy link
Contributor Author

@spnda 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.

Loading

src/newgrf_roadstop.cpp Outdated Show resolved Hide resolved
Loading
src/newgrf_station.cpp Outdated Show resolved Hide resolved
Loading
@spnda spnda force-pushed the roadstops branch 3 times, most recently from 5fb03d2 to e27250c Jun 17, 2020
src/rev.cpp Outdated Show resolved Hide resolved
Loading
src/station_cmd.cpp Outdated Show resolved Hide resolved
Loading
@TrueBrain
Copy link
Member

@TrueBrain TrueBrain commented Dec 21, 2020

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 :)

Loading

@spnda
Copy link
Contributor Author

@spnda 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.

Loading

@spnda spnda force-pushed the roadstops branch 2 times, most recently from a118b50 to cda54d8 Jan 31, 2021
@spnda spnda force-pushed the roadstops branch 3 times, most recently from fdf42b2 to c09dd0e Feb 1, 2021
@spnda
Copy link
Contributor Author

@spnda 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)

Loading

@spnda spnda force-pushed the roadstops branch 2 times, most recently from 0b32c78 to db9a427 Feb 22, 2021
@Wahazar
Copy link

@Wahazar 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.

Loading

@kevinfields777
Copy link

@kevinfields777 kevinfields777 commented Sep 25, 2021

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

Loading

@spnda
Copy link
Contributor Author

@spnda 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.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

8 participants