jamespetts / simutrans-extended

Sources for the Experimental branch of the popular game Simutrans
http://forum.simutrans.com/index.php?board=53.0
Other
82 stars 53 forks source link

vehicle trading between players #669

Open Ranran-the-JuicyPork opened 4 months ago

Ranran-the-JuicyPork commented 4 months ago

This patch enables vehicle trading between players. Please note that this only implements the functionality and UI, it does not tweak the economic balance.

How to buy and sell a vehicle:

A management button will be added to the top right of the depot dialog. Press this button to open the management dialog.

Changing the depot name has been moved to this dialog for space reasons.

The dialogue currently shows the vehicles stocked in the depot. Players can choose to scrap them or list them for sale to other players.

This list is a sortable table, and clicking on a header will sort by that item. The code for vehicle list has also been significantly changed to make it the same as the code for vehicle list. Left-click on a row to select a vehicle, right-click to open a details window. To be consistent with this behavior, the way to open the details window in the vehicle list has also been changed to right-clicking.

To list for sale, select "Sell" from the mode buttons. Then press the execute_listing button and the selected vehicle will be moved to the list. The selector can select multiple vehicles at the same time.

Once you've been listed, other players will be notified via message.

Vehicles listed by other players can be purchased from the "Buy" list. You can only purchase vehicles that are supported by the depot. This means you need to open the management dialog from the correct depot. Select the vehicle you want to purchase and press the execute_purchase button to purchase the vehicle and transfer it immediately to your depot.

We can still sell vehicles in the existing depot dialog, and this functionality is still there, but we should be aware that the old vehicle selling functionality has some flaws. Vehicles of the same model are displayed in stacks rather than one by one, so we cannot pick out a specific one to sell. For example, if there are multiple vehicles of the same model with different livery schemes, the player cannot decide which livery scheme vehicle to sell. It is difficult to even know how many vehicles of each livery scheme are in storage. Due to livery scheme features, bundling different colored vehicles is a bad design. This dialog allows us to select the appropriate retired vehicle.

Next, the existing code (action on the depot window) automatically sells the newest vehicles because they sell for a higher price, which is the exact opposite of what happens in the real world. Generally, vehicles are scrapped starting from the oldest because they are consumables. I think that in the future or at this stage, we will need to fix or remove the selling(scrap) functionality that includes the flaws in the depot dialog.

As I said at the beginning, there are currently no economic balancing adjustments in this patch. Vehicles still get sold immediately for a high price rather than for scrap. Therefore, at present there is no benefit to selling vehicles to other players; only the UI and functionality have been implemented.

However, the extended implementation plan included scrapping the vehicles, so I think this is sufficient preparation for that. I also think that even at this stage it is possible to make adjustments such as lowering the scrap price when sold to non-players.


EDIT: The depot list UI has been revamped in this update. Note that we have added an indication of the number of vehicles for sale. This is shown in parentheses in the vehicles number column.