FS#6189 - Vehicle Groups: parent group should count total number of vehicles in subgroups

Attached to Project: OpenTTD
Opened by A. Lam (2006TTD) - Friday, 26 December 2014, 10:28 GMT
Last edited by andythenorth (andythenorth) - Monday, 21 August 2017, 06:29 GMT
Type Bug
Category Interface
Status New
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


For ease of discussion I attached a screenshot showing a sample multi-level vehicle group.

First, I understand that in "Level 2" the grayed out entries are those that belong to the subgroups, this has no problem.

However, the number of vehicles shown on the left panel (i.e. the column at which the yellow arrow is pointing) may be confusing.
"Level 2" is displaying the figure of 1 - one vehicle which is in the group, but not in any of the subgroups, but some may be thinking it should be displaying 1+1+3+4+0 = 9

A similar problem is also seen in "2A", it may be debatable on whether it should be 1 or 1+3+4 = 8

To tackle this problem, there may be three solutions:
(1) Leave it as it is and add to the documentation that the numbers are meant for the vehicles that belong to that group at that level exclusively, but that is not very reasonable as many would expect a sum of the group and the subgroups from a mathematical perspective.

(2) Display the total number of vehicles in that group and subgroups
i.e. Level 1 would show 0+2+1+2 = 5; Level 2 showing 9; 2A showing 8 and so on.

(3) Display both figures in the form
(Number of vehicles in group only) / (Total number of vehicles in group and subgroups)
i.e. Level 1 would show 0/5; Level 2 showing 1/9; 2A showing 1/8 and so on.

This task depends upon

Comment by andythenorth (andythenorth) - Thursday, 17 August 2017, 20:15 GMT
In my experience (YMMV), hierarchies like the group hierarchy show a total per node based on the contents of all child nodes, not just on the contents of the node.

TL:DR; it should sum the subgroups.
Comment by 3298 (3298) - Thursday, 17 August 2017, 21:37 GMT
Ah, you found the correct ticket for that preparatory patch I posted over at FS#6053. I must've missed it. Thanks, Andy! :)

The patch implements solution 2 - with collapsed subgroups solution 1 is even more counterintuitive than now.
Solution 3 never occurred to me, but reading it now I find it intriguing. Though I'd change the format to "only_this_group (+sum_of_subgroups)" to avoid ambiguity. Opinions?
Comment by A. Lam (2006TTD) - Thursday, 05 October 2017, 09:13 GMT
Just caught up with this today. I would agree that using parentheses is clearer than the / symbol proposed previously.