Completely confused :/

Hi , unable to get started with a bot , if someone is kind enough to help me out it would be cool.

i usually use c# on .net 4.x , but his year i cannot get a bot up and running , the issue being that i only get " cannot run program “dotnet” " and i assume this is because i do not have .net core 2 ,i have tried to install this ,however i only get an installation error which states it is not compatible with my os, so i think this is because i do not have sp1 on my os , and that is a whopper of an download and installation simply to be able to install .net core 2 ,so anyway…

the only bot i am able to run matches with is the java bot in the example , so i thought i would try java even though i am a complete noob to it , i have started a project in eclipse with the reference java bot code added and also one with the starter java bot code ,both of which gives the same result “file \command.txt not found” , i have no idea why this is happening though…

can someone help me get an eclipse java project up and running from the reference/starter bot , if you could highlight it in a step by step procedure,in a reply it would be cool ,or a project already saved would be cool too, i only need to get it running ,the rest i would try and figure out .

that or i am out of this year’s challenge , unless i would be able to update my os to sp1 soon …

Check the readme.txt document in the starter pack folder, make sure everything is setup properly. The error you are getting is because no command file was found in the folder that is expected to have the file.

 ______ _   _ _______ ______ _      ______ _____ _______ 
|  ____| \ | |__   __|  ____| |    |  ____/ ____|__   __|
| |__  |  \| |  | |  | |__  | |    | |__ | |       | |   
|  __| | . ` |  | |  |  __| | |    |  __|| |       | |   
| |____| |\  |  | |  | |____| |____| |___| |____   | |   
|______|_| \_|  |_|  |______|______|______\_____|  |_|   

  _____ _    _          _      _      ______ _   _  _____ ______ 
 / ____| |  | |   /\   | |    | |    |  ____| \ | |/ ____|  ____|
| |    | |__| |  /  \  | |    | |    | |__  |  \| | |  __| |__   
| |    |  __  | / /\ \ | |    | |    |  __| | . ` | | |_ |  __|  
| |____| |  | |/ ____ \| |____| |____| |____| |\  | |__| | |____ 
 \_____|_|  |_/_/    \_\______|______|______|_| \_|\_____|______|

 __       __       ___  
/_ |     /_ |     |__ \ 
 | |      | |        ) |
 | |      | |       / / 
 | |  _   | |  _   / /_ 
 |_| (_)  |_| (_) |____|


Welcome to the starter pack for the 2018 Entelect Challenge!
Here you will find all that you'll need to run your first bot and compete in this year's challenge.



==== STEP 1 ====

