Patch: Small map industry selector v6 [update]

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

BigBB
Engineer
Engineer
Posts: 106
Joined: 07 Aug 2007 20:39

Re: Patch: Small map industry selector [done]

Post by BigBB »

Hi gule,

first: nice patch.

I had a look into your patch-file and you have a big problem with spaces and tabs. E.g. the only thing what you change in an original code line is a space which you add on the end (e.g. line 61/62 and more). Or you have void lines only with tabs. In line 190 have you spaces instead of tabs before the DrawString().

And this DrawString() in line 190 have a magic number which isn't needed. Replace the "16" with "TC_BLACK" and have a look if there are more magic numbers which you can remove.

As a tip: it's helpfully if you read your patchfile before publish it.

Regards,
BigBB
OpenTTD-patch(es) in development: missing shores (new version of: completely shore), road lamps for each position
gule
Engineer
Engineer
Posts: 60
Joined: 16 Dec 2004 15:08
Location: Slovenia

Re: Patch: Small map industry selector [done]

Post by gule »

BigBB wrote:Hi gule,

first: nice patch.

I had a look into your patch-file and you have a big problem with spaces and tabs. E.g. the only thing what you change in an original code line is a space which you add on the end (e.g. line 61/62 and more). Or you have void lines only with tabs. In line 190 have you spaces instead of tabs before the DrawString().

And this DrawString() in line 190 have a magic number which isn't needed. Replace the "16" with "TC_BLACK" and have a look if there are more magic numbers which you can remove.

As a tip: it's helpfully if you read your patchfile before publish it.

Regards,
BigBB
Thank you. :]

I removed unneeded tabs and spaces and replace that magic number.
There are still a few magic numbers to replace (smallmap type, window size,...), but first i have to find the right enumerators or define new.
New version is in first post.
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Re: Patch: Small map industry selector [done]

Post by belugas »

I worked a bit on the feature, allowing myself a few changes. Results:
Attachments
Nothing changed in here
Nothing changed in here
Now_You_See_Them.png (39.06 KiB) Viewed 2805 times
Disabling has changed for grey, as it is more &quot;universal&quot;.<br />Plus the legend color is the industry color without border, making it less important, thus a bit dimmed
Disabling has changed for grey, as it is more "universal".
Plus the legend color is the industry color without border, making it less important, thus a bit dimmed
Now_You_See_A_Few.png (41.73 KiB) Viewed 2811 times
Have you noticed, no more industries on the small map ;)
Have you noticed, no more industries on the small map ;)
Now_You_Dont.png (38.39 KiB) Viewed 2805 times
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Re: Patch: Small map industry selector [done]

Post by belugas »

And here goes the diff
Attachments
smallmap_industry_selector_r11448.diff
(10.3 KiB) Downloaded 118 times
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
User avatar
George
Tycoon
Tycoon
Posts: 4364
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Re: Patch: Small map industry selector [done]

Post by George »

Time to put into the trunk?
Image Image Image Image
fabca2
Transport Coordinator
Transport Coordinator
Posts: 312
Joined: 14 Apr 2004 15:18
Location: Fr

Re: Patch: Small map industry selector [done]

Post by fabca2 »

just my poor suggestion (before going into trunk)
Instead of "enable all" and "disable all", it would be better to have "show all" and "hide all", no ?
gule
Engineer
Engineer
Posts: 60
Joined: 16 Dec 2004 15:08
Location: Slovenia

Re: Patch: Small map industry selector [in trunk r11474]

Post by gule »

It is in trunk with Belugas changes. :D :]
Thank you everyone for suggestions and help.
User avatar
pavel1269
Route Supervisor
Route Supervisor
Posts: 473
Joined: 03 Dec 2006 13:22
Location: Czech Republic
Contact:

Re: Patch: Small map industry selector [in trunk r11474]

Post by pavel1269 »

Congrats, this is one of my favorite patches :) Nice to see it in trunk.
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Re: Patch: Small map industry selector [in trunk r11474]

Post by richk67 »

Sorry - not been able to check the logs. Did this make it into v0.6.0-beta1?
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
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Re: Patch: Small map industry selector [in trunk r11474]

Post by belugas »

Nope. Sadly, i was not fast enough ;)
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: Small map industry selector [in trunk r11474]

Post by Bilbo »

Hmm .. I wonder whether it will get into beta2 once it would be out, or is there a feature freeze?
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)
User avatar
Digitalfox
Chief Executive
Chief Executive
Posts: 710
Joined: 28 Oct 2004 04:42
Location: Catch the Fox if you can...

Re: Patch: Small map industry selector [in trunk r11474]

Post by Digitalfox »

