The International Simutrans Forum

 

Author Topic: Extension of fab details  (Read 8252 times)

0 Members and 1 Guest are viewing this topic.

Offline hreintke

  • *
  • Posts: 168
Extension of fab details
« on: October 22, 2012, 04:27:28 PM »
LS,

I always end up going from factory to factory finding out where goods are and how the storage at suppliers and consumers is.
I updated info_con and info_prod from simfab.cc to contain :

This shows up in the fab  window.

- at consumption
The number of halts that contain the goods for this fab and the amount
The number of convoys that contain the goods for this fab and the amount

- at consumer and supplier
The actual/max storage of the goods (not yet designated to a destination !) and whether a route exists.

See the attached picture for an example

For now I just did not cache anything, works fine with my (rather small) games.
If it is a usefull patch I can do more work on it to make it more efficient.

Herman

Offline greenling

  • Lounger
  • *
  • Posts: 1728
  • Simutransarchology it my hobby!
  • Languages: DE,EN
Re: Extension of fab details
« Reply #1 on: October 22, 2012, 04:32:43 PM »
hreintke
Your Patch it very good that be are missing in Simutrans! :thumbsup:

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10636
  • Languages: De,EN,JP
Re: Extension of fab details
« Reply #2 on: October 22, 2012, 06:54:26 PM »
The idea is nice. Just the presentations needs probably more userfreindlyness for non-professional gamers.

Some settings are imho better done with icons, like Route ok. Also the producer's text is better "oil pump at (2,3) has 13 of 111 m³ (route ok icon)" or as translator string "%s at (%s) offers %s of max. %s%s" For consumer just instead of offers use accepts.

The convoi stuff I found very confusing. Maybe add another statistics with the number of convois (or rather destinations) served by this factory. Especially since every ten crates those will be recalculated by every factory anyway, caching is almost free.

Offline hreintke

  • *
  • Posts: 168
Re: Extension of fab details
« Reply #3 on: October 23, 2012, 08:11:34 AM »
Prissi,

I agree on user friedliness. I first wanted to see whether I was able to get the information I wanted to show.
Didn't use an  icon as I just don't know (yet) how to do that. Thought on colorcoding and will give it a try.

On Convoys, it are not only convoys which are directly linked to the factory. If goods are moved to an intermediate storage area (halt) another convoy will move goods further to the destination.
I want to show how much goods are in "Transition/Moving to" the factory. That's why I check all halts and convoys, where I check the specific good, bound for the destination (fab).

Will work further on it.

Herman

« Last Edit: October 23, 2012, 08:21:54 AM by hreintke »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10636
  • Languages: De,EN,JP
Re: Extension of fab details
« Reply #4 on: October 23, 2012, 07:25:58 PM »
I like the goods in transit idea. It could be even added to factories, that goods in transit will be recorded at the recieving factory and so avoid the oversupply. I.e. production will stop when the factory input is
a) 100% full,
b) not empty and more than 200% of maximal input was sent
c) fully empty and more than 500% was sent

The just requires few additions to the code handing the removal of lost goods (i.e. when a convoi is sent to a depot) but would avoid the often problem of factories producing too much during not 100% input filled times.

Thus the input will be something like this
Requires
coal (sent 250t, avail. 14t of 300t max)

The produced sent goods cannot be tracked, as each packet only knows it destination. But this number is not so important imho. And the route information is anyway updated after every 10 unit of goods.

Counting convois seem rather too brute force for some games I have in my possession.

Offline isidoro

  • Devotee
  • *
  • Posts: 1140
Re: Extension of fab details
« Reply #5 on: October 23, 2012, 10:21:30 PM »
I would use the word ordered instead of sent.  It seems clearer to me.

Or if not accurate, in transit.  I would also put the available quantity first.  It seems more important.


Offline VS

  • Senior Plumber (Devotee)
  • Devotees (Inactive)
  • *
  • Posts: 4856
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Extension of fab details
« Reply #6 on: October 24, 2012, 09:11:03 AM »
I like "in transit"... and it could be used for both sending and receiving, which might be a good or bad thing.

Offline Zeno

  • ENASSA Designer
  • Devotees (Inactive)
  • *
  • Posts: 1997
    • Zeno's Simutrans Creations
  • Languages: ES, EN, CAT
Re: Extension of fab details
« Reply #7 on: October 24, 2012, 12:41:27 PM »
Wow, this amount of info on the goods being transported from/to a factory is great!
Btw, I like in transit too (+1) as a description for those goods.

Offline hreintke

  • *
  • Posts: 168
Re: Extension of fab details
« Reply #8 on: October 24, 2012, 03:24:24 PM »
LS,

I have some ideas to work on with the remarks given in this thread. But it has to wait until the weekend to actively do something.

Herman

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10636
  • Languages: De,EN,JP
Re: Extension of fab details
« Reply #9 on: October 24, 2012, 07:33:28 PM »
The translation can be agreed on later. Even the order can be changed later. I would like two seperate strings, since not all languages may have this universal term.

