Wolf01's hire point - Last addition: sloped stations
Moderator: OpenTTD Developers
Re: Wolf01's hire point - Now working: User Configurable Hotkeys
Ok, I'm working on a new patch, this time really simple as devs told me
It's a WIP of Drag&Drop for buildings roadstops and roadstations
The planned features will be:
- limit the drag for the roadstations, so they will be build on a line, maybe in two lines with the entrances in opposite directions (eg. If I chose NE the entrance of the other line will be SW)
- allow to extend a station adjacent to 2 other stations (the one you can build with CTRL), like it works with trains
- allow the replacement of existent stations, you will be able to replace a bus roadstop/station with a truck roadstop/station if is in the same direction
See the first post for a preview diff
It's a WIP of Drag&Drop for buildings roadstops and roadstations
The planned features will be:
- limit the drag for the roadstations, so they will be build on a line, maybe in two lines with the entrances in opposite directions (eg. If I chose NE the entrance of the other line will be SW)
- allow to extend a station adjacent to 2 other stations (the one you can build with CTRL), like it works with trains
- allow the replacement of existent stations, you will be able to replace a bus roadstop/station with a truck roadstop/station if is in the same direction
See the first post for a preview diff
Re: Wolf01's hire point - Last addition: drag&drop roadstations
I'm here again with one of my weird ideas, sloped stations!!!
More infos, picture and patch on the first post: http://www.tt-forums.net/viewtopic.php?f=32&t=26105
More infos, picture and patch on the first post: http://www.tt-forums.net/viewtopic.php?f=32&t=26105
- StopRightThere
- Chief Executive
- Posts: 761
- Joined: 18 Dec 2005 20:10
- Location: United Kingdom
Re: Wolf01's hire point - Last addition: sloped stations
That's really cool, does the track follow the slope?
Bye Bye OpenBVE
Official TT-Hot young ginger Doctor Who assistant FanClub
Formerly known as AdditionalData
Official TT-Hot young ginger Doctor Who assistant FanClub
Formerly known as AdditionalData
Re: Wolf01's hire point - Last addition: sloped stations
If you mean the train, yes
The track currently not because I need to mess up with the drawing code (I think I'll try to do something tomorrow)
Future plans are: make the station leveled when there is nothing at the bottom of the slope, or maybe like roads so if you click near the top of the slope you'll make an horizontal station and if you click near the bottom of the slope you'll make a sloped station
Tomorrow I'll try to add this code for roadstops too and I'll try to fix the behavior on SLOPE_N/W/E/S (the ones with only one corner raised)
The track currently not because I need to mess up with the drawing code (I think I'll try to do something tomorrow)
Future plans are: make the station leveled when there is nothing at the bottom of the slope, or maybe like roads so if you click near the top of the slope you'll make an horizontal station and if you click near the bottom of the slope you'll make a sloped station
Tomorrow I'll try to add this code for roadstops too and I'll try to fix the behavior on SLOPE_N/W/E/S (the ones with only one corner raised)
Re: Wolf01's hire point - Last addition: sloped stations
The problem graphics-wise is that you cannot reuse existing graphics. It would need some new graphics drawn and put into openttd(w).grf, that look similar enough to fit with the existing graphics, but are no rip off (for copyright reasons).
A possible solution for this could be if you leave the station like it is (completely on the upper of the two levels), except the track in the middle of the tile, which goes down a ramp, like a normal piece of track going down a hill. Would not look nice nor be realistic, but station newgrfs could still provide nicer sloped platforms. (That's basically like rivers. Without any newgrf they just look like a piece of ocean, you need a newgrf to make them look nice)
Speaking of newgrfs, that's something you maybe didn't think of at all.. I think a proper implementation of sloped stations needs also some considerations regarding newgrfs. e.g. a callback for newgrfs to tell them if a piece of station is on a slope or not.. (well, it may exist already, I've only gotten into newgrf very briefly, so I don't know.. )
A possible solution for this could be if you leave the station like it is (completely on the upper of the two levels), except the track in the middle of the tile, which goes down a ramp, like a normal piece of track going down a hill. Would not look nice nor be realistic, but station newgrfs could still provide nicer sloped platforms. (That's basically like rivers. Without any newgrf they just look like a piece of ocean, you need a newgrf to make them look nice)
Speaking of newgrfs, that's something you maybe didn't think of at all.. I think a proper implementation of sloped stations needs also some considerations regarding newgrfs. e.g. a callback for newgrfs to tell them if a piece of station is on a slope or not.. (well, it may exist already, I've only gotten into newgrf very briefly, so I don't know.. )
Re: Wolf01's hire point - Last addition: sloped stations
You've got the information direction backwards there. Callbacks allow the grf to provide information to the host.Roujin wrote:I think a proper implementation of sloped stations needs also some considerations regarding newgrfs. e.g. a callback for newgrfs to tell them if a piece of station is on a slope or not.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Re: Wolf01's hire point - Last addition: sloped stations
Okay, I shoudn't start talking about stuff I don't fully understand. Still I think you have to consider newgrfs for your patch, wolf. A newgrf author should e.g. have control over whether it's allowed to place a station part on a slope or not, and if so, specify a special sprite layout to be drawn on sloped tiles.
-
- Tycoon
- Posts: 5948
- Joined: 27 Apr 2005 07:09
- Contact:
Re: Wolf01's hire point - Last addition: sloped stations
I.e., what Dale meant was that TTDPatch already has a mechanism to allow a newgrf checking for land slopes when building stations: https://wiki.ttdpatch.net/tiki-index.php ... _check_149_Roujin wrote:[...]
Thus, something like this is possible in TTDPatch:
OTOH, having slopes in the same direction as track would require complete new station graphics, not only some "modified" foundation sprites. (If you want to do it in the right way. )
regards
Michael
Re: Wolf01's hire point - Last addition: sloped stations
Update:
r14988 - v0.2
- Trains and road vehicles now follow the slope
- Is not possible to build road bays facing slope (the vehicle movement code must be rewritten for that or it looks weird)
(download the win32 package from the same link on the first post, or the patch only from here)
I tried to don't draw the foundations under the stations, but doing this they are drawn at the lower level and leave void parts.
Those should be fixed with proper graphics, or at least drawing under the station the sloped track/road instead of the stations leveled tile
I didn't try it with newstations, and it still miss the grf checking for the slope (as MB said)
r14988 - v0.2
- Trains and road vehicles now follow the slope
- Is not possible to build road bays facing slope (the vehicle movement code must be rewritten for that or it looks weird)
(download the win32 package from the same link on the first post, or the patch only from here)
I tried to don't draw the foundations under the stations, but doing this they are drawn at the lower level and leave void parts.
Those should be fixed with proper graphics, or at least drawing under the station the sloped track/road instead of the stations leveled tile
I didn't try it with newstations, and it still miss the grf checking for the slope (as MB said)
- Attachments
-
- sloped_stations_14988_v02.diff
- (5.72 KiB) Downloaded 135 times
Re: Wolf01's hire point - Last addition: sloped stations
Now that there is no limit to the amount of road stops at the same station (besides the station spread), a feature for building road stops with drag&drop would be even more useful. Do you plan to update this patch?
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: Wolf01's hire point - Last addition: sloped stations
Maybe, I don't have so much spare time to sit in front of my pc and write down code so I keep the idea of this patch for the next vacation time which isn't this Christmas holidays, maybe in the first half of next year... we waited long time for a roadstop improvement, we can wait for another improvement too... or if somebody would like to continue my work I'll feel happy too
EDIT: I think I might give it a look today, to know why see the attached picture
EDIT 2: I updated the patch to r18533 -> but is impossible to build a road stop.
The game compiles without errors/warnings, the drag&drop code works but there is something I can't understand, maybe in the new code changes and I can't debug right now (I tried with some checks and printing out values but I can't find the problem)
EDIT: I think I might give it a look today, to know why see the attached picture
EDIT 2: I updated the patch to r18533 -> but is impossible to build a road stop.
The game compiles without errors/warnings, the drag&drop code works but there is something I can't understand, maybe in the new code changes and I can't debug right now (I tried with some checks and printing out values but I can't find the problem)
- Attachments
-
- DSCN0802.JPG (217.08 KiB) Viewed 4222 times
-
- DSCN0811.JPG (141.75 KiB) Viewed 4222 times
Re: Wolf01's hire point - Last addition: sloped stations
I have been tinkering with the patch and I made the following changes:
Edit: Patch removed
- CommandCost cost variable was redeclared inside the TILE_LOOP; this caused the command to return an error. After solving this, I noticed that only the cost of the last road stop was used. Both issues have been corrected.
- The addition of CMD_NO_WATER to CMD_BUILD_ROAD_STOP at road_gui.cpp, which also caused an error. CMD_NO_WATER has been removed.
- The code related to creating or finding a station, and setting related widgets / windows dirty has been taken out of the TILE_LOOP. This is faster and solves an issue where CmdBuildRoadStop did not check station spread properly, resulting in a crash.
- When trying to join stations, the join station window was always empty.
- Additionally, I have implemented a new feature; non drive-through stations can only be built as a line corresponding to their axis. I find this useful because building more than a single row of normal stations together is not useful at all.
Edit: Patch removed
Last edited by Terkhen on 07 Jan 2010 23:39, edited 1 time in total.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: Wolf01's hire point - Last addition: sloped stations
Many thanks Terkhen
A lot of things were changed since last time i put my hands on OTTD code (think about I had problems iterating with the rectangle because I didn't notice that BEGIN/END_TILE_LOOP now become TILE_LOOP ) so I was a bit confused
A lot of things were changed since last time i put my hands on OTTD code (think about I had problems iterating with the rectangle because I didn't notice that BEGIN/END_TILE_LOOP now become TILE_LOOP ) so I was a bit confused
Re: Wolf01's hire point - Last addition: sloped stations
Do you think that there are any features or code corrections missing from the drag and drop patch? I'm really interested to see this completed and I'm willing to make further changes if they are needed.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Re: Wolf01's hire point - Last addition: sloped stations
I think this patch is complete, maybe the other one (the sloped stations one) might be updated to trunk, road stops on slopes for hilly cities should be a good improvement.
It should be split into two patches, sloped road stops and sloped rail stations, so the road stops one can be added without scrambling the things too much, but not that much, it's really simple as patch, it's just a check removed and some code for drawing slopes.
Drawing new graphics is not required for now, current graphics fit well enough the sloped layout, for train stations is different instead, they really need new graphics, that's why I want the patch split.
It should be split into two patches, sloped road stops and sloped rail stations, so the road stops one can be added without scrambling the things too much, but not that much, it's really simple as patch, it's just a check removed and some code for drawing slopes.
Drawing new graphics is not required for now, current graphics fit well enough the sloped layout, for train stations is different instead, they really need new graphics, that's why I want the patch split.
Re: Wolf01's hire point - Last addition: sloped stations
I spotted a pair of bugs at the Drag and drop road stops patch.
- Drive-through stops could be built over any roads, no matter what directions they had.
- Only the first road stop was joined to existing roads, and not in the right directions.
I will keep testing it: if there aren't any new bugs, I think the patch is ready for getting a flyspray task
EDIT: Update to trunk.
- Drive-through stops could be built over any roads, no matter what directions they had.
- Only the first road stop was joined to existing roads, and not in the right directions.
I will keep testing it: if there aren't any new bugs, I think the patch is ready for getting a flyspray task
EDIT: Update to trunk.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Who is online
Users browsing this forum: No registered users and 26 guests