A bot made to speedrun The Challenge in the game The Witness
- Windows computer capable of running The Witness at 60 fps in 1080p (Linux may also work if you can get mss working)
- A 1920x1080 monitor (Support for larger resolutions may be added in the future)
- Python 3.9 (Other Python versions should also work)
- Copy of The Witness
- Clone or download this source code
- Install requirements
- From the command line, cd into the source code folder, then run
pip install -r requirements.txt
- From the command line, cd into the source code folder, then run
- Configure the following settings in The Witness
- Resolution: 1080p (must be native and fullscreen)
- Fullscreen: Yes
- Field Of View: 100 (exactly)
- Mouse Softening: All the way to the left
- Invert Mouse (both axes): No
- Mouse Control: FPS Mouselook
- Launch The Witness. It should be running at 1920x1080 natively on a screen of the same resolution. If you have multiple screens, make note of which it is on.
- From a command line, run the command
python
, then runimport mss; from matplotlib import pyplot; import numpy; sct=mss.mss(); pyplot.imshow(numpy.array(sct.grab(sct.monitors[1]))[:,:,:3]); plt.show()
- A window should appear which shows a screenshot of one of your monitors. If the monitor shown is the monitor The Witness was running on, you're all set
- If the correct monitor did not appear you will need to figure out which monitor The Witness is running on
- If you do not know, try running the following command, replacing 1 with 2, 3, etc.
pyplot.imshow(numpy.array(sct.grab(sct.monitors[1]))[:,:,:3]); plt.show()
- Once you determine the correct monitor, edit the file witness.py and find the line
MONITOR = 1
(approx line 23). Replace the number 1 with the proper number
- Ensure that there is nothing on top of The Witness's window (No screen recording software, timers, etc. These will confuse the bot.)
- In The Witness, walk to the start of the challenge, approximately at this location
- Turn around, and notice the left-most peninsula as shown in the image below
- Walk as far onto that peninsula as possible, then turn around and position the music box at approximately the center of the screen
- Run witness.py through the GUI of your choice, or through the command line by changing directory into the project folder and running
python witness.py
- After waiting for several seconds, the bot will look for the escape screen. Once you open the escape screen in The Witness, the bot will exit the escape screen and start the challenge. Using the mouse or the keyboard at this point will mess up the bot.