Mass orders/grouping interface

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

l_Blue_l
Transport Coordinator
Transport Coordinator
Posts: 285
Joined: 29 Mar 2006 22:42
Contact:

Post by l_Blue_l »

:) looks goods to me.

i like it how you have added "add shared vehicles". But will there be different types of groups where the vehicles can be in each type of group. eg RouteID, GroupID, CargoGroupID, EngineGroupID etc etc. //sorry if i didnt explain it that well in my last post
Asterix
Engineer
Engineer
Posts: 121
Joined: 04 Apr 2005 18:17
Location: Germany

Post by Asterix »

I've got an extended function for building vehicle-lists that allows filtering... maybe this could be used in conjunction with the grouping thing, too.

The problem is: If you include too much in one patch, none of the devs will have the time to look through all of it to include it into trunk (see my stats-patch for a bad example :wink: )

If you really want to get it into trunk you should try to first get the basics working and think about expanding it later. You might also want to talk to some devs on IRC.
nycom
Engineer
Engineer
Posts: 62
Joined: 14 Nov 2005 13:14
Location: Paris, France

Post by nycom »

I update the group patch. I add two new buttons ("Replace Vehicles" and "Add Shared Vehicles").

Features :
- Create a group : press the "create" button.
- Rename a group : select the group you want to rename, then press the "rename" button.
- Delete a group : select a group and press the "delete" button.
- Add a vehicle to a group : on the right side, click on a train and drag and drop over a group.
- Delete a vehicle from a group : on the right side, click on a train, and drag and drop over the group "All trains".
- Change a vehicle from a group : on the right side, click on a train and drag and drop over an other group.
- Start/Stop all vehicles of a group.
- Send to depot/service all vehicles of a group.
- Add Shared Vehicles to a group : press the "Add shared vehicles" button, it automatically adds all shared vehicles of all vehicles of the group.
- Replace Vehicles : You can replace vehicles from a group only. The global autoreplace function override this feature.
- When you click on a group name, you can see all vehicles which are in this group (screenshot).
- You can't rename or delete the group "All trains".
- The groups are load/save.


I upgrade SAVEGAME_VERSION to 33, so don't overwrite your savegame.
Attachments
group_interface_r6358.diff
(79.5 KiB) Downloaded 337 times
La SNCF, 27th Apr 1979.png
La SNCF, 27th Apr 1979.png (48.65 KiB) Viewed 7082 times
La SNCF, 27th Apr 1979 #1.png
La SNCF, 27th Apr 1979 #1.png (64.56 KiB) Viewed 7083 times
User avatar
White Rabbit
Tycoon
Tycoon
Posts: 1734
Joined: 22 Jun 2005 19:15

Post by White Rabbit »

:shock: This is an excellent patch that will allow players yet more control over their fleet of vehicles, so great job!

I do, however, think that another feature is needed, which is the 'replacement protection' of a group. By protecting a group, global vehicle replacements will simply not affect it, and this simplifies things a lot.

EDIT: Heh, the E60CP is supposed to be a passenger locomotive only. :P That's why it has a P at the end.
Image
nycom
Engineer
Engineer
Posts: 62
Joined: 14 Nov 2005 13:14
Location: Paris, France

Post by nycom »

White Rabbit wrote:EDIT: Heh, the E60CP is supposed to be a passenger locomotive only. :P That's why it has a P at the end.
It's a bug of the autoreplace function. I just report it to bugs.openttd.org
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

nycom wrote:
White Rabbit wrote:EDIT: Heh, the E60CP is supposed to be a passenger locomotive only. :P That's why it has a P at the end.
It's a bug of the autoreplace function. I just report it to bugs.openttd.org
funny, I just got a mail from flyspray telling me that somebody named nycom posted a bug report regarding autoreplace.
The thing is.. it's been a while since I last tried the US set. How is it supposed to work? And what happened, that was wrong?

The answers to those two questions would really help finding the bug :wink:
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

White Rabbit wrote:EDIT: Heh, the E60CP is supposed to be a passenger locomotive only. :P That's why it has a P at the end.
actually passenger/freight locomotives are more like guidelines than mandatory (at least in the real world). A true freight locomotive like the Allegheny was even outfitted with heating steam pipes and valves to heat up passenger cars (rarely used though). For those of you, who don't know it, it's a 7500 HP, 550-600 (different measurements) Ton steam locomotive designed to haul thousands of tons of coal. This engine even beat Big Boy in drawbar power.
Don't be so traditional in your thinking that you limit yourself more than needed :P
Psistorm
Traffic Manager
Traffic Manager
Posts: 173
Joined: 05 Jun 2004 12:22

