Subsidiaries management (latest build: r7213)

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

DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Scenario with Subs6161

Post by DaleStan »

dares wrote:Can I play Scenario, which I created in Subsidiaries (rev 6161), in classic OTTD?
Exists any way to play scenario created in Subs patch in classic version of OTTD?
No and Not unless you know how to code in C, respectively.
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

dares
Engineer
Engineer
Posts: 8
Joined: 22 Nov 2005 19:15

Re: Scenario with Subs6161

Post by dares »

DaleStan wrote:
dares wrote:Can I play Scenario, which I created in Subsidiaries (rev 6161), in classic OTTD?
Exists any way to play scenario created in Subs patch in classic version of OTTD?
No and Not unless you know how to code in C, respectively.
I did not want listen it :cry:
Bad news but thanks.

User avatar
LordOfThePigs
Route Supervisor
Route Supervisor
Posts: 435
Joined: 01 Jul 2004 10:28
Location: Jura/Switzerland

Post by LordOfThePigs »

Actually, that's not exactly true. Since the Subsidiaries patch does not make any changes to the savegame format, it is very possible to play games made with the subsidiaries patch in the nightlies.

However, the game might crash, throw an assertion error, or otherwise behave strangely if one of the following conditions is met:

- you have trains of company A running on company B's tracks.
- any vehicle of company A has a station of company B in it's order
- you have built stations where some parts belong to company A, and some part to company B

if none of these conditions as met, then you can probably play a subsidiaries patch game in a nightly more recent than the latest subsidiaries version.

So for examples, people that use one subsidiary for road vehicles, one subsidiary for trains, one subsidiary for airplanes etc... will probably not have any problem (unless they have built stations that meet the third condition). And as far as I know, this pattern is pretty common among people playing in single player mode.

Anyway, in the end, the best way to find out is to try.
Sometimes I'm told "Brilliant"...
Sometimes I'm told "Charming"...
And Often I'm told "Shut Up"!

SM9T8
Traffic Manager
Traffic Manager
Posts: 169
Joined: 23 Oct 2006 21:25
Location: Either the Shire or Brizzle.

Post by SM9T8 »

This patch is genius! It is exactly what I've wanted now for many years now, I've used it to create numerous 'lines' on a railway network, just to make the game more fun, and realistic, and have as yet found no problems.

Sorry If i've praised it in the wrong section of the forum, but i just wanted to thank those responsible.

User avatar
LordOfThePigs
Route Supervisor
Route Supervisor
Posts: 435
Joined: 01 Jul 2004 10:28
Location: Jura/Switzerland

Post by LordOfThePigs »

Hello,

here is a version that fixes all problems that I know of.

You are all invited to test it as much as you want.

I won't post a binary yet, because I don't have time to, but I'm sure somebody can do it :)

here's a list of changes (some of them might be old changes, because my fixed bugs list isn't versioned ;) ):
  • [fixed] busses/trucks do not enter station from other subsidiaries
  • [fixed] extending the station of another subsidiary attributes the extension to the wrong company
  • [fixed] impossible to extend the station of a subsidiary with a bus/truck station
  • [fixed] Depot windows do not take subsidiaries into account at all
  • [fixed] road vehicles (and possibly other vehicles) cannot find the path to subsidiaries depots
  • [fixed] when selling a vehicle the money goes to the selling player, not the vehicle owner
  • [changed] players cannot attach their wagons to other players trains, even subsidiaries. Basically, this forbids rainbow trains.
Attachments
subsidiaries_7134.diff
source code path to apply to trunk revision 7134
(148.62 KiB) Downloaded 462 times
Sometimes I'm told "Brilliant"...
Sometimes I'm told "Charming"...
And Often I'm told "Shut Up"!

MartinA
Engineer
Engineer
Posts: 58
Joined: 22 Nov 2002 00:18

Post by MartinA »

Great!
I'll start testing it as soon as someone put up a binary (wich I knew how to do it!)

/Good work!

Martin!

User avatar
mart3p
Tycoon
Tycoon
Posts: 1032
Joined: 31 Oct 2005 21:00
Location: UK

Post by mart3p »

I've found a bug, it's still possible to build rainbow trains.

