Page MenuHomeFeedback Tracker

Slow object position update, up to 4 times slower than player
Closed, ResolvedPublic

Description

If I want to getPosATL for example from an AI, the result will update up to 4 times slower than if I getPosATL player. If I want to synchronise some entity position with object position, this results in jerky movement of synchronised entity. If I do the same and sync it with player it all goes smooth.

It makes no sense as I can see AI on my screen, it exists on my client I can see it moving smoothly, why I cannot get as frequent position update as I can get from the player object?

I'm also doing it in editor so no network involvement.

Details

Legacy ID
3362737177
Severity
None
Resolution
Fixed
Reproducibility
Always
Category
Engine
Steps To Reproduce

Open editor,
create blufor unit,
preview,
esc,
copy paste code below into debug console,
exec

null = [] spawn {
unit2 = (group player) createUnit [typeOf player, getPosATL player, [], 0, "NONE"];
playerPos = "";
unit2Pos = "";
playerUpdate = 0;
unit2Update = 0;
while {true} do {

		_playerPos = str (getPosATL player);
		if (_playerPos != playerPos) then {
			playerUpdate = diag_tickTime - ticktimePlayer; 
			ticktimePlayer = diag_tickTime;
			playerPos = _playerPos;
		};	
		_unit2Pos = str (getPosATL unit2);
		if (_unit2Pos != unit2Pos) then {
			unit2Update = diag_tickTime - ticktimeUnit2; 
			ticktimeUnit2 = diag_tickTime;
			unit2Pos = _unit2Pos;
		};
		hint format ["Unit2 position update is %1 times slower", round (unit2Update / playerUpdate)];

};
};

Event Timeline

Killzone_Kid edited Additional Information. (Show Details)
Killzone_Kid set Category to Engine.
Killzone_Kid set Reproducibility to Always.
Killzone_Kid set Severity to None.
Killzone_Kid set Resolution to Fixed.
Killzone_Kid set Legacy ID to 3362737177.May 7 2016, 2:12 PM
Killzone_Kid added a subscriber: Killzone_Kid.

Now this is weird. Updates on AI position (as explained above) are slow but if I attach an object to AI with attachto and then read position of that object it updates faster, still not as fast as player.

here is video I made that explains the problem.

http://www.youtube.com/watch?v=carLw450muw

as you can see my tag moves with me smoothly while AIs tags jump. The thing is the update loop does with 0.01 sleep delay that is 100 frames per second. So I retrieve AI positions 100 times per second, the actual position update is much more rare.

This could be closed now. The solution is to use

visiblePosition
visiblePositionASL

commands

http://forums.bistudio.com/showthread.php?155487-Position-update-for-unit-on-foot-is-lagging-a-lot&p=2403197&viewfull=1#post2403197

works great!

Bohemia added a subscriber: Bohemia.May 7 2016, 2:12 PM

But issue still actual for current function, need to be fixed

neokika added a subscriber: neokika.May 7 2016, 2:12 PM

Use visiblePosition function instead.