Bilbo wrote:Hmm .. I wonder whether it will get into beta2 once it would be out, or is there a feature freeze?
For what i understand, trunk is in a half freeze new features state ( just small medium features are inserted to prevent instability ), so this new feature will be in 0.6 beta 2 or RC's or Final 0.6.0 :)

Basically before when a RC was released from let's say version 0.5, no new features that made their way to trunk after the branch was created would be included.. With this system of Beta's every commit made in trunk until Final 0.6 is released will be in 0.6.0.. That is if theres no RC and it copy's the system of release from 0.5.0.. Hope i made myself easy to understand.. :D
User avatar
electricmonk
Engineer
Engineer
Posts: 50
Joined: 11 Aug 2006 08:20
Location: Earth

Re: Patch: Small map industry selector [in trunk r11474]

Post by electricmonk »

Hi,

Finally got to try this out. Good job. Below are 3 suggestions:
  • There should be a third button that toggles the selection (unselected industries are selected and selected industries are unselected). This is handy if you press an industry button but you forgot to press the "Disable all" button.
  • If the industries come from multiple GRF files (such as the ECS vectors), there should be a means of enabling/disabling only the vectors from a specific GRF file (eg. a single ECS vector).
  • If just one industry is selected, it should be possible to be able to select only those industries that accept a cargo produced by the selected industry. Likewise for selecting industries that produce cargo accepted by the selected industry.
gule
Engineer
Engineer
Posts: 60
Joined: 16 Dec 2004 15:08
Location: Slovenia

Re: Patch: Small map industry selector [in trunk r11474]

Post by gule »

electricmonk wrote:
  • If just one industry is selected, it should be possible to be able to select only those industries that accept a cargo produced by the selected industry. Likewise for selecting industries that produce cargo accepted by the selected industry.
Very good idea. I will try to make this feature.

But first I will add a button for selecting if disabled industries are shown in default color (red) or as grass (green). Because I like to see where are the other (not disabled) industries for better network planing.
User avatar
electricmonk
Engineer
Engineer
Posts: 50
Joined: 11 Aug 2006 08:20
Location: Earth

Re: Patch: Small map industry selector [in trunk r11474]

Post by electricmonk »

gule wrote:Very good idea. I will try to make this feature.
And so, ECS becomes more manageable...

What if an industry produced cargoes accepted by towns? Would the towns disappear from the map if what the industry produced was not accepted by towns? Perhaps the parts of the towns that accept the cargo could be coloured differently.
gule wrote:But first I will add a button for selecting if disabled industries are shown in default color (red) or as grass (green). Because I like to see where are the other (not disabled) industries for better network planing.
How about using grey as the default colour? A colour with zero saturation looks more 'unused'.
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Re: Patch: Small map industry selector [in trunk r11474]

Post by belugas »

electricmonk wrote:[*]If the industries come from multiple GRF files (such as the ECS vectors), there should be a means of enabling/disabling only the vectors from a specific GRF file (eg. a single ECS vector).
No way. Industries are industries, no matter where they are coming from. Although it is faisable, it is not required and is totally useless.
electricmonk wrote:[*]If just one industry is selected, it should be possible to be able to select only those industries that accept a cargo produced by the selected industry. Likewise for selecting industries that produce cargo accepted by the selected industry.[/list]
Once more, no way. This will only be usefull for a couple of minutes for the real beginners. Once they know what industry produces and requires what (all infor mations that are available easily), the feature will not be used, except maybe out of laziness. And I have very little respect of laziness...
Ho... and this will be quite more CPU intensive, by the way...
electricmonk wrote:What if an industry produced cargoes accepted by towns? Would the towns disappear from the map if what the industry produced was not accepted by towns? Perhaps the parts of the towns that accept the cargo could be coloured differently.
Do I need to express my feelings toward this one?
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: Small map industry selector [in trunk r11474]

Post by Bilbo »

belugas wrote:
electricmonk wrote:[*]If just one industry is selected, it should be possible to be able to select only those industries that accept a cargo produced by the selected industry. Likewise for selecting industries that produce cargo accepted by the selected industry.[/list]
Once more, no way. This will only be usefull for a couple of minutes for the real beginners. Once they know what industry produces and requires what (all infor mations that are available easily), the feature will not be used, except maybe out of laziness. And I have very little respect of laziness...
Ho... and this will be quite more CPU intensive, by the way...
Still better to select that in-game than digging in some readme file ... this query can be done only once at start/loading the map (what produces what) and then stored in memory.

So for temperate if you turn on this feature, then pick up coal mine, powerplants gets highlighted too. Then switch to iron ore mine and you see steel mills too, with only one click. Another function "do this with one click instead of five", which is IMHO useful not only for beginners.
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)
User avatar
electricmonk
Engineer
Engineer
Posts: 50
Joined: 11 Aug 2006 08:20
Location: Earth

Re: Patch: Small map industry selector [in trunk r11474]

Post by electricmonk »

