Finding amount of minerals

50 views
Skip to first unread message

Yaser Norouzzadeh

unread,
Nov 19, 2015, 2:07:05 PM11/19/15
to sc2reader

How can I find players resources per time slice or per multi-frame?


David Joerg

unread,
Nov 20, 2015, 6:56:02 AM11/20/15
to sc2reader

On Thu, Nov 19, 2015 at 2:07 PM, Yaser Norouzzadeh <ynr....@gmail.com> wrote:

How can I find players resources per time slice or per multi-frame?


--
You received this message because you are subscribed to the Google Groups "sc2reader" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sc2reader+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yaser Norouzzadeh

unread,
Nov 20, 2015, 4:45:08 PM11/20/15
to sc2reader
Thanks. I'm beginner in Python, could you guide me how to use tracker.py to find the required data?
Let assume I loaded the replay file in 'rep'.

David Joerg

unread,
Nov 21, 2015, 9:06:50 AM11/21/15
to sc2reader
Hi Yaser, you might find github.com/blizzard/s2protocol easier to use for your purposes, because you can run s2protocol with --trackerevents and then parse the output with whatever tools you're already familiar with to get what you need.

The hardest thing about being a Python beginner is that sometimes you get stuck and won't know how to get yourself un-stuck, ideally you have someone nearby who can get you un-stuck from those problems. Usually on this mailing list people post specific sc2reader-specific problems or ideas they're having.

Yaser Norouzzadeh

unread,
Nov 23, 2015, 11:58:18 AM11/23/15
to sc2reader
Hi David, You right, but I have to use sc2reader and Python.  replay.tracker_events returns empty list. Also, I tried the following code, but I'm not sure I passed the inputs correctly for PlayerStatsEvent():

from sc2reader.events.tracker import PlayerStatsEvent
from sc2reader.factories import SC2Factory path1 = 'D:/Data/sorted/bronze/'
sc2 = SC2Factory()
replays = sc2.load_replays(path1)
for r in replays:
    if r.type == '1v1':
        data = [r.player[1].pid, r.players[1].events ]
game_state = PlayerStatsEvent(r.frames , data, r.build )

Eddie

unread,
Nov 27, 2015, 10:57:17 PM11/27/15
to sc2r...@googlegroups.com
If memory serves correctly, you probably want to check which events in replay.events are PlayerStatsEvents. I'm confused by what you're trying to do with game_state... after a replay has been loaded it has all the events already created so I don't understand the call to the PlayerStatsEvent constructor.

Eddie

Yaser Norouzzadeh

unread,
Dec 1, 2015, 5:09:34 AM12/1/15
to sc2reader
I have the events after loading the replay. I'm looking for game state information (minerals, gas, workers, armies, ...) in each frame.
Reply all
Reply to author
Forward
0 new messages