Patch: Supplied cargo (in trunk r12596)

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

Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Patch: Supplied cargo (in trunk r12596)

Post by Roujin »

Supplied Cargo v4 released!

Download:
station_supplies_v4_r12436.diff
station_supplies v4 for r12436
(8.84 KiB) Downloaded 309 times
Changes:
- Removed unnecessary code (initial window size...)
- Unified some functions, general coding style, cleanup

Fixes:
- The "Supplied Cargo: ..." line was 90 pixels too low for newgrf rail station builder window.


have fun!

---
older post:

New version - v3!
For Changelog see this post: http://www.tt-forums.net/viewtopic.php? ... 19#p661619

Download:

Screenshots:
screenshot 1
screenshot 1
station_supplies_v3_1.png (68.28 KiB) Viewed 10323 times
screenshot 2
screenshot 2
station_supplies_v3_2.png (42.06 KiB) Viewed 10321 times

---
older post:

Version 2 updated to revision 11861

- Changed text to "Supplies:"
- Houses are now supported

download:


screenshot:


---
original post:

Another little patch i made :P

This adds another line to the station (all types) construction window which states what kinds of cargo will be delivered to that station. e.g. if you build a station near a steel mill, it will display:

Accepts: Iron Ore
Delivered: Steel


Works fine as far as i noticed; all cargos including newcargos are working - except for passengers and mail created by houses. They don't get displayed under "delivered" for some reason...

(maybe someone already made a patch like this and i didn't know about it... i guess someone must have thought of the same thing...)
Here's the patch.


and a screenshot:
Last edited by Roujin on 12 Apr 2008 17:45, edited 12 times in total.
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
User avatar
rbenevid
Traffic Manager
Traffic Manager
Posts: 192
Joined: 14 Oct 2004 20:08
Location: Brazil

Re: station_delivered

Post by rbenevid »

I think it's very useful, especially for primary industries which doesn't accept anything.

thanks, roujin!
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: station_delivered

Post by planetmaker »

You are on the best road to become my personal "favorite OTTD patcher" as you seem to implement exactly that stuff which I consider most useful :)

EDIT: I think I'd change the wording from "delivered" to either "delivers" or "supplies" or "provides"
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Re: station_delivered

Post by richk67 »

My thoughts exactly - Supplies: makes a better association with Accepts.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: station_delivered

Post by Rubidium »

And what when there are multiple stations already in the neighbourhood of the industries? Then it might be that an industry will not supply to the station. This will cause 'bug' reports of people telling that during the station building it said that it would get cargo X whereas it will nog get cargo X due to the too low rating of the station and the higher rating of the others.
Psistorm
Traffic Manager
Traffic Manager
Posts: 173
Joined: 05 Jun 2004 12:22

Re: station_delivered

Post by Psistorm »

how about calling it "May supply" instead of "Supplies"? - this wording implicates the possibility of the cargo not being delivered to the station and might prevent confusion.

as for the patch itself: its small, simple and great, imho, and is a logical addition to the station GUI. Id quite like it in trunk :)
User avatar
rbenevid
Traffic Manager
Traffic Manager
Posts: 192
Joined: 14 Oct 2004 20:08
Location: Brazil

Re: station_delivered

Post by rbenevid »

I thought the industry would always give at least minimal cargo to the station, even with low ratings. I always
hate when a train visits a station by mistake and then the station has forever a few units of cargo waiting...
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: station_delivered

Post by Rubidium »

Not when there are more stations that 'want' that cargo and have a higher rating.
User avatar
rbenevid
Traffic Manager
Traffic Manager
Posts: 192
Joined: 14 Oct 2004 20:08
Location: Brazil

Re: station_delivered

Post by rbenevid »

Everyday we learn something new...

Some tidbits that crossed my mind:

- what should be displayed if the secondary industry is not producing anything? Like a refinery without oil.

- I know some GRFs industries receive cargo from different parts of the sprite (animal farms, for example).
Is there any that produces different cargo from different parts of the sprite? If yes, this patch becomes
almost essential.
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: station_delivered

Post by Roujin »

This displays what cargos could be - under the right circumstances - supplied at the station being built.

In other words: The station has the possibility that cargo X will appear at it. It does not take into account that you may not receive the cargo because of what Rubidium mentioned, nor that you might have to deliver cargo Y to the secondary Industry before it starts spitting out cargo X.

If someone can think of a better word (than delivers or supplies) for that, out with it ;)
"May supply" sonds somewhat strange in my opinion.