belugas wrote:
electricmonk wrote:[*]If the industries come from multiple GRF files (such as the ECS vectors), there should be a means of enabling/disabling only the vectors from a specific GRF file (eg. a single ECS vector).
No way. Industries are industries, no matter where they are coming from. Although it is faisable, it is not required and is totally useless.
I suppose you're right. I was thinking about the ECS vectors and immagined that it would be easier to visualise the industry-chains if only one set was displayed at a time, but seeing that there are many cross-vector links in the chain, I see your point.
belugas wrote:
electricmonk wrote:[*]If just one industry is selected, it should be possible to be able to select only those industries that accept a cargo produced by the selected industry. Likewise for selecting industries that produce cargo accepted by the selected industry.[/list]
Once more, no way. This will only be usefull for a couple of minutes for the real beginners. Once they know what industry produces and requires what (all infor mations that are available easily), the feature will not be used, except maybe out of laziness. And I have very little respect of laziness...
Ho... and this will be quite more CPU intensive, by the way...
Here I have to disagree. What I had in mind was being able to select industry-types that are capable of recieving/producing cargo from/for the currently selected industry-type. That is, things like an instance of an industy-type (an individual industry) not accepting a certain type of cargo because it's stockpile is too full is not taken into account. All the code has to do is iterate through the 37 or so industry types and select them depending on whether or not they can accept/produce any type of cargo from/for the selected industry-type. This just needs to be done once. However, if the map were to display the current acceptance status of each and every individual industry in realtime, I can immagine that being CPU intensive, but that is not what I had in mind.

Now that NewIndustries has been implemented, even non-beginners will have trouble remembering all the cargo-flow possibilities. At the moment, there's ECS and PBI, and someone could just as well produce more industry-chains in the future, and every time someone wants to try a new industry-chain, they'll have to memorise an entire schema. Even though I've printed out the big schema-diagram of George's ECS vectors and refer to it frequently, I would still find being able to visualise potential cargo-flow on the map useful.

belugas wrote:
electricmonk wrote:What if an industry produced cargoes accepted by towns? Would the towns disappear from the map if what the industry produced was not accepted by towns? Perhaps the parts of the towns that accept the cargo could be coloured differently.
Do I need to express my feelings toward this one?
I suppose you're right here as well. I'd guess that that could take up much CPU time. It's probably not worth the CPU-time involved.
gule
Engineer
Engineer
Posts: 60
Joined: 16 Dec 2004 15:08
Location: Slovenia

Re: Patch: Small map industry selector [in trunk r11474]

Post by gule »

electricmonk wrote:What if an industry produced cargoes accepted by towns? Would the towns disappear from the map if what the industry produced was not accepted by towns? Perhaps the parts of the towns that accept the cargo could be coloured differently.
I will not touch towns. If you select an industy and select to see which industry accept produced cargo and none industry shows up it is posible only that industry produce something for towns (goods, mail,....) or that it produce nothing.
electricmonk wrote:How about using grey as the default colour? A colour with zero saturation looks more 'unused'.
In all smallmap types are industries shown in red color, so i will use it. Like I made it in my original version of this patch.
Bilbo wrote:Still better to select that in-game than digging in some readme file ... this query can be done only once at start/loading the map (what produces what) and then stored in memory.

So for temperate if you turn on this feature, then pick up coal mine, powerplants gets highlighted too. Then switch to iron ore mine and you see steel mills too, with only one click. Another function "do this with one click instead of five", which is IMHO useful not only for beginners.
I agree here with Bilbo.
User avatar
belugas
OpenTTD Developer
OpenTTD Developer
Posts: 1507
Joined: 05 Apr 2005 01:48
Location: Deep down the deepest blue
Contact:

Re: Patch: Small map industry selector [in trunk r11474]

Post by belugas »

Bilbo wrote:Still better to select that in-game than digging in some readme file ... this query can be done only once at start/loading the map (what produces what) and then stored in memory.
Maybe yu're not aware, but in newindustries, via callbacks, it is possible to change production and/or acceptance cargoes. Which means, if one would like to do it right, that the query at load will not reflect reality, and therefor would render the feature erroneous. So only the looping will be adequate. And then, watch out, more then one industry can accept/product given cargo. So... it's getting a bit complex, don't you think? And I was not referring to a readme file, by the way. The fund industry gui is full of infos, as well as each industry been clicked on :) So, all in all, i do not see much of a problem.

One thing that i could envision, though, would be a new section, where you will have "acceptance" points and "production" points. Much like the industry section, but only showing the cargo(s) been accepted/produced. I.E: houses do producce and accept passengers. Show it. INdustru too, show it, etc...
But this will not be a simple task to do. Just that it might be considered more interesting then overcharging the industry section with tons of new features.
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Baidu [Spider] and 8 guests