Coder Social home page Coder Social logo

entelectchallenge / 2018-towerdefence Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 20.0 56.43 MB

Main repository for the Entelect Challenge 2018 tournament

License: MIT License

Java 52.95% C# 5.18% JavaScript 2.47% Python 6.03% Makefile 0.02% Batchfile 0.04% C++ 4.84% Kotlin 3.81% Rust 3.27% Go 2.37% Haskell 6.36% PHP 3.20% Common Lisp 4.95% Scala 4.50%

2018-towerdefence's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

2018-towerdefence's Issues

Rules fixes

  • Score description out of date based on opponent damage
  • Building vs Unit references

NullPointerException when game ends in a tie

https://forum.entelect.co.za/t/questions/322/33

Test game for Tie endings:
java.lang.NullPointerException
at za.co.entelect.challenge.bootstrapper.GameBootstrapper.lambda$getGameCompleteHandler$2(GameBootstrapper.java:174)
at za.co.entelect.challenge.engine.runner.GameEngineRunner.publishGameComplete(GameEngineRunner.java:159)
at za.co.entelect.challenge.engine.runner.GameEngineRunner.processRound(GameEngineRunner.java:112)
at za.co.entelect.challenge.engine.runner.GameEngineRunner.startNewGame(GameEngineRunner.java:74)
at za.co.entelect.challenge.bootstrapper.GameBootstrapper.startGame(GameBootstrapper.java:130)
at za.co.entelect.challenge.bootstrapper.GameBootstrapper.main(GameBootstrapper.java:47)

