Some personal changes
Moderator: OpenTTD Developers
-
- Engineer
- Posts: 2
- Joined: 02 Feb 2018 15:10
Some personal changes
I made some personal changes that I would like to share, in case some people are interested in implementing them further!
Just for the record: I branched my code of JGR's patch git repository. Obviously anybody can do with the changes what they wish, and I am sure they could be turned into a diff against the base game by someone who is more experienced in that than I am..
My changes can be found on this branch on github. I had a few issues getting the code to compile with Visual Studio, so ignore the first few commits.
The changes so far
Running early economies (1870's) you can easily need a lot of delivery vehicles as they are slow and have low capacity. This gives two issues:
1. Vehicles on a conditional delivery system (goto A, if loaded go to B, goto A, if loaded go to C, etc) will circle the pick-up station
2. Vehicles tend to pick the same drive-through loading area as the one in front of them, causing a block despite there being open bays.
So first off, I made vehicles which see their next actual order is the same station as they are at immediately go back to loading:
This has the consequence many vehicles can be waiting for their delivery station to have available things and depart immediately:
This also works for ships and trains.
I also removed a check from the refit code that erroneously seems to think vehicles are already refitted, causing them to not refit in this home station scenario.
For the second point, I modified yapf to check the tile in front of the current vehicle for other vehicles; and for every vehicle there note the tiles they are headed to right now. These tiles are then given a higher cost when traversed, and an even higher cost if they are loading areas. This means vehicles are willing to travel farther if it means not going the same way as the person in front of them. This can help clear up clogged cities, too, as vehicles are more willing to diversify.
Before:
With modifications:
This idea came about when I noticed vehicles make the wrong loading area choice because they make the decision to turn into it before the vehicle in front of them has entered the loading tile; meaning they think the tile is free whereas really it is already occupied.
This changes are not guaranteed to be stable or good, but as I made them and am enjoying my networks more with them, I thought I would share.
Just for the record: I branched my code of JGR's patch git repository. Obviously anybody can do with the changes what they wish, and I am sure they could be turned into a diff against the base game by someone who is more experienced in that than I am..
My changes can be found on this branch on github. I had a few issues getting the code to compile with Visual Studio, so ignore the first few commits.
The changes so far
Running early economies (1870's) you can easily need a lot of delivery vehicles as they are slow and have low capacity. This gives two issues:
1. Vehicles on a conditional delivery system (goto A, if loaded go to B, goto A, if loaded go to C, etc) will circle the pick-up station
2. Vehicles tend to pick the same drive-through loading area as the one in front of them, causing a block despite there being open bays.
So first off, I made vehicles which see their next actual order is the same station as they are at immediately go back to loading:
This has the consequence many vehicles can be waiting for their delivery station to have available things and depart immediately:
This also works for ships and trains.
I also removed a check from the refit code that erroneously seems to think vehicles are already refitted, causing them to not refit in this home station scenario.
For the second point, I modified yapf to check the tile in front of the current vehicle for other vehicles; and for every vehicle there note the tiles they are headed to right now. These tiles are then given a higher cost when traversed, and an even higher cost if they are loading areas. This means vehicles are willing to travel farther if it means not going the same way as the person in front of them. This can help clear up clogged cities, too, as vehicles are more willing to diversify.
Before:
With modifications:
This idea came about when I noticed vehicles make the wrong loading area choice because they make the decision to turn into it before the vehicle in front of them has entered the loading tile; meaning they think the tile is free whereas really it is already occupied.
This changes are not guaranteed to be stable or good, but as I made them and am enjoying my networks more with them, I thought I would share.
Re: Some personal changes
BTW, lack of non-articulated horse vehicles in egrvts was a reason, why I started polroad grf project, which offer both small single horse carriages as well as multiple horse "articulated" ones.
Formerly known as: McZapkie
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: Some personal changes
Nice idea!
Why did you not send a patch?
Why did you not send a patch?
-
- Engineer
- Posts: 2
- Joined: 02 Feb 2018 15:10
Re: Some personal changes
I am beginning to think I should! I just never modified OpenTTD before (I hail from OpenRCT2!), and the features were a bit experimental.HackaLittleBit wrote:Nice idea!
Why did you not send a patch?
So to submit a patch I'll have to check what to actually do for that which may take me a bit longer to figure out.
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: Some personal changes
I send you a pm with the patch
Re: Some personal changes
Nice - this is actually one of the most annoying things in game for me - as it makes timetabling trams etc needlessly difficult. (can't rely on slack time at a lay-up station to get back on schedule, as the late vehicle always gets stuck behind the one ahead)JeroenDStout wrote:This idea came about when I noticed vehicles make the wrong loading area choice because they make the decision to turn into it before the vehicle in front of them has entered the loading tile; meaning they think the tile is free whereas really it is already occupied.
Re: Some personal changes
both of these changes sound great, and are something i have wished for before.
does the station order thing work with conditional orders?
does the station order thing work with conditional orders?
- goto A
- if load < 20% jump to 1
- goto B
- andythenorth
- Tycoon
- Posts: 5658
- Joined: 31 Mar 2007 14:23
- Location: Lost in Music
Re: Some personal changes
+1 this is useful if it works. RV stops get contended easily because of the current behaviour.JeroenDStout wrote:This idea came about when I noticed vehicles make the wrong loading area choice because they make the decision to turn into it before the vehicle in front of them has entered the loading tile
FIRS Industry Replacement Set (released) | HEQS Heavy Equipment Set (trucks, industrial trams and more) (finished)
Unsinkable Sam (ships) (preview released) | CHIPS Has Improved Players' Stations (finished)
Iron Horse ((trains) (released) | Termite (tracks for Iron Horse) (released) | Busy Bee (game script) (released)
Road Hog (road vehicles and trams) (released)
Unsinkable Sam (ships) (preview released) | CHIPS Has Improved Players' Stations (finished)
Iron Horse ((trains) (released) | Termite (tracks for Iron Horse) (released) | Busy Bee (game script) (released)
Road Hog (road vehicles and trams) (released)
- Redirect Left
- Tycoon
- Posts: 7249
- Joined: 22 Jan 2005 19:31
- Location: Wakefield, West Yorkshire
Re: Some personal changes
Very useful changes, would be nice to see these merged into one of the larger patch packs later on.
Who is online
Users browsing this forum: No registered users and 46 guests