EQBrowser and graphs

  • Guest, it's time once again for the hotly contested and exciting FoH Asshat Tournament!



    Go here and fill out your bracket!
    Who's been the biggest Asshat in the last year? Once again, only you can decide!

tyen

EQ in a browser wait time: ____
<Banned>
4,638
5,164
lol, indians gonna win world series dawg.

NL sucks btw
 

Secrets

ResetEra Staff Member
1,860
1,856
zoningquest is finished

ead5c17dbd.jpg


a1a9d1278a.jpg
 
  • 2Like
Reactions: 1 users

Kharzette

Watcher of Overs
4,855
3,470
How does the server send movement? Is it periodic position updates? And some of them are under ground?
 

tyen

EQ in a browser wait time: ____
<Banned>
4,638
5,164
Playing with Navmesh & Navmesh agents. Z still fucked, but at least I have gnolls climbing hills instead of running through them.

Doing something like this to adjust Z:

Code:
if(NavMesh.SamplePosition(this.transform.position, out myNavHit, 100 , NavMesh.AllAreas))
{
     this.transform.position = new Vector3 (movetoX, myNavHit.position.y, movetoZ);
}


SVm0RR0.png
 

tyen

EQ in a browser wait time: ____
<Banned>
4,638
5,164
How does the server send movement? Is it periodic position updates? And some of them are under ground?

The Z that the server sends the client is sometimes correct and the client adjusts based on the zone geometry.

The way I have to implement this variable adjustment is very tricky because it is extremely easy to lower FPS from 50 to 8 when every single mob is calculating the adjustment with every step they take up or down a hill.

This is webgl specific in terms of performance. Since you are limited in a browser compared to a mobile/desktop app that uses all available resources.
 
Last edited:

tyen

EQ in a browser wait time: ____
<Banned>
4,638
5,164
@performance

I usually get 40fps in this zone on chrome. With my navmesh test, I have 30fps, for example.

 

tyen

EQ in a browser wait time: ____
<Banned>
4,638
5,164
How does the server send movement?

-Server sends client initial x,y,z spawn spot coordinates.
-Server then sends client target positions with delta positions
-When delta magnitude != 0 and an npc reaches it's target destination, it has to keep walking on the delta path while waiting for the next target position update.
-When delta mag == 0 and an npc reaches it's target destination, it will idle at the target position

cut this script up to make it more readable.

Code:
//Initial Spawn Position
public float x;
public float y;
public float z;

//Target Position
public float movetoX;// x coord
public float movetoY;// y coord
public float movetoZ;// z coord
public float movetoH;// z coord

//Delta Position
public float deltaX;// x coord
public float deltaY;// y coord
public float deltaZ;// z coord
public float deltaH;// z coord

void Start()
{
    //place NPCs via ZoneSpawns packet positions
    this.transform.position = new Vector3(x, y, z);
}

void Update () 
{

    //update deltas from clientupdate packet
    if(updateDeltas == true)
    {
        deltaF = new Vector3 (deltaX,deltaY,deltaZ);
        updateDeltas = false;
    }
       
    if (deltaF.magnitude != 0)
    {       
        //idle gameobject recieving a target position
        if(clientUpdate == true)
        {
            //initial movement
            targetPosition = new Vector3 (movetoX,movetoY,movetoZ);
        }
        //if waiting on update from server for final target position, move along the delta positions
        if(clientUpdate == false)
        {
            //continuing to move in between updates
            targetPosition += new Vector3 (deltaX,0f,deltaZ);
        }   
        //move now
        this.transform.position = Vector3.MoveTowards(this.gameObject.transform.position, targetPosition, step * Time.deltaTime);
    }
    //idle npc after reaching a target destination.
    else
    {
        if (deltaX == 0 && deltaY == 0 && deltaZ == 0 && movetoX != 0 && movetoY != 0 && movetoZ != 0)
        {
            this.transform.position = new Vector3(movetoX, movetoY, movetoZ);
        }
        else
        {
            //FOR  Y ADJUSTMENTS IF UNDER OR BENEATH WORLD WHEN NOT MOVING AND NO POSITION UPDATES FROM SERVER
        }
}
 

Kharzette

Watcher of Overs
4,855
3,470
You don't really need a full pathfind query for a movement update. Just a capsule trace style move routine should suffice, though there's always the chance it could diverge from the server's results. I guess you could check and do corrections.

The move routines should take a motion vector and trace it against the collision, with each hit reflecting the vector along the surface hit until the energy is expended, with some special cases for stuff like stairs and ramps. The good ones are swept over time, so you don't get any tunneling with fast movement.

They are incredibly tricky to write, so hopefully Unity comes with one. If not, the old quakes had swept box routines, and Unreal has swept shapes of the basics.
 

tyen

EQ in a browser wait time: ____
<Banned>
4,638
5,164
EQBrowser runs in a browser on a PC, EQMobile runs on Apple & Android. I'll have mobile up in the store(free) next xmas.

They both connect to the same server.