Starter-algo crashes when ran locally

Whenever I try to run the starter algo locally, it crashes. I am trying to run it in the git bash terminal on a windows machine. Python 3 and Java 10 are installed and the output is below. Any help is appreciated, thank you!

$ scripts/run_match.sh algos/starter-algo/run.sh algos/starter-algo/run.sh
Run Match
P1: algos/starter-algo/run.sh
P2: algos/starter-algo/run.sh
Starting Match: algos/starter-algo/run.sh vs. algos/starter-algo/run.sh
Starting Engine
Starting single worker game.
algos/starter-algo/run.sh/run.sh
algos/starter-algo/run.sh/run.sh
Error on simple algo process creation
java.io.IOException: The system cannot find the path specified
at java.base/java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.base/java.io.File.createNewFile(Unknown Source)
at towergame.gamecore.player.SimpleAlgoPlayer.(SimpleAlgoPlayer.java:57)
at towergame.gamecore.player.PlayerManager.setupPlayerFromCommandString(PlayerManager.java:101)
at towergame.GameMain.main(GameMain.java:149)
at towerworker.TowerWorker.main(TowerWorker.java:79)
Algo Crashed. Crash: true !processIsAlive: null
Error on simple algo process creation
java.io.IOException: The system cannot find the path specified
at java.base/java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.base/java.io.File.createNewFile(Unknown Source)
at towergame.gamecore.player.SimpleAlgoPlayer.(SimpleAlgoPlayer.java:57)
at towergame.gamecore.player.PlayerManager.setupPlayerFromCommandString(PlayerManager.java:101)
at towergame.GameMain.main(GameMain.java:150)
at towerworker.TowerWorker.main(TowerWorker.java:79)
Algo Crashed. Crash: true !processIsAlive: null

It looks like the command you are using is slightly off (but close). The arguments run_match.sh expects is the folder your bot is contained in.

So instead you would run:

$ scripts/run_match.sh algos/starter-algo algos/starter-algo

or alternatively:

$ scripts/run_match.sh

since the starter-algo is the default if no arguments are given (obviously add the arguments if you change the name).

Thank you for the help! Unfortunately, this is giving me an entirely different error now. I saw a suggestion on StackOverflow saying I should run using bash.exe and parameters, but I wasn’t sure if that made any sense in this context. The error output is again below.

$ scripts/run_match.sh algos/starter-algo/ algos/starter-algo/
Run Match
P1: algos/starter-algo
P2: algos/starter-algo
Starting Match: algos/starter-algo vs. algos/starter-algo
Starting Engine
Starting single worker game.
algos/starter-algo/run.sh
algos/starter-algo/run.sh
Command: algos/starter-algo/run.sh
Run: [algos/starter-algo/run.sh]
Error on simple algo process creation
java.io.IOException: Cannot run program “algos/starter-algo/run.sh”: CreateProcess error=193, %1 is not a valid Win32 application
at java.base/java.lang.ProcessBuilder.start(Unknown Source)
at java.base/java.lang.ProcessBuilder.start(Unknown Source)
at towergame.gamecore.player.SimpleAlgoPlayer.(SimpleAlgoPlayer.java:71)
at towergame.gamecore.player.PlayerManager.setupPlayerFromCommandString(PlayerManager.java:101)
at towergame.GameMain.main(GameMain.java:149)
at towerworker.TowerWorker.main(TowerWorker.java:79)
Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application
at java.base/java.lang.ProcessImpl.create(Native Method)
at java.base/java.lang.ProcessImpl.(Unknown Source)
at java.base/java.lang.ProcessImpl.start(Unknown Source)
… 6 more
Algo Crashed. Crash: true !processIsAlive: null
Command: algos/starter-algo/run.sh
Run: [algos/starter-algo/run.sh]
Error on simple algo process creation
java.io.IOException: Cannot run program “algos/starter-algo/run.sh”: CreateProcess error=193, %1 is not a valid Win32 application
at java.base/java.lang.ProcessBuilder.start(Unknown Source)
at java.base/java.lang.ProcessBuilder.start(Unknown Source)
at towergame.gamecore.player.SimpleAlgoPlayer.(SimpleAlgoPlayer.java:71)
at towergame.gamecore.player.PlayerManager.setupPlayerFromCommandString(PlayerManager.java:101)
at towergame.GameMain.main(GameMain.java:150)
at towerworker.TowerWorker.main(TowerWorker.java:79)
Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application
at java.base/java.lang.ProcessImpl.create(Native Method)
at java.base/java.lang.ProcessImpl.(Unknown Source)
at java.base/java.lang.ProcessImpl.start(Unknown Source)
… 6 more
Algo Crashed. Crash: true !processIsAlive: null

Sorry, I should have read your original post more carefully! Running on a windows machine you should not execute the program using the Git Bash. Instead, use PowerShell.

Go to the same directory as before (should contain engine.jar, README, etc) and run the following command:

Set-ExecutionPolicy Unrestricted

This will enable the program to run in PowerShell. You will need to run this using an administrator PowerShell.
Then you should be good to go!

Note: A lot of this information is in the README, I highly recommend giving it a look to get an idea of how to startup and how the file structure works.

1 Like

Thank you! Long story short, i’ve been trying to get this to run locally for about 5 hours now. I’ve tried a bunch of goofy things and you can see where it got me haha It is running but of course I am getting a different error now. I’ll check the forums and see if it is there. I really appreciate the help!

P.S. I was wondering why everyone kept saying “read the ReadMe” because I didn’t think it had anything useful. Of course I kept reading the wrong one -.- Thanks again!

1 Like

No problem, thanks for taking the time to research to problem yourself. If you can’t find the solution or have some other problems don’t hesitate to ask! :smiley:

2 Likes

What readme did you read that was the wrong readme?