Offline hreintke

  • *
  • Posts: 168
Re: Extension of fab details
« Reply #10 on: October 28, 2012, 02:23:42 PM »
LS,

Next version of the patch. It keeps a running value of goods in transit to avoid the full parsing of halts and convois.
Value is initialized in "laden_abschliessen" by a one time full parse.

Need to do
- update transit value after arriving in a depot when goods are removed
- update transit value after "recall ware"
- clean up coding

If anyone knows addtional locations in the code where running value of translit should be updated please let me know.

See attachments for current view and source patch.

Herman

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10636
  • Languages: De,EN,JP
Re: Extension of fab details
« Reply #11 on: November 05, 2012, 10:04:06 PM »
Instead of Route ok, I think I would also add for the supplier the amount in transit.

Offline hreintke

  • *
  • Posts: 168
Re: Extension of fab details
« Reply #12 on: November 06, 2012, 09:24:00 AM »
Prissi,

I don't understand what you would like to see under suppliers.

For suppliers themself, the in transit counts is their input materials, not the output to the fab that we are detailing.
And the goods in transit do not know their origin (and even can be combined from several sources), so I cannot split the overall in transit of a good (as shown under consumption).

For a consumer the in transit could be added easily.

For the route, I agree that the text shown is not the best option. I have been looking into icons or even better buttons but just do not know/understand how to update the gui code to get them in. Some example code will be helpful there.
I prefer buttons as I am looking into the possibility to be able to show the latest calculated route for the goods when pushing that. I have some prototype code getting that info already so looks feasible.

Also for the other texts. I presume something  has to be done to get them translated properly. Any hint on requirements for get that done are appreciated so I can also work on that.

Herman
« Last Edit: November 06, 2012, 10:04:19 AM by hreintke »

Offline hreintke

  • *
  • Posts: 168
Re: Extension of fab details
« Reply #13 on: November 18, 2012, 03:23:01 PM »
LS,

Next version of the patch.
I think all base functionality is now included (all locations where in transit should be updated are in).

Each eingang of fab now has an addtional value of "in transit". For now only used for display.

Still to do, but I cannot do that is :

- Prissi's wish to make route ok text to a button
- Make it working on with translations.

I am happy to work on that too but will need help to get started.




Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10636
  • Languages: De,EN,JP
Re: Extension of fab details
« Reply #14 on: November 18, 2012, 04:32:09 PM »
Well, you work has kickstarted me to finish the stuff I had also started. The final result is likely a mixture of both ...

EDIT: Ok, submitted code, that chang be used to avoid cheating by not transporting stuff. There is a problem with the "In transit" button, as it is normally nor really seen in the factory statistics dialoge.

BTW, a good setting for the percentage in not too large maps is 25. (Default no limit as before.)
« Last Edit: November 18, 2012, 09:33:23 PM by prissi »

Offline hreintke

  • *
  • Posts: 168
Re: Extension of fab details
« Reply #15 on: November 19, 2012, 06:48:34 PM »
Prissi,

I am surprised you put the absolute value of in transit into the graphs. It has no "historical reference" as now for ealier months/years it is just the value what it was at the end of the reporting period. Maybe the max in transit is a better choice.

Also I would add the stock/in transit/max values for the consumers. That gives an easy insight in possibilty of delivery.

Herman

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10636
  • Languages: De,EN,JP
Re: Extension of fab details
« Reply #16 on: November 19, 2012, 09:19:50 PM »
About the graph: Also stock is just the value at the end of the month. THis is just in accordance with these statistics.

