diff --git a/docs/en-us/2.4-Oversea Service Adaptation.md b/docs/en-us/2.4-Oversea Service Adaptation.md index a9bb6efd48..b898ce953f 100644 --- a/docs/en-us/2.4-Oversea Service Adaptation.md +++ b/docs/en-us/2.4-Oversea Service Adaptation.md @@ -4,17 +4,17 @@ Before starting this tutorial, make sure you have. -1. installed and properly configured the required software. There should be information in the `readme.md` of the ZH-CH service or the corresponding client to ensure that the supported features work properly. -2. Read `MaaAssistantArknights/docs/3.4-TASK_SCHEMA.md` and have a basic understanding of the meaning and usage of each field, and can understand the meaning and usage of `@` and `#` type tasks. -3. understand what is not mentioned or missing in the `task.json` and template image of Oversea service, and use the `task.json` and template image of ZH-CH service as an alternative. The content in the Oversea `task.json` will overwrite and rewrite the corresponding fields of the ZH-CH task. +1. installed and properly configured the required software. There should be information in the `readme.md` of the ZH-CH client or the corresponding client to ensure that the supported features work properly. +2. Read `MaaAssistantArknights/docs/3.4-TASK_SCHEMA.md`, have a basic understanding of the meaning and usage of each field, and can understand the meaning and usage of `@` and `#` in the code. +3. understand the `task.json` file and template image of ZH-CH client will be used as an alternative when it is unmentioned or missing for the oversea client. The content in the `task.json` for oversea client are replaced and rewrited according to the fields of the ZH-CH task. 4. have some English ability, be able to read English logs, and be able to find out the missing pictures and other information through the logs. -5. push the recommended changes according to the task chain. For example, for the `Award` task, replace `template image` / `text` / `modify roi` step by step according to the `next` order of the `Award` task in the ZH-CH `task.json` to make sure that each step after the modification works properly or can find the error quickly. This way you can avoid not knowing which step the program is stuck on and not running because too many changes are made at once. +5. understood that it is recommended to perform the modification individually according to the task chain. As an illustration, to modify the `Award` task, modify the `template image` / `text` / `roi` step by step in accordance with the order in its `next` field, to ensure that every task are working normally after modification and error are spotted easily. Moreover, this can prevent confusion and forgetting which task the software is stuck on when too much content is modified at once. ### Preparation before making changes Before making changes, there are several preparations that need to be noted. -1. refer to the ZH-CH task.json and make sure you have prepared the template images and text content for the Oversea service differently from the ZH-CH service. +1. refer to the ZH-CH task.json and make sure you have prepared the template images and text content for the oversea client. 2. Make sure you have ready access to these images and text content. ## Get screenshots @@ -22,7 +22,7 @@ Before making changes, there are several preparations that need to be noted. In order to get high quality screenshots, please follow these guidelines. 1. Use the screenshot tool that comes with the emulator to take and save screenshots. -2. Make sure the size of the screenshot is larger than `1280*720` and the aspect ratio is `16:9`. 3. +2. Make sure the size of the screenshot is larger than `1280*720` and the aspect ratio is `16:9`. 3. Make sure that the screenshot does not contain any extraneous content, such as the taskbar, status bar, notification bar, etc. 4. Make sure that the screenshot contains all the content that needs to be recognized. @@ -30,10 +30,10 @@ In order to crop the image and get the text/image `roi`, you need to install `py Then, follow these steps. -1. Create new `src` and `dst` folders in the same directory as `main.py`. 2. -2. Put the **complete screenshot** that needs to be resized or get the text/image `roi` into the `src` folder. 3. -3. Run `main.py`. 4. -4. Select the target range by dragging with the mouse, trying not to include extraneous content. 5. +1. Create new `src` and `dst` folders in the same directory as `main.py`. +2. Put the **complete screenshot** of the text/image that needs to be resized or in need of new `roi` value into the `src` folder. +3. Run `main.py`. +4. Select the target range by dragging the mouse, trying not to include extraneous content. 5. Once the range is determined, press `S` to save and `Q` to exit. The cropped image will be saved in the `dst` folder. For example, the output after completing a crop would be @@ -49,7 +49,7 @@ where `Screenshot_xxx.png` is the name of the full screenshot placed in the `src` folder. `Screenshot_xxx.png_426,272,177,201.png` is the image after the capture. -`original roi` is the area selected by the mouse. `amplified roi` is the expanded area, you need the expanded range, so the `roi` field in `task.json` is filled with this value. +`original roi` is the area selected by the mouse. `amplified roi` is the enlarged area, you need the enlarged area, so the `roi` field in `task.json` is filled with this value. ## Modify the template image @@ -64,7 +64,7 @@ Refer to the template images mentioned in `task.json`, compare the template imag Usually, except for images such as logos, templates that contain text need to be replaced by screenshots. If the image size is significantly larger than the corresponding template image in the ZH-CH service, you need to modify the size of `roi`. -Put the intercepted and renamed template image into the template image folder of the corresponding client. +Put the captured and renamed template image into the template image folder of the corresponding client. ## Modify the text content @@ -77,15 +77,15 @@ For example. Find the corresponding task and change the `text` field to the content displayed in the corresponding server. Note that the identified content can be a substring of the full content within the game. -In general, `text` containing text needs to be replaced unless it is recognized as a pure ASCII character. If the text length is significantly longer than that of the ZH-CH service, you need to modify the size of `roi`, e.g. if the difference between `"Mission"` and `"Mission"` length is too large, you need to modify the size of `roi` for that mission in the Oversea service. +In general, `text` containing text needs to be replaced unless it is recognized as a pure ASCII character. If the text length is significantly longer than that of the ZH-CH service, you need to modify the size of `roi`, e.g. if the difference of length between `"任务"`(Mission in chinese) and `"Mission"` is too large, you need to modify the size of `roi` for that mission in the Oversea service. -If there is no such mission in the `task.json` of the corresponding external service, you need to add the mission, just fill in the `text` field. +If there is no such task in the `task.json` of the corresponding external service, you need to add the mission, just fill in the `text` field. ## Modify ROI range 1. Open the `task.json` of the corresponding server, for example, the location of the US service is `MaaAssistantArknights\resource\global\YoStarEN\resource\tasks.json`. 2. Find the task that corresponds to the `roi` range you need to modify, and use the screenshot you prepared of the Oversea game interface to adjust the size of the `roi` range according to the `amplified roi`. -3. Normally, `roi` does not need to be modified, but only when the difference between the size of the content and that of the ZH-CH game is too large. +3. Normally, `roi` does not need to be modified, but only when the difference between the size of the text and that of the ZH-CH client is too large. 4. If the task does not exist in the `task.json` of the corresponding Oversea service, add the task and write the `roi` field. ## Save the settings and restart the software @@ -94,7 +94,7 @@ After the changes are done, restart the software and reload the file to make the To check for success. -1. Check the operation of the software to make sure the software can be used properly in the external service. +1. Check the operation of the software to make sure the software can be used properly o the external service. 2. If it does not work properly, you need to check if the changes are correct or check the log output so that you can find what went wrong. ## Interpreting the logs @@ -129,6 +129,6 @@ In this log, you can see that. - `pre_task` represents the previous task. In addition, the execution of the command (e.g. `Call`) and the `OCR` information (e.g. `OcrPack::recognize`) are recorded in the log. -In this log `"to_be_recognized"`,`"cur_retry":3,"retry_times":20` means that the task has been repeatedly recognized 10 times, and the maximum number of times is 20, after the maximum number of times is recognized, the task will be skipped and an error will be reported, and the next task will be continued. If there is no problem with the previous task, we can basically determine that there is a problem with the recognition here. We need to check the tasks mentioned in the log to find out whether there is a corresponding `template file`, whether the `text` of the corresponding task is wrong, and whether the `roi` range of the task recognition is correct, so as to find out where the problem lies and modify it. +In this log `"to_be_recognized"`,`"cur_retry":3,"retry_times":20` means that the task has been repeatedly recognized 10 times, and the maximum number of times is 20, after the maximum number of times is recognized, the task will be skipped and an error will be reported, and the next task will be performed. If there is no problem with the previous task, we can basically determine that there is a problem with the recognition here. We need to check the tasks mentioned in the log to find out whether there is a corresponding `template file`, whether the `text` of the corresponding task is wrong, and whether the `roi` range of the task recognition is correct, so as to find out where the problem lies and modify it. By looking at the corresponding template image, I found that there is a template for this picture in the US template folder, but the size is obviously larger than the picture in China, so the `roi` in China is not recognized in the US, so I need to modify the corresponding task `roi` in the US `task.json` to make it correspond to the size of the picture in the US.