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

Re: Cargo Distribution

Post by fonso »

ChillCore wrote: I am going to test your patch and i will post a patch for turtoise.
If you think the patch is stable enough I will post my binaries too,
if that is okay with you that is.
Of course it is. The sources are "derived work" of OpenTTD and thus under the GPL. Everyone can change, republish, compile, distribute or do whatever with them. I'm happy to see people doing that.

I'm even more happy if people help me find the bugs mentioned here. It was only a little frustrating to spend half the day on setting up a virtual machine with windows, installing all the stuff and actually finding the problem, just to see someone else had just done the same thing. Perhaps just drop me a line when you start working on some known problem, so that I can concentrate on something else then. I'll post my IM information in my forum profile. But again: I don't want to prevent anyone from doing anything they like with the patches I post.

The good thing is: I can build Windows binaries myself now. I'll attach the fixed one I've tested with.
Attachments
openttd.zip
(1.94 MiB) Downloaded 222 times
The guy on the picture is not me, it's Alonso.

User avatar
ChillCore
Tycoon
Tycoon
Posts: 2658
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Cargo Distribution

Post by ChillCore »

As promised.
Svn / Turtoise patch attached.
After quick testing no more slowdowns. even with accuracy set higher (32 tested)

How to use a patch including new files using Turtoise:

- create a dummy file for each new file.
- apply the patch and compile.
- Never apply the patch twice.
First revert your source using Turtoise.
Then revert the new files to dummy files manually:
Turtoise does not revert new files for some reason.

Now you can reapply the patch to your source.


@ fonso:
Now you can easier debug windows compatibility, your afternoon was not a total waste. I hope.

ps:
The patch is the all in version.
Attachments
cargodist_r16055_svn_Turtoise.patch
(132.2 KiB) Downloaded 154 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.

isk
Engineer
Engineer
Posts: 4
Joined: 05 Oct 2007 16:56

Re: Cargo Distribution

Post by isk »

fonso wrote: Perhaps just drop me a line when you start working on some known problem, so that I can concentrate on something else then. I'll post my IM information in my forum profile. But again: I don't want to prevent anyone from doing anything they like with the patches I post.

Will keep that in mind next time :)
I have spend some time playing with your patch applied and it seems that everything is working, although during compilation (still MSVC and WinXP) there is one warning

Code: Select all

Warning	1	warning C4804: '>' : unsafe use of type 'bool' in operation	f:\temp\openttd\src\mcf.cpp	72	openttd

el koeno
Route Supervisor
Route Supervisor
Posts: 454
Joined: 24 Sep 2004 15:47

Re: Cargo Distribution

Post by el koeno »

fonso wrote:
ChillCore wrote: I am going to test your patch and i will post a patch for turtoise.
If you think the patch is stable enough I will post my binaries too,
if that is okay with you that is.
Of course it is. The sources are "derived work" of OpenTTD and thus under the GPL. Everyone can change, republish, compile, distribute or do whatever with them. I'm happy to see people doing that.

I'm even more happy if people help me find the bugs mentioned here. It was only a little frustrating to spend half the day on setting up a virtual machine with windows, installing all the stuff and actually finding the problem, just to see someone else had just done the same thing. Perhaps just drop me a line when you start working on some known problem, so that I can concentrate on something else then. I'll post my IM information in my forum profile. But again: I don't want to prevent anyone from doing anything they like with the patches I post.

The good thing is: I can build Windows binaries myself now. I'll attach the fixed one I've tested with.
Hi,

I downloaded the binary you posted, and copied it to an install of trunk R16055 (which works) and I get an error: " No available language packs (invalid versions?)" I'm not quite sure what the problem is there, but if trunk works, I guess there's nothing wrong with the language packs?

User avatar
fonso
President
President
Posts: 945
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

el koeno wrote: I downloaded the binary you posted, and copied it to an install of trunk R16055 (which works) and I get an error: " No available language packs (invalid versions?)" I'm not quite sure what the problem is there, but if trunk works, I guess there's nothing wrong with the language packs?
Ouch, I'm sorry ... this is because you not only need the binary but also some other files that are generated from the patch-modified sources. If you use the binary I posted with trunk versions of those other files it complains (as you have seen). I'll try to figure out which those files are.
The guy on the picture is not me, it's Alonso.

User avatar
ChillCore
Tycoon
Tycoon
Posts: 2658
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Cargo Distribution

Post by ChillCore »

Hi fonso,
I see you only included openttd.exe
You need everything from the bin i think.
Try these to compare.
I think you can leave the svn folders out.

[EDIT]
Binaries removed. newer are available further in the thread.
[/EDIT]
Last edited by ChillCore on 22 Apr 2009 10:29, edited 1 time in total.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

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.

el koeno
Route Supervisor
Route Supervisor
Posts: 454
Joined: 24 Sep 2004 15:47

Re: Cargo Distribution

Post by el koeno »

ChillCore wrote:Hi fonso,
I see you only included openttd.exe
You need everything from the bin i think.
Try these to compare.
I think you can leave the svn folders out.
Thanks, that one worked. It might contain some copyrighted material though.

mullie0
Engineer
Engineer
Posts: 14
Joined: 13 Oct 2008 11:40

Re: Cargo Distribution

Post by mullie0 »

wow this really works great fonso :bow: :bow: :bow:

I only have one question. In the map there are some new black numbers. What do they exactly mean?

Also sometimes the numbers are writen on top of the numbers of other cities rendering them unreadible

User avatar
ChillCore
Tycoon
Tycoon
Posts: 2658
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Cargo Distribution

Post by ChillCore »

Thanks, that one worked. It might contain some copyrighted material though.
Please tell me which files those are.
So i do not do that again.
I will remove the binaries if needed.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

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 »

mullie0 wrote:wow this really works great fonso :bow: :bow: :bow:

I only have one question. In the map there are some new black numbers. What do they exactly mean?

Also sometimes the numbers are writen on top of the numbers of other cities rendering them unreadible
The numbers are shown in the following format:

U/C:S/P

U = usage of the link (cargo having arrived at the destination coming from the source)
C = capacity of the link
S = cargo sent along the link (without necessarily arriving at the other side)
P = cargo planned for the link

Of course this doesn't matter much as no one can read it. If you click on the town names button some coloured boxes will be shown instead, but those are only marginally more readable. The coding is as follows:

white: capacity
grey: usage
red: plan
yellow: sent

The space, however, is so tight that you have to get really close to the screen in order to see if there is a box of a certain colour or not. And then you still don't know much about its size. Also, in areas with lots of stations, for example in town centers, the boxes still overlap and you can't discern anything. I'm thinking of reducing the space used for each item of information even further by drawing cubes instead of boxes, but I doubt it would help a lot.

