Jump to content

Collecting Player Data in Vector as Game is Played


dcpc
 Share

Recommended Posts

I'm trying to create a player state vector that is updated every 20 or 30 seconds and collects data such as the number of each resource and numbers of units of each class to be stored in a vector as a game goes on.

It would look something like this:

time wood metal food stone melee horse skirmisher ... etc

0 300 300 300 300 5 1 3 ...

30 120 450 60 420 12 5 7

.

.

With a new string being added on to the end every 30 seconds with the players information at the time of collecting it as the game is played.

However, I'm having a lot of difficulty finding where in the code this kind of data is stored, or how it is accessed. I've looked through the save game functions and found out about the component manager and serializer and and how component classes has serialize methods, but none of these components seem to have anything about the data relating to a players resources or unit numbers.

Does anyone have any insight on how to accomplish this task? More specifically what files handle real time player's resource and unit information?

Thank you.

Link to comment
Share on other sites

Have a look at the charts mod thread: http://www.wildfiregames.com/forum/index.php?showtopic=18763&hl=charts

and the StatistiksTracker: http://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/simulation/components/StatisticsTracker.js

Should give you an idea where to grab the data and may even help to connect your code to the game. There is quite a wealth of data available.

  • Like 1
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...