Patch: New passenger destinations
Moderator: OpenTTD Developers
Patch: New passenger destinations
Hi folks,
playing without passenger destinations was quite boring but I didn't want to miss new features like timetables and the new grouping system, so I decided to give it a try and write a passenger destinations patch using the new cargo packets. Thanks to the old patch it was quite easy to find the places that needed to be changed, but the new cargo packets are so different that I decided to rewrite from scratch.
Although still in development, it already works quite well, so I think it's time for a first patch-file.
You can activate it in the economy tab of the patch settings. But please do not do this at the starting screen. At the moment the game will crash if the patch is activated during a game that already has generated passengers, so don't forget to activate it right after starting a new game. The savegame format is also incompatible with others and I plan to introduce features that will change the format again.
Passengers will choose their destination based on how far away and how "big" (according to passengers produced) stations are. They choose their way to their destination depending on the length of the route, not necessarily the number of transfers. The route length is determined by adding the distances between each station involved plus some virtual length for each station and even more length for a transfer.
Connections are displayed in the station window similar to the way the old passenger destinations patch did along with all stations at which passengers have to transfer. Since this list can get very long, I plan to show connections in an extra window later, where they also can be sorted. This would also allow to display alternative routes, which are not implemented yet.
Currently, the passengers' destinations are only displayed at stations and in trains. Other vehicles can also transport them but you won't see where they want to go.
Many thanks go to:
- the authors of the original patch, destinations make OpenTTD so much better
- rubidium for reading my mind and improving the pool-code at the same time I got nuts trying to write the saveload-code
- my girlfriend for not being too upset that I was programming all day long during the last week
Enough said for now, just try it out (hope it works)!
Greetings,
Kathius
playing without passenger destinations was quite boring but I didn't want to miss new features like timetables and the new grouping system, so I decided to give it a try and write a passenger destinations patch using the new cargo packets. Thanks to the old patch it was quite easy to find the places that needed to be changed, but the new cargo packets are so different that I decided to rewrite from scratch.
Although still in development, it already works quite well, so I think it's time for a first patch-file.
You can activate it in the economy tab of the patch settings. But please do not do this at the starting screen. At the moment the game will crash if the patch is activated during a game that already has generated passengers, so don't forget to activate it right after starting a new game. The savegame format is also incompatible with others and I plan to introduce features that will change the format again.
Passengers will choose their destination based on how far away and how "big" (according to passengers produced) stations are. They choose their way to their destination depending on the length of the route, not necessarily the number of transfers. The route length is determined by adding the distances between each station involved plus some virtual length for each station and even more length for a transfer.
Connections are displayed in the station window similar to the way the old passenger destinations patch did along with all stations at which passengers have to transfer. Since this list can get very long, I plan to show connections in an extra window later, where they also can be sorted. This would also allow to display alternative routes, which are not implemented yet.
Currently, the passengers' destinations are only displayed at stations and in trains. Other vehicles can also transport them but you won't see where they want to go.
Many thanks go to:
- the authors of the original patch, destinations make OpenTTD so much better
- rubidium for reading my mind and improving the pool-code at the same time I got nuts trying to write the saveload-code
- my girlfriend for not being too upset that I was programming all day long during the last week
Enough said for now, just try it out (hope it works)!
Greetings,
Kathius
- Attachments
-
- newdestinations_10814.diff
- (51.85 KiB) Downloaded 1853 times
Re: Patch: New passenger destinations
Wow, thanks a lot for your effort!
..building right now to try it out
Your system of length+virtual length sounds reasonable can't wait to test it & hope you get the issues with crashes etc. sorted without too much hassle
bang, compile finished, i'm off wheee ^_^
PS: well tell your gf it was worth it you're definately my hero of the day right now ^^
edit: first thing i noticed: the text in the patch options is in another color than the other lines, or is that on purpose?
..building right now to try it out
Your system of length+virtual length sounds reasonable can't wait to test it & hope you get the issues with crashes etc. sorted without too much hassle
bang, compile finished, i'm off wheee ^_^
PS: well tell your gf it was worth it you're definately my hero of the day right now ^^
edit: first thing i noticed: the text in the patch options is in another color than the other lines, or is that on purpose?
Last edited by Roujin on 07 Aug 2007 00:11, edited 2 times in total.
- athanasios
- Tycoon
- Posts: 3138
- Joined: 23 Jun 2005 00:09
- Contact:
Re: Patch: New passenger destinations
I will download and compile. Thanks!
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.
I prefer to be contacted through PMs. Thanks.
"If no one is a fool I am also a fool." -The TTD maniac.
I prefer to be contacted through PMs. Thanks.
Re: Patch: New passenger destinations
i think i have found a bug: in the station window, as soon as there are three or more blue lines (the ones for specific destinations), the white lines for other types of cargo (e.g. mail) get pushed down outside of view. there's no scroll bar to scroll down to them.
if i have another (4th) destination, i can scroll down to that line, but still not down to the white line for mail (in my case), which should be below.
other than that, it works like a charm (have yet to try airport feeders and such )
edit: and i have a question about your destination choosing system. if there are two ways from A to B, and one is slightly better, will ALL of the passengers only take the better one or will some also take the longer route?
if i have another (4th) destination, i can scroll down to that line, but still not down to the white line for mail (in my case), which should be below.
other than that, it works like a charm (have yet to try airport feeders and such )
edit: and i have a question about your destination choosing system. if there are two ways from A to B, and one is slightly better, will ALL of the passengers only take the better one or will some also take the longer route?
Re: Patch: New passenger destinations
awesome first post Kathius! welcome to the forums
I really, really like passenger destinations, and I hope I can find the time to compile & run this patch really quick!
I also have a suggestion (not critisising your awesome work in any way): you could use timetables to let passengers decide which is the quickest route to their destination (eg: from station A to B, directly with train X takes 100 ticks, going via bus Y to airport C and take plane Z to B takes 40+20 ticks, so passengers will prefer to go by plane)
I really, really like passenger destinations, and I hope I can find the time to compile & run this patch really quick!
I also have a suggestion (not critisising your awesome work in any way): you could use timetables to let passengers decide which is the quickest route to their destination (eg: from station A to B, directly with train X takes 100 ticks, going via bus Y to airport C and take plane Z to B takes 40+20 ticks, so passengers will prefer to go by plane)
Re: Patch: New passenger destinations
Awesome first post! I'm so glad to see this patch resurrected...
I like that, it'll stop the profiteering which was possible in the last version where you could force passengers to take excessively long routes. This way they'll take the cheapest route - much more reallistic.They choose their way to their destination depending on the length of the route, not necessarily the number of transfers.
Re: Patch: New passenger destinations
Someone, please, post the compiled windows executable!
Thanks in advance!
Thanks in advance!
Re: Patch: New passenger destinations
ofcourse, you could try compiling yourself with BuildOTTDGhost wrote:Someone, please, post the compiled windows executable!
Thanks in advance!
Re: Patch: New passenger destinations
Managed to do this. Thank you for advice!rav wrote:ofcourse, you could try compiling yourself with BuildOTTDGhost wrote:Someone, please, post the compiled windows executable!
Thanks in advance!
Re: Patch: New passenger destinations
Outstanding first post Kathius !
Considering the passenger with destination, I wonder if it could be possible to have the same function for general cargo.
I mean, currently, in OTTD, when an industry produce N units of goods, you can transport it all to any other industry accepting this kind of goods.
But in reality it doesn't work like this : an industry will subscribe contracts with others ones, then will send to them only the needed amount, not more.
By this way, we could end up with REALLY complex networks, that must combine any kind of transport.
Currently, you can become a Tycoon just by looking at the map :
- Ok, 3 coal mines are closes together here...
- Ok, one power plant is very far... Land is quite flat...
Let's go : I build 50 trains on a very long line between the coal mines and the power plant, then all trains will gain millions dollars for each course. After less than 5 years I have billions in bank so I just have to start a new game coz it's anoying to continue building while there is no challenge anymore.
With various destinations for goods, we should be encouragead to start the game with more trucks for short range services, as only a few amount of goods will be transportable to each consumer industries and longer routes with trains won't gain anought money.
I don't have any idea about the "how hard is it to code", but I should love this feature... I dream for this since the first Transpot Tycoon version
Considering the passenger with destination, I wonder if it could be possible to have the same function for general cargo.
I mean, currently, in OTTD, when an industry produce N units of goods, you can transport it all to any other industry accepting this kind of goods.
But in reality it doesn't work like this : an industry will subscribe contracts with others ones, then will send to them only the needed amount, not more.
By this way, we could end up with REALLY complex networks, that must combine any kind of transport.
Currently, you can become a Tycoon just by looking at the map :
- Ok, 3 coal mines are closes together here...
- Ok, one power plant is very far... Land is quite flat...
Let's go : I build 50 trains on a very long line between the coal mines and the power plant, then all trains will gain millions dollars for each course. After less than 5 years I have billions in bank so I just have to start a new game coz it's anoying to continue building while there is no challenge anymore.
With various destinations for goods, we should be encouragead to start the game with more trucks for short range services, as only a few amount of goods will be transportable to each consumer industries and longer routes with trains won't gain anought money.
I don't have any idea about the "how hard is it to code", but I should love this feature... I dream for this since the first Transpot Tycoon version
Re: Patch: New passenger destinations
it's certainly different from passenger destinations as passengers pick destinations only if they can reach them
Re: Patch: New passenger destinations
Ohrav wrote:it's certainly different from passenger destinations as passengers pick destinations only if they can reach them
I would prefer passenger destination works with any existing city on the map. I'll take a look at the patch and see if it can be turned as an option then
Re: Patch: New passenger destinations
I think that that would result through-the-roof memory usage, and generally an unplayable game: lets say a city produces a couple of hundred passengers per year on a 2048 * 2048 sized map with a reasonable amount of cities: each city would get only a few passengers and transportation would result in losses
Re: Patch: New passenger destinations
How nice (and complex to work with) that may look, it doesn't work that way in reality.MagicBuzz wrote:I would prefer passenger destination works with any existing city on the map.
You don't go to the trainstation wanting to travel to Town-X-which-has-absolutely-no-public-transport do you?
All passengers waiting at a specific trainstation have a travelplan in their minds which includes a destination station to end their journey.
I used "waiting" there, of course, some passengers go to a station to ask for possible directions to destination X, but those aren't waiting, and so shouldn't bee seen in the list of waiting passengers in openttd.
And, I concur with rav: it would be rather unplayable on a large map: there are just to many cities to connect together in one complete 1920-2050 game usually.
Re: Patch: New passenger destinations
Thanks everybody for the positive feedback.
By the way, it's also possible to create - how should I call it? - bidirectional circular routes. So if you have two routes a-b-c-d-a-b... and a-d-c-b-a-d... and a passenger want to get from a to d, he will take the a-d-c-b-a route. In the old patch he would have used whatever vehicle arrived first.
I don't like how "connections" are generated currently anyway, it's just a very basic system that doesn't recognize route changes very well. The station looks for connections as soon as a vehicle enters the station. It then compares the vehicle orders to its existing connections, replacing routes that got shorter, but not replacing routes that got longer. It just doesn't know that the short route doesn't exist anymore.
Like the connection building system, the way passengers decide their destination is just a quick and dirty approach to make it work for the moment, that has some major "problems" especially when you start to build rather unrealistic networks (ten bus stations in a small town compared to a single large station in a big city, the small town will attract way more passengers than the large one).
But for now I don't care as much for WHERE passengers want to go. It's more important to me to have a good way to decide HOW they get there, so I will approach a better connection building system next.
So long,
Kathius
Just something I was too lazy to fixRoujin wrote: first thing i noticed: the text in the patch options is in another color than the other lines, or is that on purpose?
Never noticed this one, because I usually don't transport mail. Will be fixed soon.Roujin wrote: if i have another (4th) destination, i can scroll down to that line, but still not down to the white line for mail (in my case), which should be below.
All passengers will take the shorter route, so the vehicles serving the longer route have more space for passengers on their route. However, if passengers have to wait more than 3 months for their short route train to arrive, they will start to take ANY train that brings them to the next station.Roujin wrote: and i have a question about your destination choosing system. if there are two ways from A to B, and one is slightly better, will ALL of the passengers only take the better one or will some also take the longer route?
By the way, it's also possible to create - how should I call it? - bidirectional circular routes. So if you have two routes a-b-c-d-a-b... and a-d-c-b-a-d... and a passenger want to get from a to d, he will take the a-d-c-b-a route. In the old patch he would have used whatever vehicle arrived first.
I thought about that before. But not every route is guaranteed to have a timetable, so how would I compare timetabled to not timetabled routes? If vehicles would be forced to generate a timetable and you couldn't change them below the calculated times, it could be a very reliable system though.rav wrote: you could use timetables to let passengers decide which is the quickest route to their destination
I don't like how "connections" are generated currently anyway, it's just a very basic system that doesn't recognize route changes very well. The station looks for connections as soon as a vehicle enters the station. It then compares the vehicle orders to its existing connections, replacing routes that got shorter, but not replacing routes that got longer. It just doesn't know that the short route doesn't exist anymore.
This would be interesting indeed, and it shouldn't be too hard to implement. However, I first want to get passenger destinations right, it still has some problems and needs some finetuning.MagicBuzz wrote: Considering the passenger with destination, I wonder if it could be possible to have the same function for general cargo.
Like the connection building system, the way passengers decide their destination is just a quick and dirty approach to make it work for the moment, that has some major "problems" especially when you start to build rather unrealistic networks (ten bus stations in a small town compared to a single large station in a big city, the small town will attract way more passengers than the large one).
But for now I don't care as much for WHERE passengers want to go. It's more important to me to have a good way to decide HOW they get there, so I will approach a better connection building system next.
So long,
Kathius
Re: Patch: New passenger destinations
hmm, after some more playing around, i wondered if you should consider different means of transportation when calculating the best route. Say there is both a train and a bus from A to B, normally the train should be first choice. But on the other hand, then the bus line would be totally empty, would that be realistic? I think some people would still use the bus... hmm
How do they act currently? From what you wrote i guess they would treat the train an the bus line equally...
Unless of course the bus line has a stop inbetween (which the train line doesn't have). Then suddenly the train would be preferred, wouldn't it?
I think (without any disrespect to your effort so far) this system still needs some thought...
Choosing which way to take should in my opinion be more flexible, not all-or-nothing - a smaller percentage of passengers might also choose a slightly longer route. (Though, you would have to guarantee that no one uses lines that are completely the wrong directions...)
just some thoughts i've had...
edit:
I've made this little setup.. (see image)
first i made Bus 1 go A->B->C->B->...
they happily take the bus to any destination
then i made the Train, A<->C
now the pax from A to C and from C to A won't take the bus anymore, just the train (except that 3 month rule, haven't tested that)
then i made Bus 2, which goes only A<->C without stopping at B
now the pax from A to C and from C to A will use the train and Bus 2 equally, whatever comes first
all in all the behavior is like i thought it would be.
A suggestion i have is adding some virtual distance to the ways depending on the transport type (bus, train...), so bus gets some kind of a penalty compared to train... airplane would be even better than train etc.
But then you would have to change it so that a certain percentage will still use the longer route...
How do they act currently? From what you wrote i guess they would treat the train an the bus line equally...
Unless of course the bus line has a stop inbetween (which the train line doesn't have). Then suddenly the train would be preferred, wouldn't it?
I think (without any disrespect to your effort so far) this system still needs some thought...
Choosing which way to take should in my opinion be more flexible, not all-or-nothing - a smaller percentage of passengers might also choose a slightly longer route. (Though, you would have to guarantee that no one uses lines that are completely the wrong directions...)
just some thoughts i've had...
edit:
I've made this little setup.. (see image)
first i made Bus 1 go A->B->C->B->...
they happily take the bus to any destination
then i made the Train, A<->C
now the pax from A to C and from C to A won't take the bus anymore, just the train (except that 3 month rule, haven't tested that)
then i made Bus 2, which goes only A<->C without stopping at B
now the pax from A to C and from C to A will use the train and Bus 2 equally, whatever comes first
all in all the behavior is like i thought it would be.
A suggestion i have is adding some virtual distance to the ways depending on the transport type (bus, train...), so bus gets some kind of a penalty compared to train... airplane would be even better than train etc.
But then you would have to change it so that a certain percentage will still use the longer route...
- Attachments
-
- Vorwald Transport, 23rd Sep 1936.png
- (286.45 KiB) Downloaded 1068 times
Re: Patch: New passenger destinations
The type of vehicle is not taken into account, that's right. The system works this way:
The best thing (in my opinion) would be to let passengers know their next waypoint (transfer or destination) plus some indicator to know which vehicle to take. This could be the order list, vehicle type, vehicle speed or a combination. However, there might be second best routes only slightly behind the best route, so that passengers might want to use that one instead if it arrives first. A station would need to store more than one connection to the same destination. But that would definitely require the seperate connections window. There could be a button next to the vehicle buttons in the stations window that opens that extra window.
- Passengers know their destination and the next station in their route (not necessarily a transfer station).
- Passengers will jump on any vehicle that has their next station as its next station, i.e. if a bus and a plane both go directly to a station 1000km away, passengers will use the bus if it comes first. If the plane has another airport in between they even will never go by plane (except, of course, the passengers have to wait for more than 3 months. However, the plane would take only the (frustrated) part of passengers that really waited that long, not the ones that just arrived, so it's not all or nothing).
- Passengers will leave the vehicle as soon as its next station doesn't fit anymore, effectively meaning that passengers sometimes transfer more often than necessary. Still, they could be faster this way because there might be a train with route a-b-c, a train a-b and a train b-c. If the train a-b arrives first, they will use it until b where train b-c might arrive before train a-b-c.
The best thing (in my opinion) would be to let passengers know their next waypoint (transfer or destination) plus some indicator to know which vehicle to take. This could be the order list, vehicle type, vehicle speed or a combination. However, there might be second best routes only slightly behind the best route, so that passengers might want to use that one instead if it arrives first. A station would need to store more than one connection to the same destination. But that would definitely require the seperate connections window. There could be a button next to the vehicle buttons in the stations window that opens that extra window.
Re: Patch: New passenger destinations
You could implement the ConnectionList in the GoodsEntry struct so the patch would be prepared for all cargo and new Industries.Kathius wrote:This would be interesting indeed, and it shouldn't be too hard to implement. However, I first want to get passenger destinations right, it still has some problems and needs some finetuning.MagicBuzz wrote: Considering the passenger with destination, I wonder if it could be possible to have the same function for general cargo.
Try to keep it as simple as possible for the beginning.
And please Dev's, don't let this one die like the last patch! Post your opinions and help him getting it into trunk. It seems to be a good approach.
Re: Patch: New passenger destinations
A basic solution to the passengers per station weighting problem would be as follows:
PA = XA/T
Where:
PA = Probability of a new passenger wanting to travel to station A
XA = Passenger production rate of station A
T = Total passenger production rate of all player's stations
This need only be updated once a month or so so would not be computationally intensive...
PA = XA/T
Where:
PA = Probability of a new passenger wanting to travel to station A
XA = Passenger production rate of station A
T = Total passenger production rate of all player's stations
This need only be updated once a month or so so would not be computationally intensive...
Who is online
Users browsing this forum: No registered users and 15 guests