So, I got a task for the artists among you: Draw a mockup of how the capacity/usage/planned/sent information (or at least a subset you'd like to see there) can be displayed readably in the map. I could really use an idea there as I'm not very good with GUI stuff.
The guy on the picture is not me, it's Alonso.

mullie0
Engineer
Engineer
Posts: 14
Joined: 13 Oct 2008 11:40

Re: Cargo Distribution

Post by mullie0 »

thank you very much for the info Fonso

as
Transport Coordinator
Transport Coordinator
Posts: 281
Joined: 07 Mar 2007 20:13

Re: Cargo Distribution

Post by as »

ChillCore wrote:
Thanks, that one worked. It might contain some copyrighted material though.
Please tell me which files those are.
So i do not do that again.
I will remove the binaries if needed.
I don't think any files should be removed, but you should add GPL-licence.

el koeno
Route Supervisor
Route Supervisor
Posts: 454
Joined: 24 Sep 2004 15:47

Re: Cargo Distribution

Post by el koeno »

ChillCore wrote:
Thanks, that one worked. It might contain some copyrighted material though.
Please tell me which files those are.
So i do not do that again.
I will remove the binaries if needed.
I'm not totally sure, but the data directory might contain some of the original artwork. I'm not entirely sure, as it might just contain the openGFX these days. I only use the openttd/data directory in "My Documents", so I wouldn't really know. ;)

Jafinto
Engineer
Engineer
Posts: 10
Joined: 04 Apr 2009 12:35
Location: The Hague, The Netherlands

Re: Cargo Distribution

Post by Jafinto »

ChillCore wrote:
Thanks, that one worked. It might contain some copyrighted material though.
Please tell me which files those are.
So i do not do that again.
I will remove the binaries if needed.
You haven't included any of the original artwork grfs, so no reason to panic ;). For the record, the said files are (at least for the windows version): sample.cat, trg1r.grf, trgcr.grf, trghr.grf, trgir.grf and trgtr.grf. I think the files of the DOS version have other names, but they are similar though.

-3s-
Engineer
Engineer
Posts: 12
Joined: 09 Apr 2009 19:26
Location: La Haye, NL

Re: Cargo Distribution

Post by -3s- »

I just tried Chillcore's build: cargodist_r16055_win32.7z [2.88 ].

Again I builded two buses: A->B and A->C. So far no freezings yet, or high cpu-load. I will try further by building trains. I'll keep you posted, but so far so good.

User avatar
ChillCore
Tycoon
Tycoon
Posts: 2658
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Cargo Distribution

Post by ChillCore »

Yes, lets get back on topic.

Here too it runs like a train even with bigger savegames.
I watched smallmap mostly i love how i can evaluate downloaded savegames.

For cargo distribution testing i should start a new game i guess ...
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

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.

DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Cargo Distribution

Post by DaleStan »

Zuu wrote:

Code: Select all

1/accuracy < epsilon
can be changed to

Code: Select all

1 < epsilon * accuracy
In pure math, these are equivivalent
No, they're not. They are equivalent iff "accuracy" is positive.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser

el koeno
Route Supervisor
Route Supervisor
Posts: 454
Joined: 24 Sep 2004 15:47

Re: Cargo Distribution

Post by el koeno »

Jafinto wrote:
ChillCore wrote:
Thanks, that one worked. It might contain some copyrighted material though.
Please tell me which files those are.
So i do not do that again.
I will remove the binaries if needed.
You haven't included any of the original artwork grfs, so no reason to panic ;). For the record, the said files are (at least for the windows version): sample.cat, trg1r.grf, trgcr.grf, trghr.grf, trgir.grf and trgtr.grf. I think the files of the DOS version have other names, but they are similar though.
Ah, good. I wasn't sure what was in the .grfs in the data directory.

On-topic: It seems to work fine, haven't found any problems. The GUI needs a major overhaul, but Fonso is on the case there.

MJS
Director
Director
Posts: 539
Joined: 28 Jul 2005 09:31

Re: Cargo Distribution

Post by MJS »

The Cargodest GUI worked quite well, I feel - lots of information, yet presented in an accessible format. And you could set your favourite view (for me, Destinations) as your default.

MJS
Director
Director
Posts: 539
Joined: 28 Jul 2005 09:31

Re: Cargo Distribution

Post by MJS »

With the r16055 exe version I get 100% CPU load and then game crashes. I run the 2cc set on a 512/256 map with snowy terrain. What debugging/crash information can I send in to help?

(I've just built a network with an eye on the CPU meter all the time. Seems that my method of making a few very long-distance connections with very few stations all across the map brings CPU up quite a lot.; up to 60% for some time after I open the link, with just two trains. See attached image. The other two trains run a local line with four stops.)
Attachments
CPU.jpg
(606.66 KiB) Downloaded 117 times

Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 23 guests