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

User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Link Capacities and Cargo Distribution

Post by Zuu »

fonso wrote:I have updated the first post and the patches. I'm using git's patch format again as no one could say if the other one is better. You get the all-in-one patch in this post.
I'm sorry I have not have time to test your edited diff. I cant promise anything, so I wont. But if I test, I'll check the one above that you have edited.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
fonso
President
President
Posts: 945
Joined: 13 Oct 2007 08:28

Re: Link Capacities and Cargo Distribution

Post by fonso »

Updated. I have fixed some issues with coding style, made the threading optional and implemented a different algorithm for the multi commodity flow problem.
The guy on the picture is not me, it's Alonso.
jungle
Engineer
Engineer
Posts: 76
Joined: 17 Dec 2004 23:40
Location: UK

Re: Link Capacities and Cargo Distribution

Post by jungle »

This looks very impressive... by the sounds of things it should have a much better chance of being playable (and reliable) than any of the many previous cargo/passenger destination attempts. 8)

I can't compile so I'll be awaiting the point when it gets playable enough for someone to produce a binary...
el koeno
Route Supervisor
Route Supervisor
Posts: 454
Joined: 24 Sep 2004 15:47

Re: Link Capacities and Cargo Distribution

Post by el koeno »

The poll results are quite boring. :mrgreen:
kdoganorak
Engineer
Engineer
Posts: 11
Joined: 10 Jan 2009 13:27

Re: Link Capacities and Cargo Distribution

Post by kdoganorak »

Thanks for taking this on fonso. I was really excited about the last cargodest but it's quirks made it very frustrating to use on complex passenger networks. Load balancing is defiinately important. I look forward to trying this out.
jui-feng
Engineer
Engineer
Posts: 35
Joined: 01 Feb 2009 15:20
Location: Germany

Re: Link Capacities and Cargo Distribution

Post by jui-feng »

kdoganorak wrote:Thanks for taking this on fonso. I was really excited about the last cargodest but it's quirks made it very frustrating to use on complex passenger networks. Load balancing is defiinately important. I look forward to trying this out.
I agree. However I'm not sure if the actual "cargo-dest" part of the patch is already implemented. I will read your post again carefully later today, and if I find it to be "play- and testable" from what I read, I'm going to compile it and try it out. :-)
User avatar
fonso
President
President
Posts: 945
Joined: 13 Oct 2007 08:28

Re: Link Capacities and Cargo Distribution

Post by fonso »

updated:
first prototype with all functionality implemented

That doesn't mean it works, though. There are still loads of bugs to find and correct. But if you'd like to comment on the code, go ahead.

Most significant new things:
- mapping of path forest to flows at stations
- refactoring of vehicle loading code
- rudimentary new station GUI that doesn't work yet
The guy on the picture is not me, it's Alonso.
Gen.d.Pz.Tr.Seb
Engineer
Engineer
Posts: 1
Joined: 30 Jan 2009 12:43

Re: Link Capacities and Cargo Distribution

Post by Gen.d.Pz.Tr.Seb »

This looks really great! Can't test it at the moment because I will not have internet for a week, but if this works I will run it as soon as possible. I stopped playing openttd until something like this was done so I hope that the cargo distribution will be finally implemented (with the load distribution).

One question though, will it work in a multiplayer game?
User avatar
fonso
President
President
Posts: 945
Joined: 13 Oct 2007 08:28

Re: Link Capacities and Cargo Distribution

Post by fonso »

Gen.d.Pz.Tr.Seb wrote:One question though, will it work in a multiplayer game?
Of course it will!
The guy on the picture is not me, it's Alonso.
seansharlos
Engineer
Engineer
Posts: 3
Joined: 08 Apr 2008 08:49

Re: Link Capacities and Cargo Distribution

Post by seansharlos »

jungle wrote:This looks very impressive... by the sounds of things it should have a much better chance of being playable (and reliable) than any of the many previous cargo/passenger destination attempts. 8)

I can't compile so I'll be awaiting the point when it gets playable enough for someone to produce a binary...
I'm very happy that cargo distribution and destination are being invented. The game has no sense without it, I really like the Improved timetable patch but it beginning to be old and is not up to date with nightly - so I hope that this patch will be a good replacement for it.

fonso - thank you for this patch.

One request: I can't compile patchs too, so It's up to you guys to upload a binary, please, I tried every thing and nothing worked, I would be very grateful to have this patch working on my computer.
User avatar
fonso
President
President
Posts: 945
Joined: 13 Oct 2007 08:28

Re: Link Capacities and Cargo Distribution

Post by fonso »

One request: I can't compile patchs too, so It's up to you guys to upload a binary, please, I tried every thing and nothing worked, I would be very grateful to have this patch working on my computer.
No use producing a binary yet. You won't have much fun with it as it crashes quite a lot and the station GUI is a mess. The patches so far are for the developers to be able to see what I'm doing and comment on it. I'll announce when they are stable enough to be tested by the greater public.
The guy on the picture is not me, it's Alonso.
el koeno
Route Supervisor
Route Supervisor
Posts: 454
Joined: 24 Sep 2004 15:47

