GithubHelp home page GithubHelp logo

entelectchallenge / 2017-battleships Goto Github PK

View Code? Open in Web Editor NEW
22.0 22.0 31.0 20.77 MB

License: MIT License

C# 34.79% PowerShell 0.91% Java 3.98% Scala 0.87% Python 0.62% Go 0.68% JavaScript 8.62% Rust 0.44% Julia 0.43% Makefile 0.21% C++ 40.11% C 2.24% HTML 3.99% CSS 2.10%

2017-battleships's People

Contributors

amanica avatar aodendaal avatar bhaeussermann avatar ddebree avatar delraich avatar entelectchallenge avatar gerhardsmit avatar gkmauer avatar gvhuyssteen avatar jworthe avatar mallin avatar oockyoo avatar raezor07 avatar s-rabe avatar sschocke avatar svanellewee avatar x0lani avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

2017-battleships's Issues

SeekerMissile throws exception when no targets in range

When the seekermissle has no targets in range, an exception is thrown, causing the shot to do nothing.

The following code fixes the problem, but might not be so very elegant.
Point cellToHit; try { var cellInRange = occupiedCells.Select(x => new { distance = Math.Sqrt(Math.Pow((x.X - _centerPoint.X), 2) + Math.Pow(x.Y - _centerPoint.Y, 2)), cell = x }).OrderBy(x => x.distance).First(x => x.distance <= 2); cellToHit = new Point(cellInRange.cell.X, cellInRange.cell.Y); gameMap.Shoot(player.PlayerType, new List<Point> { cellToHit }, WeaponType.SeekerMissle); } catch (InvalidOperationException ioe) { cellToHit = new Point(_centerPoint.X, _centerPoint.Y); gameMap.Shoot(player.PlayerType, new List<Point> { cellToHit }, WeaponType.SeekerMissle); }

C# SampleBot and ReferenceBot Timeouts

Hi,

I'm getting timeouts with the C# SampleBot and ReferenceBot.

Contents of log.txt:

16-05-2017 09:19:30:673 - I: Your bot exceeded the maximum execution time
16-05-2017 09:19:30:673 - E: Bot time limit exceeded BotRunner.Exceptions.TimeLimitExceededException: Time limit exceeded by 00:00:00.8102689
at TestHarness.TestHarnesses.Bot.BotRunner.RunBot() in W:\Projects\100k\2017\Github\2017-Batteships\GameEngine\Battleships\BotRunner\Harness\Bot\BotRunner.cs:line 96
at TestHarness.TestHarnesses.Bot.BotHarness.RunBotAndGetNextMove() in W:\Projects\100k\2017\Github\2017-Batteships\GameEngine\Battleships\BotRunner\Harness\Bot\BotHarness.cs:line 142

My machine specifications:
HDD = 250GB SSD
RAM = 8GB DDR3
CPU = Intel Core i7 4712MQ @ 2.30Ghz
OS = Windows 10 Pro
Anti-Virus = Trend Micro
Visual Studio = 2015 Pro

Any ideas why this is happening?

Mixed up files, Instructions don't match

The 2017-Battleships-1.0.0 has the files a bit muddled up.

There is a 2017-Battleships-1.0.0\GameEngine\GameEngine.csproj
which seems to be the same as 2017-Battleships-1.0.0\GameEngine\Battleships\GameEngine\GameEngine.csproj

The 2017-Battleships-1.0.0\GameEngine\Battleships\Battleships.sln solution seems to be the main program but is in a subdirectory of the GameEngine Project?

There is also no run.bat that allows you to watch the demo bots go at it.

Calibration test failure

