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
Director
Director
Posts: 636
Joined: 23 Oct 2006 02:07
Location: Berlin

Re: Cargo Distribution

Post by Auge »

Hello ChillCore
ChillCore wrote:Git is fine and cargodist too but since december there was a codechange in trunk.
Sorry I can not recall in what revision the codechange was made but here is a linky.
http://www.tt-forums.net/viewtopic.php? ... it=liblzo2
Thank you for the link. Installing the dev package for liblzo2 solved the "problem".

Tschö, Auge
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Cargo Distribution

Post by petert »

This build has been deprecated because of two major bugs mentioned in Zuu's post below, it has been removed from the post. Please wait until a new build is made or use the previous one.



Old post:
Hi again,
New build (r19361, MSVC). Sorry that I can't make an x64 build this time, I only have Express Editions installed on this computer. Click here for the previous x64 build.

Disclaimer:
If CargoDist crashes, do not report it to the OpenTTD developers. Report it to this thread. When making your post about the crash, please upload the crash.dmp, crash.log, crash.sav, and crash.png. These files are vital to finding what happened during the crash. For developers, you can find the PDB file and other files at this site: http://users.tt-forums.net/petert/dev/

Peter

PS: I've removed the warning about not having crash.png since most of my builds are with newer versions.
Last edited by petert on 10 Mar 2010 23:51, edited 3 times in total.
User avatar
ostlandr
Chairman
Chairman
Posts: 882
Joined: 12 May 2007 01:09
Location: Northeastern USA

Re: Cargo Distribution

Post by ostlandr »

Thanks!
petert wrote:Hi again,
New build (r19361, MSVC). Sorry that I can't make an x64 build this time, I only have Express Editions installed on this computer. Click here for the previous x64 build.

Disclaimer:
If CargoDist crashes, do not report it to the OpenTTD developers. Report it to this thread. When making your post about the crash, please upload the crash.dmp, crash.log, crash.sav, and crash.png. These files are vital to finding what happened during the crash. For developers, you can find the PDB file and other files at this site: http://users.tt-forums.net/petert/dev/

Peter

PS: I've removed the warning about not having crash.png since most of my builds are with newer versions.
Who is John Galt?
User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: Cargo Distribution

Post by NekoMaster »

Thank's A LOT petert, I may not be on windows much anymore but I still like to have a updated build of cargodist :)
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Cargo Distribution

Post by Zuu »

You probably want to update to a later trunk version since there has been two crash fixes since that revision:

r19362 and r19367

I don't know for sure, but it is possible that the prospect failure crash happens when the game tries to spawn a new industry but fails. The second crash fix is probably only needed if you use AIs.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Cargo Distribution

Post by petert »

Zuu wrote:You probably want to update to a later trunk version since there has been two crash fixes since that revision:
Hi Zuu,
I'll update in a few days, likely on Thursday or Friday. It's just, at the moment I'm extremely busy. I haven't even had time to check most of the forums, only now did I see your comment.

Peter

Sorry for the belated reply.
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Cargo Distribution

Post by petert »

New build with the bugs fixed from the last build. 19387 on MSVC.

Disclaimer:
If CargoDist crashes, do not report it to the OpenTTD developers. Report it to this thread. When making your post about the crash, please upload the crash.dmp, crash.log, crash.sav, and crash.png. These files are vital to finding what happened during the crash. For developers, you can find the PDB file and other files at this site: http://users.tt-forums.net/petert/dev/

Peter

Edit: PDB is now available, I've deleted some old builds.
Attachments
g6949dbeb-cargodist_win32.rar
(3.12 MiB) Downloaded 217 times
g6949dbeb-cargodist_x64.rar
(3.59 MiB) Downloaded 166 times
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2822
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Cargo Distribution

Post by ChillCore »

Hello fonso,
I have found a small bug in the smallmap gui. Please see attachment.
On resizing the gui the behaviour changes (read click the same place -> something else changes).
I have tested with firs r600. In clean trunk this behaviour does not show.
Other than that I have not (yet) found other bugs.
Attachments
Geen naam, 1 Jan 1950.png
Geen naam, 1 Jan 1950.png (15.63 KiB) Viewed 4525 times
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

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: 945
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

ChillCore wrote:Hello fonso,
I have found a small bug in the smallmap gui. Please see attachment.
On resizing the gui the behaviour changes (read click the same place -> something else changes).
I have tested with firs r600. In clean trunk this behaviour does not show.
Other than that I have not (yet) found other bugs.
This is fixed now. Thanks for the report.
The guy on the picture is not me, it's Alonso.
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2822
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Cargo Distribution

Post by ChillCore »

No problem fonso, thank you for fixing it so fast.
It works like a charm now.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

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.
Logital82
Engineer
Engineer
Posts: 58
Joined: 15 Feb 2010 12:03
Location: Germany, Berlin

