Rails icon indicating copy to clipboard operation
Rails copied to clipboard

1835: Rails does not allow selling president share.

Open peter-de-boer opened this issue 3 years ago • 15 comments

See the attached file. Peter should be able to buy a 10% BY share from the pool and then sell his 20% BY president share. Rails 2.4.6 does not allow that sell. 1835_20220730_0739_Peter.zip

peter-de-boer avatar Jul 30 '22 07:07 peter-de-boer

Confirmed. I'll investigate.

erik-vos avatar Jul 30 '22 21:07 erik-vos

Rails deliberately forbids selling an 1835 director's share. In a code comment, the reason is stated as follows: "In 1835 it is not allowed to split the Presidents Certificate on sale". I could not find this explicit statement anywhere in the rules, but perhaps it has been concluded by someone from rule XV.7.5 in the 2nd edition English rules: "A Director's share may not be sold to the Bank, instead the rules for a change of director (IV.3 and XII.11) should be followed".

The relevant part of rule IV.3 reads "[dumping a directory is only allowed when] the old director [is] able to sell shares to the Bank (see Sales XV.7)". This is a circular reference that does not help, at least not me.

Rule XII.11 does not exist. So the references in XV.7 to IV.3 and XII.11 are completely useless.

On the other hand, I also have a German rules version (dated 1990) that states in rule 2.6.3.2 (my translation) that selling a director's share is possible if another player has a 20% share (10% for Pr). And in The Depot I found a clarification, allegedly backed by the 1835 author, to the same effect. Taken literally that would mean that, if the Pool has no more than 2 shares, even 3 shares (the full 30%) could be sold.

I have no problem with either interpretation, but I cannot be the referee in this case. Anyone?

erik-vos avatar Jul 31 '22 21:07 erik-vos

Ah, I now see that this aspect has been discussed before in issue #77, including a reference to German rule 3.3.7, where Peter's intended presidence dump is explicitly allowed, but only this way: buy 10%, then sell 20%!

So splitting a director's share would be allowed if and only if also a 10% share is owned! Who would have guessed that?

I wonder: do we have a split between the English and the German way to play 1835?

erik-vos avatar Jul 31 '22 22:07 erik-vos

I always follow the German rules, as they are the original rules. The English rules are IMO a somewhat poor translation. I have yet to find a player who says the English rules are leading.

peter-de-boer avatar Aug 01 '22 07:08 peter-de-boer

OK. Now what I need is a statement exactly formulating in which way 1835 differs from 1830 in this matter.

Let me try: in 1835 you cannot dump by selling 10% if you only have the 20% presidency (and all other dumping conditions apply), whereas in 1830 you can. And in addition, specifically for 1835: you cannot dump by selling 10% (or 30%) if you only own 20% shares.

In other words: in 1835, if you want to dump by selling an odd number of 10% shares, you must own a 10% share.

Would this work?

erik-vos avatar Aug 01 '22 09:08 erik-vos

What you say is correct. But it does not apply to the situation here as Peter wants to sell 20% shares, not an odd number of 10% shares.

The rule in 1835 is basically very simple:

  • you can only sell whole certificates, you can never split them
  • you can also sell the president certificate, but only if someone else has at least 20% and you end up having less shares.

peter-de-boer avatar Aug 01 '22 11:08 peter-de-boer

Of course, if you sell the president certificate and someone else becomes president, the president share is exchanged for a number of other shares just before the sell. But that is not the same as splitting the certificate.

peter-de-boer avatar Aug 01 '22 11:08 peter-de-boer