Running the compiled game engine provided (https://github.com/EntelectChallenge/2017-Battleships/releases/latest) on i7 Windows 10, I get the following errors in the log Failed to run calibration test System.ComponentModel.Win32Exception (0x80004005)

The error happens during phase 1.
Attached log files,

Phase 1 - Round 0.zip

It appears to be looking for BotCalibrationDotNet.exe which is missing from both the code base and the pre-compiled application.

Subsequent errors are that, because of the JIT compiler the first time the exe loads it fails as it takes to long after that it is quick. It then fails to place its boats in the first round phase 1 and gets a penalty.

Incorrect Points Calculations

if a ship is sunk and then hit on a damaged part , the system wil keep awarding points , i noticed this while making a coding mistake in my bot , in just a few round the score can climb over a 1000.

i have emailed twice and had difficulty creating a topic here multiple times , but better late than never .

regards

From Forum Post

Remove Golang Reference Bot

Quick one, my bad.
I prematurely created a PR for the Golang bot which was not ready for release. It seem to have merged automatically though (or someone was faster at merging than I was at closing the PR).

Intended on replacing this bot code in the reference directory with a cleaned up version in that I moved to the sample directory instead.

This PR #22 is the new improved PR.

Issue with rendering game rounds

When I run the new engine v1.0.1 with option --pretty it fails to run. It seems there might be a hardcoded path in the code?
See my run comman below with responses:

$ ./Battleships.exe --pretty -b "D:\My Space\entelect\Challenge 2017\Sample.Bot.-.Java\Java\SampleBot" "D:\My Space\entelect\Challenge 2017\Sample.Bot.-.Java\Java\SampleBot"
Starting new game
System.IO.IOException: The handle is invalid.

   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.Console.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded)
   at System.Console.Clear()
   at GameEngine.Renderers.ConsoleRender.RenderToConsolePretty(GameMap gameMap, PlayerType playerType) in W:\Projects\100k\2017\Github\2017-Batteships\GameEngine\Battleships\GameEngine\Renderers\ConsoleRender.cs:line 13
   at Battleships.BattleshipsGame.engine_RoundComplete(GameMap gameMap, Int32 round) in W:\Projects\100k\2017\Github\2017-Batteships\GameEngine\Battleships\Battleships\BattleshipsGame.cs:line 120
   at GameEngine.Engine.BattleshipEngine.RoundStartingHandler.Invoke(GameMap gameMap, Int32 round)
   at GameEngine.Engine.BattleshipEngine.PublishRoundStarting() in W:\Projects\100k\2017\Github\2017-Batteships\GameEngine\Battleships\GameEngine\Engine\BattleshipEngine.cs:line 216
   at GameEngine.Engine.BattleshipEngine.StartNewRound() in W:\Projects\100k\2017\Github\2017-Batteships\GameEngine\Battleships\GameEngine\Engine\BattleshipEngine.cs:line 207
   at GameEngine.Engine.BattleshipEngine.StartNewGame() in W:\Projects\100k\2017\Github\2017-Batteships\GameEngine\Battleships\GameEngine\Engine\BattleshipEngine.cs:line 65
   at Battleships.BattleshipsGame.StartNewGame(Options options) in W:\Projects\100k\2017\Github\2017-Batteships\GameEngine\Battleships\Battleships\BattleshipsGame.cs:line 91

Environment variable setting for game engine building

I need some way to set environment variables before building my code (Go requires this for any large complex codebase.)

I've suggested some changes here : #33 but if there is a better way of doing this I'm open to those suggestions as well.
Best regards,
Stephan

Ship Placement

The reference bot often also fails to place his ships, and after mine failed many times I decided to test it manually. I took the place.txt file, and placed the ships manually on a Excel sheet, paying close attention to use the Direction modifiers as they are coded in the Game Engine. It works out every time, but the Game Engine fails with errors like Cell(9,1) has no neighbours to the east, which regardless of whether East is left or right, there should be a cell there!

SeekerMissile error - Reference bot

Running the reference bots with the latest engine can't seem to pass through phase 1 of the game. Digging through the log I come across this error message:

Unhandled Exception: Newtonsoft.Json.JsonSerializationException: Error converting value 
"SeekerMissile" to type 'ReferenceBot.Domain.State.WeaponType'. Path 
'PlayerMap.Owner.Ships[0].Weapons[1].WeaponType', line 1, position 8054. ---> 
System.ArgumentException: Requested value 'SeekerMissile' was not found.

PlayerMap and Opponent Map properties null

Hi,

I just started looking at the code and noticed that the PlayerMap and Opponent Map properties are null on the GameState. The JSON generated by the Game Engine has Player1Map and Player2Map properties that do have data. Is this the expected result? I assume not, because of how the reference bot class looks:

Game State class

public class GameState {

    public PlayerMap PlayerMap;

    public OpponentMap OpponentMap;

    public String GameVersion;

    public int GameLevel;

    public int Round;

    public int MapDimension;

    public int Phase;
}

Game Engine JSON

{
  "PlayerMap": null,
  "OpponentMap": null,
  "GameVersion": "1.0.0",
  "GameLevel": 1,
  "Round": 50,
  "MapDimension": 10,
  "Phase": 2,
  "Player1Map": {...valid data...}
  "Player2Map": {...valid data...}
}

Anomaly Matches

In some matches that game engine incorrectly views the player ships as incorrectly place causing a cascade failure for the rest of the game. More info described in this forum post.

Test Harnass bug - Player A and B

Hey guys, Just stumbled upon a slight bug, not sure if anyone has reported it yet.

When having my bots face each other (2 java bots with the same bot.json file). I noticed that the log printed out for both player 1 and player 2 were exactly the same. I would hit a ship and my board state will not even see it. My bot behaves in a certain way once it hits a target. What I noticed was. My bot randomly broke when I copied my bot into a secondary directory to have it face itself. My launch command is as follows:

Battleships.exe -b "..\Reference Bots\C#" "..\Reference Bots\bot1" --clog --pretty --debug --size 3

So in both those folders the same bot exists. What happened was. My bot1 analyzed the board as if it had bot C#'s board state.

The moment I change one bot's bot.json files so that they arent the same everything works normally again. So there seems to be some kind of issue. I can reproduce this if more information is needed.

Oddly enough. My map files differ for player A and B. Its just the content I print out into my log.txt files thats the same.

I am getting my map info from a simple call:
OpponentMap P2 = state.OpponentMap;
ArrayList P2M = P2.Cells;

As player B this call returns my own board state instead of the opponents which should be the case. I cannot say if this bug is in the game harness or the reference bot itself. Unfortunately I working with unfamiliar languages so I could not identify the source of the bug. I just believe it could be a problem if two people (Against all odds) choose the same names and one bot is broken because of it.

Forum Post

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.