Cargo Distribution

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Auge
Chief Executive
Chief Executive
Posts: 661
Joined: 23 Oct 2006 02:07
Location: Berlin

Re: Cargo Distribution

Post by Auge »

Hello
Elukka wrote:Any chance for newer binaries? I see the newest patch is for r22941 but the latest binaries date from June.
fonso wrote: Obviously I've broken the multimap in June. It's fixed in my git repository now. Thanks for the report.
maybe ...
fonso wrote: The last code change in Michi_cc's YACD repository was on June 2nd. However, Michi_cc might be working on something without telling us. It wouldn't be the first time. In that case, I'd like to know what he is doing before doing anything myself. ...
... maybe not; *scnr*

Auge
Schianto
Engineer
Engineer
Posts: 10
Joined: 27 Aug 2008 11:17

Crash

Post by Schianto »

Do anyone can understand why it crashes? I've used this for months...

Thank you
Attachments
Kameameha, 1 Gen 2010.sav
(134.36 KiB) Downloaded 109 times
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

Which game version did you use to create this and with which version does it crash? Also, what exactly does it do when crashing? Any messages, crash logs, crash saves, etc? Hint: The game version is written in the title bar of the main menu. For cargodist it's usually something like "OpenTTD g12345678".
The guy on the picture is not me, it's Alonso.
Schianto
Engineer
Engineer
Posts: 10
Joined: 27 Aug 2008 11:17

Re: Cargo Distribution

Post by Schianto »

Created and saved with g4dd2678f-cd (Mac OS) ...

No message or crash report, only OTTD stuck... every 2nd of january 2010...

hope this helps

Thank you
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

OK, in fact pools can shrink ...

This is a hotfix in case you want to keep playing that particular game. General update to the repository will be done tomorrow.

Code: Select all