Re: Cargo Distribution

Post by Logital82 »

Sorry for asking again, but does anyone know where i can find a version with cargodist and infrastructure sharing?
Survivor
Engineer
Engineer
Posts: 44
Joined: 17 Mar 2010 20:26

Re: Cargo Distribution

Post by Survivor »

Hello,
Cargo distribution is very funny, making the game more playable. Thank for cargo distribution. :D

I have tried some situations as below:
B-----A
|
|
|
C-----D
A,B,C,D are stations. Assume distance between AB = BC = CD = AD.
The maximum income is based on the distance between two stations (Am I correct?), so the income earning by AB = BC = CD = AD are equal and assume it is $100. If there are transports connected as above, passengers from A to D should pass through the B and C. As a result, AB transport earn $100 yellow money, BC as the same, but CD will earn -$100 (red money, so sad! :cry: ).

In reality, I know there is “Interchange Discount” for attracting passengers from one end to another end through two different transports. But I don’t want to give this kind of discount to my passengers ( :evil: I am a profiteer). I think it should change to real money instead of virtual money, so AB, BC, CD earn a green money, $100.

The red money is so disturbing. I have 2 suggestions to improve this situation. One is averaging the whole journey to different parts of transports, and the other is mentioned as before (my preference).

Suggestion 1: averaging the actual income
Using the above example (A to D), the actual income earned is $100.
income of AB = (distance AB / total journey distance) x actual income
= (AB / AB + BC + CD) x $100
= 1/3 x $100
= $33.33

Suggestion 2: passengers pay all the fees, no discount!
Of course, if there is more expensive traveling from one place to another place, this should be less people to using this route.
Using the above example again, if all pay the actual fees, the cost from A to D will be tripled through B and C. We can design a mathematical equation for calculating the preference of passengers using this route.
e.g. passengers pick this route = total potential passengers x direct cost / route cost
where direct cost = the direct cost between two ends of the route ($100 as above example),
route cost = total cost through the route ($300 as above example)

Another condition altering the equation is the routes provided. If there is only one route, maybe more passengers will pick this (because they don’t want on foot). If there is a direct route from A to D, so A-B-C-B may be more less passengers to pick.

This suggestion has another benefit because this makes the game more challengeable. If opponent already built a route, u still can build a shorter one to beat him (make opponent earn less and even negative).
User avatar
fonso
President
President
Posts: 945
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

Once and for all about those red numbers, we have discussed them multiple times here ...

1. The red numbers aren't real loss. It's just loss attributed to specific vehicles due to other vehicles having taken an improper share of the income for the overall trip.
2. I'm not going to track all transfer stations and travelling times for all cargo packets. That would be a horrible performance hit.
3. The problem is not specific to cargodist. Cargodist just happens to do more transfers than you'd see in a trunk game.
4. You cannot have the cargo pay for all legs of the journey as if they were independent from each other. Like that you could easily cheat by artificially extending all routes.

Now given those preconditions, if someone comes up with a useful idea I will think about it.
The guy on the picture is not me, it's Alonso.
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: Cargo Distribution

Post by Eddi »

you may want to check the setting "reduce payment for transfers" (in advanced settings->economy), that way, the transfer vehicles earn less, but the resulting vehicle earns more (total money stays same)
Fast2
Engineer
Engineer
Posts: 2
Joined: 14 Aug 2009 12:18

Version r18053

Post by Fast2 »

Short description of the situation:
TrainA should transport wheat and cattle from the farm to the factory.
In exchange, it should take away the goods and deliver them to the farm, so TrainB can bring them to the city.
Picture:
http://www.LupiUpload.de/file.php/file/kMk_NLjq0o
The problem:
TrainA takes away the goods he just unloaded because the destination for the goods is not set to the city's station
but to "any" station, or it is set to the right station at first, but this is sometimes discarded later.

Edit: Works now, although I didn't change anything...
Attachments
Salzfurt Transport, 10. Aug 1960, Problem.sav
(42.02 KiB) Downloaded 104 times
Last edited by Fast2 on 20 Mar 2010 12:02, edited 1 time in total.
User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: Cargo Distribution

Post by NekoMaster »

Um, I can't download the source from SVN anymore cause I don't have internet on my PC and im stuck with using my psp for access now. Could someone PM me the source for OpenTTD r19462
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
User avatar
ostlandr
Chairman
Chairman
Posts: 882
Joined: 12 May 2007 01:09
Location: Northeastern USA

Re: Cargo Distribution

Post by ostlandr »

