Cargo Distribution
Moderator: OpenTTD Developers
Re: Cargo Distribution
It's indeed not so easily expressed in a mathematical formula. There are quite a lot of parameters and the notation would get kind of messy. It's probably easier to understand the source code. Look at src/linkgraph/demands.cpp. That's where the transport demand between nodes in the link graph and thus stations in the game is calculated. Destinations are assigned according to the demands calculated there.
The guy on the picture is not me, it's Alonso.
- BlueEagle_nl
- Transport Coordinator
- Posts: 352
- Joined: 28 Jan 2006 09:44
- Skype: tilly5014
- Location: Tillywood, The Netherlands
Re: Cargo Distribution
Hi alll,
Trying to play around with release gc0e22a3f released last monday, and I noticed fonts are a little bit too tiny to remain playable... See screenshot below.
I'm running a Windows 8 32bits PC, have the game windowed (also tried full screen and different resolutions: no effect). Also tried deleting openttd.cfg, and switching back and forth between Original and OpenGFX, but that also had no effect.
Vanilla OTTD has no font issues whatsoever, so it seems to be in the patch...
Hope you can come up for a solution Loved to play with the patch on my old Ubuntu machine, and can't actually play without it anymore
Greets,
Blueeagle_NL
[edit]Seems to be something up with the language settings: English (UK) and English (US) have no issues ... Small Fonts reported in at least Dutch, Danish and French[/edit]
Trying to play around with release gc0e22a3f released last monday, and I noticed fonts are a little bit too tiny to remain playable... See screenshot below.
I'm running a Windows 8 32bits PC, have the game windowed (also tried full screen and different resolutions: no effect). Also tried deleting openttd.cfg, and switching back and forth between Original and OpenGFX, but that also had no effect.
Vanilla OTTD has no font issues whatsoever, so it seems to be in the patch...
Hope you can come up for a solution Loved to play with the patch on my old Ubuntu machine, and can't actually play without it anymore
Greets,
Blueeagle_NL
[edit]Seems to be something up with the language settings: English (UK) and English (US) have no issues ... Small Fonts reported in at least Dutch, Danish and French[/edit]
- Attachments
-
- Damn Small Prints...
- TinyFonts.png (446.93 KiB) Viewed 2222 times
Re: Cargo Distribution
Yep, those languages use characters not in the standard font, so they switch to a font at your system that does have them, apparently it picks a font for testing your eye quality
You may want to set a saner font as explained at http://wiki.openttd.org/FAQ_troubleshoo ... ll_to_read
You may want to set a saner font as explained at http://wiki.openttd.org/FAQ_troubleshoo ... ll_to_read
Re: Cargo Distribution
It seems waiting cargo (passengers) keeps resetting to zero at stations. Running a city circular bus route with 5 stations and let TT run at full speed, after a few years the passengers waiting at the stops build up to 1 or 2 thousand then keeps resetting to 0.
Started to noticed this in the last couple of releases, Donwloaded 04-Nov-2012 version to test that and in that version the waiting seems ok.
Started to noticed this in the last couple of releases, Donwloaded 04-Nov-2012 version to test that and in that version the waiting seems ok.
Re: Cargo Distribution
Seems I forgot to fix one occurrence of Truncate() in my refactoring effort. That's actually one I introduce in a later commit so it wasn't actually there when I refactored that code. So much about the problems of managing long patch queues...
Anyway, the problem will be fixed in tonight's build. Thanks for the report. This one was easy to reproduce. However, in the general case it's much easier for me to debug those things if you provide a savegame. The problem will usually be fixed faster, too. If you provide a savegame for a bug, in cases where the bug has not damaged the savegame, I will build you a savegame-compatible but fixed binary (32bit-Windows or 64bit-Linux) of cargodist on request. (If/when I find the bug, that is ...)
Anyway, the problem will be fixed in tonight's build. Thanks for the report. This one was easy to reproduce. However, in the general case it's much easier for me to debug those things if you provide a savegame. The problem will usually be fixed faster, too. If you provide a savegame for a bug, in cases where the bug has not damaged the savegame, I will build you a savegame-compatible but fixed binary (32bit-Windows or 64bit-Linux) of cargodist on request. (If/when I find the bug, that is ...)
Code: Select all
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -3329,7 +3329,7 @@ static void UpdateStationRating(Station *st)
* decrease the flow of incoming cargo. */
StationCargoAmountMap waiting_per_source;
- ge->cargo.Truncate(waiting, &waiting_per_source);
+ ge->cargo.Truncate(ge->cargo.Count() - waiting, &waiting_per_source);
for (StationCargoAmountMap::iterator i(waiting_per_source.begin()); i != waiting_per_so
Station *source_station = Station::GetIfValid(i->first);
if (source_station == NULL) continue;
The guy on the picture is not me, it's Alonso.
Re: Cargo Distribution
Thanks, quick fix and quick reply.
Noted about uploading the saved game but as it was happening every game and very easy to reproduce, i knew you`d find it.
Noted about uploading the saved game but as it was happening every game and very easy to reproduce, i knew you`d find it.
Re: Cargo Distribution
The problem is not finding, the problem is time and distraction. When puzzling about a problem, you need all your attention for the actual problem you're looking into. You cannot afford to get distracted by anything else.JamieW wrote:it was happening every game and very easy to reproduce, i knew you`d find it.
Thus, the first thing any developer does is to create a setup where the problem is reproducible in about 10 seconds. That alone can take hours, time that cannot be spent on the problem you really want to solve.
As an illustration:
Before I became a dev, people were making cargo-dest. I submitted several bug reports with problems. In one case, I spent about 2 hours to setup a sequence of steps to follow to reproduce a problem. Afterwards, the devs reported they fixed the problem in 15 minutes due to my detailed report.
In other words, I gave them 2 extra hours for working on other problems.
Re: Cargo Distribution
The ga715aacf update seems to have made the passenger numbers a little bit less eratic but the amount is still rolling over to zero.
Here 'Detbridge' station builds up to about 1580 passengers waiting until 11 Feb then resets. I havn`t really played with any other cargo so I can`t say if its just happening to passengers.
Here 'Detbridge' station builds up to about 1580 passengers waiting until 11 Feb then resets. I havn`t really played with any other cargo so I can`t say if its just happening to passengers.
- Attachments
-
- Detbridge Transport, 2nd Feb 1953.sav
- (330.29 KiB) Downloaded 36 times
Re: Cargo Distribution
Thanks a lot. That's a related bug. The "waiting" thing obviously must not be > cargo.Count() anymore. There's actually a comment warning about that very effect one line above the problematic expression ... :/ The new version being built tonight will be savegame compatible with ga715aacf.
Code: Select all
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index afce80c..763146c 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -3300,7 +3300,9 @@ static void UpdateStationRating(Station *st)
uint32 r = Random();
if (rating <= (int)GB(r, 0, 7)) {
/* Need to have int, otherwise it will just overflow etc. */
- waiting = max((int)waiting - (int)((GB(r, 8, 2) - 1) * num_dests), 0);
+ int remove = (int)GB(r, 8, 2) - 1;
+ if (remove > 0) waiting -= min(waiting, remove * num_dests);
+ assert(waiting <= ge->cargo.Count());
waiting_changed = true;
}
}
The guy on the picture is not me, it's Alonso.
Re: Cargo Distribution
https://secure.openttd.org/hg/openttd/trunk.hg/shortlog
Something's happening... 1.3 has branched off so we just might be looking for a 1.4 inclusion Thumbs up for your perseverence Fonso!
Something's happening... 1.3 has branched off so we just might be looking for a 1.4 inclusion Thumbs up for your perseverence Fonso!
Re: Cargo Distribution
The savegame-compatible version is the out-of-schedule built g8d7fe8cf-cd, not the additional scheduled build that will be done later.
The guy on the picture is not me, it's Alonso.
Re: Cargo Distribution
Indeed, nice to see some of those commits there. Though it I think they're more code preparations for the possible inclusion of CargoDist.
Re: Cargo Distribution
Interesting behaviour here..
I'm not sure if its supposed to happen, but there seems to be a really high rate of passenger attraction to stations,
this screen demonstrates the situation I build a small station in the middle of a town with 1100 or so population, it is served fairly regularly and trains have around 300 pax capacity
yet after a short there are around 1400 people waiting...? That's more than the town's population!
Does anyone know whats going on here?
EDIT: (version according to OTTD itself is gbc6b29cd-cd)
I'm not sure if its supposed to happen, but there seems to be a really high rate of passenger attraction to stations,
this screen demonstrates the situation I build a small station in the middle of a town with 1100 or so population, it is served fairly regularly and trains have around 300 pax capacity
yet after a short there are around 1400 people waiting...? That's more than the town's population!
Does anyone know whats going on here?
EDIT: (version according to OTTD itself is gbc6b29cd-cd)
"O2 is for noobs, real people breath O3" ~ said sometime by Me
All comments from me may or may not be true and do not take them word-for-word
Feel Free to join me and some other people in The Nations Game - its actually quite fun.
1000th Post at Wed Feb 08, 2012 8:43 am
2000th post at Sun Apr 14, 2013 10:22 am
All comments from me may or may not be true and do not take them word-for-word
Feel Free to join me and some other people in The Nations Game - its actually quite fun.
1000th Post at Wed Feb 08, 2012 8:43 am
2000th post at Sun Apr 14, 2013 10:22 am
Re: Cargo Distribution
Could you please post a savegame? This doens't help really as we don't know what the routes are the passengers take. In general it can be said that passenger production in OpenTTD is rather high, however this doesn't become apparent while playing a normal game, you really start to notice this when playing CD games.
Re: Cargo Distribution
here
but careful, you're probably going to need to hunt for NewGrfs seems really odd to me
but careful, you're probably going to need to hunt for NewGrfs seems really odd to me
"O2 is for noobs, real people breath O3" ~ said sometime by Me
All comments from me may or may not be true and do not take them word-for-word
Feel Free to join me and some other people in The Nations Game - its actually quite fun.
1000th Post at Wed Feb 08, 2012 8:43 am
2000th post at Sun Apr 14, 2013 10:22 am
All comments from me may or may not be true and do not take them word-for-word
Feel Free to join me and some other people in The Nations Game - its actually quite fun.
1000th Post at Wed Feb 08, 2012 8:43 am
2000th post at Sun Apr 14, 2013 10:22 am
Re: Cargo Distribution
Can you please tell me where to get modern_set.grf, pgs2w.GRF and your version of the Canadian stations set? For the canadian stations it says version 0.3d and I though I had that, but apparently I either have some broken grf or it's a different version than I think it is (or the GUI is inconsistent ...)
Anyway, there are a lot of newgrfs that change passenger generation. Could it be that one of those missing ones is such a thing?
Anyway, there are a lot of newgrfs that change passenger generation. Could it be that one of those missing ones is such a thing?
The guy on the picture is not me, it's Alonso.
Re: Cargo Distribution
pgs is here: viewtopic.php?p=268709#p268709
MTSS: viewtopic.php?f=26&t=23472&hilit=modern ... tation+set
MTSS: viewtopic.php?f=26&t=23472&hilit=modern ... tation+set
"O2 is for noobs, real people breath O3" ~ said sometime by Me
All comments from me may or may not be true and do not take them word-for-word
Feel Free to join me and some other people in The Nations Game - its actually quite fun.
1000th Post at Wed Feb 08, 2012 8:43 am
2000th post at Sun Apr 14, 2013 10:22 am
All comments from me may or may not be true and do not take them word-for-word
Feel Free to join me and some other people in The Nations Game - its actually quite fun.
1000th Post at Wed Feb 08, 2012 8:43 am
2000th post at Sun Apr 14, 2013 10:22 am
Re: Cargo Distribution
Fonso, thank you for this great mod, I always thought TT was missing cargo destinations.
I'm sure you've answered this before, you probably explain it in the code review thread, but I don't quite get it: In my current game I created one small island with four towns and now have about 10 docks with lots of waiting passengers. And at least 20 passenger ferries, half going one, half going the other way round, visiting every dock. However, ships arrive at docks, are nowhere near full and don't pick anybody up - even though lots of people want to go to in that direction (though maybe 3, 4 docks away).
Why is that? Is it because cargo is reserved for specific ships? Is it because they also have the choice to use a bus system and prefer that (even though it is helplessly overloaded/underserved)?
Or is it best to only offer direct connections? But 9+8+7+6+5+4+3+2+1= 45 different routes (direct connections between all the 10 docks) is a bit of a hassle. Instead, maybe I should just have ferries running from one dock to the next? And passengers will have to transfer up to 4 times until they reach their destination?
I'm sure you've answered this before, you probably explain it in the code review thread, but I don't quite get it: In my current game I created one small island with four towns and now have about 10 docks with lots of waiting passengers. And at least 20 passenger ferries, half going one, half going the other way round, visiting every dock. However, ships arrive at docks, are nowhere near full and don't pick anybody up - even though lots of people want to go to in that direction (though maybe 3, 4 docks away).
Why is that? Is it because cargo is reserved for specific ships? Is it because they also have the choice to use a bus system and prefer that (even though it is helplessly overloaded/underserved)?
Or is it best to only offer direct connections? But 9+8+7+6+5+4+3+2+1= 45 different routes (direct connections between all the 10 docks) is a bit of a hassle. Instead, maybe I should just have ferries running from one dock to the next? And passengers will have to transfer up to 4 times until they reach their destination?
Re: Cargo Distribution
I've encountered similar trouble in a couple of my games; if there are multiple possible routes between two points (particularly noticeable if there are parallel express/semi-fast/stopping services on the same route), you can get big pile-ups of people who ignore one train, going non-stop to their destination, so that they can catch a subsequent stopping service that follows exactly the same route to the same station, but calls at one other station in between...
Of course this can also happen the other way (less silly-looking), where they all ignore slightly slower services to wait for the express.
Presumably this also applies if there are ships with parallel bus services, although I don't think I've tried that.
Try expanding the entries in the 'waiting cargo' and look at the 'via' lines: do they all want to go via the next bus stop in that direction?
Of course this can also happen the other way (less silly-looking), where they all ignore slightly slower services to wait for the express.
Presumably this also applies if there are ships with parallel bus services, although I don't think I've tried that.
Try expanding the entries in the 'waiting cargo' and look at the 'via' lines: do they all want to go via the next bus stop in that direction?
Temporary Permanent signature filling text. Content coming soon delayed indefinitely! Oh, and I have had a screenshot thread.
Linux user (XMonad DWM/KDE, Arch), IRC obsessive and rail enthusiast. No longer building robots; now I ring church bells.
Author of an incredibly boring stickied post about NewGRFs.
Linux user (XMonad DWM/KDE, Arch), IRC obsessive and rail enthusiast. No longer building robots; now I ring church bells.
Author of an incredibly boring stickied post about NewGRFs.
Who is online
Users browsing this forum: Bing [Bot] and 0 guests