@Rubidium: Hmm, I think like it is now you have exactly the same chance of people reporting such a situation. They know that a coal mine should produce coal anyways, so if they build a station at it in the situation you described and don't know about that rating stuff, they will also make a bug report like "not getting coal from coal mine".
It's no difference between if they are explicitly told "When building a station near a coal mine, it will be supplied with coal" and if they silently assume it. It's just a matter of convenience.

You could e.g. turn off the station acceptance radius if you find that ugly, without risking to misplace your station too far away. Or when playing with a new Industries grf set, it'd save you from having to click on all the industries again and again because you don't know anymore what a particular industry produced..
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: station_delivered

Post by Bilbo »

Rubidium wrote:And what when there are multiple stations already in the neighbourhood of the industries? Then it might be that an industry will not supply to the station. This will cause 'bug' reports of people telling that during the station building it said that it would get cargo X whereas it will nog get cargo X due to the too low rating of the station and the higher rating of the others.
But rating is thing that could change over time - once you stick trains waiting on full load into the station, you are likely to increase the rating of your station high enough to get some part of the production.
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: station_delivered

Post by Roujin »

Again, i'd appreciate additional suggestions regarding the naming of this - best would be something that sounds elegant and somehow includes that it is only a possibility, not a fact.

If someone has a good idea for that, i'll use it for a new version of this, else i'll probably use "supplies".

---
I now found out why the function that gives the delivered cargo doesn't work for houses - It's just not defined for tiles of type town. :roll:
The AI seems to work out passenger networks from cargo acceptance only (implicitly but somehow safely assuming that where's pax/mail accepted also pax/mail is produced)

I wonder If i break something (like the AI) if i define such a function for town tiles... hmm :roll:
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Re: Patch: show delivered cargo in station placement window

Post by richk67 »

Another suitable word may be "potential".

It gives the impression that it may provide, it may not.

Online thesaurus gave these synonyms: ability, capacity, possibility, makings, what it takes, aptitude, capability.

Not sure whether to combine it.. "potential supply:"
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
sc79
Director
Director
Posts: 586
Joined: 22 Feb 2005 09:51

Re: Patch: show delivered cargo in station placement window

Post by sc79 »

Supplies sounds fine to me. While it may be possible that in some situations, the station may not actually be supplied due to ratings, I don't think its a huge problem. With new industries, its also possible that stations won't accept goods, and it think thats far more potentially confusing than not receiving goods because of bad service ratings.
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: Patch: show delivered cargo in station placement window

Post by Roujin »

So here's the next version. I changed the text to "supplies". Plus now houses work properly. NewHouses too, they could even produce something totally different than passengers or mail. But i don't know of any newHouses that do that.

Download in first post.
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: show delivered cargo in station placement window

Post by Bilbo »

What about "Produces:" or "Can produce:" instead of "Supplies:" ?
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
Psistorm
Traffic Manager
Traffic Manager
Posts: 173
Joined: 05 Jun 2004 12:22

Re: Patch: show delivered cargo in station placement window

Post by Psistorm »

considering produce / can produce: imo its not the best way to say it, since it implies the station itself producing the goods, which is wrong.

I again suggest "can supply" or "may supply", in regards to my previous post and also Bilbo´s
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: station_delivered

Post by planetmaker »

Rubidium wrote:And what when there are multiple stations already in the neighbourhood of the industries? Then it might be that an industry will not supply to the station. This will cause 'bug' reports of people telling that during the station building it said that it would get cargo X whereas it will nog get cargo X due to the too low rating of the station and the higher rating of the others.
Nevertheless: The accepted cargo may also change, especially if you use ECS vectors with industry only accepting a certain amount. IMO it will greatly ease station placement as not every tile of an industry accepts or delivers the same or anything at all (e.g. steel plant, food factory,...).
I agree though, that a phrase like "may supply" is probably better than an phrase expressing certainty.

Regarding phrases:
may supply
may provide
may receive (from surrounding industry, but ambigious with 'accepts')
may wait (for pickup)

And I prefer 'may' over 'can' or 'possibly'.
User avatar
sickie
Engineer
Engineer
Posts: 85
Joined: 15 Sep 2007 00:51
Location: Slovenia
Contact:

Re: Patch: show delivered cargo in station placement window

Post by sickie »

In relation with "accepts", TTD's defaults, I support Roujin's "supplies" instead of "may/can(etc.) supply/provide(etc.)". It is more consistent.
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: show delivered cargo in station placement window

Post by Bilbo »

Perhaps using just "Supplies" or "Produces" would suffice. If people don't know that the cargo have some requirements to get actually produced, I think they'll complain no matter what the string would be (we can send those bug reports to /dev/null :) because listing conditions under which some cargo can be produced would be almmost impossible).
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 45 guests