Jump to content
  • 0

MAJOR. EPOCH_server_saveBuilding.sqf


Demellion

Question

[
    "WoodFloor_EPOCH",
    [
        [
            [
                12549,
                17009,
                6
            ],
            [
                0.893555,
                0.980469,
                0.714178
            ]
        ],
        [
            -0.633545,
            0.773706,
            0
        ],
        [
            -0.0000730738,
            -0.0000598361,
            1
        ]
    ],
    "-1",
    "76561198123138658",
    0,
    []
]

Good day, sirs. The code above is the exact extraction of an object data (buildable) formatted in JSON.

So whats the problem generally. Inspecting some objects saved to the hive I did find out that lots of objects like this in one place can cause huge lags on both server and client if you approach close enough to read them:

        [
            -0.0000730738,
            -0.0000598361,
            1
        ]

This gets worse cumulative to amount of players reading those objects.

Im not sure if thats the problem of Hive operations, because its almost impossible to overflow double (if its not a float), but pretty sure that Arma III reads that really badly. I hope this is helpful and detailed enough, cause I cant cofirm thats the exactly reason, but do confirm the fact that this mostly happens around those objects. (Tested on Vanilla)

Thanks.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

If you are referring to this part as the position, that actually objects vector UP array and not the position.

 [
            -0.0000730738,
            -0.0000598361,
            1
        ]

This is the position array:

[
            [
                12549,
                17009,
                6
            ],
            [
                0.893555,
                0.980469,
                0.714178
            ]
        ],

It is stored in two parts first the low precision array (whole numbers) and the second high precision array (decimals), these are both added together again at the time of server load and result so we obtain a very consistent and very accurate position. This is because Arma's number to string conversion actually causes floating point rounding errors this results in a number that may only have a few decimal places as the number gets larger thus resulting in objects like bases shifting out of original position causing gaps.

When you want to get this position back from the database you can use this code to return the precision position:
 

_location = (_location select 0) vectorAdd (_location select 1);

and to create this high low position array with vectorDir and UP so we can save it to the database.

_worldspace = [(getposATL _this call EPOCH_precisionPos), vectordir _this, vectorup _this];

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...