[Genshin Impact] AI fully automated fishing, completely free your hands (open source)!

Still worried about catching fish in “Genshin Impact”? Here’s a belated guide to fishing in Tivat.

In September this year, this open world adventure game, which has been on top of the domestic and international buzz and handicap charts since its open beta, was updated to add/enrich the map and launch a mini-game – fishing. There are many fishing spots in the game, and you can catch different kinds of fish in different locations. Although it is a common game, it still attracts players. Generally speaking, fishing is divided into three steps: flinging the rod → waiting for the fish to bite → lifting the rod. The principles involved require a certain digital image processing and machine learning foundation. The model is divided into two parts: fish positioning and identification and rod pulling (and fish gaming). Many players are looking for fishing tips, are you still worried about not being able to catch fish in “Genshin Impact”? Today we send you this late Tivat fishing guide. This fishing guide can be said to be completely free of hands, no need for any operation, just start the program to complete. Just a few days online, harvest 700 + stars.

[Genshin Impact] AI fully automated fishing, completely free your hands (open source)!
[Genshin Impact] AI fully automated fishing, completely free your hands (open source)!

GitHub:github.com/7eu7d7/gensh

 

Project Introduction

The Genshin Impact Auto-Fishing AI consists of a two-part model: YOLOX, DQN. in addition, the project uses migration learning, and semi-supervised learning for training. The model also contains some unlearnable parts implemented using traditional digital image processing methods such as opencv.

  • YOLOX for fish location and type identification as well as for locating rod drop points.;
  • DQN for adaptive control of clicks during fishing, so that the force falls in the optimal area.

Installation

This project is used in the python runtime environment, you need to install python first, here we recommend using anaconda.

Configure the environment: Open anaconda prompt (command line interface), create a new python environment and activate it (python 3.7 or below is recommended).

conda create -n ysfish python=3.6
conda activate ysfish

Download the project code: use git to download it, or unzip it directly after downloading it from the github web page at:

git clone https://github.com/7eu7d7/genshin_auto_fish.git

Dependency installation: switch the command line to the directory where the project is located:

cd genshin_auto_fish

Execute the following command to install the dependencies:

python -m pip install -U pip
python requirements.py 

If you want to use the graphics card for acceleration, you need to install CUDA and cudnn, ignore the above command and use the following to install the gpu version:

pip install -U pip
python requirements.py --cuda [cuda Versions]
# For example, the installed CUDA11.x
python requirements.py --cuda 110

Install yolox: switch to the command line to the directory where the project is located and execute the following command to install yolox:

python setup.py develop 

Download pre-training weights: Download pre-training weights (.pth file), yolox_tiny.pth and place the weights file in the project directory / weights after download。

YOLOX training workflow: YOLOX is partially labeled with semi-supervised learning. After labeling a small number of samples, the model is trained to generate pseudo-labels for the rest of the samples and then manually corrected, iterating continuously to improve accuracy. The sample size is small so migration learning is used to fine-tuning on the COCO pre-trained model.

Change the value of self.data_dir in yolox/exp/yolox_tiny_fish.py to the path where the 2 folders are located after decompression.

Training code:

python yolox_tools/train.py -f yolox/exp/yolox_tiny_fish.py -d 1 -b 8 --fp16 -o -c weights/yolox

DQN training workflow: The control effort is trained using the reinforcement learning model DQN. The difference between the two progresses is used as reward to provide the model with a learning direction. Interactive learning between the model and the environment.

Training directly within the original god takes longer, first you need to create a simulation environment that roughly simulates fishing effort control operations. Pre-train a model within the simulation environment. This model is then migrated to the original god for inter-domain migration.

Pre-training code for simulation environment:

python train_sim.py

Genshin Impact in-game training:

python train.py 

Run

Once the above is ready, you can run the fishing AI, note that the command line window must be started with administrator privileges.

Video Card Acceleration:

python fishing.py image -f yolox/exp/yolox_tiny_fish.py -c weights/best_tiny3.pth --conf 0.25 --nms 0.45 --tsize 640 --device gpu 

cpu Run:

python fishing.py image -f yolox/exp/yolox_tiny_fish.py -c weights/best_tiny3.pth --conf 0.25 --nms 0.45 --tsize 640 --device cpu

After running, init ok appears and press r to start fishing, the original god needs full screen. For performance reasons, the detection box will not be displayed in real time, and the processing operation will be carried out in the background.

For more implementation details, the reader is referred to the original project.

GitHub:github.com/7eu7d7/gensh

Leave a Reply

Your email address will not be published. Required fields are marked *