Skip to content

Comments

[WIP] Rune adjustments for Mac#68

Open
kevin3991 wants to merge 28 commits intoKenYu910645:mainfrom
kevin3991:feature/cleric
Open

[WIP] Rune adjustments for Mac#68
kevin3991 wants to merge 28 commits intoKenYu910645:mainfrom
kevin3991:feature/cleric

Conversation

@kevin3991
Copy link
Contributor

@kevin3991 kevin3991 commented Jun 25, 2025

🧙‍♂️ PR: Add Cleric Support and Enhanced Rune Detection Features

📋 Summary

This PR introduces comprehensive support for Cleric class optimization and significantly enhances the rune detection system with improved movement controls and configuration options.

✨ Key Features Added

🔍 Enhanced Rune Detection System

  • Improved Detection Accuracy:
    • Expanded rune detection box (700x150 pixels)
    • Optimized threshold values for better recognition
    • Enhanced rune warning detection with adjusted coordinates
  • Movement Control System:
    • Added configurable movement cooldowns for different rune states
    • long_movement_cooldown: Controls movement speed during rune finding
    • movement_cooldown: Controls precise positioning near runes
  • State Management:
    • Separate movement controls for finding_rune and near_rune states
    • Improved logging for debugging rune-related commands

⚙️ System Optimizations

  • Performance Improvements:
    • Increased main loop FPS to 30 for smoother operation
    • Optimized window capture FPS to 20
  • Configuration Enhancements:
    • Added nametag detection configuration
    • Enhanced teleport and edge detection features
    • Improved rune solver parameters

🔧 Technical Changes

Core Logic Updates (mapleStoryAutoLevelUp.py)

  • Added movement cooldown system for rune finding states
  • Implemented separate timer tracking for different movement states
  • Enhanced logging for better debugging capabilities
  • Added initialization for new timer variables

Configuration Updates

  • config_default.yaml: Added new rune movement cooldown parameters
  • Makefile: Updated run commands to use new script and cleric config

�� Benefits

  1. Improved Rune Handling: More reliable and efficient rune detection and solving
  2. Better Movement Control: Smoother and more precise character movement
  3. Enhanced Debugging: Better logging and monitoring capabilities
  4. Performance Gains: Optimized FPS settings for better responsiveness

🧪 Testing

  • Verified rune detection accuracy improvements
  • Confirmed movement control system functionality
  • Validated configuration parameter effectiveness

kevin3991 added 14 commits June 25, 2025 10:05
1. Introduce run-fire-land-2 for fire_land_2 map with specified monsters.
2. Add run-ant-cave-2 for ant_cave_2 map with specified monsters.
3. Include run-cloud_balcony for cloud_balcony map with specified monsters.
Replaced instances of mapleStoryAutoLevelUp_legacy.py with mapleStoryAutoLevelUp.py in run-fire-land-2, run-ant-cave-2, and run-cloud_balcony targets in the Makefile.
Updated run targets in the Makefile to use the correct syntax for the --cfg option in the mapleStoryAutoLevelUp.py script for fire_land_2, ant_cave_2, and cloud_balcony maps.
Changed force_heal setting from True to False in config_cleric.yaml to prevent the cleric from stopping attacks while healing.
Increased the add_hp_ratio from 0.4 to 0.5 to adjust the threshold for drinking potions when HP is low.
- Updated jump key from 'a' to 'z'.
- Added experimental teleport feature for Mages to move faster while walking, with a cooldown setting.
- Introduced edge teleport functionality to prevent falling off platforms, with customizable trigger box dimensions and color code.
- Added timers and cooldowns for movement commands in both 'finding_rune' and 'near_rune' statuses to enhance character control.
- Introduced new configuration options for long and short movement cooldowns in the config file.
- Improved logging for movement commands to aid in debugging and monitoring behavior.
…ic.yaml

- Added new settings for nametag detection, including mode, offset, matching thresholds, and split detection parameters.
- Introduced a rune detection box with configurable dimensions and matching threshold.
- Updated rune finding behavior with new cooldowns and timeout settings for improved interaction with runes.
- Increased near_rune_duration from 10 to 20 seconds to enhance interaction time with detected runes.
- Adjusted rune_trigger_distance from 24 to 30 units for improved detection range during rune interactions.
- Introduced run targets for north_forest_training_ground_2, lost_time_1, north_forest_training_ground_8, and monkey_swamp_3.
- Configured each target with specific monsters and attack strategies for cleric gameplay.
- Changed teleport key from empty to "space" for improved functionality.
- Updated add_hp key from "1" to "s" to match potion shortcut.
- Introduced auto_change_channel feature with options for channel switching.
- Adjusted health_monitor add_hp_ratio from 0.5 to 0.6 for better potion usage.
- Modified rune_detect box_width from 700 to 350 for optimized detection area.
- Reduced near_rune_duration from 20 to 10 seconds for quicker interactions.
- Updated cooldowns for movement commands in rune finding states for enhanced control.
- Changed teleport key from "space" to "a" for improved accessibility.
- Increased directional_attack range_y from 60 to 90 for better attack coverage.
- Updated health_monitor settings: set force_heal to True and adjusted add_hp_ratio from 0.6 to 0.7 for enhanced healing behavior.
- Modified rune_detect diff_thres from 0.25 to 0.2 for a stricter match threshold.
@KenYu910645
Copy link
Owner

