git clone https://github.com/rishavb123/3DMazeGame.git
The AI requires python 3, which can be downloaded at https://www.python.org/downloads/. Make sure to check the box to add python (and PIP) to your PATH
.
Then run
pip install requests
pip install numpy
in command prompt to install the dependencies.
Also, the server uses an ssh reverse proxy to forward the server port to a url, so ssh must be enabled to use the forwarding capabilities. To check if ssh is enabled run
ssh
If it says "'ssh' is not recognized as an internal or external command, operable program or batch file.", then ssh is not enabled yet. On Macs, Linux, and most Windows devices, it should be auto-enabled, but on some older windows machines you have to manually enable. To do so follow this link: https://www.howtogeek.com/336775/how-to-enable-and-use-windows-10s-built-in-ssh-commands/.
run
This runs a batch script which will run the java application (Application.java) and will forward port localhost:8000 to port maze.serveo.net:80 for general use of the http server. If maze.serveo.net:80 does not work, it is likely that serveo is temporarily down and will be fixed in a couple of days. As I am writing this it is currently disabled due to phishing. The controller can still be accessed at |your-ip|:8000/controller.
Two windows will open; one is to forward the server, while the other is the game. These two windows and the original window need to be open for all of the programs functionality to work.
The first parameter will specify which maze to use.
run one
will run the program using the maze stored in mazes/one.txt. If this parameter is left blank, the program will default to mazes/seven.txt.
A second parameter is whether or not to forward the server to serveo.net.
run one X
will run the program on mazes/one.txt and will not forward the server to serveo.net. So only one window will open and you will not be able to control the player from maze.serveo.net/controller. The server is still accessible on localhost and the computers ip address.
This will just delete all the class files.
- Pressing and holding the
UP
key will move you forwards. - The
LEFT
andRIGHT
keys will turn you left and right respectively. - The
DOWN
key will move you backwards. - The
R
key will reset you to your original location. - The
SPACE
key will toggle between the two dimensional view and the three dimensional view. - The
C
key will toggle the compass in the two dimension view. - The
P
key will launch a python script that uses a reinforcement learning algorithm to control the explorer using the server. It will find the optimal path (maximizing your health) to the end adapting to portals and traps.
If you are forwarding the server to serveo.net then you will be able to control the explorer from the url maze.serveo.net/controller. The UP
, DOWN
, LEFT
, and RIGHT
buttons do that same thing as the keys.
If you are not forwarding the server, this site can still be accessed at locahost:8000/controller locally or |your-ip|:8000/controller on the network.
You will start with an initial health equal to the area of the maze. Every step makes you lose 1 health. If you hit a trap (Trap.java) you will lose 10% of your maximum health. When the explorer reach 0 or less health, the explorer will "die," and you will have to restart.
- A red ceiling indicates that there is a trap in that location.
- A purple floor indicates that there is a portal in that location.
- A green wall means that you are at the end. Just run into the green wall to win.
- Red squares indicate traps.
- Blue and green squares indicate portals. To find the corresponding portal, look for a portal with the same shade.
- The white square is the goal state or the winning location.
S
is the starting location+
is the end location#
are walls_
is a space~
is a trap- Any numbers are portals. 1 teleports to 1, 2 teleports to 2, . . .