The underlying principle for selling holdings, in which 1835 differs from most other 18xx games, seems to be: in 1835 you sell certificates, not shares. So if you want to sell 10% (which is wat Peter effectively wants to do), you must have a 10% certificate (and initially Peter doesn't). But the Rails selling logic is based on selling shares, and that is the background of all selling problems that we keep running into with 1835.

OK, it is clear that the share selling code needs another hard look, as the current implementation of the no-split rule still appears to be buggy. It is all generic code, with the no-split rule being an existing parameter. Stay tuned.

erik-vos avatar Aug 01 '22 16:08 erik-vos

Not sure if it helps fixing this, but I noticed that it is possible to sell the president certificate if you own 30% if there is just 20% or less in the pool. Only in this particular case with 30% in the pool, the sell is not possible.

peter-de-boer avatar Aug 02 '22 05:08 peter-de-boer

Whilst debugging, I found more errors, and it did not help at all that the code for sorting out the possible sell actions was a mess, even though I had likely written most of it myself, long ago. And the whole of it exists in two not too different versions: StockRound and ShareSellingRound (the latter being mainly used in emergency selling).

In a previous comment I said: "The underlying principle for selling holdings, in which 1835 differs from most other 18xx games, seems to be: in 1835 you sell certificates, not shares." To get out of the mess, I have decided to start following this rule rigorously. A serious limitation then is, that in the SellShares action only one type of certificate (10%, 20% and presidency) can be mentioned at the same time. So 10% and 20% shares must always be sold separately.

This will require some attention by the players. For instance, if you have 60% BY and the pool is empty, and someone else has 20%, you can no longer dump BY by selling 50% in one action. First you have to sell 3 (not 4!) 10% shares, and then the 20% president's share. All in the same turn and at the same price, of course.

This new procedure has much simplified and clarified the code. Handling of splittable and unsplittable certificates is now largely separate, and much easier to follow.

Done: StockRound. Still to do: ShareSellingRound. I hope it will be possible to merge the share selling code of latter into the former. Also more testing is needed.

I will add a modified version of your game file to the test set.

erik-vos avatar Aug 08 '22 21:08 erik-vos

All in the same turn and at the same price, of course

Well, it turns out that the rules say, that multiple sell actions cause multiple price drops. The words "in the same turn" are missing, but presumably that is the intended context. Indeed 1835 was implemented that way, but I had to remove that exception because it would be unfair to maintain it if you cannot sell single and double shares in the same action.

If there really is a need to apply multiple price drops in the same turn, I'm willing to add a new "Adjust share price" action to the Special menu after any subsequent sell action of the same company in one turn.

erik-vos avatar Aug 11 '22 21:08 erik-vos

Indeed you can have multiple price drops! Never noticed it before, or maybe I have just forgotten it, but the German rules are very clear:

2.6.1.3. Ein Zug eines Spielers in einer Aktienrunde besteht aus maximal einem Kauf und beliebig vielen Verkaufsaktionen in beliebiger Reihenfolge.

2.6.3.3. Aktienwertänderungen als Folge eines Verkaufs

  • Pro Verkaufsaktion von Aktien einer Gesellschaft wird der Kursmarker um eine Zeile nach unten gerückt, unabhängig davon ob ein Spieler eine oder mehrere Aktien dieser Gesellschaft verkauft. Die Aktienkursveränderung wird sofort nach dem Verkauf vorgenommen. Beispiel: Verkauft ein Spieler zunächst nur eine Aktie einer AG und in seiner nächsten Aktion noch eine derselben Gesellschaft, so kann er damit den Kurswert dieser AG zweimal nach unten verschieben. Allerdings erhält er als Ertrag auch nur einmal den ursprünglichen Kurswert: beim zweiten Verkauf nämlich gilt schon der dann aktuelle Kurswert.

peter-de-boer avatar Aug 12 '22 14:08 peter-de-boer

And I think there are circumstances where a player would like to do these multiple price drops.

You said before that 10% and 20% shares must always be sold separately. I guess that is just a consequence of how the sell action is currently implemented, isn't is? It would be much cleaner to be able to just select all the certificates that you want to sell.

peter-de-boer avatar Aug 12 '22 14:08 peter-de-boer

Since the multiple price drop is not used often, I guess your suggestion of an adjust share price feature would be ok. Note, in case of a multiple price drop also the money of the selling player needs to be adjusted. So, some careful bookkeeping would be required. To me, this would all be acceptable and I guess you do not want to spend too much time on this ;)

peter-de-boer avatar Aug 13 '22 07:08 peter-de-boer

It would be much cleaner to be able to just select all the certificates that you want to sell.

Yes, I was already thinking along that line. But you're right, I don't want to spend much more time on this matter, so I'll leave it as an idea for the future. For the record, I will write down here what problems its implementation could create, with some possible solutions, and keep this issue open.

  1. Most games allow selling half a president's share, so we need an additional invention to handle that.
  2. A complete replacement of the SellShares action will invalidate all existing saved files, including the 'official' test set and my own collection. Points 1 and 2 can partly be mitigated by restricting the new method to 1835. But even then the loss of all test files for that game only does not attract me at all. A potential fix for point 2 might also be obtained by keeping the current selling process backwards compatible by not replacing but extending the SellShares action. But that could make the code rather ugly.
  3. Each certificate has a unique ID, so in theory we could just provide a list of sellable IDs to the UI. One problem with this approach would be, that another developer in his wisdom has decided to replace many Lists by Sets throughout the code, and not always a SortedSet, so we might lose the original sequence. That could cause the actually owned certificate IDs being not reproducible, making saved files unreloadable. Not long ago I already had to fight that same problem with train IDs. So a List of IDs may not work, and all we then can do is pass a list of share sizes, one per certificate, or the number of owned shares per share size. The UI could then compose a nice selection popup, also quoting the max. number of shares that can be sold, and the dump threshold, if applicable.

I'll do the adjust share price action, after debugging the partial integration of emergency selling with normal share selling, that I am now working on. I have also added a Game Option to 1835 that allows disabling my deviation from the official rules in the Options tab of the start screen. By default it is enabled now. This setting remains valid for the whole game.

erik-vos avatar Aug 13 '22 15:08 erik-vos