Big Update#68
Open
bebabinlarsson-blip wants to merge 32 commits into
Open
Conversation
Agent-Logs-Url: https://github.com/bebabinlarsson-blip/BrawlStarsBotPrompt/sessions/c908f4f6-51a5-4d3b-a0f8-0ac4be55ce66 Co-authored-by: bebabinlarsson-blip <248225309+bebabinlarsson-blip@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bebabinlarsson-blip/BrawlStarsBotPrompt/sessions/c908f4f6-51a5-4d3b-a0f8-0ac4be55ce66 Co-authored-by: bebabinlarsson-blip <248225309+bebabinlarsson-blip@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bebabinlarsson-blip/BrawlStarsBotPrompt/sessions/c908f4f6-51a5-4d3b-a0f8-0ac4be55ce66 Co-authored-by: bebabinlarsson-blip <248225309+bebabinlarsson-blip@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bebabinlarsson-blip/BrawlStarsBotPrompt/sessions/c908f4f6-51a5-4d3b-a0f8-0ac4be55ce66 Co-authored-by: bebabinlarsson-blip <248225309+bebabinlarsson-blip@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bebabinlarsson-blip/BrawlStarsBotPrompt/sessions/c908f4f6-51a5-4d3b-a0f8-0ac4be55ce66 Co-authored-by: bebabinlarsson-blip <248225309+bebabinlarsson-blip@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bebabinlarsson-blip/BrawlStarsBotPrompt/sessions/c908f4f6-51a5-4d3b-a0f8-0ac4be55ce66 Co-authored-by: bebabinlarsson-blip <248225309+bebabinlarsson-blip@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bebabinlarsson-blip/BrawlStarsBotPrompt/sessions/c908f4f6-51a5-4d3b-a0f8-0ac4be55ce66 Co-authored-by: bebabinlarsson-blip <248225309+bebabinlarsson-blip@users.noreply.github.com>
…-performance Harden Python dependencies and refresh bot runtime/data for current Brawl Stars
Agent-Logs-Url: https://github.com/bebabinlarsson-blip/BrawlStarsBotPrompt/sessions/bdbff8a5-9b51-4d74-bae6-0888c2110041 Co-authored-by: bebabinlarsson-blip <248225309+bebabinlarsson-blip@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bebabinlarsson-blip/BrawlStarsBotPrompt/sessions/bdbff8a5-9b51-4d74-bae6-0888c2110041 Co-authored-by: bebabinlarsson-blip <248225309+bebabinlarsson-blip@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bebabinlarsson-blip/BrawlStarsBotPrompt/sessions/bdbff8a5-9b51-4d74-bae6-0888c2110041 Co-authored-by: bebabinlarsson-blip <248225309+bebabinlarsson-blip@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bebabinlarsson-blip/BrawlStarsBotPrompt/sessions/bdbff8a5-9b51-4d74-bae6-0888c2110041 Co-authored-by: bebabinlarsson-blip <248225309+bebabinlarsson-blip@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bebabinlarsson-blip/BrawlStarsBotPrompt/sessions/bdbff8a5-9b51-4d74-bae6-0888c2110041 Co-authored-by: bebabinlarsson-blip <248225309+bebabinlarsson-blip@users.noreply.github.com>
…ode-functionality Add multi-mode gameplay profiles, team-aware targeting hooks, and predictive engagement logic
Agent-Logs-Url: https://github.com/bebabinlarsson-blip/BrawlStarsBotPrompt/sessions/3d6364cf-2260-4b50-ab8f-7e1842e63e49 Co-authored-by: bebabinlarsson-blip <248225309+bebabinlarsson-blip@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bebabinlarsson-blip/BrawlStarsBotPrompt/sessions/3d6364cf-2260-4b50-ab8f-7e1842e63e49 Co-authored-by: bebabinlarsson-blip <248225309+bebabinlarsson-blip@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bebabinlarsson-blip/BrawlStarsBotPrompt/sessions/3d6364cf-2260-4b50-ab8f-7e1842e63e49 Co-authored-by: bebabinlarsson-blip <248225309+bebabinlarsson-blip@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bebabinlarsson-blip/BrawlStarsBotPrompt/sessions/3d6364cf-2260-4b50-ab8f-7e1842e63e49 Co-authored-by: bebabinlarsson-blip <248225309+bebabinlarsson-blip@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bebabinlarsson-blip/BrawlStarsBotPrompt/sessions/3d6364cf-2260-4b50-ab8f-7e1842e63e49 Co-authored-by: bebabinlarsson-blip <248225309+bebabinlarsson-blip@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bebabinlarsson-blip/BrawlStarsBotPrompt/sessions/3d6364cf-2260-4b50-ab8f-7e1842e63e49 Co-authored-by: bebabinlarsson-blip <248225309+bebabinlarsson-blip@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bebabinlarsson-blip/BrawlStarsBotPrompt/sessions/3d6364cf-2260-4b50-ab8f-7e1842e63e49 Co-authored-by: bebabinlarsson-blip <248225309+bebabinlarsson-blip@users.noreply.github.com>
…laggy-behavior Stabilize runtime control loop and reduce lag/jitter in detection and input handling
There was a problem hiding this comment.
Pull request overview
This PR is a broad “big update” focused on improving runtime efficiency (reducing busy-wait loops), making detection/class handling more extensible (class-name mapping + configurable per-class thresholds), and adding configurable gameplay profiles for solo vs. team modes (including short-horizon enemy prediction and optional teammate-aware behavior).
Changes:
- Reduced CPU busy-waiting in capture/detection/control loops and improved thread safety patterns (more
daemon=True,with lock, small sleeps). - Reworked detection output handling to use class-name mapping and configurable per-class thresholds, and expanded brawler stats lookup robustness.
- Added game mode profiles (solo/team), short-term enemy movement prediction, and rank-push context fields for runtime output.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents new team-mode profiles and recent performance/behavior updates. |
| modules/windowcapture.py | Avoids deprecated NumPy API and improves threading patterns for screenshot capture. |
| modules/screendetect.py | Adds cooldown gating + safer pixel matching and reduces idle CPU usage. |
| modules/detection.py | Adds class-name based detection mapping, per-class thresholds, and reduces busy-waiting. |
| modules/bot.py | Adds mode-profile driven behavior, deterministic fallback movement, and enemy prediction logic. |
| misc/textInstruction.md | Updates setup steps to reflect constants.py and game mode configuration. |
| main.py | Wires new Detection signature and prints mode/rank-push context; avoids busy-wait when no frame yet. |
| detection_test.py | Updates Detection instantiation to include per-class thresholds. |
| constants.py | Adds brawler-name normalization, mode profiles, and switches to dict-based class thresholds. |
| brawler_stats.json | Expands roster coverage with additional brawler entries. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| default_class_threshold = min(class_threshold.values()) | ||
| # Backward-compatible index-based thresholds for any existing code paths. | ||
| # This list intentionally follows only the `classes` array order. | ||
| threshold = [class_threshold.get(class_name, default_class_threshold) for class_name in classes] |
| normalized_game_mode = "solo_showdown" | ||
| active_game_mode = normalized_game_mode | ||
| selected_game_mode = game_mode_profiles[active_game_mode] | ||
| centerOrder = selected_game_mode["centerOrder"] |
Comment on lines
+147
to
166
| tempList = [[] for _ in range(len(self.classes))] | ||
| results = self.model.predict( | ||
| screenshot, | ||
| imgsz=Constants.imgsz, | ||
| half=Constants.half, | ||
| conf=min(Constants.threshold), | ||
| verbose=False | ||
| ) | ||
| result = results[0] | ||
| for box in result.boxes: | ||
| x1, y1, x2, y2 = [round(x) for x in box.xyxy[0].tolist()] | ||
| class_id = int(box.cls[0].item()) | ||
| prob = round(box.conf[0].item(), 2) | ||
| threshold = Constants.threshold[class_id] | ||
| class_name = result.names.get(class_id) | ||
| if class_name is None: | ||
| continue | ||
| if class_name not in self.class_to_index: | ||
| continue | ||
| threshold = self.class_thresholds.get(class_name, min(Constants.threshold)) | ||
| if prob >= threshold: |
Comment on lines
+57
to
+61
| - Expanded `brawler_stats.json` with newer and missing brawlers for current roster coverage. | ||
| - Added configurable mode profiles for solo and team modes (`3v3`, `5v5`) with different bot behavior. | ||
| - Added class-name based detection mapping so custom models can be extended more safely. | ||
| - Added short-horizon enemy movement prediction and optional teammate-support aggression. | ||
| - Added manual rank-push context fields for current/target rank visibility. |
| 1. Run "detection_test.py" to check if object detection is working | ||
| 2. Change the brawler_name in "constants.py" to your selected Brawler's name and run "constant.py". | ||
| 2. Change the brawler_name in "constants.py" to your selected brawler's name and run "constants.py" (spaces/punctuation are handled, e.g. "Mr. P" or "mr p"). | ||
| 3. If the brawler's stats in not found manually change the speed, attack range and height scale factor located below brawler_name at "constant.py" to the brawler's [speed and range](https://pixelcrux.com/Brawl_Stars/Brawlers/) and to find the height scale factor run "hsf_finder". Also modify sharpCorner (True if the map has many walls, otherwise False) and centerOrder ( True if brawler spawns in the middle of the map, otherwise False). |
Agent-Logs-Url: https://github.com/bebabinlarsson-blip/BrawlStarsBotPrompt/sessions/e75e574d-feaf-4e91-a452-fc7d6b1a7a6e Co-authored-by: bebabinlarsson-blip <248225309+bebabinlarsson-blip@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bebabinlarsson-blip/BrawlStarsBotPrompt/sessions/e75e574d-feaf-4e91-a452-fc7d6b1a7a6e Co-authored-by: bebabinlarsson-blip <248225309+bebabinlarsson-blip@users.noreply.github.com>
…verywhere Generalize bot decision loop for team modes (3v3/5v5) beyond solo bush-hiding behavior
…otPrompt) Agent-Logs-Url: https://github.com/bebabinlarsson-blip/BrawlStarsBotPrompt/sessions/0a6a611c-bd25-4c11-a122-07ebc475e575 Co-authored-by: bebabinlarsson-blip <248225309+bebabinlarsson-blip@users.noreply.github.com>
…git-install Update README install instructions to point to this fork
Agent-Logs-Url: https://github.com/bebabinlarsson-blip/BrawlStarsBotPrompt/sessions/1f9f4ec4-bdfb-4f3f-a9e2-e8eab28ccb20 Co-authored-by: bebabinlarsson-blip <248225309+bebabinlarsson-blip@users.noreply.github.com>
…install-error Update dependencies for Python 3.14 compatibility
…from bbox Agent-Logs-Url: https://github.com/bebabinlarsson-blip/BrawlStarsBotPrompt/sessions/67667c8c-24e3-46e3-842c-20dc3dd15fc6 Co-authored-by: bebabinlarsson-blip <248225309+bebabinlarsson-blip@users.noreply.github.com>
Agent-Logs-Url: https://github.com/bebabinlarsson-blip/BrawlStarsBotPrompt/sessions/67667c8c-24e3-46e3-842c-20dc3dd15fc6 Co-authored-by: bebabinlarsson-blip <248225309+bebabinlarsson-blip@users.noreply.github.com>
…and-fix-requirements Fix Python 3.14 install failure, add cubebox attack, auto player position detection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.