Page MenuHomeFeedback Tracker

No way to get precise position of an object
Closed, ResolvedPublic

Description

I have noticed that the current commands in-game to return position all round their results. The amount of rounding depends on the object's current position. Remembering my high-school chemistry class while I ran some tests, I found that the game rounds the result to a number with 6 significant figures. This is great for casual map-makers who don't really care, but for someone that desires or needs near-absolute accuracy this is a nightmare. I will attach a picture with all of my tests run.

Example: If you have an object at [~12345m, ~345m, ~89m] ([x,y,z]), using getPos on it will return something like this [12345.2, 345.234, 89.3928]

I think it would be amazing to have a new command that ONLY outputs positions rounded to the eighth decimal place. That would turn 12345.3 into 12345.25085729. To put it into better perspective, this is the difference between being 99% accurate and being 99.99999999% accurate. Please consider this proposal. {F24893}

Details

Legacy ID
4223589923
Severity
None
Resolution
Not A Bug
Reproducibility
Always
Category
Feature Request
Steps To Reproduce
  1. Load the editor with the map of your choice.
  2. Place a unit down anywhere with "CONTROL: Player".
  3. In the unit's initialization type "hint str getPos player;"
  4. Click preview.
  5. Count the number of digits each array entry has.
  6. Move the unit and repeat the test.
    • OR ----
  1. Load the editor with the map of your choice.
  2. Move the cursor around while observing the bar at the bottom of the screen which shows your cursor's current position in [x,y,z]
Additional Information

Leading and trailing zero's do not count as significant figures, ie. 0.00193857 still only has 6 significant figures.

Also, occasionally you may see a number with less than 6 significant figures, something like 345.4 or 23.1, this is really 345.400 and 23.1000 (respectively) but the extra zero's are removed by the game.

In fact, at the bottom of the editor you are able to see the [x,y,z] position of where your cursor currently is, this also exhibits this behavior.

Event Timeline

DreadedEntity edited Additional Information. (Show Details)
DreadedEntity set Category to Feature Request.
DreadedEntity set Reproducibility to Always.
DreadedEntity set Severity to None.
DreadedEntity set Resolution to Not A Bug.
DreadedEntity set Legacy ID to 4223589923.May 7 2016, 7:32 PM

The returned position has all the precision needed, when you convert it to string so that you can see the number on screen, this is when clipping occurs, and only for displayed number.

I've researched the issue further and saw that numbers have plenty of accuracy, but when you try to show them with a hint or if you create a variable and save them, that's when you begin to lose accuracy due to rounding.

I'm going to rewrite the function I posted in my post on the BIS forum, so it doesn't rely on an actual object.

I'm going to close it as non issue, however if you want to make another request to make conversion to string retain all the decimal places, be my guest.