Export Raw Data

Options
Hi Everyone,

I'm making a game that I'll use for scientific purposes.
To perform analysis, I have to export raw variables from the game (such as player positions) to my computer (in .csv for example).
What is the best way to go about this?

Thanks in advance.

Nicolas

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    edited June 2020
    Options
    Hi @NicolasC,

    Thank you for choosing Photon!

    The best way is to do this via custom plugin, especially if you use the self-hosted Photon Server as it's only available for Enterprise customers.

    Otherwise, you can use WebRPCs and Webhooks to send positions updates to your server and save them on each update OR save the last positions when the room is destroyed.

    Are you using PUN?
    How do you update positions? do you use PhotonView/PhotonTransformView?

    How big is the data? (other than player positions what do you want to save? how often is position updated and how many players?)
  • NicolasC
    Options

    Thanks so much for your answer.
    I'm indeed using PUN and PhotonTransformView.
    My goal is to make a detailed analysis of player behaviour in the environment.
    Ideally, that means I get players positions, scores,... at least every second.
    I'll use the csv files to make graphs and further analysis.

    I just figured out how to send data via an event webhook to a pipedream URL. I'll try to continue from there. Should that work?

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    I just figured out how to send data via an event webhook
    this is going to be tricky to do in PUN's built-in PhotonTransformView unless you modify the code and understand PUN's view serialization event structure...
    maybe you're planning to switch to bare RaiseEvent for positions sync/updates instead of PhotonTransformView?

    also I think we have limits for HTTP requests frequency per second.
    I don't have the number now but you should not send too many per second so I don't know the positions update rate..
    maybe you can batch or you can bypass Photon altogether in communicating with your webservice.

    did you consider a custom plugin + self-hosted server (e.g. locally)?

    thanks for pipedream mention!
    I like it, I'm gonna use it for sure, I like HTTP tools, I was sad to see webscript.io or old runscope.io gone.