About Store Forum Documentation Contact
Donations:
309$/mo



Post Reply 
How transfer pathWorld server to client ?
Author Message
Amnedge1331 Offline
Member

Post: #1
How transfer pathWorld server to client ?
hey so im coming to you, simply to ask, how would you pass a pathWorld from a client to a server to archieved a link between my ai client side and server side on their movement.

i'd like to handle the fact that when a item got set in the client/server side, the other one understand it without communication and have a sync every couple minutes to make sure they are similar (for exemple)

this would be to avoid killing the bandwidth on large regions, but maybe someone has a better idea ?

when i create my pathworld into my world, my region seems to not have any knowledge of it and the data disapear, someone knows why ?

ps: i am using inesis base with modified coding

Thanks
05-09-2015 12:23 AM
Find all posts by this user Quote this message in a reply
Amnedge1331 Offline
Member

Post: #2
RE: How transfer pathWorld server to client ?
Someone got an idea ?
06-08-2015 07:37 PM
Find all posts by this user Quote this message in a reply
Jben Offline
Member

Post: #3
RE: How transfer pathWorld server to client ?
I am interested to !
06-08-2015 07:38 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Zervox Offline
Silver Supporter

Post: #4
RE: How transfer pathWorld server to client ?
Usually this would be done by sending the object updating the pathworld to the clients instead of passing something as large as the entire pathworld, to my knowledge the navmesh should be accurate enough to be able to generate the exact same pathworld on both client and server. Is this not good enough? I can't see a reason why this would incurr a large bandwidth problem.
(This post was last modified: 06-11-2015 07:33 PM by Zervox.)
06-11-2015 07:32 PM
Find all posts by this user Quote this message in a reply
Amnedge1331 Offline
Member

Post: #5
RE: How transfer pathWorld server to client ?
Now the pathworld is generated by client side, but there is a separation between each area of 1 meter like here:
[Image: 461831image1jeu.png]

Areas look good i don't know where is the problem, here a picture between 2 areas:
[Image: 729362image2jeu.png]
06-16-2015 10:50 PM
Find all posts by this user Quote this message in a reply
Zervox Offline
Silver Supporter

Post: #6
RE: How transfer pathWorld server to client ?
from what I remember you need to get the edge geometry from the neighboring areas as well for them to be connected.
06-17-2015 12:18 AM
Find all posts by this user Quote this message in a reply
Amnedge1331 Offline
Member

Post: #7
RE: How transfer pathWorld server to client ?
Ok i see but actually i use de "parts" from the PhysBody of each area so how can I get the edge geometry from the neighboring areas ?

I need to add "parts" of other area neighbor into the calcul of one area ?
(This post was last modified: 06-17-2015 08:22 AM by Amnedge1331.)
06-17-2015 08:20 AM
Find all posts by this user Quote this message in a reply
Zervox Offline
Silver Supporter

Post: #8
RE: How transfer pathWorld server to client ?
you can get the geometry from physbody by using the Mesh class or is it meshbase that allows creating a mesh from physbody.

I created this along time ago when creating my own worldmanager(not sure it compiles without altering some functions first).
Code:
static void SetDefaultPathType(MeshBase &mesh){
    if (!mesh.tri.flag()){ mesh.include(TRI_FLAG); REPA(mesh.tri)mesh.tri.flag(i) = PM_GROUND; }
    if (!mesh.quad.flag()){ mesh.include(QUAD_FLAG); REPA(mesh.quad)mesh.quad.flag(i) = PM_GROUND; }
}

static void CreatePath(Cell<Area> &cell,Ptr=nullptr){
        Area *a = nullptr;
    if(!(a = cell.data()))return;
    MeshBase mesh; mesh.add(MeshBase(a->phys));
    if(a->l() )mesh.add(MeshBase(a->l()->phys));
    if(a->r() )mesh.add(MeshBase(a->r()->phys));
    if(a->b() )mesh.add(MeshBase(a->b()->phys));
    if(a->f() )mesh.add(MeshBase(a->f()->phys));
    if(a->lb())mesh.add(MeshBase(a->lb()->phys));
    if(a->lf())mesh.add(MeshBase(a->lf()->phys));
    if(a->rb())mesh.add(MeshBase(a->rb()->phys));
    if(a->rf())mesh.add(MeshBase(a->rf()->phys));
    SetDefaultPathType(mesh);
    Rect drect(a->mat.pos.xz()-2,a->mat.pos.xz()+(World.HMRes()+1)); //create a scaled rectangle used for cutting edge geometry from neigbouring areas to prevent navmesh generation on excessive amount of data.
        
    if(!drect.validX())Swap(drect.min.x, drect.max.x);
    if(!drect.validY())Swap(drect.min.y, drect.max.y);
    Mems<Bool> vtx_is;vtx_is.setNumZero(mesh.vtxs());
    REPA(mesh.vtx){
        if(Cuts(mesh.vtx.pos(i).xz(), drect)){
            if(InRange(i, vtx_is))vtx_is[i]=true;
        }
    }
    Mesh d;d.add(mesh);
    mesh.create(d.splitVtx(0, vtx_is.data()));
    mesh.weldVtx();
    a->pm.create(mesh,a->_xz,World.ps);//path mesh
    a->Save();
    mesh.del();
    d.del();
}
(This post was last modified: 06-17-2015 02:48 PM by Zervox.)
06-17-2015 02:43 PM
Find all posts by this user Quote this message in a reply
Post Reply