Skip to content

Round table

User Avatar
#882
Auto-translated
It turns out that the analogy with the second game is not complete. There are cases where, according to the penalty method, there shouldn't be a penalty, but in reality, there is. Presumably, the problem lies in the even horizontal lines. I'll investigate further. But the fact remains that you can shoot without a penalty through unbroken walls.

Added 11 hours 15 minutes later
I checked the method. There are no significant differences from the algorithm in the second game. Again, machine inaccuracies are to blame for everything.

The only difference between the methods in the second and third games lies in the way the "discrete" attack line is constructed. In the second game, the line is built with a step of 1/10 along the larger dimension, while in the third game, it's 1/17! The number 1/10 = 0.1 fits comfortably within four bytes, meaning the real fraction 0.1 is equal to the machine representation. However, 1/17, no matter how you look at it, doesn't fit and is rounded, meaning the real fraction 1/17 is NOT equal to the machine representation! Therefore, the accumulation of error in the third game occurs both along the X and Y axes (unlike the second game, where it only occurs along the Y axis), which manifests itself when the attack line passes through one of the vertices of the section's neighborhood.

Therefore, in the case where the attack line passes through one of the vertices of the section's neighborhood, whether or not there is a penalty can only be determined empirically.

Theoretically, it's also possible, but you need to take into account the specifics of arithmetic operations with four-byte fractions.

In all other cases, the inaccuracies don't play a role.