Trying to run games localy ,gettign wirred eror fix on website doesnt work

so im trying to run some games localy and the eroor im getting is explained on the website but my algos run fine on the website and i double checked and i dont use print.
here is the error:
at com.c1games.terminal.game.GameMain.startGame(GameMain.java:175)
at com.c1games.terminal.game.GameMain.main(GameMain.java:150)
at com.c1games.terminal.Terminal.main(Terminal.java:141)
Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:80)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
at com.google.gson.Gson.fromJson(Gson.java:887)
… 8 more
Invalid command, couldn’t json for player 0 : {“p2Units”:[[],[],[],[],[],[],[]],“turnInfo”:[0,98,-1],“p1Stats”:[30.0,530.0,55.7,2],“p1Units”:[[],[],[],[],[],[],[]],“p2Stats”:[30.0,530.0,55.7,2],“events”:{“selfDestruct”:[],“breach”:[],“damage”:[],“shield”:[],“move”:[],“spawn”:[],“death”:[],“attack”:[],“melee”:[]}}
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.Gson.fromJson(Gson.java:899)
at com.google.gson.Gson.fromJson(Gson.java:852)
at com.google.gson.Gson.fromJson(Gson.java:801)
at com.c1games.terminal.game.Parser.processInputForPlayer(Parser.java:131)
at com.c1games.terminal.game.Parser.processInputDeploy(Parser.java:239)
at com.c1games.terminal.game.GameMain.runLoop(GameMain.java:324)
at com.c1games.terminal.game.GameMain.startGame(GameMain.java:175)
at com.c1games.terminal.game.GameMain.main(GameMain.java:150)
at com.c1games.terminal.Terminal.main(Terminal.java:141)
Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:80)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
at com.google.gson.Gson.fromJson(Gson.java:887)
… 8 more
Invalid command, couldn’t json for player 1 : {“p2Units”:[[],[],[],[],[],[],[]],“turnInfo”:[0,98,-1],“p1Stats”:[30.0,530.0,55.7,2],“p1Units”:[[],[],[],[],[],[],[]],“p2Stats”:[30.0,530.0,55.7,2],“events”:{“selfDestruct”:[],“breach”:[],“damage”:[],“shield”:[],“move”:[],“spawn”:[],“death”:[],“attack”:[],“melee”:[]}}
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.Gson.fromJson(Gson.java:899)
at com.google.gson.Gson.fromJson(Gson.java:852)
at com.google.gson.Gson.fromJson(Gson.java:801)
at com.c1games.terminal.game.Parser.processInputForPlayer(Parser.java:131)
at com.c1games.terminal.game.Parser.processInputDeploy(Parser.java:239)
at com.c1games.terminal.game.GameMain.runLoop(GameMain.java:324)
at com.c1games.terminal.game.GameMain.startGame(GameMain.java:175)
at com.c1games.terminal.game.GameMain.main(GameMain.java:150)
at com.c1games.terminal.Terminal.main(Terminal.java:141)
Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:80)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
at com.google.gson.Gson.fromJson(Gson.java:887)
… 8 more
Invalid command, couldn’t json for player 0 : {“p2Units”:[[],[],[],[],[],[],[]],“turnInfo”:[1,98,0],“p1Stats”:[30.0,530.0,55.7,2],“p1Units”:[[],[],[],[],[],[],[]],“p2Stats”:[30.0,530.0,55.7,2],“events”:{“selfDestruct”:[],“breach”:[],“damage”:[],“shield”:[],“move”:[],“spawn”:[],“death”:[],“attack”:[],“melee”:[]}}
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.Gson.fromJson(Gson.java:899)
at com.google.gson.Gson.fromJson(Gson.java:852)
at com.google.gson.Gson.fromJson(Gson.java:801)
at com.c1games.terminal.game.Parser.processInputForPlayer(Parser.java:131)
at com.c1games.terminal.game.Parser.processInputBuild(Parser.java:115)
at com.c1games.terminal.game.GameMain.runLoop(GameMain.java:318)
at com.c1games.terminal.game.GameMain.startGame(GameMain.java:175)
at com.c1games.terminal.game.GameMain.main(GameMain.java:150)
at com.c1games.terminal.Terminal.main(Terminal.java:141)
Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:80)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
at com.google.gson.Gson.fromJson(Gson.java:887)
… 8 more
Invalid command, couldn’t json for player 1 : {“p2Units”:[[],[],[],[],[],[],[]],“turnInfo”:[1,98,0],“p1Stats”:[30.0,530.0,55.7,2],“p1Units”:[[],[],[],[],[],[],[]],“p2Stats”:[30.0,530.0,55.7,2],“events”:{“selfDestruct”:[],“breach”:[],“damage”:[],“shield”:[],“move”:[],“spawn”:[],“death”:[],“attack”:[],“melee”:[]}}
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.Gson.fromJson(Gson.java:899)
at com.google.gson.Gson.fromJson(Gson.java:852)
at com.google.gson.Gson.fromJson(Gson.java:801)
at com.c1games.terminal.game.Parser.processInputForPlayer(Parser.java:131)
at com.c1games.terminal.game.Parser.processInputBuild(Parser.java:115)
at com.c1games.terminal.game.GameMain.runLoop(GameMain.java:318)
at com.c1games.terminal.game.GameMain.startGame(GameMain.java:175)
at com.c1games.terminal.game.GameMain.main(GameMain.java:150)
at com.c1games.terminal.Terminal.main(Terminal.java:141)
Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:80)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
at com.google.gson.Gson.fromJson(Gson.java:887)
… 8 more
Invalid command, couldn’t json for player 0 : {“p2Units”:[[],[],[],[],[],[],[]],“turnInfo”:[0,99,-1],“p1Stats”:[30.0,535.0,55.8,2],“p1Units”:[[],[],[],[],[],[],[]],“p2Stats”:[30.0,535.0,55.8,2],“events”:{“selfDestruct”:[],“breach”:[],“damage”:[],“shield”:[],“move”:[],“spawn”:[],“death”:[],“attack”:[],“melee”:[]}}
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.Gson.fromJson(Gson.java:899)
at com.google.gson.Gson.fromJson(Gson.java:852)
at com.google.gson.Gson.fromJson(Gson.java:801)
at com.c1games.terminal.game.Parser.processInputForPlayer(Parser.java:131)
at com.c1games.terminal.game.Parser.processInputDeploy(Parser.java:239)
at com.c1games.terminal.game.GameMain.runLoop(GameMain.java:324)
at com.c1games.terminal.game.GameMain.startGame(GameMain.java:175)
at com.c1games.terminal.game.GameMain.main(GameMain.java:150)
at com.c1games.terminal.Terminal.main(Terminal.java:141)
Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:80)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
at com.google.gson.Gson.fromJson(Gson.java:887)
… 8 more
Invalid command, couldn’t json for player 1 : {“p2Units”:[[],[],[],[],[],[],[]],“turnInfo”:[0,99,-1],“p1Stats”:[30.0,535.0,55.8,2],“p1Units”:[[],[],[],[],[],[],[]],“p2Stats”:[30.0,535.0,55.8,2],“events”:{“selfDestruct”:[],“breach”:[],“damage”:[],“shield”:[],“move”:[],“spawn”:[],“death”:[],“attack”:[],“melee”:[]}}
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.Gson.fromJson(Gson.java:899)
at com.google.gson.Gson.fromJson(Gson.java:852)
at com.google.gson.Gson.fromJson(Gson.java:801)
at com.c1games.terminal.game.Parser.processInputForPlayer(Parser.java:131)
at com.c1games.terminal.game.Parser.processInputDeploy(Parser.java:239)
at com.c1games.terminal.game.GameMain.runLoop(GameMain.java:324)
at com.c1games.terminal.game.GameMain.startGame(GameMain.java:175)
at com.c1games.terminal.game.GameMain.main(GameMain.java:150)
at com.c1games.terminal.Terminal.main(Terminal.java:141)
Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:80)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
at com.google.gson.Gson.fromJson(Gson.java:887)
… 8 more
Winner (p1 perspective, 1 = p1 2 = p2): 1
Waiting to exit finished game.
sent game end playerIndex: 0
sent game end playerIndex: 1
sent game end playerIndex: 0
sent game end playerIndex: 1
Done waiting now exiting finished game.
Hard Exiting Now
Closing stream
Closing playerIndex: 0
Closing stream
Closing playerIndex: 1
Exited for loop
End of main
Closing stream
Closing stream

if anyone can help would be very usefull

  • Can you send the command you are using
  • Does the default starter-algo work?

If the default starter-kit works for you, a reasonable way to find the issue is to strip away your changes and add your changes back to it one by one to identify what change is causing the breakage.

./run_match.ps1 algos/python-algo algos/python-algo is the comand and it also isnt working with the starter algo

I think the script expects to be run from the starterkit root. Try this for example:

scripts\run_match.ps1 java-algo/algo-target python-algo

While your working directory is the root of the starterkit.
Also, try downloading a fresh starterkit download.

If these suggestions dont work, you can try the python version of the script:

 py -3 run_match.py

p1-30-03-2021-14-26-27-1617107187392–273083257.replay (58.6 KB)
so i got it to run the matches with this comand: scripts\run_match.ps1 algos/python-algo algos/python-algo and a new startrekit but im getting those replay files and i think those mean the algos arent doing anything.it also still gives the same error

Did you try all of the suggestions given in a fresh starterkit? Based on the command you shared it seems like your directory structure was edited, as there is no ‘algos’ folder by default. I also don’t know what else has been edited, and have not been able to replicate the issue locally.

If you could try the suggestions above in a fresh starterkit and let me know what happens that would be the most helpful next step