jeremyshannon / Exile

This repo is parked, moved to codeberg.org
https://codeberg.org/Mantar/Exile
GNU General Public License v3.0
16 stars 12 forks source link

Transporters: Unexpected behaviour with respect to distances. #245

Open Ceeee opened 11 months ago

Ceeee commented 11 months ago

In-game genesis / detailed description of the problem(s), refer below for a summary in keywords: ① I decided to use a transporter (when I say transporter I mean a fully equipped, five-component-setup) to establish a far-away base after reaching it by air boat once. I didn't know about the intended range limit of the transporter then. I flew nearly 10km while taking a transporter key to my base in the greater spawn region with me. I created a shelter with a transporter there, tied another key to it and used the transporter successfully to return to my base, where I bonded an additional pad with the newly established far-away base transporter. On using this pad, it behaved unexpectedly by not activating properly after having been charged, and instead removing the tie to its target transporter when being right-clicked. ② I then learnt about the range limit from the source code constants. Incorporating this knowledge I decided to set up a range of three more transporter stations to cover the distance with in-between steps. After having established two intermediate transport stations within the distance limit of 3 km, I went to tie station 1 to station 2 with the respective key. After that I wanted to make the transporter jump to station 2 in order to continue the setup with the last intermediary station from there by air boat. I charged the newly tied pad and on completing the process stepped onto it and right-clicked with no apparent reaction. It remained charged and I remained in the place I had been. Once the charge period timed-out I tried a second time and was zapped and transported only a few blocks away, seemingly randomly.

Observed (and reproduced) behaviour: ⒜ Successful transport from (-305/26/-8952) to (-400/94/603) [d = 9555.7] ⒝ No transport at all from (-400/94/603) to (-305/26/-8952) [d = 9555.7] accompanied by removal of the pad's bond. ⒞ No transporter response on trying to travel from (-335/30/-2380) to (-317/70/-4986) [d = 2606.4] while possibly removing the bond and resulting in a zapping random transport to a close-by location on trying a second time.

Expected behaviour: ⒜ Failure of transport according to the intended 3000 block distance limit followed by the intended in-game consequences. ⒝ Random transport, zapping, or any other intended "unsafe" transport result, target data remaining on the pad in use. (In short: ⒜ = ⒝!) ⒞ Successful and precise transport from one pad at (-335/30/-2380) to a second at (-317/70/-4986)

Potential/supposed cause of the problem; The successful transport across a beyond-limit distance to target coordinates of absolute values below the number 3000 paired with the failure of transport within the 3k limit for a target destination with absolute coordinate values greater than 3000 leads me to suspect that one of the distance checks fails to calculate the distance correctly (e.g. one vector used in the calculation being a zero one, potentially type cast automatically from a nil value) and ends up using absolute coordinate values for comparison against the threshold.