entelectchallenge / 2017-battleships Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Starting energy is always 3, should be 2,3,4 for small,medium and large maps respectively.
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); }
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?
Ship placement bug as described in this forum post
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.
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,
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.
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
Forum post 191 reported an issue where the points don't add up when sinking all enemy ships.
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.
I've created a PR #25 that implements rebuilding of DotNet and Golang bots before each match.
Example usage:
mono Battleships.exe -b $(SAMPLEBOTHOME)/Java/SampleBot $(SAMPLEBOTHOME)/Golang --clog --pretty --debug --forceRebuild
As described in this forum post.
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
Hi
I notice you have fixed the spelling of ShipsRemaing to ShipsRemaining in the state.json.
Can you maybe please also fix in on this line when you have a moment:
https://github.com/EntelectChallenge/2017-Battleships/blob/master/Sample%20Bots/Scala/SampleBot/src/main/scala/za/co/sample/GameMapParser.scala#L36
If you do not mind, I would prefer not to go through the whole process to generate a pull request for two characters.
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
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!
When I ran the RunGame.bat for some reason the program gives an index error.
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.
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...}
}
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.