Closed timotheeg closed 4 years ago
Any objection if I set the stats OCR pattern to TDD
rather than DDD
? That implies counts up to 299 max for each piece type, which should be more than enough for any game, unless RNG gets you really really skewed distribution.
Any objection if I set the stats OCR pattern to
TDD
rather thanDDD
? That implies counts up to 299 max for each piece type, which should be more than enough for any game, unless RNG gets you really really skewed distribution.
No objection, i guess it gives a small perf boost.
Can you hook it to config so that we respect stats_method?
There are 3(?) methods: scanning text (this pr), check top of field (set a hook for it then raise unimplemented), None.
So in NAIVE if they set no-stats then we should setup the relevant task. It may be a good idea to subclass something that sorts this out. You can leave checking top of field as unimplemented for now.
Can you hook it to config so that we respect stats_method?
That's already done. I've only implemented the flow which starts with scan_stats_text()
, which is already invoked by respecting the config:
if config["stats.enabled"]:
if config["stats.capture_method"] == "FIELD":
tasks.append(self.scan_spawn)
elif config["stats.capture_method"] == "TEXT":
tasks.append(self.scan_stats_text)
Perfect!
Yeah i should have checked the code first, i was lazy :(
I think eventually i want to change from stats.enabled and stats.capture_method to stats.method and having "None" / "FIELD" / "TEXT" but that's an aside. I can merge now that you've put your TDD in?
I can merge now that you've put your TDD in?
Yes please 👍
⚠️ Merge #57 before checking this PR!
Restore naive piece stats OCR.
Other methods, relying on field inspection don't work well on twitch streams with varying quality, and frame drops. Piece stats are more "stable" for such cases.
Tested on OSX from a twitch stream.
@alex-ong @blakegong