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

A error of sc2::ClientEvents::OnUnitCreated() . #299

Open
DotaIsMind opened this issue Mar 31, 2019 · 3 comments
Open

A error of sc2::ClientEvents::OnUnitCreated() . #299

DotaIsMind opened this issue Mar 31, 2019 · 3 comments

Comments

@DotaIsMind
Copy link

I hope use sc2::ClientEvents::OnUnitCreated() to record the number of units and the GameLoop when the units was created in a replay, but there was an error in recording the number of workers(probe, drone and SCV), with more recorded results than actual results. On December 28, 2018, this error disappeared, my program ended up recording the same results as in the replay, I thought it was fixed, but now it appears again. Does anyone else have the same problem as me?How did you solve it?

@DotaIsMind
Copy link
Author

This issue has the same problem. #242

@Archiatrus
Copy link

The problem is that units get "created" whenever the unit model gets created. So whenever a worker leaves a refinery. But also a unit leaving a medivac for example. Interesting that this was changed for a while.
Anyway, I assume that the unit tag stays with a unit. So you could have something like std::map<unit_type_id_type, std::set<unit_tag_type>> unitTypeCounter. Then you insert every unit in the set for it's type and at the end of the game you can query the size of the relevant unit type set. Of course if you are only interested in workers you can drop the map part and only use one set were you insert if it is a worker.

@DotaIsMind
Copy link
Author

Thanks for your help.

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

No branches or pull requests

2 participants