Page MenuHomeFeedback Tracker

Dedicated command "distance" is less efficient than doing it by hand!!
Closed, ResolvedPublic

Description

This is really weird, why would dedicated command that calculates distance between 2 coordinates on the map inside the engine be slower than a bunch of SQF commands put together in the game??

Wait, this is not all. The accuracy of dedicated command is atrocious as well!!!

Mistery is solved!: http://killzonekid.com/arma-scripting-tutorials-distance/
Upvote: http://feedback.arma3.com/view.php?id=17324

Details

Legacy ID
3077821100
Severity
None
Resolution
Fixed
Reproducibility
Always
Category
Performance
Steps To Reproduce

346.41m sqrt (200 ^ 2 + 200 ^ 2 + 200 ^ 2) - 0.0045ms
346.300m
[0,0,0] distance [200,200,200] - 0.0063ms
346.527m [0.000,0.000,0.000] distance [200.000,200.000,200.000] - 0.006ms
346.514m
[200,200,200] distance [0,0,0] - 0.0059ms
346.345m //[200.000,200.000,200.000] distance [0.000,0.000,0.000] - 0.006ms

Event Timeline

Killzone_Kid edited Additional Information. (Show Details)
Killzone_Kid set Category to Performance.
Killzone_Kid set Reproducibility to Always.
Killzone_Kid set Severity to None.
Killzone_Kid set Resolution to Fixed.
Killzone_Kid set Legacy ID to 3077821100.May 7 2016, 5:57 PM

Wow, awesome! ticket was assigned in less than 20 minutes! Bumped!

at >2000 metres the difference is >13 metres

How is that even possible?
Wow.

You think this is awful? You just wait, I have compiled some irrefutable data that is going to blow your mind!

I'm not really sure if I want that, but hit me!

Ouch, it's like the distance command is doing a rough estimate instead of an exact calculation.
This hurts my brain.