If you have an unattached wagon in the depot, switch to a different subsidiary company, build another wagon of the same type and it will attach to the unattached wagon. Repeat this a number of times, each time switching to a different subsidiary. You can then use CTRL-drag to move all the wagons and attach them to an engine. If the first wagon belongs to the same company as the engine they will all attach.

To fix this change the function CmdBuildRailWagon at line 595 in train_cmd.c as shown:

Code: Select all

FOR_ALL_VEHICLES(w) {
	if (w->type == VEH_Train && w->tile == tile &&
			w->owner == _current_player &&               // <- add this line
			IsFreeWagon(w) && w->engine_type == engine) {
		u = GetLastVehicleInChain(w);
		break;
	}
}
MartinA: I’ve attached a win32 exe (with fix above included).
Attachments
OTTD-win32-r7162-subs.zip
win32 exe
(1.39 MiB) Downloaded 603 times
Image

User avatar
LordOfThePigs
Route Supervisor
Route Supervisor
Posts: 435
Joined: 01 Jul 2004 10:28
Location: Jura/Switzerland

Post by LordOfThePigs »

mart3p wrote:I've found a bug, it's still possible to build rainbow trains.

If you have an unattached wagon in the depot, switch to a different subsidiary company, build another wagon of the same type and it will attach to the unattached wagon. Repeat this a number of times, each time switching to a different subsidiary. You can then use CTRL-drag to move all the wagons and attach them to an engine. If the first wagon belongs to the same company as the engine they will all attach.
Wow, you are twisted :shock:

;)

Thanks for the spot and the fix. I'll post the updated patch as soon as I find time to.
Sometimes I'm told "Brilliant"...
Sometimes I'm told "Charming"...
And Often I'm told "Shut Up"!

Moriarty
Tycoon
Tycoon
Posts: 1395
Joined: 12 Jun 2004 00:37
Location: United Kingdom of Great Britain and Northern Ireland
Contact:

Post by Moriarty »

Isn't this patch ready for merging into the trunk? It's certainly had a long time to get stable and if all known bugs are fixed....

User avatar
LordOfThePigs
Route Supervisor
Route Supervisor
Posts: 435
Joined: 01 Jul 2004 10:28
Location: Jura/Switzerland

Post by LordOfThePigs »

So as promised, here is the binary and language files of the latest version of the patch.
Attachments
subsidiaries_bin_r7169.zip
the windows executable and language files.
(1.14 MiB) Downloaded 499 times
subsidiaries_7169.diff
The .diff to apply to trunk revision 7169
(148.24 KiB) Downloaded 407 times
Sometimes I'm told "Brilliant"...
Sometimes I'm told "Charming"...
And Often I'm told "Shut Up"!

Moriarty
Tycoon
Tycoon
Posts: 1395
Joined: 12 Jun 2004 00:37
Location: United Kingdom of Great Britain and Northern Ireland
Contact:

Post by Moriarty »

Some bugs/issues/suggestions from the latest version:

1) Unless you know what you're looking for, it's practically impossible to know how to actually trigger the subsidiaries screen. A non-descript coloured box probably isn't the best place to hide this functionality. Couldn't you add another menu item, probably under "company leagure info", or even under the "company info" list of companies whilst also keeping the box?

2) The above mentioned non-descript toggle box for subsidiaries doesn't have a tool-top, which only serves to make things even worse. 8)

3) If you hold down shift whilst either getting or sending a $0 cash transation, it will give the error "insufficient funds" AND then close the transfer window. This is inconsistant with standard OTTD behaviour (show what would happen but don't try and transact it).

3b) Related to 3 - Using Shift-click results in the error, even if you send a sum of money you do have in your account. i.e. I tried to send 10k from a new company with 100k. Using Shift-click stated "insufficient funds".

4) On the subsidiaries screen, as it is used for the transfering of cash between accounts, it may be useful to show the amount of cash each company has on hand.

5) Would it be possible to allow pinning of the subsidiaries window?

6) Double clicking a subsidiary doesn't seem to do anything at present beyont select then deselect it. Would it be possible to make this action "administrate" the subsidiary?

7) The tooltips for cash sending/getting do not reflect the different sums that are transfered if you hold down Shift [+100k (which is non-standard behabiour)], Ctrl [double], or Alt [+10k].