Re: Link Capacities and Cargo Distribution

Post by el koeno »

fonso wrote:I'll announce when they are stable enough to be tested by the greater public.
I'm guessing that'll be the time I start a new game of OTTD. ;)
User avatar
fonso
President
President
Posts: 945
Joined: 13 Oct 2007 08:28

Re: Link Capacities and Cargo Distribution

Post by fonso »

Tease, tease ...

if you are brave, you can try this now. Don't use the station GUI, though.
Attachments
Fort Mutown Transport, 2080-06-20.png
Fort Mutown Transport, 2080-06-20.png (131.86 KiB) Viewed 1351 times
The guy on the picture is not me, it's Alonso.
jui-feng
Engineer
Engineer
Posts: 35
Joined: 01 Feb 2009 15:20
Location: Germany

Re: Link Capacities and Cargo Distribution

Post by jui-feng »

Amazing to see you rush milestone after milestone! There goes my hero. :bow:

I'm going to wait a few more days and as soon as all the bullet points are green or yellow, patch my source tree and test it. :-)

I wonder why this thread has relatively low "traffic" or posts, as it is the single most important missing ottd feature for me. Maybe people only read "Poll", or maybe even "Poll: Link Capacities..", and think "wow, that's boring". ;)

Keep it up!
mullie0
Engineer
Engineer
Posts: 14
Joined: 13 Oct 2008 11:40

Re: Link Capacities and Cargo Distribution

Post by mullie0 »

wow amazing I cant wait to test this patch myself
User avatar
RFHolloway
Engineer
Engineer
Posts: 5
Joined: 11 Jan 2008 10:13

Re: Link Capacities and Cargo Distribution

Post by RFHolloway »

Interesting - I'm probably missing something major (or stating the obvious), but the most useful thing on the interface would be to split by where people are going to rather than coming from.
User avatar
fonso
President
President
Posts: 945
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

updated:
  • tested the new vehicle loading code and found and fixed a lot of bugs. I really think the worst problems are gone now.
  • implemented a rudimentary GUI. It will improve in future versions.
  • found out that the MCF algorithm isn't as good as I had thought. It tries to saturate all demands up to a maximum ratio. However, when that ratio is reached it doesn't saturate any more demands, even if capacity is left. I could have known that ... stupid me.
  • found out that the demand algorithm is a little quirky. For stations that are close to each other and otherwise similar it may assign quite different demands depending on their order of StationIDs. I don't know if that's a problem, but it could be changed.
  • moved the description into the wiki.
You may try it now...
The guy on the picture is not me, it's Alonso.
555gln22
Engineer
Engineer
Posts: 120
Joined: 09 Sep 2008 19:48

Re: Cargo Distribution

Post by 555gln22 »

This looks crazy good Fonso, congratulations on getting it to work.

Except of course I'm too rubbish to get patching to work so I have to wait until it makes trunk. :D
Formerly known as 'davepoth'
as
Transport Coordinator
Transport Coordinator
Posts: 281
Joined: 07 Mar 2007 20:13

Re: Cargo Distribution

Post by as »

MSVC doesn't like it:

Code: Select all

Error	1	error C2668: 'sqrt' : ambiguous call to overloaded function	c:\Users\as\Desktop\Uusi kansio (2)\svn.openttd.org\src\smallmap_gui.cpp	849	openttd
Error	2	error C2668: 'sqrt' : ambiguous call to overloaded function	c:\Users\as\Desktop\Uusi kansio (2)\svn.openttd.org\src\smallmap_gui.cpp	850	openttd
Error	3	error C2668: 'sqrt' : ambiguous call to overloaded function	c:\Users\as\Desktop\Uusi kansio (2)\svn.openttd.org\src\smallmap_gui.cpp	851	openttd
Error	4	error C2668: 'sqrt' : ambiguous call to overloaded function	c:\Users\as\Desktop\Uusi kansio (2)\svn.openttd.org\src\smallmap_gui.cpp	852	openttd
The previous version compiled without problems.

Also some warnings:

Code: Select all

Warning	5	warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)	c:\Users\as\Desktop\Uusi kansio (2)\svn.openttd.org\src\cargopacket.cpp	210	openttd
Warning	6	warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)	c:\Users\as\Desktop\Uusi kansio (2)\svn.openttd.org\src\cargopacket.cpp	214	openttd
jub
Engineer
Engineer
Posts: 67
Joined: 17 Jul 2003 13:46
Location: Sudice, Czech Republic
Contact:

Re: Cargo Distribution

Post by jub »

Hello,

and my mingw (gcc 3.4.2) doesn't like std::vector::data() method. It's not part of some STL implementations.

Code: Select all

src/saveload/linkgraph_sl.cpp: In function `const SaveLoad* GetComponentDesc()':
src/saveload/linkgraph_sl.cpp:60: error: 'class GetComponentDesc()::SaveLoadVector' has no member named 'data'
Regards
Jakub
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 11 guests