gw2raidar icon indicating copy to clipboard operation
gw2raidar copied to clipboard

ARC Positional Logging

Open merforga opened this issue 7 years ago • 22 comments

ARC has provided test DLL for tracking positions. Nothing needs to be done yet, but just want to be able to see if logging works correctly and if it is usable data:

ARC Position BETA.zip

CBTS_POSITION = 19,
    CBTS_VELOCITY = 20
cast dst_agent to a float[3]

x/y/z stored in binary order ev->src_agent = ag->m_ptr_agent; ev->time = timegettime64(); ev->is_statechange = CBTS_POSITION; ag->GetPos((D3DXVECTOR3*)&ev->dst_agent);

merforga avatar Jun 15 '18 05:06 merforga

I'm going to say... I don't think it is working? I don't see any events of that type from a log from that dll.

immortius avatar Jun 17 '18 13:06 immortius

Hmm is it not an additional field thingy at the end of current recorded events? I dont think it's it's own event

merforga avatar Jun 17 '18 13:06 merforga

CBTS_POSITION = 19, CBTS_VELOCITY = 20 cast dst_agent to a float[3] if the results look manageable for size and programming ill run it past cc feel free to share those links with the devs

that was the full thingy from DELTA, what encounter were you looking at for the position data? Also is log larger than what you would expect?

merforga avatar Jun 17 '18 13:06 merforga

I created a new golem log. The description from delta suggests they are new state change events.

immortius avatar Jun 17 '18 22:06 immortius

Confirmed error with DLL, will need new test logs. Updated DLL attached below. Some source code:

                if (timewithin(ag->m_cbt_lastvelocity_poll, 250)) {
                    D3DXVECTOR3 v;
                    ag->GetVelocity(&v);
                    if (v != ag->m_cbt_lastvelocity) {
                        ag->m_cbt_lastvelocity = v;
                        ag->m_cbt_lastvelocity_poll = timegettime64();

                        /* create event */
                        if (getlock(m_cbtevents_area_hlock, 0, 0)) {
                            cbtevent_extended* ev = &m_ar_cbtevents_area[m_cbtevents_area_tail_raw];
                            ev->src_agent = ag->m_ptr_agent;
                            ev->time = timegettime64();
                            ev->is_statechange = CBTS_VELOCITY;
                            ag->GetVelocity((D3DXVECTOR3*)&ev->dst_agent);
                            m_cbtevents_area_tail_raw = (m_cbtevents_area_tail_raw + 1) % RB_STR_ELEMENTS;
                            postlock(m_cbtevents_area_hready);
                            postlock(m_cbtevents_area_hlock);
                        }
                    }
                }
            /* healthmax update */
            if (m_area_cbt_cid && ag->m_is_in_species_list) {
                float new_healthmax = ag->GetHealthMax(0);
                if (new_healthmax != ag->m_cbt_health_max) {
                    ag->m_cbt_health_max = new_healthmax;

                    /* create event */
                    if (getlock(m_cbtevents_area_hlock, 0, 0)) {
                        cbtevent_extended* ev = &m_ar_cbtevents_area[m_cbtevents_area_tail_raw];
                        ev->src_agent = ag->m_ptr_agent;
                        ev->time = timegettime64();
                        ev->is_statechange = CBTS_HEALTHMAXUPDATE;
                        ev->dst_agent = (uintptr_t)new_healthmax;
                        m_cbtevents_area_tail_raw = (m_cbtevents_area_tail_raw + 1) % RB_STR_ELEMENTS;
                        postlock(m_cbtevents_area_hready);
                        postlock(m_cbtevents_area_hlock);
                    }
                }
            }

ARC Position BETA 0.2.zip

was cleaning up timing stuff instead of having a hundred if (time < x + something) everywhere that are sometimes written backwards simplified to a macro and mightve swapped the < with an > not even thinking about how it should work miracle it didnt crash anywhere Attachment file type: unknown d3d9_arcdps_buildtemplates.dll 200.00 KB Attachment file type: unknown d3d9.dll 472.50 KB these will be good pos and velocity every 300ms if changed since previous

merforga avatar Jun 18 '18 14:06 merforga

Draft replay format, in json - json isn't a requirement, but convenient for a web renderer and a decent enough way to explore the structure more of a simple way to consider structure:

