Vision Engine Performance & Thermal Management
Because Macrion executes computer vision and neural OCR models directly on your Android device's CPU, understanding how the engine allocates resources is critical. Proper performance tuning ensures fast, responsive touch reactions while keeping CPU utilization, battery drain, and thermal throttling under control during extended automation sessions.
The Automation Performance Equation
The total processing load generated by a running scenario can be expressed as:
$$\text{Load} \propto \text{Detection Frequency} \times \text{Frame Resolution}^2 \times \sum \text{Active Condition Complexities}$$
- Detection Frequency: How many times per second Macrion captures and inspects a screen frame.
- Frame Resolution: The pixel dimensions of the image passed to OpenCV and Tencent NCNN.
- Condition Complexity: The algorithms used (Color $\ll$ Image Template Matching $\ll$ Neural Text OCR).
Optimizing any one of these factors yields compound reductions in processing latency and battery consumption.
Resolution Scaling Benchmarks
Template matching (TM_CCOEFF_NORMED) calculates cross-correlations across a sliding window. For an image search area of size $W \times H$ and a template of size $w \times h$, the computational complexity is approximately:
$$\mathcal{O}\bigl((W - w + 1)(H - h + 1) \cdot w \cdot h\bigr)$$
Because computational cost scales quadratically with linear dimensions, downscaling the capture frame produces dramatic speedups:
| Resolution Factor | Frame Dimensions (from 1080p) | Total Pixels | Avg. Template Match Latency | Relative Speedup |
|---|---|---|---|---|
1.0 (Native) | $1920 \times 1080$ | $2{,}073{,}600$ | $\approx 78\text{ ms}$ | $1.0\times$ (Baseline) |
0.5 ($1/2$ Scale) | $960 \times 540$ | $518{,}400$ | $\approx 14\text{ ms}$ | $5.5\times$ Faster |
0.33 ($1/3$ Scale) | $640 \times 360$ | $230{,}400$ | $\approx 6\text{ ms}$ | $13\times$ Faster |
0.25 ($1/4$ Scale) | $480 \times 270$ | $129{,}600$ | $\approx 2.5\text{ ms}$ | $31\times$ Faster |
(Benchmarks gathered on an octa-core ARM64 Snapdragon 8-series processor evaluating a $150 \times 150$ px template).
Recommended Scaling by Condition Type
- Color Conditions: Can run at any scaling factor (including $1/4$ scale) because sampling RGB values takes less than $0.1\text{ ms}$.
- Image Conditions: Best at $1/2$ Scale (
0.5). Retains crisp graphic borders while slashing compute latency by over $80%$. - Text (OCR) Conditions: Best at Native (
1.0) or $1/2$ Scale (0.5). Chinese characters, Devanagari ligatures, and small fonts require sufficient pixel density for the NCNN neural network to segment character strokes accurately.
Detection Frequency Tuning
Detection frequency controls the polling interval between successive screen captures. Adjust this setting based on the pacing of the target game or application:
Detection Frequency Guidelines
├── 100 ms – 200 ms: Fast-twitch rhythm, action games, instant reaction triggers
├── 300 ms – 600 ms: Standard UI navigation, gacha farming, turn-based combat (Recommended)
└── 1000 ms – 3000 ms: Background monitoring, idling, low-battery farming| Application Category | Suggested Frequency | Rationale |
|---|---|---|
| Turn-Based RPGs / Gacha Games | 500 ms | Battles and turn transitions take several seconds; evaluating twice per second is plenty fast while conserving battery. |
| Action / Timed Mini-Games | 150 ms | Requires rapid reaction to catch fleeting prompts or rhythm indicators. |
| Menu & Inventory Routines | 300 ms | Matches standard Android UI transition and page slide animations. |
| Overnight Idle Farming | 1000 ms to 2000 ms | Minimizes heat buildup when the device runs unattended for 8+ hours. |
Architectural Efficiency Best Practices
Beyond global settings, scenario design directly impacts runtime efficiency:
1. Short-Circuit with OR Conditions
When evaluating multiple visual conditions, using the OR logic operator allows Macrion's vision pipeline to stop evaluating remaining conditions immediately upon encountering the first positive match. By contrast, AND logic must evaluate every condition in sequence before concluding.
2. Immediate Reaction with keepDetecting = false
By default, when an event matches, Macrion halts frame evaluation for that cycle, immediately dispatches the event's actions, and moves to the next frame. Only enable keepDetecting = true if you specifically require multiple events to fire on the identical screen frame.
3. Apply Event Cooldowns
During network loading screens or combat victory animations, the visual indicator may remain on screen for 2 to 5 seconds. Without an event cooldown, Macrion would continually re-detect the condition and dispatch redundant taps every few milliseconds. Setting an event cooldown of 1500 ms to 3000 ms:
- Prevents duplicate touch injection.
- Puts the event listener into a lightweight sleep state, reducing CPU wakeups.
4. Isolate Phases with State Machines
Do not leave 20 events active simultaneously. Use the ToggleEvent Action to divide your scenario into distinct operational phases (e.g., Lobby Phase, Combat Phase, Victory Screen Phase). When only 2 or 3 events are active at any moment, vision processing remains essentially instantaneous.
Thermal & Hardware Considerations
Extended automation sessions generate continuous CPU activity. To prevent your device from throttling its clock speeds:
- Lower Target App Framerates: If the game provides graphical settings, cap it to
30 FPSinstead of60 FPSor120 FPS. The GPU will run significantly cooler, leaving more thermal headroom for Macrion's CPU vision tasks. - Reduce Screen Brightness: The display is often the largest single contributor to battery drain and internal heat. Dimming the screen during overnight farming sessions drastically reduces thermal throttling.
- Avoid Thick Cases During Long Sessions: When running continuous overnight automation, thick protective cases trap internal heat. Removing the case helps the phone dissipate heat naturally.