Coder Social home page Coder Social logo

grassjedi / 2015-spaceinvaders-testharness Goto Github PK

View Code? Open in Web Editor NEW

This project forked from entelectchallenge/2015-spaceinvaders-testharness

0.0 1.0 0.0 164 KB

The test harness for the 2015 Entelect R100K challenge.

License: GNU General Public License v2.0

C# 99.74% Shell 0.10% Batchfile 0.16%

2015-spaceinvaders-testharness's Introduction

2015 Space Invaders Test Harness

The current release of the test harness is version 1.0.2.

For more information about the challenge see the Challenge website .

The purpose of this project to allow contestants to test their bots on their local machines. The test harness contains the logic for processing moves and running a match between two bots. This project can also be used to get a better understanding of the rules and to help debug your bot.

Improvements and enhancements may be made to the test harness code overs time, but the rules should remain stable.

The test harness has been made available to the community for peer review and bug fixes, so if you find any bugs or have any concerns, please e-mail [email protected], discuss it with us on the Challenge forum or submit a pull request on Github.

Usage

The easiest way to start using the test harness is to download the binary release zip. You will also need the .NET framework if you don't have it installed already - you can get the offline installer for .NET Framework 4.5.1 here.

Once you have installed .NET and downloaded the binary release zip file, extract it and open a new Command Prompt in the test harness folder.

We have bundled the compiled C# sample bot with the harness in the player1 and player2 folders, so at this point you could simply run SpaceInvadersDuel.exe to see two random bots play a match.

Once you have written your own bot you can override one of the player folders with your bot or you can use the command line arguments to specify the bots that should be run. You can see the available command line arguments by running SpaceInvadersDuel.exe --help:

SpaceInvadersDuel 1.0.3.0                                                     
Copyright c Microsoft 2015                                                    
                                                                              
  -o, --one          (Default: player1) Relative path to the folder containing
                     the player one bot                                       
                                                                              
  -t, --two          (Default: player2) Relative path to the folder containing
                     the player two bot                                       
                                                                              
  -r, --rules        (Default: False) Prints out the rules and saves them in  
                     markdown format to rules.md                              
                                                                              
  -q, --quiet        (Default: False) Disables console logging - logs will onl
                     be written to files.                                     
                                                                              
  -s, --scrolling    (Default: False) Forces scrolling console log output,    
                     which shouldn't crash when running the harness from      
                     another application.                                     
                                                                              
  -l, --log          (Default: ) Relative path where you want the match replay
                     log files to be output (instead of the default           
                     Replays/{matchNumber}).                                  
                                                                              
  --help             Display this help screen.                                

So for example you can do something like this to run your bot against the bundled example bot: SpaceInvadersDuel.exe -o ../mybot -t player2.

Compiling

The test harness is a C# project, so you will need to download and install Visual Studio Express 2013 if you intend to work on it.

Once you have installed Visual Studio, open the SpaceInvadersDuel.sln solution file at the root of the project and select Build -> Build Solution from the menus to compile the project. This should automatically fetch the library dependencies using NuGet.

Tests

We have written a number of automated tests to ensure that the game logic and rules have been implemented correctly - if you make any changes to the test harness you should run the tests to ensure that everything is still working correctly before submitting a pull request. The easiest way to run the tests is to select Test -> Run -> All Tests from the menu in Visual Studio.

If you add a new feature you should add tests to cover it. After compiling the project you can run the coverage report yourself as follows:

  • Open a new Command Prompt
  • Change to the project directory
  • cd SpaceInvadersTest\bin\Debug
  • coverage && report

Provided all the tests pass, you should find the coverage report in SpaceInvadersTest\bin\debug\coverage\index.html.

Release Notes

v1.0.3 - 22/05/2015

  • Bugs fixed:
    • Fixed alien randomness: both AlienManagers used separate Random classes with the same seed, so randomness was the same for both players (thanks AttieG.
    • Fixed application still crashing when not running a in a console (ScrollingLogger did a Console.clear() on creation).
  • Minor features:
    • Added a command line option to specify a folder that the replay should be put into (-l or --log).

v1.0.2 - 10/05/2015

  • Bugs fixed
    • Fixed some exceptions related to bot timeouts and killing the bot process (thanks Bernard Haeusermann)
    • Ship spawn logic now deducts a life before spawn / collision checking which could have caused the life not to be deducted if spawning on an alien or bullet (thanks Jansen du Plessis).
    • Aliens hitting the back wall now destroy the correct player (thanks Jansen du Plessis).
    • Improved tests for aliens hitting the back wall a bit.
    • Fixed run.sh newline characters and gave hints on installing dependencies (thanks Marius Kruger).
    • Got rid of compiler warnings (thanks Bernhard Haeusermann).
  • Minor features:
    • Added a command line option to force scrolling console logging (-s or --scrolling).
    • Added a command line option to disable console logging (-q or --quiet).

v1.0.1 - 24/04/2015

  • Bugs fixed:
    • A life is now deducted on ship spawning instead of player death which should give a consistent 1 ship & 3 lives, regardless of how they are used.
    • Player.CopyAndFlip now also copies the:
      • AlienFactory
      • MissileController (thanks to @leppie)
      • Ship
    • Should no longer crash if the terminal is too small to render the game - instead falls back on scrolling output.
    • Now correctly changes the process name to /bin/bash on Linux.
    • Fixed MoveNotOnMapException that sometimes happened when spawning aliens (thanks to @leppie).
  • Minor features:
    • On Linux the TestHarness will try to use run.sh instead of run.bat. Example files have been added to all sample bots and they will also be tagged as version 1.0.1.

v1.0.0 - 09/04/2015

Changelog:

  • Initial release.

Code coverage:

  • Line: 98%
  • Branch: 89.8%

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.