Skip to content

Commit 729c373

Browse files
committed
python-pure-adb doc & correct integration
1 parent 3882b6e commit 729c373

37 files changed

+18767
-12354
lines changed

README.md

Lines changed: 14 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,18 @@ This modules provides an interface for automatically playing the game on an Andr
1010

1111
[Here is a demonstration of it working on a emulator](https://www.youtube.com/watch?v=GJIp3fEq9Xc).
1212

13-
This is a first draft, meaning many components are missing or poorly implemented. See the [roadmap](#roadmap) for details.
13+
This is a first draft, meaning many components are missing or poorly implemented.
1414

1515
![Hoplite Android Icon](https://2.bp.blogspot.com/-QH3Ceormja0/UrKqFsfIMkI/AAAAAAAAAIM/XicUf6o0n4I/s200/helmetICON.png)
1616

1717
## Getting Started
1818

1919
### Prerequisites
2020

21-
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)).
2222

2323
`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)).
2424

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-
2725
### Installation
2826

2927
1. Clone the repository
@@ -35,55 +33,27 @@ You will need Python 3 and Android Studio (for [`adb`](https://developer.android
3533
cd hoplite/
3634
pip install -r requirements.txt
3735

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+
3842
### Usage
3943

4044
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
4146

42-
2. Start the script with:
47+
adb devices
4348

44-
python main.py play
49+
3. Start the script with:
4550

46-
Use `python main.py --help` for more details.
51+
python main.py play <adb-device-id>
4752

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.
8454

8555
## Contributing
8656

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.
8858

8959
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

Comments
 (0)