Jump to content

Querying game state


Recommended Posts

Is it possible to connect to a live game and subscribe to updates to the game state? I'm trying to achieve something similar to what you can do with Dota 2/CSGO's "game state integration", which allows third-parties to have a server they can connect to and receive updates about the game. From there, you can set up a client that connects to the server and parses out all the information (much like this for Dota 2). The primary use cases are typically for custom broadcast effects that react to gameplay or keeping track of stats in real time.

Link to comment
Share on other sites

12 minutes ago, threecarbonalkane said:

Is it possible to connect to a live game and subscribe to updates to the game state? I'm trying to achieve something similar to what you can do with Dota 2/CSGO's "game state integration", which allows third-parties to have a server they can connect to and receive updates about the game. From there, you can set up a client that connects to the server and parses out all the information (much like this for Dota 2). The primary use cases are typically for custom broadcast effects that react to gameplay or keeping track of stats in real time.

Well you can connect as an observer to the games, and you will compute the game in real time. You won't get a simple json though, since you have to compute the whole game state to get that kind of data. Also not everyone will let you monitor their games. 

Link to comment
Share on other sites

If you are fine with being annoying to the host, you can recieve a binary serialization of the game. Which you can do periodically. From what I have read, you only need to deserialize the JS stattracker component.

Once you are a connected client, the server won’t let the game proceed until you compute the game as well. (Or pretend to). So being in the game itself doesn’t seem to be what you want.

The game updates sent to the lobby also contain some data. Which would be easier and more friendly to the host.

Edited by Guest
Link to comment
Share on other sites

Thanks for the replies.

Quote

Once you are a connected client, the server won’t let the game proceed until you compute the game as well. (Or pretend to). So being in the game itself doesn’t seem to be what you want.

I think the simplest implementation would be utilize the work the client is already doing to parse the state, then just "echo" it to localhost for another process to consume all that info. This would limit querying to players and spectators (rather than allowing anyone with the host IP to ping the server).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...