Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not showing event for queuing ordered units #117

Closed
demienYu opened this issue May 23, 2020 · 7 comments · Fixed by #162
Closed

not showing event for queuing ordered units #117

demienYu opened this issue May 23, 2020 · 7 comments · Fixed by #162

Comments

@demienYu
Copy link

If i order just one unit at a time (say, Marine in a Barrack) i have two events:

  1. BasicCommandEvent event.ability.id = 5088, event.ability.name = TrainMarine
    when i order marine
  2. UnitBornEvent event.name = "Unit born Marine"
    when marine production is done

But when I order multiple marines in a queue i just get one BasicCommandEvent "TrainMarine" and then multiple UnitBornEvents, when every marine is done.

Is it possible to catch "train" event when i order every unit in a queue?

@dsjoerg
Copy link
Member

dsjoerg commented May 24, 2020

That is so weird, I would have thought you would get multiple TrainMarine events.
I suggest you look at the raw event stream, either using sc2reader or https://github.com/Blizzard/s2protocol.

If the raw event stream doesn't have multiple TrainMarine events, then there isn't anything that can be done about it without hacking the StarCraft2 client itself.

@dsjoerg
Copy link
Member

dsjoerg commented May 24, 2020

It seems especially weird to me because the replay contains all the information necessary to replay the game. So somewhere in there is the information about how many marines the player is attempting to train.

@demienYu
Copy link
Author

What do you mean by the "raw event stream"? How can i access it using sc2reader?
I access events through replay.events list.

@demienYu
Copy link
Author

I've just parsed game events using s2protocol and i actually see queuing marines. But s2protocol events format is something really hard to comprehend. sc2reader is much usable.
{"m_cmdFlags": 256, "m_abil": {"m_abilLink": 159, "m_abilCmdIndex": 0, "m_abilCmdData": None}, "m_data": {"None": None}, "m_sequence": 19, "m_otherUnit": None, "m_unitGroup": None, "_event": "NNet.Game.SCmdEvent", "_eventid": 27, "_gameloop": 2264, "_userid": {"m_userId": 0}, "_bits": 112}, {"m_state": 1, "m_sequence": 20, "_event": "NNet.Game.SCommandManagerStateEvent", "_eventid": 103, "_gameloop": 2267, "_userid": {"m_userId": 0}, "_bits": 56}, {"m_state": 1, "m_sequence": 21, "_event": "NNet.Game.SCommandManagerStateEvent", "_eventid": 103, "_gameloop": 2271, "_userid": {"m_userId": 0}, "_bits": 56}, {"m_state": 1, "m_sequence": 22, "_event": "NNet.Game.SCommandManagerStateEvent", "_eventid": 103, "_gameloop": 2275, "_userid": {"m_userId": 0}, "_bits": 56}, {"m_state": 1, "m_sequence": 23, "_event": "NNet.Game.SCommandManagerStateEvent", "_eventid": 103, "_gameloop": 2280, "_userid": {"m_userId": 0}, "_bits": 56}, {"m_state": 1, "m_sequence": 24, "_event": "NNet.Game.SCommandManagerStateEvent", "_eventid": 103, "_gameloop": 2282, "_userid": {"m_userId": 0}, "_bits": 56},
So in my opinion it would be great to fix this in sc2reader

@StoicLoofah
Copy link
Collaborator

That's a great suggestion! Admittedly, sc2reader is very much in maintenance mode, so if either your or someone else in the community wants to submit a pull request for it, I will happily take a look, but I personally am unlikely to take a stab at this

@danfulton
Copy link
Contributor

I know this is a zombie thread, but running into this at the moment, so I thought I'd chime in if anyone has any hints for me.

I think this generally affects any Train* event, even if it is not immediate... e.g. if I select a Command Center, train an SCV, wait five seconds and train another SCV without changing selection, then I do see a TrainSCV BasicCommandEvent for the first SCV, but nothing for the second. I noticed something similar with Zerg Morph* events, but in that case you DO see all the larva->egg morphs at the same time, so you can imply what the egg is for based on the last Morph event you saw.

Before I found this issue, I was thinking along same lines as @dsjoerg ... the info MUST be in the replay, so somehow it is not getting extracted properly somewhere along the line.

All the binary parsing is a little obscure to me, but if I can figure anything out I'll make a PR.

@danfulton
Copy link
Contributor

Ah, I was a bit confused by the CommandManagerStateEvent that @demienYu was catching, but it looks like it just means "repeat the last CommandEvent received."

{'m_state': 1, 'm_sequence': 33, '_event': 'NNet.Game.SCommandManagerStateEvent', '_eventid': 103, '_gameloop': 1031, '_userid': {'m_userId': 0}, '_bits': 56}

I'm making a class to catch these and will make a PR shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants