• Stars
    star
    435
  • Rank 99,433 (Top 2 %)
  • Language
    Python
  • Created over 3 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Artificial intelligence software for MapleStory that uses various machine learning and computer vision techniques to navigate challenging in-game environments

Auto Maple

Auto Maple is an intelligent Python bot that plays MapleStory, a 2D side-scrolling MMORPG, using simulated key presses, TensorFlow machine learning, OpenCV template matching, and other computer vision techniques.

Community-created resources, such as command books for each class and routines for each map, can be found in the resources repository.


Minimap

Auto Maple uses OpenCV template matching to determine the bounds of the minimap as well as the various elements within it, allowing it to accurately track the player's in-game position. If record_layout is set to True, Auto Maple will record the player's previous positions in a quadtree-based Layout object, which is periodically saved to a file in the "layouts" directory. Every time a new routine is loaded, its corresponding layout file, if it exists, will also be loaded. This Layout object uses the A* search algorithm on its stored points to calculate the shortest path from the player to any target location, which can dramatically improve the accuracy and speed at which routines are executed.

Command Books


The above video shows Auto Maple consistently performing a mechanically advanced ability combination.

Designed with modularity in mind, Auto Maple can operate any character in the game as long as it is provided with a list of in-game actions, or a "command book". A command book is a Python file that contains multiple classes, one for each in-game ability, that tells the program what keys it should press and when to press them. Once a command book is imported, its classes are automatically compiled into a dictionary that Auto Maple can then use to interpret commands within routines. Commands have access to all of Auto Maple's global variables, which can allow them to actively change their behavior based on the player's position and the state of the game.

Routines


Click here to view the entire routine.

A routine is a user-created CSV file that tells Auto Maple where to move and what commands to use at each location. A custom compiler within Auto Maple parses through the selected routine and converts it into a list of Component objects that can then be executed by the program. An error message is printed for every line that contains invalid parameters, and those lines are ignored during the conversion.

Below is a summary of the most commonly used routine components:
  • Point stores the commands directly below it and will execute them in that order once the character is within move_tolerance of the specified location. There are also a couple optional keyword arguments:
    • adjust fine-tunes the character's position to be within adjust_tolerance of the target location before executing any commands.
    • frequency tells the Point how often to execute. If set to N, this Point will execute once every N iterations.
    • skip tells the Point whether to run on the first iteration or not. If set to True and frequency is N, this Point will execute on the N-1th iteration.
  • Label acts as a reference point that can help organize the routine into sections as well as create loops.
  • Jump jumps to the given label from anywhere in the routine.
  • Setting updates the specified setting to the given value. It can be placed anywhere in the routine, so different parts of the same routine can have different settings. All editable settings can be found at the bottom of settings.py.

Runes

Auto Maple has the ability to automatically solve "runes", or in-game arrow key puzzles. It first uses OpenCV's color filtration and Canny edge detection algorithms to isolate the arrow keys and reduce as much background noise as possible. Then, it runs multiple inferences on the preprocessed frames using a custom-trained TensorFlow model until two inferences agree. Because of this preprocessing, Auto Maple is extremely accurate at solving runes in all kinds of (often colorful and chaotic) environments.

Video Demonstration

Click below to watch the full video


Setup

  1. Download and install Python3.
  2. Download and install the latest version of CUDA Toolkit.
  3. Download and install Git.
  4. Download and unzip the latest Auto Maple release.
  5. Download the TensorFlow model and unzip the "models" folder into Auto Maple's "assets" directory.
  6. Inside Auto Maple's main directory, open a command prompt and run:
    python -m pip install -r requirements.txt
  7. Lastly, create a desktop shortcut by running:
    python setup.py
    This shortcut uses absolute paths, so feel free to move it wherever you want. However, if you move Auto Maple's main directory, you will need to run python setup.py again to generate a new shortcut. To keep the command prompt open after Auto Maple closes, run the above command with the --stay flag.

More Repositories

1

yolo-v1

PyTorch implementation of the YOLOv1 architecture presented in "You Only Look Once: Unified, Real-Time Object Detection" by Joseph Redmon, Santosh Divvala, Ross Girshick, Ali Farhadi
Python
38
star
2

auto-maple-resources

Community repository for Auto Maple command books and routines
Python
22
star
3

planit

Assignment tracker for students that compiles due dates into an interactive, minimalist calendar
JavaScript
8
star
4

github-statistics

GitHub stat tracker that uses GraphQL to retrieve both public and private user statistics, which can then be displayed on profile READMEs
Java
7
star
5

attention-is-all-you-need

PyTorch implementation of "Attention Is All You Need" by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, Illia Polosukhin
Python
6
star
6

ml-paper-implementations

Collection of my implementations of various machine learning papers
HTML
4
star
7

deep-residual-learning

PyTorch implementations of the deep residual networks published in "Deep Residual Learning for Image Recognition" by Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun
Python
4
star
8

tanjeffreyz

Real-time statistics and animated graphics for my GitHub profile
Python
2
star
9

coding-challenge-companion

Chrome extension that pushes your coding challenge solutions to GitHub upon successful submission and displays your progress using interactive charts
JavaScript
2
star
10

electrotactile-braille-display

Refreshable braille display that uses electrical pulses to simulate the feeling of braille dots on the user's fingertips
C++
2
star
11

convolutional-autoencoder

Pytorch implementation of "A Better Autoencoder for Image: Convolutional Autoencoder" by Yifei Zhang
Python
2
star
12

cs184-writeups

Writeups for our CS 184 projects
HTML
1
star
13

neural-algorithm-of-artistic-style

PyTorch implementation of "A Neural Algorithm of Artistic Style" by Leon A. Gatys, Alexander S. Ecker, and Matthias Bethge
Python
1
star
14

batch-normalization

PyTorch implementation of batch normalization from "Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift" by Sergey Ioffe, Christian Szegedy
Python
1
star
15

generative-adversarial-networks

PyTorch implementation of "Generative Adversarial Networks" by Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, Yoshua Bengio
Python
1
star
16

pytorch-multi30k

Patch for PyTorch's Multi30k machine translation dataset (WMT16)
1
star
17

2face

Full stack web application for two-factor authentication (2FA) using facial recognition
Java
1
star
18

neighborhood-mia

Implementation of "Membership Inference Attacks against Language Models via Neighbourhood Comparison" by Justus Mattern, Fatemehsadat Mireshghallah, Zhijing Jin, Bernhard Schรถlkopf, Mrinmaya Sachan, Taylor Berg-Kirkpatrick
Python
1
star