Hi Kevin,
Thanks for your work! But I'm wondering whether it is a good idea to add movement cooldown in rune finding states. I think it will cost more time to traverse map, but of cause with the benefit of better chance to detect the runes.

I'm thinking of better way to solve this. Can we detect the runes and make the character run toward it? And make it stop in front of the rune(when the distance is close enough)?

I'd like to know your opinion on this

Thanks

@kevin3991 kevin3991 changed the title Rune adjustments for Mac [WIP] Rune adjustments for Mac Jun 26, 2025
@kevin3991
Copy link
Contributor Author

I think your suggestion would be better. My current approach is a modification to address the issue of low computer FPS causing characters to move beyond the gears.
Regarding your suggestion about walking towards the gear, I may need to take a closer look at how to modify it.
I think this PR doesn't need to be merged. Others can pull it if they need it.

1. Updated `get_random_action` method to exclude both 'up' and 'down' actions.
2. Enabled nametag feature in `config_cleric.yaml`.
3. Adjusted cooldown settings in `config_cleric.yaml` for improved movement timing.
4. Modified camera boundary values in `config_default.yaml` for better detection.
5. Added redirect option in `rune_warning` section of `config_default.yaml` to change channel upon detection.

Signed-off-by: Ken Yu <luckyyu910645@gmail.com>
1. Reduced `rune_find.timeout` from 1200 to 3 seconds for quicker search attempts.
2. Added `timeout_action` to specify behavior upon timeout.
3. Introduced `rune_trigger_distance_x` and `rune_trigger_distance_y` to refine interaction distance with runes.

Signed-off-by: Ken Yu <luckyyu910645@gmail.com>
1. Introduced macOS-specific imports and functionality using Quartz to get window regions.
2. Implemented `get_window_region_mac` function to retrieve window bounds on macOS.
3. Updated `click_in_game_window` to handle window clicks differently based on the operating system.

Signed-off-by: Ken Yu <luckyyu910645@gmail.com>
1. Disabled PyAutoGUI fail-safe to prevent exceptions during automation in KeyBoardController.py, KeyBoardListener.py, and util.py.
2. Adjusted camera boundary values in config_cleric.yaml and config_default.yaml for improved detection.
3. Commented out the ensure_is_in_party method call in mapleStoryAutoLevelUp.py for potential performance enhancement.

Signed-off-by: Ken Yu <luckyyu910645@gmail.com>
1. Changed attack strategy for `lost_time_1` map from directional to aoe_skill in Makefile.
2. Introduced a new timer for tracking the start of the rune finding status in `mapleStoryAutoLevelUp.py`.
3. Added logic to reset the rune finding timer upon entering the finding_rune status and after successful rune solving.
4. Increased `rune_find.timeout` from 2 to 20 seconds in `config_cleric.yaml` for extended search duration.

Signed-off-by: Ken Yu <luckyyu910645@gmail.com>
- Updated `get_all_other_player_locations_on_minimap` to include dynamic color tolerance for improved detection of other players.
- Introduced `debug_minimap_colors` function for analyzing color distribution on the minimap, aiding in identifying the correct player color.
- Modified `mapleStoryAutoLevelUp.py` to utilize the new color detection logic and added configuration for player color based on the operating system.
- Increased wait time in `mapleStoryAutoLevelUp.py` from 25 to 35 seconds for improved synchronization.
- Re-enabled the `ensure_is_in_party` method to ensure the player is in a party before proceeding with actions.
- Updated HP potion hotkey in `config_cleric.yaml` to "1" and added new keys for return home and party window shortcuts.
- Modified health monitor settings to adjust potion cooldowns and added a watchdog timeout for health checks.
…tings

- Simplified health command logic in `KeyBoardController.py` by removing unnecessary conditions.
- Added new map configuration for mage in `Makefile` to support additional gameplay scenarios.
- Expanded buff skill keys and cooldowns in `config_cleric.yaml` for improved automation flexibility.
- Increased rune find timeout to 180 seconds and adjusted movement cooldowns for better performance during rune searching.
- Removed unnecessary timers and conditions related to rune movement in `mapleStoryAutoLevelUp.py`.
- Reduced the maximum rune find timeout from 180 seconds to 10 seconds in `config_cleric.yaml` for quicker fallback actions.
- Adjusted the login button threshold in `config_default.yaml` to improve detection accuracy.
kevin3991 added 2 commits July 2, 2025 13:25
- Removed the command construction from individual components in the `MapleStoryBot` class to streamline the logic when the player is stuck during rune finding.
…ration

- Eliminated long_movement_cooldown and movement_cooldown parameters in both config_cleric.yaml and config_default.yaml to streamline rune finding logic.
@maple11041
Copy link

maple11041 commented Jul 6, 2025

I've been using this branch for a week on macOS and cleric, and I think this branch works better compared to the current main branch. It has higher fps on my MacBook, works more smoothly, and has a higher chance of finding the rune.
I think I will stick to this branch rather than the main branch for quite a while, thanks.

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

Successfully merging this pull request may close these issues.

3 participants