You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You will need Python 3 and Android Studio (for [`adb`](https://developer.android.com/studio/command-line/adb) and [`monkeyrunner`](https://developer.android.com/studio/test/monkeyrunner)).
21
+
You will need Python 3 and Android Studio (for [`adb`](https://developer.android.com/studio/command-line/adb)).
22
22
23
23
`adb` allows for remotely controlling the Android device (either a real phone plugged into the computer via USB with ['USB debugging' enabled](https://developer.android.com/studio/command-line/adb#Enabling), or an emulated phone created with [AVD](https://developer.android.com/studio/run/managing-avds)).
24
24
25
-
`monkeyrunner` makes the interface between Python and Java. I had some troubles getting it to work properly. I mostly used this [StackOverflow answer](https://stackoverflow.com/questions/52815413/monkeyrunner-noclassdeffounderror-com-android-chimpchat-chimpchat).
26
-
27
25
### Installation
28
26
29
27
1. Clone the repository
@@ -35,55 +33,27 @@ You will need Python 3 and Android Studio (for [`adb`](https://developer.android
35
33
cd hoplite/
36
34
pip install -r requirements.txt
37
35
36
+
**Disclaimer: interactions with phone screen currently rely on static and hardcoded values. A screen resolution of 1080x1920 is required for them to work properly.** For other resolutions, changes might be required in the following places:
37
+
38
+
-`vision.observer.ScreenParser.__init__`
39
+
-`actuator.hexagonal_to_pixels`
40
+
-`actuator.Actuator`
41
+
38
42
### Usage
39
43
40
44
1. Either start the emulated phone in AVD or plug in your phone, and open the Hoplite app.
45
+
2. List the available devices with
41
46
42
-
2. Start the script with:
47
+
adb devices
43
48
44
-
python main.py play
49
+
3. Start the script with:
45
50
46
-
Use `python main.py --help` for more details.
51
+
python main.py play <adb-device-id>
47
52
48
-
## Roadmap
49
-
50
-
There is a lot to do, so feel free to [contribute](#contributing)!
51
-
52
-
-[x]~~Implement basic interaction with the game~~
53
-
-[x]~~Implement a basic game engine~~
54
-
-[x]~~Implement a basic decision making system~~
55
-
-[x]~~Make the MonkeyRunner interface more reliable~~
56
-
-[ ] Enhance the game re-implementation:
57
-
-[x]~~Develop a game explorer to build a database of state sequences for further analysis~~
58
-
-[ ] Complete and implement the [game rules](RULES.md)
59
-
-[x]~~Prayers~~
60
-
-[x]~~Energy restoration~~
61
-
-[x]~~Knockback, collisions~~
62
-
-[x]~~Killing spree (Surge and Regeneration prayers)~~
63
-
-[ ] Demons movements
64
-
-[ ] Footman movement
65
-
-[ ] Archer and Wizard movement
66
-
-[ ] Demolitionist movement and throw
67
-
-[ ] Cooldowns
68
-
-[ ] Bash cooldown
69
-
-[ ] Wizard cooldown
70
-
-[ ] Demolitionist cooldown
71
-
-[ ] Demons status
72
-
-[ ] Stunned
73
-
-[ ] Sleeping
74
-
-[ ] Shield
75
-
-[x]~~Allow for menus recognition (title screen and altars) and answering~~
76
-
-[x]~~Implement memory for `GameState` to allow prayers handling~~
77
-
-[x]~~Fasten `Observer` by using fine-tuned template recognition model~~
78
-
-[ ] Enhance the AI part:
79
-
-[ ] Fine-tune player's incentives between killing all enemies, go to the next level, and pray at the altar
80
-
-[ ] Implement a proper training of the game state evaluation
81
-
-[ ] Implement a proper exploration of variations starting from a position, like chess engines
82
-
-[ ] Explore support for device with resolution different from 1080*1920
83
-
-[ ]*Many more things that I am not thinking of right now...*
53
+
Use `python main.py --help` for more details.
84
54
85
55
## Contributing
86
56
87
-
Open pull requests or issues if you have any proposition to make. Check the [roadmap](#roadmap) for ideas (there are many), and the [documentation](https://ychalier.github.io/hoplite/) for how to implement them. I put some screenshots [here](https://mega.nz/folder/2L5TnJLC#70yL5fUOErmTHBo9SUD2Nw) (2MB) helping development, and the [templates](https://mega.nz/folder/LCgFUYaD#P4OjM9CjsMTVFGx_TDo-Aw) (1MB) used for the classifiers.
57
+
Open pull requests or issues if you have any proposition to make. I put some screenshots [here](https://mega.nz/folder/2L5TnJLC#70yL5fUOErmTHBo9SUD2Nw) (2MB) helping development, and the [templates](https://mega.nz/folder/LCgFUYaD#P4OjM9CjsMTVFGx_TDo-Aw) (1MB) used for the classifiers.
88
58
89
59
If you implement some features, please make sure your code is clean enough (for this matter I use the [Pylint](https://www.pylint.org/) linter) and documented enough (add docstrings with short descriptions, types of arguments and returned values). I use [pdoc](https://pdoc3.github.io/pdoc/) to generate the documentation.
0 commit comments