That'll do for now. I might actually play a game with it later. ;-)
It certainly looks to have come a long way since last I used it. Good work. :D

User avatar
LordOfThePigs
Route Supervisor
Route Supervisor
Posts: 435
Joined: 01 Jul 2004 10:28
Location: Jura/Switzerland

Post by LordOfThePigs »

Moriarty wrote:1) Unless you know what you're looking for, it's practically impossible to know how to actually trigger the subsidiaries screen. A non-descript coloured box probably isn't the best place to hide this functionality. Couldn't you add another menu item, probably under "company leagure info", or even under the "company info" list of companies whilst also keeping the box?
It used to be accessible from the company information window. Apparently it disapeared somewhere along the road, but I added it again.
Moriarty wrote:2) The above mentioned non-descript toggle box for subsidiaries doesn't have a tool-top, which only serves to make things even worse. 8)
fixed.
Moriarty wrote:3) If you hold down shift whilst either getting or sending a $0 cash transation, it will give the error "insufficient funds" AND then close the transfer window. This is inconsistant with standard OTTD behaviour (show what would happen but don't try and transact it).

3b) Related to 3 - Using Shift-click results in the error, even if you send a sum of money you do have in your account. i.e. I tried to send 10k from a new company with 100k. Using Shift-click stated "insufficient funds".
This should be fixed now.
Moriarty wrote:4) On the subsidiaries screen, as it is used for the transfering of cash between accounts, it may be useful to show the amount of cash each company has on hand.
Good idea, I implemented that.
Moriarty wrote:5) Would it be possible to allow pinning of the subsidiaries window?
Good idea again. Changed
Moriarty wrote:7) The tooltips for cash sending/getting do not reflect the different sums that are transfered if you hold down Shift [+100k (which is non-standard behabiour)], Ctrl [double], or Alt [+10k].
I fixed the tooltip, but I couldn't fix the shift button. I really want to provide the 3 possibilities to add or substract money from the amount to transfer, but there is nothing in OpenTTD that lets me detect whether alt was pressed or not, AFAIK.

Anyway, here is the new version of the patch and the binaries. There seems to be a little problem with the language files lately in the trunk, so not all of the language files could be generated, but the ones that work as included.
Attachments
subsidiaries_bin_7213.zip
Windows executable and language files.
(1.02 MiB) Downloaded 574 times
subsidiaries_7213.diff
.diff against trunk revision 7213
(155.07 KiB) Downloaded 546 times
Screenie of the new management window
Screenie of the new management window
Manville Transport, 21st Sep 1951.png (34.81 KiB) Viewed 8487 times
Sometimes I'm told "Brilliant"...
Sometimes I'm told "Charming"...
And Often I'm told "Shut Up"!

Snuk the Great
Engineer
Engineer
Posts: 63
Joined: 26 Aug 2005 15:12

Post by Snuk the Great »

This patch just gets nicer and nicer :D. Great work LordOfThePigs (and Moriarty for the ideas ;) )!
Snuk the Great

Moriarty
Tycoon
Tycoon
Posts: 1395
Joined: 12 Jun 2004 00:37
Location: United Kingdom of Great Britain and Northern Ireland
Contact:

Post by Moriarty »

On the one hand I'm impressed by the prompt solutions. On the other hand I'm going to have to go and find something else to complain about now. :D
Nice going.

Couple of other things:
- Is it necessary for them all to say (Player 1) after them on the subs screen? They are your subsidiaries thus their ownership is obvious.
Or doesn't OTTD let you "get" the company name without the player #?

