Page MenuHomeFeedback Tracker

Add Client Event for Objects When Position is Updated
Closed, ResolvedPublic

Description

What I am asking is for a way to reject client position updates coming from server.

This is to make a local client simulation for an entity that is not disrupted by server updates but still is synced in other ways as it should be.

A small code example is below. This will go into the object class.

This first example is the default behaviour for all objects.

/*
/*
@param position is the current position of the entity on the server
@return the position
*/
vector OnPositionUpdate( vector position )
{
    return position;
}

This next example is one of the potential use cases of this system where it checks the distance between the client position and the server position and if the distance is less than a certain amount the position stays the same.

/*
@param position is the current position of the entity on the server
@return the position
*/
vector OnPositionUpdate( vector position )
{
    if ( vector.Distance( GetPosition(), position ) > 0.5 )
        return position;

    return GetPosition();
}

This should have no effect on the velocity and other physics information. If it does, please enquire with myself and @Arkensor on other alternatives.

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 7
Category
General

Event Timeline

Jacob_Mango edited Additional Information. (Show Details)
Unknown Object (User) added a subscriber: Unknown Object (User).Apr 27 2019, 2:19 PM
Jacob_Mango updated the task description. (Show Details)Apr 28 2019, 9:33 AM
Jacob_Mango edited Additional Information. (Show Details)
Jacob_Mango updated the task description. (Show Details)Apr 28 2019, 9:50 AM
Jacob_Mango added a subscriber: Arkensor.
rVn claimed this task.May 10 2019, 1:02 PM
rVn changed the task status from New to Acknowledged.
axeman added a subscriber: axeman.May 13 2019, 1:33 PM
rVn closed this task as Resolved.May 30 2019, 12:47 PM

OnNetworkTransformUpdate (Entity.c)