C# bot does not extend Cell class

    public class Building
    {
        public int Health { get; set; }
    ...

Building should extend Cell, so that it has access to the x-y-coordinates and playerType field

Game-runner in headless mode

Have the console not output any console map. It can run much faster this way.

Have a "verbose" property in the config that will change this

Add building/missile blueprint stats in state-file

Every building and missile type should be defined in the state file, so that bots can reference that for values. Game balancing is bound to change when new features are added, this will give a concrete reference point for bots to find this info

Change score calculation based on health

Score based on health is calculated at the end of the match, but if health is a negative value then the score will be as well

Rather use a per damage score system (when the opponent loses health, the ally gains score). Only valid for positive health

Score calculation has changed

Looks like missile damage score doesn't get the 100x multiplier as stated in the rules when hitting the base in this build (1.1.2). Ran a few games where the score was below 10k, which is the minimum with the correct multiplier.

Python bot ReadMe file

Add a ReadMe file to the Python starter bot for some guidance on how to get started or troubleshoot.

starter-bots error - Cannot run program "py"

I am having a bit of trouble running the starter-pack out of the box. I want to write a bot in Python 2.7.10.
Current PC:

  • Windows 10, version 1709
  • Python 2.7.10, installed with Python (x,y).
  • Java 1.8.0_171"

./config.json
{
"round-state-output-location": "./tower-defence-matches",
"game-config-file-location": "./game-config.properties",
"verbose-mode": true,
"max-runtime-ms": 20000,
"player-a": "./starter-bots/python3",
"player-b": "./reference-bot/java"
}

./starter-bots/python3/bot.json
{
"author": "John Doe",
"email": "[email protected]",
"nickName": "Guido",
"botLocation": "/",
"botFileName": "StarterBot.py",
"botLanguage": "python2"
}

Tried the botLanguage as python3 with the same error.

The error I get is:

=======================================
Starting game
=======================================
=======================================
Starting round 0
=======================================
Bot execution failed: Cannot run program "py" (in directory "C:\Entelect\2018\111_1\starter-bots\python3"): CreateProcess error=2, The system cannot find the file specified
BotRunner Started.
File C:\Entelect\2018\111_1\starter-bots\python3/command.txt not found
BotRunner Started.
Error List: []

Player A Health=100, Energy=25, Score=5
Player B Health=100, Energy=5, Score=6
[0 0][1 0][2 0][3 0][3 0][2 0][1 0][0e0]
[0 1][1 1][2 1][3 1][3 1][2 1][1 1][0 1]
[0 2][1 2][2 2][3 2][3 2][2 2][1 2][0 2]
[0 3][1 3][2 3][3 3][3 3][2 3][1 3][0 3]

=======================================
Starting round 1
=======================================
Bot execution failed: Cannot run program "py" (in directory "C:\Entelect\2018\111_1\starter-bots\python3"): CreateProcess error=2, The system cannot find the file specified
BotRunner Started.
File C:\Entelect\2018\111_1\starter-bots\python3/command.txt not found
BotRunner Started.
Error List: []

bla
bla
bla...

Any suggestions?

Java bot ReadMe file

Add a ReadMe file to the Java starter bot for some guidance on how to get started or troubleshoot.

Rectify the game rules

We will rectify the game rules on this, so that missiles always move over buildings under construction without hindrance

Firing missile before building is destroyed

Sometimes, buildings DO NOT generate missiles if they are destroyed in that round (contradictory to the rules). In the example below the A’s attack building on (2,1) will fire next round. However, there is a missile on (3,1) which destroys the building before it can fire off a missile in round 11.

=======================================
Starting round 10
=======================================
BotRunner Started.
BotRunner Started.
Error List: []

Player A Health=100, Energy=30, Score=110
Player B Health=100, Energy=25, Score=88
[0E0][1 0][2 0][3 0][3E0][2 0][1 0][0 0]
[0E1][1 1][2A1][< 1][3 1][2 1][1D1][0 1]
[0E2][1 2][2 2][3 2][3 2][2 2][1 2][0 2]
[0 3][1 3][2 3][3 3][3 3][2 3][1 3][0 3]

=======================================
Starting round 11
=======================================
BotRunner Started.
BotRunner Started.
Error List: []

Player A Health=100, Energy=14, Score=125
Player B Health=100, Energy=13, Score=103
[0E0][1 0][2 0][3 0][3E0][2 0][1 0][0 0]
[0E1][1 1][2 1][3d1][3 1][2 1][1D1][0 1]
[0E2][1 2][2 2][3 2][3 2][2 2][1 2][0 2]
[0 3][1 3][2 3][3 3][3e3][2 3][1 3][0 3]

In the next example, the attack building at 0,3 (for player B) gets to fire off its missile before it gets destroyed. This is different to what happens for player A above and in line with the rules.

=======================================
Starting round 132
=======================================
BotRunner Started.
BotRunner Started.
Error List: []

Player A Health=90, Energy=1637, Score=3261
Player B Health=25, Energy=1411, Score=3541
[0D0][1 0][< 0][3 0][3 0][2 0][<D0][0A0]
[0E1][1E1][2A1][3D1][3 1][2 1][1E1][0 1]
[0E2][1D2][2 2][3 2][3D2][2E2][<E2][0A2]
[0D3][1 3][2 3][3 3][3 3][2d3][1 >][0A3]

=======================================
Starting round 133
=======================================
BotRunner Started.
BotRunner Started.
Error List: []

Player A Health=90, Energy=1651, Score=3281
Player B Health=25, Energy=1425, Score=3560
[0D0][< 0][2 0][3 0][3 0][< 0][1D0][0A0]
[0E1][1E1][2A1][3D1][3 1][2 1][1E1][0 1]
[0E2][1D2][2 2][3 2][3D2][<E2][1E2][0A2]
[0D3][1 3][2 3][3 3][3 3][2D3][< 3][0 3]

Expose energy per turn

In the state.json file, show the base amount of extra energy that a bot will receive on each round

Do not take the energy buildings into account, since they could be destroyed

Better unit testing for scoring events

Some scoring events do not match up with the rules. These results needs to be investigated

  • Damage points is given on all missiles that hit a building for example if a building has hp of 5 and 2 missiles hit it at the same time the player gets 10 points but only one missile hits the building, the other continues and will possible get the player 5 more points.
  • Damage points is given to a player for missiles hitting his own building, these missiles don’t do any damage to the building though

No error when the bot executable is not found

When the runner tries to run the sample java bot, there is no visible error when it fails to find the actual executable jar file. This makes it really hard to realize the actual issue.
For example, with the change in version number, the java jar file produced by the build is java-sample-bot-1.1-SNAPSHOT-jar-with-dependencies.jar instead of the java-sample-bot-1.0-SNAPSHOT-jar-with-dependencies.jar. The bot.json file still pointed at the old version number.
When I ran the run.bat command there was no indication from the runner that it was failing to locate the defined jar file. Instead it just complains that no command file is present. I would have expected a big error message saying the jar file is missing or at least that the java command it must be running internally failed.

Multiple missiles hitting a “dead” building should not all be removed

It is not intended to destroy all missiles hitting a “dead” building, or else a player could win by having their attackers fire in-phase

If 5 attackers are placed in the same row, at the correct time, they will fire 5 missiles moving in the same cell. When these 5 arrive at a weak building, then all 5 will be destroyed, although 1 missile already killed the building

Kotlin bot ReadMe file

Add a ReadMe file to the Kotlin starter bot for some guidance on how to get started or troubleshoot.

Extract properties from configs

Some ideas in the comments about config files:

_I would really like to be able to configure:

Max Rounds
Map Size
Starting Energy
Energy Per Turn Net Of Energy buildings_


We need to discuss what properties should be moved out of the hardcoded "game-config.properties"

Javascript bot ReadMe file

Add a ReadMe file to the Javascript starter bot for some guidance on how to get started or troubleshoot.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.