Let's start off by running your very first match:
(Because we are going to run java files, please make sure you have java installed [http://www.oracle.com/technetwork/pt/java/javase/downloads/jdk8-downloads-2133151.html])

We included some 'run' files for various operating systems to run a match.

    On Windows:
        Simply run (double-click) the "run.bat" file.

    On Linux:
        Open the terminal in the starter pack's root directory and run the "make" or "make run" command.

You should now see some text whizz by in the console/terminal. If this is not the case, your match didn't run as it should. If the error message isn't clear, you can ask for help on our forum [forum.entelect.co.za].



==== STEP 2 ====

Now let's change things up a little bit. The previous match we ran, was between the Java reference bot and the Java starter bot. Let's change the match to be between the Java reference bot and a starter bot of your choice. To change this we need to edit the "config.json" file.

The format of the 'config.json' is as follows:

    "round-state-output-location" => This is the path to where you want the match folder in which each round's folder with its respective logs will be saved.

    "game-config-file-location" => This is the path to the game-config.properties file that is used to set various game-engine settings such as map size and building stats.

    "verbose-mode" => This is a true or false value to either print logs to the console or not respectively.

    "max-runtime-ms" => This is the amount of milliseconds that the game runner will allow a bot to run before making its command each round.

    "player-a" &
    "player-b" => This is the path to the folder containing the 'bot.json' file. If you would like to replace one of the bot players with a console player, just use the word "console" as the path.

The format of the 'bot.json' is as follows (also see the example in "/examples/example-bot.json"):

    "author" => This is the name of the person who wrote the bot.

    "email" => This is an email address where the author of the bot can be contacted if there are any questions.

    "nickName" => This is a nickname for the bot that will be used in visualisations.

    "botLocation" => This is a relative path to the folder containing the compiled bot file for the specific language.

    "botFileName" => This is the compiled bot file's name.

    "botLanguage" => This is the language name in which the bot is coded. A list of the currently supported languages and the names used in the runner can be found below.

To change the bots that play in the match, replace the "player-a" value in the "config.json" file with the path to another starter bots' folder containing "bot.json".

---- LANGUAGES ----

Java            => "java"
C# (.net core)  => "c#core"
Python3         => "python3"
Javascript      => "javascript"
Rust            => "rust"
C++             => "c++"
Kotlin          => "kotlin"
Golang          => "golang"
Haskell         => "haskell"
PHP             => "php"
LISP            => "lisp"



==== STEP 3 ====

All that is left to do is to modify the existing logic or to code your own, into one of the starter bots. This will require you to do some coding in the language of your choice.

Here is a brief explanation of how a bot should work:

    The bot will be called to run once per round in the game. After every round, the bot will be terminated and restarted for the next round.

    For each round the bot should go through the following process:

        Firstly read in the "state.json" file that contains the game map and all the round properties.

        Apply your logic to these properties and decide on what your next move is and where you want to apply it.

        Finally, write your move into the "command.txt" file.

Here are short explanations of the files mentioned above:

    "state.json" => This file keeps track of everything that is on the map, the player's health, energy and scores. For an example of a state file, see "/examples/example-state.json".

    "command.txt" => This file will be read by the game engine to know what your bot decided to do for that specific round. For an example of a command file, see "/examples/example-command.txt".



==== Prerequisites ====

Java bots
    The Java starter bot requires Java 8 or above.
    [http://www.oracle.com/technetwork/pt/java/javase/downloads/jdk8-downloads-2133151.html]

C# bots
    The C# core starter bot requires .NET Core runtime package 2.x.
    [https://www.microsoft.com/net/download/all]

Python2 bots
    The Python starter bot requires Python 2.7.
    [https://www.python.org/downloads/]

Python3 bots
    The Python starter bot requires Python 3.6.
    [https://www.python.org/downloads/]

Javascript bots
    The Javascript starter bot requires Node.Js 8.x.x or above.
    [https://nodejs.org/en/download/]

Rust bots
    For more info on the Rust bot, see the readme file or contact the person who submitted the bot, JWorthe (on GitHub)
    [https://github.com/EntelectChallenge/2018-TowerDefence/tree/master/starter-bots/rust]

C++ bots
    For more info on the C++ bot, see the readme file or contact the person who submitted the bot, linjoehan (on GitHub)
    [https://github.com/EntelectChallenge/2018-TowerDefence/tree/master/starter-bots/cplusplus]

Kotlin bots
    For more info on the Kotlin bot, see the source files or contact the person who submitted the bot, gkmauer (on GitHub)
    [https://github.com/EntelectChallenge/2018-TowerDefence/tree/master/starter-bots/kotlin]

Golang bots
    For more info on the Golang bot, see the readme file or contact the person who submitted the bot, dougcrawford (on GitHub)
    [https://github.com/EntelectChallenge/2018-TowerDefence/tree/master/starter-bots/golang]

Haskell bots
    For more info on the Haskell bot, see the readme file or contact the person who submitted the bot, Quiescent (on GitHub)
    [https://github.com/EntelectChallenge/2018-TowerDefence/tree/master/starter-bots/haskell]

PHP bots
    For more info on the PHP bot, see the readme file or contact the person who submitted the bot, PuffyZA (on GitHub)
    [https://github.com/EntelectChallenge/2018-TowerDefence/tree/master/starter-bots/php]

LISP bots
    For more info on the LISP bot, see the readme file or contact the person who submitted the bot, HenryS1 (on GitHub)
    [https://github.com/EntelectChallenge/2018-TowerDefence/tree/master/starter-bots/common-lisp]

Hi @wjb

Sorry to hear your troubles with .Net. Unfortunately we are only supporting .Net core this year rather than the full .Net framework due to our underlying architecture, you could possibly try running an earlier version of .Net core, it shouldn’t have to be specifically .Net core 2.x.

As to your current issue with Java, would you be willing to rather use Netbeans than Eclipse as your IDE? It has better Maven support than Eclipse, which is the build tool we are using to compile the bots?

I have created a Java zip that works in Netbeans for you, please check it out and let me know if you have any issues.

1 Like

hey thank you , after installing netbeans and cloning the reference bot ,i had the same issues
for a while “could not find command.txt” , but with netbeans i quickly figured out that this was because gson was not included in the build … i did not know what maven is and how it works and that it needed to have internet access to download what it needs , i just got it compiled and working ,shamefully complete noob at java …

That is good news @wjb!

Please don’t hesitate to shout if you have any other issues.