diff --git a/src/linkgraph/linkgraph.cpp b/src/linkgraph/linkgraph.cpp
index 068d83a..3529897 100644
--- a/src/linkgraph/linkgraph.cpp
+++ b/src/linkgraph/linkgraph.cpp
@@ -109,7 +109,7 @@ void LinkGraph::CreateComponent(Station *first)
 void LinkGraph::NextComponent()
 {
        if (this->GetSize() > 0) return; // don't mess with running jobs (might happen when changing interval)
-       StationID last_station_id = this->current_station_id;
+       StationID last_station_id = min(this->current_station_id, Station::GetPoolSize() - 1);
        LinkGraphComponentID current_component_id = this->LinkGraphComponent::index;
 
        do {
Edit: There is another way to work around this bug, in case you don't want to recompile. Build 10 new stations (disconnected bus stops or something) before January 2nd. You can demolish them later.
The guy on the picture is not me, it's Alonso.
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

It seems the hotfix broke more than it fixed. An actual fix is a bit more complicated, see below. Thanks Mikola for the report.
Attachments
linkgraph.diff
real fix
(1.15 KiB) Downloaded 150 times
The guy on the picture is not me, it's Alonso.
Logital82
Engineer
Engineer
Posts: 58
Joined: 15 Feb 2010 12:03
Location: Germany, Berlin

Re: Cargo Distribution

Post by Logital82 »

I have always problems in understanding the following 3 values in Cargodist settings:

Accruracy: Sounds like this has only effect of using CPU: But wiki tells:

"The higher the accuracy the less demand is generated each round" So it influence how much passangers a building generates?

"Effect of distance on demands": The higher the value the shorter are the average distance for the people? Is this correct?

Remotes station popularity: Cant imagine what this means. The higher x the higher y?
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

Logital82 wrote:I have always problems in understanding the following 3 values in Cargodist settings:

Accruracy: Sounds like this has only effect of using CPU: But wiki tells:

"The higher the accuracy the less demand is generated each round" So it influence how much passangers a building generates?
No. If less demand is generated in each round more rounds have to be done in order to generate all the demand required by the available supply. This is why it takes more CPU time. On the other hand the smaller the chunks of demand assigned in each round the more even the demand is distributed overall.
"Effect of distance on demands": The higher the value the shorter are the average distance for the people? Is this correct?
Yes. The higher the effect of distance on demands the more difference will be between the demand for further away and nearer locations. So if you set it to a high value a lot of demand will be created for near destinations and only little for far away ones. In the end this lowers the average distance.
Remotes station popularity: Cant imagine what this means. The higher x the higher y?
Symmetric demands are note really symmetric unless you set this to 100%. The demand generated in the other direction in each round is only X% of the demand generated in the forward direction, where X is this setting.
The guy on the picture is not me, it's Alonso.
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: Cargo Distribution

Post by Kogut »

win32 binary
Attachments
cargodist - r23025.7z
(3.76 MiB) Downloaded 298 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
User avatar
ostlandr
Chairman
Chairman
Posts: 882
Joined: 12 May 2007 01:09
Location: Northeastern USA

Re: Cargo Distribution

Post by ostlandr »

YES! :D Thankyouthankyouthankyou!

Kogut wrote:win32 binary
Who is John Galt?
CommanderSirow
Engineer
Engineer
Posts: 6
Joined: 07 Nov 2011 22:48

Re: Cargo Distribution

Post by CommanderSirow »

Here is the (latest)CargoDist build. CargoDist version 818a319, branched from OpenTTD 1.1.3, build with all dependencies (w/o allegro) with mingw/msys.

http://www.mediafire.com/?6gzq1o3z1x7bmht
WWW
President
President
Posts: 920
Joined: 28 Jan 2005 20:37

Re: Cargo Distribution

Post by WWW »

Here's cargodist against trunk r23431, so you get the infrastructure maintenance patch included. It won't load your old savegames.

Oh, yeah, Win32, MSVC, Directmusic
Attachments
bundle.7z
Cargodist on trunk 23431.
(3.76 MiB) Downloaded 98 times
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

Thanks for building the binaries. I've stopped maintaining the branches cdo, smallmap-stats and smallmap-zoom-in. I hope no one is using those anymore. Also I noticed a nasty performance hit in comparison to the last merge. It wasn't me. I've double-checked with trunk and the performance is similar there. Maybe it's better if you build without debug symbols. I didn't check that.
The guy on the picture is not me, it's Alonso.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Cargo Distribution

Post by Zuu »

A debug build in visual studio is considerable slower in execution speed than a release build. Linking is however quicker in debug builds.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

I know that a debug build is slower than a release build. My point is that yesterday's debug build is considerably slower than a debug build from two weeks ago.
The guy on the picture is not me, it's Alonso.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Cargo Distribution

Post by planetmaker »

Hm... apropos branches or compile. Should we setup the (new) CF to compile from your repo again? Everything needed to be completely re-done from scratch so... all build jobs have to be re-added.
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

CF builds would be very nice, yes. The openttdcoop people are still keeping the webspace around, so I guess you can push the builds there.
The guy on the picture is not me, it's Alonso.
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2868
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Cargo Distribution

Post by ChillCore »

fonso wrote: I've stopped maintaining the branches cdo, smallmap-stats and smallmap-zoom-in. I hope no one is using those anymore.
Hmm, I am still using smallmap-stats and smallmap-zoom-in as well as the ancient cargo-coloured smallmap-linkgraphs, then again I am also using an older version of your patch.
I am soon going to restart my patchpack and will be using your most recent version of CargoDist, which I will be bumping again (for as long as possible) like I did before.
Would it be hard for me (¿or impossible?) to re-introduce these three things myself because I really like these and they are an essential part of my playing style. Just curious because I have not been keeping up for quite a few revisions :oops:


Also, great that you are still maintaining this.
Thank you very, very much for CargoDist fonso ... I almost never play a game without this feature since whenever you started this project. :bow:
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

It has become fairly hard to maintain smallmap-stats, that's why I stopped it. I haven't made much of an effort to keep it "in the spirit" of trunk, so code duplications and subtle differences between trunk and smallmap-stats kept accumulating to a point where it just became too much work to maintain.

I recommend the new style of linkgraph overlay over smallmap and main viewport. Of course you could fork it, refactor it a bit and reactivate it. The last update is just some 3 weeks old. I just don't want to do it because I got the impression that smallmap-zoom-in has no future in openttd and smallmap-stats doesn't work without it.
The guy on the picture is not me, it's Alonso.
User avatar
fonso
President
President
Posts: 948
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

The compile farm now builds Cargodist again. See http://bundles.openttdcoop.org/cargodist/releases/ . Thanks planetmaker and TrueBrain.
The guy on the picture is not me, it's Alonso.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 4 guests