Post by Psistorm »

This is a most excellent patch you have there :D
Cant wait until it hits the nightlies/trunk
User avatar
White Rabbit
Tycoon
Tycoon
Posts: 1734
Joined: 22 Jun 2005 19:15

Post by White Rabbit »

Bjarni wrote:
nycom wrote:
White Rabbit wrote:EDIT: Heh, the E60CP is supposed to be a passenger locomotive only. :P That's why it has a P at the end.
It's a bug of the autoreplace function. I just report it to bugs.openttd.org
funny, I just got a mail from flyspray telling me that somebody named nycom posted a bug report regarding autoreplace.
The thing is.. it's been a while since I last tried the US set. How is it supposed to work? And what happened, that was wrong?

The answers to those two questions would really help finding the bug :wink:
Oracle coded the GRF in a way that prevents players from attaching freight wagons onto certain locomotives (this can be found in the US Set readme, and E60CP is one of them). The bug is that auto-replace can be used to circumvent this.

And about the E60CP, I was 'traditional' because it is simply inefficient at freight duties, and was designed solely with passenger service in mind. (I may be wrong, but it may not even be capable of hauling freight wagons IRL).
Image
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

White Rabbit wrote:Oracle coded the GRF in a way that prevents players from attaching freight wagons onto certain locomotives (this can be found in the US Set readme, and E60CP is one of them). The bug is that auto-replace can be used to circumvent this.
actually autoreplace a locomotive (or wagon, it's the same code) is basically done with build command, refit command if needed, move command (new into rear of old), move old out of train, move cargo command if needed, sell command for old one. The user should be able to do this manually as well and trigger the same bugs (if any). Autoreplace relies heavily on the commands the user can trigger to avoid autoreplace specific bugs. I changed it to this after autoreplace had problems with articulated locomotives and dualheaded locomotives (you might be able to remember that).

I can't see how autoreplace would be able to trigger this bug. It looks more like an unsupported feature in newgrf files. Feel free to proof me wrong :wink:
Asterix
Engineer
Engineer
Posts: 121
Joined: 04 Apr 2005 18:17
Location: Germany

Post by Asterix »

Psistorm wrote:This is a most excellent patch you have there :D
Cant wait until it hits the nightlies/trunk
I agree, that its a good idea.

But in its current state it will never make it to the nightlies/trunk, because the patch is getting way too big already :roll:

@nycom: I would strongly recommend you come to IRC to talk to Bjarni
(if I'm around i might be able to answer some questions, too ;) )
User avatar
White Rabbit
Tycoon
Tycoon
Posts: 1734
Joined: 22 Jun 2005 19:15

Post by White Rabbit »

Bjarni wrote: I can't see how autoreplace would be able to trigger this bug. It looks more like an unsupported feature in newgrf files. Feel free to proof me wrong :wink:
On further inspection, this newgrf feature is supported (peter1138 specifically made a patch for it, and it's in the trunk). If you test the US Set in OTTD/TTDP, you'll find that the E60CP can't carry freight cars.

Boxcars, TOFCs, heavy-item flatcars, intermodal container flats, high-cube boxcars, autoracks, and roadrailers are the exceptions to this rule, because the US Set readme states
E60CP - can only haul passengers, mail, valuables, food and goods.
(Yes, that's quite a lot of wagons, but they're still a minority, since it IS the US Set ;)).

Off-topic explanation to why this was believed to be a bug:
I thought that the E60CP could haul no freight. This was due to a real bug in the US Set that disables the attachment of valid wagons after the player tries to attach an incompatible wagon (such as a tanker), and then sells that wagon. This is all in TTDP. OTTD is mentioned later.

For example:
1. I add 1 coal wagon to my E60CP train of 5 boxcars. I then sell the coal wagon. Now I can no longer add any freight wagons (this even goes for armoured cars), unless I remove those 5 boxcars from the train.
2. I add 1 coal wagon to my E60CP engine, and then sell it. Now I can't add freight wagons at all, and must sell, then rebuy, my engine.
3. I add 1 coal wagon to my E60CP engine/train, and then remove it without selling it. I can still add freight wagons to my engine/train.

As you can see, this is easy to work around, but nevertheless a bug, and it's heading for the US Set thread soon. Ish.

Strangely enough, OTTD does not experience this bug (i.e. examples 1 and 2 do not apply).
Image
nycom
Engineer
Engineer
Posts: 62
Joined: 14 Nov 2005 13:14
Location: Paris, France

Post by nycom »

I update the patch to revision 6396.

I add a new button :
- Replace Protection, if on, global autoreplace have no effect on the group.
Asterix wrote:But in its current state it will never make it to the nightlies/trunk, because the patch is getting way too big already Rolling Eyes

@nycom: I would strongly recommend you come to IRC to talk to Bjarni
(if I'm around i might be able to answer some questions, too Wink
I didn't have time to talk to dev last two days. However, the patch can be easily cut in 3 parts :
- Group GUI and command
- start/stop function
- replace function
Attachments
group_r6395_1.1.diff
(67.62 KiB) Downloaded 361 times
La SNCF, 28th Jan 1981 #1.png
La SNCF, 28th Jan 1981 #1.png (30.18 KiB) Viewed 6831 times
La SNCF, 28th Jan 1981 #2.png
La SNCF, 28th Jan 1981 #2.png (30.59 KiB) Viewed 6830 times
l_Blue_l
Transport Coordinator
Transport Coordinator
Posts: 285
Joined: 29 Mar 2006 22:42
Contact:

Post by l_Blue_l »

Your patch doesnt compile in Visual Studio 2005 it gives 12 errors

Error 1 error LNK2001: unresolved external symbol @CmdCreateGroup@16 command.obj
Error 2 error LNK2001: unresolved external symbol @CmdAddSharedVehicleGroup@16 command.obj
Error 3 error LNK2001: unresolved external symbol @CmdAddVehicleGroup@16 command.obj
Error 4 error LNK2001: unresolved external symbol @CmdRenameGroup@16 command.obj
Error 5 error LNK2001: unresolved external symbol @CmdDeleteGroup@16 command.obj
Error 6 error LNK2001: unresolved external symbol @InitializeGroup@0 misc.obj
Error 7 error LNK2001: unresolved external symbol __group_chunk_handlers saveload.obj
Error 8 error LNK2001: unresolved external symbol __group_pool vehicle.obj
Error 9 error LNK2001: unresolved external symbol @RebuildGroupVehicleList@0 vehicle.obj
Error 10 error LNK2001: unresolved external symbol @ShowPlayerGroup@4 main_gui.obj
Error 11 error LNK2001: unresolved external symbol @UpdateTrainGroupID@4 train_cmd.obj
Error 12 error LNK2001: unresolved external symbol @SetTrainGroupID@8 train_cmd.obj

The first patch worked like a charm and i known this one will too keep up the good work.

On a side note what about an option to display all trains not in a group.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

You have to add group.c to the VS project.
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
l_Blue_l
Transport Coordinator
Transport Coordinator
Posts: 285
Joined: 29 Mar 2006 22:42
Contact:

Post by l_Blue_l »

:D thanks, adding all the group files solved the problem. silly me i should of atleast checked the files were in the project first.
User avatar
mexicoshanty
Traffic Manager
Traffic Manager
Posts: 158
Joined: 22 Aug 2006 13:15
Location: Australia
Contact:

Post by mexicoshanty »

Wow! I've been away too long! So much progess has been made. I really like the double scroll bars that nycom has used, that'll make it much more easier to navigate.
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

mexicoshanty wrote:Wow! I've been away too long! So much progess has been made. I really like the double scroll bars that nycom has used, that'll make it much more easier to navigate.
you really have been gone a while. I added two vertical scrollbars to the autoreplace windows in January 2005.

For some reason nycom is the first one besides me to use two vertical scrollbars even though I added support for it so long ago.
l_Blue_l
Transport Coordinator
Transport Coordinator
Posts: 285
Joined: 29 Mar 2006 22:42
Contact:

Post by l_Blue_l »

Are there any updates on this project or has it died??
User avatar
mexicoshanty
Traffic Manager
Traffic Manager
Posts: 158
Joined: 22 Aug 2006 13:15
Location: Australia
Contact:

Post by mexicoshanty »

I hope not cos i was really looking forward to it.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Ahrefs [Bot] and 11 guests