As to "transfer income", I don't worry if certain vehicles are losing money when using CargoDist. Sure, maybe the local bus on X route is losing money, but those passengers generally aren't making short local hops- they could be headed halfway across the map. Also (and please correct me if I'm wrong) isn't town growth encouraged when the tiles are within radius of a well-served station?
Now, if a vehicle is losing a ton of money, or if all the vehicles on a route are losing money, that's a different matter. Business is business, after all. :twisted:
Who is John Galt?
Purator
Engineer
Engineer
Posts: 51
Joined: 02 Jul 2007 10:32

Re: Cargo Distribution

Post by Purator »

Well, the only annoying thing for me is, ackording to the losing-money-vehicles, that I can't reach 1000 Points...
User avatar
fonso
President
President
Posts: 945
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

Fast2 wrote:Short description of the situation:
TrainA should transport wheat and cattle from the farm to the factory.
In exchange, it should take away the goods and deliver them to the farm, so TrainB can bring them to the city.
Picture:
http://www.LupiUpload.de/file.php/file/kMk_NLjq0o
The problem:
TrainA takes away the goods he just unloaded because the destination for the goods is not set to the city's station
but to "any" station, or it is set to the right station at first, but this is sometimes discarded later.

Edit: Works now, although I didn't change anything...
Yes, that's expected. It takes some time for the link graph calculations to run. As long as they aren't finished all cargo goes "anywhere". You can force a transfer, though, by giving a transfer order. However that wouldn't be a good idea in this situation. Also you should only do that if you know what you are doing. The link graph doesn't know about order modifications and thus could plan a contradiction to your order.
The guy on the picture is not me, it's Alonso.
Survivor
Engineer
Engineer
Posts: 44
Joined: 17 Mar 2010 20:26

Re: Cargo Distribution

Post by Survivor »

fonso wrote:Once and for all about those red numbers, we have discussed them multiple times here ...
Sorry for repeating asking, because this thread is too many posts.
fonso wrote:1. The red numbers aren't real loss. It's just loss attributed to specific vehicles due to other vehicles having taken an improper share of the income for the overall trip.
2. I'm not going to track all transfer stations and travelling times for all cargo packets. That would be a horrible performance hit.
3. The problem is not specific to cargodist. Cargodist just happens to do more transfers than you'd see in a trunk game.
4. You cannot have the cargo pay for all legs of the journey as if they were independent from each other. Like that you could easily cheat by artificially extending all routes.
I do not fully understand the given conditions.
For (4), are you meaning as following example? There are cargos from station A to B, we extending this route by adding intermediate stations around the world corners so we get a big profit. If (4) is meaning that, I think that can be solved by my suggestion mentioned in my last post.
For (3), I thought Cargodist has rewritten/redesigned the cargos generation before. But after some hard thinking, Cargodist has not rewritten the cargos generation algorithm, it just distribute the cargos generated (Am I correct?). However, I think cargos generation is closely related to the Cargodist, and Cargodist is not just for “load balancing”, as well as cargo preference (Industry preference and Passenger preference). Industry preference perhaps is more related to another requested feather called “Industry budgets” (I haven’t tried), but it requires the knowledge of Cargodist (link graph) to decide which route should be chosen. For example, the industry with low amount of budget prefer cheaper route to deliver cargos, while other may prefer faster transport if excess budget. Besides, passenger preference seems no existing project is working on, and also it will not be considered in trunk. Passenger preference may be part of Cargodist, maybe separated to another project because it is large/complicated enough. I saw a post in few previous pages, someone suggest passengers can be divded into sub-cargo, e.g. passengers by bus only, passengers those don’t by plane, etc. It is a good idea for passenger preference.

I know the red numbers aren’t real loss. However, Cargodist with virtual money has a hidden problem. For example,
E-----D-----C-----B-----A
|
|
|
F-----G-----H-----I-----J
All stations are in city (i.e. both produce and accept passenger) and connected as above. All buses are only connecting two adjacent stations. With Cargodist, passengers from A will have destination to J. They will get on and off several times in order to arrive the destination. The actual income from them is small because A and J are nearby. As a result, running cost for transport them > income gained. It is nonsense to do a business with losing money. More badly, since the destination J with different sources may cover the loss from above case, we are difficult to detect such cases. Even if we know that, it seems no way to prevent the passengers from A to J. I found that there is an advance setting option called “Effect of distance on demands”, is it used for solving such problem? I don’t know the usage of this option (Cargodist wiki haven’t stated that). But if the option is only cut off the passengers from far number of stations, I think it also not our expected. If the above link changed from “U” shape to straight line, passengers from A to J are expected.

Cargodist without virtual money maybe the best solution, cargos will be generated with specific destination only, which means no cargo goes any station anymore. So less and even no cargo will be generated under condition 4 you stated. Instead of “goes any station”, potential cargos/passengers(per month) can be used, so we can know that station still have unused cargos.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 40 guests