Also I would add the stock/in transit/max values for the consumers. That gives an easy insight in possibilty of delivery.
What do you mean by consumers? Only the recieving amount could be calculated easily, the amount sent out an still in transit cannot be guessed (as wares does not remember their origin=.

Offline hreintke

  • *
  • Posts: 168
Re: Extension of fab details
« Reply #17 on: November 20, 2012, 09:02:56 PM »
Prissi,

Ok, understand graph. I am just used more to look at arrived, consumed, delivered and produced on which you see growth of factory.

For consumers, I meant the information shown in fab display. My focus on the patch is/was to show more details on the suppliers/consumers in the fab display so you need less clicking to get a complete factory overview.
In transit was added also but not main reason.

See the picture what is displayed with my patch. In there, in the information showed for consumers, the in transit amount can be added easily. And yes, this in transit amount can be also from other factories but knowing the overall figure "explains" why a factory is not producing or transporting to it's consumers.

Herman

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10636
  • Languages: De,EN,JP
Re: Extension of fab details
« Reply #18 on: November 23, 2012, 09:09:05 PM »
Ok, those just repeat the stock/max numbers of the factories. But this will make the dialoge no longer fitting the targeted default tile size of all simutrans dialoges. I also do not see what information I gain from current amount in store and max amount, since this is not related to production at all.

And as mentioned before, a special mark (or maybe just bold text) for the active supplier resp. consumers in the last month could be easily added.

Offline ӔO

  • Devotees (Inactive)
  • *
  • Posts: 2345
  • Hopefully helpful
  • Languages: en, jp
Re: Extension of fab details
« Reply #19 on: November 23, 2012, 09:13:56 PM »
or even colour would work, if that's possible.

blue for connected route
orange or black for unconnected

Offline IgorEliezer

  • Devotee
  • Administrator
  • *
  • Posts: 4111
  • I have nothing to do with it!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Extension of fab details
« Reply #20 on: November 24, 2012, 12:53:58 AM »
While I think this would be a great feature, and it is, I'm afraid there's too much "wall-of-text" in the dialogues.

What if a bit of it were icons instead of texts?

Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1434
Re: Extension of fab details
« Reply #21 on: November 24, 2012, 01:02:23 AM »
The extra information would fit good in a details dialogue as seen with the convoy and halt info details; Keeps the main dialogue cleaner.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10636
  • Languages: De,EN,JP
Re: Extension of fab details
« Reply #22 on: November 24, 2012, 10:11:11 PM »
The original request was to show more information ...

But I agree with the wall of text. What about showing the goods symbol (which needs to be there anyhow) in front of a supplied factory. (So far, it will be mostly one for most factories.)

EDIT: See attached patch
« Last Edit: November 24, 2012, 10:51:19 PM by prissi »

Offline hreintke

  • *
  • Posts: 168
Re: Extension of fab details
« Reply #23 on: November 27, 2012, 06:23:12 PM »
Prissi,

Nice and neat idea. It now shows after some time the active connections, may take some time when a factory is overloaded due to in transit goods delivery.
Not sure yet how it will show when reset.
I am working with this now on my current gameplay.

Technical question : Is it easily possible to give the text a color to indicate specific status like "too much in transit" or "factory overloaded" ?

Herman

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10636
  • Languages: De,EN,JP
Re: Extension of fab details
« Reply #24 on: November 28, 2012, 02:52:18 PM »
The factories could show their status bars. But I think this is rather too much information.

Also the "life time" of the symbols could depend on the amount sent.

Offline hreintke

  • *
  • Posts: 168
Re: Extension of fab details
« Reply #25 on: December 15, 2012, 12:02:52 PM »
LS,

If you apply the attached patch. The intransit value is also displayed in the factory list.

Herman
« Last Edit: December 15, 2012, 03:09:28 PM by hreintke »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10636
  • Languages: De,EN,JP
Re: Extension of fab details
« Reply #26 on: December 15, 2012, 09:49:11 PM »
Instead of more subentries, I used 123+2044 to indicate input+transit. The sort by input will now also sort by input+transit, since this make more sense.

Offline hreintke

  • *
  • Posts: 168
Re: Extension of fab details
« Reply #27 on: December 16, 2012, 10:45:46 AM »
Prissi,
I see what you did.
Two remarks on the windows now.

1/ Button text doesn't match the sort order.
I am not sure yet what sortorder really happens in each sort option.

2/factorynames and numbers are not aligned and difficult to read.
See attached screenshot. Maybe a names and numbers should be split into two columns.

Herman

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10636
  • Languages: De,EN,JP
Re: Extension of fab details
« Reply #28 on: December 16, 2012, 11:37:40 AM »
Input sorts by the first numer (in store + in tranit) since this is the amount available. The problem with not producing/consuming factories alway being first in one sort direction was already there before.

Offline greenling

  • Lounger
  • *
  • Posts: 1728
  • Simutransarchology it my hobby!
  • Languages: DE,EN
Re: Extension of fab details
« Reply #29 on: December 16, 2012, 02:31:21 PM »
Hello
I view that the work on the extension of fab details go forward.

Offline hreintke

  • *
  • Posts: 168
Re: Extension of fab details
« Reply #30 on: December 18, 2012, 08:53:08 PM »
LS,

I noticed the input+transit and sorting on that, maybe button text should reflect that but is fairly clear.
I looked at output sort and don't think that's working correctly. See attached ascending and descending screenshots.

Further. Status of factory is now dependent on input only. That is correct when only using input but when using get_factory_maximum_intransit_percentage <> 0 maybe it should refect that status instead of input.

Herman

Offline hreintke

  • *
  • Posts: 168
Re: Extension of fab details
« Reply #31 on: December 19, 2012, 08:57:19 AM »
Prissi,

I found the issue in the sorting.

Your patch removed the "case factorylist::by_output" from compare_factories routine.
That means when using the by_output option, the list now gets sorted by the default value = by_name.

Herman

Code: [Select]
compare_factories(factorylist::sort_mode_t sortby_, bool reverse_) :
sortby(sortby_),
reverse(reverse_)
{}

bool operator ()(const fabrik_t* a, const fabrik_t* b)
{
int cmp;
switch (sortby) {
default:
case factorylist::by_name:
cmp = 0;
break;


Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10636
  • Languages: De,EN,JP
Re: Extension of fab details
« Reply #32 on: December 19, 2012, 09:57:33 PM »
Thank you, an extremely stupid copy&paste error. I am really getting old.