m4n4n-j / subway-surfers-AI-main

MIT License
6 stars 2 forks source link

Does this work with other emulators #1

Open Ashwin-droid opened 1 year ago

Ashwin-droid commented 1 year ago

Does this work with other emulators like Windows subsystem for Android

m4n4n-j commented 1 year ago

Hey! I haven't really tried other emulators but in theory the algorithm should work. You will have to see how to give swipe actions via the new emulator, and see that the window measurements ( and python automation of mouse movements in the window ) work as expected.any questions

Happy to answer any other questions :)

On Sun, 23 Apr, 2023, 9:24 am Ashwin-droid, @.***> wrote:

Does this work with other emulators like Windows subsystem for Android

— Reply to this email directly, view it on GitHub https://github.com/m4n4n-j/subway-surfers-AI-main/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALWBHKFESFJ47F7TUKDA6JLXCSRYVANCNFSM6AAAAAAXIIEWLI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Ashwin-droid commented 1 year ago

hmm, I was looking through the source code and I found that you use locate on screen of pyautogui, so............... I have no idea on how to make it use another emulator

Ashwin-droid commented 1 year ago

Also, will it be possible to reward for collecting coins, collecting magnets, collecting powerups, etc., penalizing for unnecessary rolls (consecutively), and hitting a wall that causes the police to come?

m4n4n-j commented 1 year ago

Exactly, using other emulator will be a new problem to solve. For penalizing the AI on different interactions in the game: Our initial thought was that is played long enough, the AI will start figuring out what leads to a higher score. We optimised for the 'highest time alive' metric. So AI started learning not to swipe twice consecutively, so that police will arrive later.

For recognising magnets and stuff, will need image recognition at every frame, which might be a lot of computation overhead. Hence, we did not consider coins or score as a metric.

On Mon, 24 Apr, 2023, 5:47 pm Ashwin-droid, @.***> wrote:

Also, will it be possible to reward for collecting coins, collecting magnets, collecting powerups, etc and penalizing for unnecessary rolls (consecutively), and hitting a wall which causes the police to come?

— Reply to this email directly, view it on GitHub https://github.com/m4n4n-j/subway-surfers-AI-main/issues/1#issuecomment-1520049465, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALWBHKDJEXVEBNYPAO2K6B3XCZVM5ANCNFSM6AAAAAAXIIEWLI . You are receiving this because you commented.Message ID: @.***>

Ashwin-droid commented 1 year ago

image If my emulator was to look like this, what would be the start_t and start_b

m4n4n-j commented 1 year ago

As far as I remember, they represent the top and bottom pixel of the window.

You can play around with pyautogui to find the pixel. I also remember using snipping tool to get the window dimensions in pixels, maybe try that.

On Tue, 25 Apr, 2023, 4:30 pm Ashwin-droid, @.***> wrote:

[image: image] https://user-images.githubusercontent.com/58349846/234256975-957f1615-1626-4641-8135-b9ef0a75f130.png If my emulator was to look like this, what would be the start_t and start_b

— Reply to this email directly, view it on GitHub https://github.com/m4n4n-j/subway-surfers-AI-main/issues/1#issuecomment-1521593968, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALWBHKCKG6ZKMPLCCBKIVT3XC6VELANCNFSM6AAAAAAXIIEWLI . You are receiving this because you commented.Message ID: @.***>

Ashwin-droid commented 1 year ago

image

It just gets stuck here and does absolutely nothing, could you update your repo to support the latest subway surfers and maybe other emulators, I have absolutely no idea on how to do so

EDIT: Trust me, I tried everything

m4n4n-j commented 1 year ago

Is the emulator working / mouse moving accross the window ??

On Thu, 27 Apr, 2023, 10:10 pm Ashwin-droid, @.***> wrote:

[image: image] https://user-images.githubusercontent.com/58349846/234931087-97122005-f662-4165-8545-518556e8c6ee.png

It just gets stuck here and does absolutely nothing, could you update your repo to support the latest subway surfers and maybe other emulators, I have absolutely no idea on how to do so

— Reply to this email directly, view it on GitHub https://github.com/m4n4n-j/subway-surfers-AI-main/issues/1#issuecomment-1526013803, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALWBHKDMNU6NCEC5L3MLB6TXDKOQZANCNFSM6AAAAAAXIIEWLI . You are receiving this because you commented.Message ID: @.***>

Ashwin-droid commented 1 year ago

The emulator works as expected (Trust me I am better on touchscreen devices)

https://user-images.githubusercontent.com/58349846/235121694-669b9bf2-461b-4d8e-8724-748d6c916a3a.mp4

and the mouse does not move at all

EDIT: Maybe make it used to the new subway surfers UI and instead of locking the emulator with logos and buttons maybe add relative positioning to the subway surfers UI

also now it is just stuck on Beginning forever

m4n4n-j commented 1 year ago

Hi, Please have a look at report.pdf Page 3.

We used nox emulator exclusively, and the model detects the emulator window, nox logo, and hence gets to know where and how much it needs to swipe.

Changing this would mean starting the emulator detection and movement from scratch. I welcome you to try this and create a fork of the repo so that we can work on solving that together, but in this version currently, other emulator support will not be possible.

on supporting the newer version, we chose v 1 of the subway surfers app because we wanted the least possible dynamic content.

mortadaNotGenius commented 1 year ago

Hi, Please have a look at report.pdf Page 3.

We used nox emulator exclusively, and the model detects the emulator window, nox logo, and hence gets to know where and how much it needs to swipe.

Changing this would mean starting the emulator detection and movement from scratch. I welcome you to try this and create a fork of the repo so that we can work on solving that together, but in this version currently, other emulator support will not be possible.

{ can you add other games like Minecraft, clash royal or clash of clans? the ai will basically defeat the enderdragon on Minecraft, if clash royal it will get the top stats and clash of clans It will defeat any village }

m4n4n-j commented 1 year ago

hi! this was made specifically for subway surfers, the movements, image analysis to read points, everything was implemented with subway surfers in mind.

your suggestions are interesting, but they require a lot of changes to this piece of code, and the complexities for those games ( number of options available for player at any given time) are way more.

so it is not possible to accomodate those ideas in this project. however you can consider this the base, and make something bigger from that :)

On Mon, 24 Jul, 2023, 6:23 pm MortadaNotGenius, @.***> wrote:

Hi, Please have a look at report.pdf https://github.com/m4n4n-j/subway-surfers-AI-main/blob/master/Report.pdf Page 3.

We used nox emulator exclusively, and the model detects the emulator window, nox logo, and hence gets to know where and how much it needs to swipe.

Changing this would mean starting the emulator detection and movement from scratch. I welcome you to try this and create a fork of the repo so that we can work on solving that together, but in this version currently, other emulator support will not be possible.

{ can you add other games like Minecraft, clash royal or clash of clans? the ai will basically defeat the enderdragon on Minecraft, if clash royal it will get the top stats and clash of clans It will defeat any village }

— Reply to this email directly, view it on GitHub https://github.com/m4n4n-j/subway-surfers-AI-main/issues/1#issuecomment-1647857672, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALWBHKDKQBNTXW22O5HP2F3XRZV53ANCNFSM6AAAAAAXIIEWLI . You are receiving this because you commented.Message ID: @.***>