- Also if you can remove that, would it still be necessary for the entire window to be so big? Because there is a lot of wasted space. A company name can only be so many characters after all (don't know the exact number) and I doubt many folks are going to be getting .
I suggest this, because, with the pin-able (which you've added) I'll probably play long stretchs with it pinned up (for ease of access), and having lots of wasted screen estate isn't good when your monitor can only handle 1024*768. ;)

- Bug - That replaced "subsidiaries" button you've put onto the Company info screen doesn't work. Clicking on it does nothing.

- Back to the send/get cash screen - Would it be possible to make it not go any higher than the money you have in the account you're trying to take it from? i.e. if I have 100k it won't let me accidentally send it up to 110k.

Trust those will help. :)

User avatar
ma5owat
Engineer
Engineer
Posts: 47
Joined: 24 Oct 2006 17:01
Location: Warren, MI, USA
Contact:

Post by ma5owat »

Moriarty wrote:- Is it necessary for them all to say (Player 1) after them on the subs screen? They are your subsidiaries thus their ownership is obvious.
Or doesn't OTTD let you "get" the company name without the player #?
Well ocassionally the AI will still keep runing the company and it won't say (Player 1). I'm not sure if that still happens in the latest build or not, I've been busy building a scenerio and not playing the last week or so.

I'm not sure how or why the aI still takes controll of certain companies.

User avatar
LordOfThePigs
Route Supervisor
Route Supervisor
Posts: 435
Joined: 01 Jul 2004 10:28
Location: Jura/Switzerland

Post by LordOfThePigs »

Moriarty wrote:- Is it necessary for them all to say (Player 1) after them on the subs screen? They are your subsidiaries thus their ownership is obvious.
That is not quite true in Multiplayer.
Moriarty wrote:Or doesn't OTTD let you "get" the company name without the player #?
That can be worked around, but I still would dislay the player number in multiplayer games.
Moriarty wrote:- Also if you can remove that, would it still be necessary for the entire window to be so big? Because there is a lot of wasted space. A company name can only be so many characters after all (don't know the exact number) and I doubt many folks are going to be getting .
I suggest this, because, with the pin-able (which you've added) I'll probably play long stretchs with it pinned up (for ease of access), and having lots of wasted screen estate isn't good when your monitor can only handle 1024*768. ;)
Hmm.... I can make it so that there are no less than 3 buttons that show at the same time. If there are more than 3 companies in the group, then I'd just resize the window to accomodate the fourth. I don't want to use a scrollbar, because that implies additional clicking, which is annoying when you keep switching between companies.
Moriarty wrote:- Bug - That replaced "subsidiaries" button you've put onto the Company info screen doesn't work. Clicking on it does nothing.
Oops ;) I put the button there but I forgot to code an actual behavior for it...
Moriarty wrote:- Back to the send/get cash screen - Would it be possible to make it not go any higher than the money you have in the account you're trying to take it from? i.e. if I have 100k it won't let me accidentally send it up to 110k.
Good idea since you can't transfer more than you have anyway.
Sometimes I'm told "Brilliant"...
Sometimes I'm told "Charming"...
And Often I'm told "Shut Up"!

Moriarty
Tycoon
Tycoon
Posts: 1395
Joined: 12 Jun 2004 00:37
Location: United Kingdom of Great Britain and Northern Ireland
Contact:

Post by Moriarty »

LordOfThePigs wrote: Oops ;) I put the button there but I forgot to code an actual behavior for it...
These things help. ;)


On the matter of (Player 1) I may not have been clear; I've not tried multiplayer with this, so I don't know how it works - but surely if two people create companies as well as subsidiaries, when you go to look on the "subsidiaries" screen it will only show you your own subs? Why would you want to see other subs on this list when you can't do anything with them? Hence my suggestion as to not needing (Player 1) on the subs list.
I appreciate it's necessary for the other lists.


And I like the idea of resizing with more/less companies - I didn't suggest it because I didn't think the OTTD engine could handle it being done automatically. Also I was suggesting width be shrunk a little.

SSX
Engineer
Engineer
Posts: 17
Joined: 24 Aug 2005 05:02

Post by SSX »

Other players can play as your subsidiaries in multiplayer, so this way you can see who is playing them. You still can give them money (they are, afterall, still your subsidiaries) but they are controlled by another player.

MartinA
Engineer
Engineer
Posts: 58
Joined: 22 Nov 2002 00:18

Post by MartinA »

I got this message when I tried to open my last save game.
Attachments
screendump.JPG
screendump.JPG (114.47 KiB) Viewed 8175 times

User avatar
Born Acorn
Tycoon
Tycoon
Posts: 7571
Joined: 10 Dec 2002 20:36
Skype: Bornacorn
Location: Wrexham, Wales
Contact:

Post by Born Acorn »

Do you have something readable, perhaps?

Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 2 guests