{
  "info" : {
    "encounter" : "Deimos",
    "time" : "date+time",
    "duration" : 123.5,
  },
  "maps" : [
    {
      "image" : "url",
      "region" : {
        "x" : 2,
        "y" : 3,
        "width" : 100,
        "height" : 100
      },
      "coordinates" : {
        "x" : 200,
        "y" : 30000,
        "width" : 900,
        "height" : 900
      },
      "vertical-range" : {
        "lower" : 200,
        "upper" : 400
      }
    }
  ],
  "actors" : [
    {
      "name" : "Bert",
      "id" : 1,
      "type" : "Class/Enemy",
      "display" : {
        "default" : {
          "icon-texture" : "",
          "icon-region" : {
            ...
          }
        },
        "up" : {
        
        },
        "down" : {
        
        },
        "dead" : {
        
        }
      }
    },
    {
      "name" : "Deimos",
      "type" : "Boss",
      ...
    }
  ],
  "tracks" : [
    {
      "path" : ["Bert","position","x"],
      "data-type" : "numeric",
      "update-type" : "interval"
      "interpolation" : "lerp",
      "start-time" : 10,
      "frequency" : 0.5,
      "data" : [1,1,1,1,2,2,2,2,2,...]
    },
    {
      "path" : ["Bert","position","y"],
      "data-type" : "numeric",
      "update-type" : "interval"
      "interpolation" : "lerp",
      "start-time" : 12,
      "frequency" : 0.5,
      "data" : [1,1,1,1,2,2,2,2,2,...]
    },
    {
      "path" : ["Bert","state"],
      "data-type" : "state",
      "update-type" : "delta"
      "data" : [
        {
          "time" : 0,
          "value": "up"
        },
        {
          "time" : 20,
          "value": "down"
        },
        {
          "time" : 24,
          "value": "dead"
        }]
    },
  ]
}

immortius avatar Jun 22 '18 11:06 immortius

i should mention that i don't actually know which coordinate system the ones i report are part of (game internals use something different for rendering/transform raw, skills/map/ui?, and mumble interface/api, in a split that i'm also unsure of)

deltaconnected avatar Jun 22 '18 13:06 deltaconnected

I'm sure we can figure out...given a relative position XD

merforga avatar Jun 22 '18 15:06 merforga

I was assuming I would need to capture some boundary positions and math it out from there anyway, so no worries.

immortius avatar Jun 22 '18 15:06 immortius

Demo of progress at http://immortius.net.au/gw2continuumsplit/

immortius avatar Jun 26 '18 06:06 immortius

@deltaconnected Is it possible to get facing information, possibly instead of velocity (which isn't as generally useful I don't think, as we can somewhat derive velocity from the change in position, but facing cannot be replicated from velocity)? Facing could possibly use as little as a byte depending on the amount of preprocessing you are willing to do (0-255, with 0 as North, 64 as East, 128 as South etc)

immortius avatar Jul 15 '18 13:07 immortius

Sure. I include velocity because I know it's the only way to reliably check if someone got hit by a red orb on xera (dodge and the lift are unique). CBTS_FACING = 21 (next in the enum list), https://pastebin.com/D1XU6XBy for copy pasta code. Included in https://www.deltaconnected.com/arcdps/dev/ which will make it to live... eventually

deltaconnected avatar Jul 15 '18 23:07 deltaconnected

Released in 18th of July arc update jul.18.2018: evtc: added facing statechange (21) for players and boss, polled at 500ms, post-encounter logs only. jul.18.2018: evtc: above use dst_agent as x/y (cast &dst_agent to float*, use as float[2], xy)

merforga avatar Jul 18 '18 23:07 merforga

New SH log

20180720-230633.evtc.zip

merforga avatar Jul 20 '18 15:07 merforga

Facing in action http://immortius.net.au/gw2continuumsplit/

immortius avatar Jul 21 '18 00:07 immortius

Added in pos/vel/fac for some raid mechanic NPC's (seekers, other guardians, spirits, sab phases, matthias spirits, etc.), don't remember which is which as of latest

deltaconnected avatar Jul 24 '18 19:07 deltaconnected

@ajrdesign for if you have time soonish to see how best to add this to the encounter pages. Demo can be viewed on divide's site above and i'm sure there's some styling changes possible as well.

merforga avatar Jul 27 '18 03:07 merforga