Rendering issues:One possible solution is to have a reverse offset: a certain number of pixels in the x and y directions in which vehicles in a pakset (or a specific vehicle) are shifted in each of its 8 orientations if marked as reversed. I am not sure quite how difficult that this would be to code, and it would take a considerable time to calibrate, but it is likely to be less work than re-rendering the whole pakset. I have not looked into this in any detail to assess the viability.
Since pak.CS has the correct position, we will need to influence only a specific pakset to avoid any negative effects.
but it seems that the shift pixel of the freight car and the passenger car are different, so it is not enough to shift by the same pixel.
This is very unfortunate but, as I pointed out, this is different for each vehicle in the width of distortion. (´・ω・`)
Freight train:

Specifically, this open wagon seems to be a contradiction of 1px in both x and y.

However, this coach has a 7px distortion in the x direction and about 2.5px distortion in the y direction.
I think it would be easier to add an offset to dat than to modify the image, like
EmptyImage[SE]=./images/abcde.0.0,7,3
Reordering algorithm:I replaced the image with a numbered one and added the example of American locomotive mentioned by Vladki.
#3:It is a code issue. Imagine an algorithm for locomotive group renumbering.
I considered the code become very complex, so I considered the locomotive as a group and did the same reversal for all.
The code is a reuse of existing code.
It is renumbering by the simple code shown below:
for( ; a<--b; a++) //increment a and decrement b until they meet each other
{
reverse = vehicle[a]; //put what's in a into swap spacekarte_t::load(
vehicle[a] = vehicle[b]; //put what's in b into a
vehicle[b] = reverse; //put what's in the swap (a) into b
}
It should be noted that the formation of the locomotive group has unlimited possibilities.
It may be a 100 or more locomotives.
First, swap the 1st and 100th vehicles. Next, replace the 2nd and 99th vehicles. Repeat this and replace 50 and 51 to finish.
Question, what code do we need to write to renumber correctly in this?


This is an extraction of only the locomotive, and another vehicle is connected behind it.
#5Whether the last vehicle is an unbidirectional vehicle is checked first. This is the same as the existing algorithm.
The tail of the fifth train is not a view vehicle. The passenger car is originally left at the station and waits for the locomotive shunt and runs in reverse. In the case of the formation of the view vehicle, it is common to rotate the whole formation with wye.
Unlike locomotives, passenger cars can not move on their own, so it is not impossible to pull out the last passenger car and rotate it on a turntable, but it will hardly happen in practice. If you do that it may be necessary to incur additional time penalties. Also, considering the possibility of fixed, the inversion algorithm will be complicated. If it is fixed, it may not fit on the turntable, so it will eventually become wye. Since this is a considerable edge case, it seems safe to use the standard method (wye) in this case. Because it is easy to be connected to the error when restoring it.
#7 and 8Orange is considered to be pulled by the shunting locomotive and moved through the shunting loop. I think the vehicles that should be left at the station (not moving) are the longer ones.
Perhaps that should be closer to the operation of the brake van.
We also look at the search algorithm for the brake van from behind. In this case, when the last one is checked, it is regarded as a kind of brake van and the search is ended.
#10Yes, that's right. But using wye suffers a big time penalty.
I think this is the player's responsibility. It looks like the player made the wrong decision but that it was corrected.
I think this problem is somewhat complicated, for example, what would happen if the previous two were locomotives without capacity and the four behind were coaches without power?
The reason for detecting No. 5 as an error is that there is no car (that is, a round end pointing to the left) that can be tailed in the remaining car when the locomotive is removed (for shunting).
#12I think it is the same matter of 10.
In short it is about finding the longest part (optimally the whole) of train that has driver cabs on both ends. Then find in the rest the longest part with brake vans on both sides. Then swap those parts. If such parts are not found, rotate the engine or brake van as needed, together with any constraints they might have
Yes, I think this makes sense.
Supplement about my reordering algorithm:Check the
power and
capacity to identify the locomotive. Therefore, locomotives should be renumbered as separate groups, with coaches and wagons without power.
EMU / DMU are different from them because they have power and capacity.
EDIT:
I think the turntable reversing time panalty should be proportional to the number of locomotive (count one power as one).
Also, I think that the remaining passenger cars and freight cars should be able to be loaded while the locomotive is shunting.