diff --git a/website/advanced_command_line.php b/website/advanced_command_line.php deleted file mode 100644 index 36eef4278..000000000 --- a/website/advanced_command_line.php +++ /dev/null @@ -1,62 +0,0 @@ - - - - - Environment Command Reference - - - - - - -
- -
- -
-

Environment Command Reference

- -

The Halite environment is responsible for running games between bots and outputting appropriate data and files upon the end of a game. The downloadable version is the same version used on the servers.

- -

- It may be passed a number of flags, including: -

    -
  • -d: allows the automatic input of the dimensions of the map. The following argument is expected to be a string containing the width and height (space-separated).
  • -
  • -t: disables timeouts for the duration of the game.
  • -
  • -q: turns on quiet output. Output will take the form of: -
      -
    • A line containing the replay file name, a space, and the map seed.
    • -
    • For n players in the game, n lines like so: playerID rank lastFrameAlive
    • -
    • A line of space separated playerIDs of the players that timed out.
    • -
    -
  • -
  • -s: provides the seed to the map generator. If this is not provided, it will use a time-based seed.
  • -
-

- -

Examples

-

To run your bot against itself on a 40 by 40 map with no timeouts, run: -

    -
  • Linux/macOS: ./halite -d “40 40” -t “python3 MyBot.py” “python3 MyBot.py”
  • -
  • Windows: .\halite.exe -d “40 40” -t “python3 MyBot.py” “python3 MyBot.py”
  • -
-

- - -

To run your python bot against a java bot (assuming it’s been compiled) on a 25 by 25 map with a predefined seed (2168), run: -

    -
  • Linux/macOS: ./halite -d “25 25” -s 2168 “python3 PythonBot.py” “java JavaBot”
  • -
  • Windows: .\halite.exe -d “25 25” -s 2168 “python3 PythonBot.py” “java JavaBot”
  • -
-

-
-
- -
- - - - - - - diff --git a/website/advanced_game_server.php b/website/advanced_game_server.php deleted file mode 100644 index 86a0239de..000000000 --- a/website/advanced_game_server.php +++ /dev/null @@ -1,108 +0,0 @@ - - - - - Game Server Reference - - - - - - -
- -
- -
- -

Game Server Reference

- -

Hardware

-

All compilation and game execution is done on AWS EC2 m3.medium servers running Ubuntu 16.04. They have the following specs: -

    -
  • 3.5 GB of RAM
  • -
  • ~10 GB of disk space
  • -
  • 1 CPU
  • -
-

- -

Sandbox

-

During compilation and games, players are run as unprivileged users in a sandbox which limits memory, processing power, execution time, disk space, and internet access. The sandbox is a docker container defined by this Dockerfile, running on top of Docker 1.6.2. If you think that there is an issue with the sandbox, please email us at halite@halite.io. - -

Compilation

-

Bot compilation is done using this autocompile script.

-

To facilitate the installation of custom software, we allow users to include an install script. If a file named install.sh exists in your submission, it is run as a bash script under the root user in a sandbox with internet access and 10 minutes of runtime. Bots may only read and write to their current directory, so all files that you want to be available at runtime must be installed locally. For more on using 3rd party libraries, click here.

-

- Your main file must be called MyBot. Your language is recognized using the file extension of your MyBot file. The appropriate file extensions for each language are: -

    -
  • Java - .java
  • -
  • Python - .py
  • -
  • C++ - .cpp and .h(pp)
  • -
  • C# - .cs
  • -
  • Rust - .toml (for your Cargo.toml) and .rs (for your Rust source)
  • -
  • Scala - .scala
  • -
  • Ruby - .rb
  • -
  • Go - .go
  • -
  • PHP - .php
  • -
  • JavaScript - .js
  • -
  • OCaml - .ml
  • -
  • Clojure - .clj
  • -
  • C - .c
  • -
-

- -

- The following compilers are used: -

    -
  • Java - javac 1.8.0_111
  • -
  • C++ - g++ 4.8
  • -
  • C# - mcs 4.6.1.0
  • -
  • Rust - rustc 1.10.0
  • -
  • Scala - scalac 2.10.4
  • -
  • C - gcc 4.8
  • -
-

- -

- The following build automators are used: -

    -
  • Rust - cargo 0.11.0
  • -
  • Clojure - lein 2.7.0
  • -
-

- -

- The following versions of each language are supported: -

    -
  • Java 8
  • -
  • Python 3.4.3
  • -
  • C++ 11
  • -
  • C# 6.0
  • -
  • Rust 1.10
  • -
  • Scala 2.10.4
  • -
  • Ruby 2.3.1
  • -
  • Go 1.6
  • -
  • PHP 7.0
  • -
  • Node.js (JavaScript) 7.1.0
  • -
  • OCaml 4.01.0
  • -
  • Clojure 1.8.0
  • -
-

- -

Games

-

Bots are given 250 MB of RAM and equal amounts of CPU.

-

Currently, 20x20, 25x25, 30x30, 35x35, 40x40, 45x45, and 50x50 games are run. Games may be 2-6 player.

-

Games are always run using the most recent environment build.

-

-
-
- -
- - - - - - - - diff --git a/website/advanced_replay_file.php b/website/advanced_replay_file.php deleted file mode 100644 index 4be5b0a2c..000000000 --- a/website/advanced_replay_file.php +++ /dev/null @@ -1,54 +0,0 @@ - - - - - Replay File Reference - - - - - - -
- -
- -
-

Replay File Reference

- -

Overview

- -

A Halite replay file is a JSON object which describes what occurred during the game. Halite replay files are easy to parse and reasonably compact (and extremely compact when compressed), making them ideal for both using machine learning on Halite as well as sharing interesting games. The extension .hlt is used to distinguish Halite replay files.

- -

Detailed Specification

- -

A Halite replay file contains only a single JSON object. This object has the following attributes: -

    -
  • version - Describes the version of the replay file. The present version is 11, which is expected to be stable for a while.
  • -
  • width - A positive integer representing the width of the map.
  • -
  • height - A positive integer representing the height of the map.
  • -
  • num_players - A positive integer of at least 2 representing the number of players taking part in the game.
  • -
  • num_frames - The number of frames encoded in this replay.
  • -
  • player_names - An array of strings which correspond to the names of the players, starting with the player with tag 1 and ending with the player with tag num_players.
  • -
  • productions - A 2D array of integers which represent the productions of the tiles on the map. These integers fill in the map from row 1 (i.e. the top) to row height and within a row from column 1 to column width and are all guaranteed to be positive and less than 255. -
  • frames - A 4D arrays of integers. This is the most complex piece of the file specification, so here it is step by step: -
      -
    • The outermost array has length num_frames, and it contains individual frames.
    • -
    • The next array inwards has length height, and it contains individual rows of the frame. The first element is the first (top) row and the last is the bottom row.
    • -
    • The following array has length width, and it contains individual sites of the frame. The first element is the first (leftmost) column and the last is the rightmost row.
    • -
    • The innermost array has length 2 and contains integers. Its contents represent the attributes of a given site. The first element is always the owner of the site and the second element is the strength of the site.
    • -
  • -
  • moves - A 3D arrays of integers. The outermost array has length num_frames - 1 and contains the moves for an individual frame. Each element is a 2D array of integers which represent the directions chosen to move for every site on the map. As always, the outer layer of the 2D array fills in the rows from top to bottom and the inside layer fills in individual rows from left to right. The integer values for each site are: STILL = 0, NORTH = 1, EAST = 2, SOUTH = 3, and WEST = 4. Sites not owned by any player are assigned the value of 0.
  • -

- -
-
- -
- - - - - - - diff --git a/website/advanced_writing_sp.php b/website/advanced_writing_sp.php deleted file mode 100644 index 228b8fdf3..000000000 --- a/website/advanced_writing_sp.php +++ /dev/null @@ -1,124 +0,0 @@ - - - - - Writing Your Own Starter Package - - - - - - -
- -
- -
-

Writing Your Own Starter Package

- -

API Design

- -

Please try to generally adhere to the API used in the Java, Python, and C++. This is as follows: -

    -
  • Global Functions -
      -
    • getInit
    • -
    • sendInit
    • -
    • getFrame
    • -
    • sendFrame
    • -
    -
  • -
  • Classes/Structs -
      -
    • Map
    • -
    • Location
    • -
    • Site
    • -
    • Move
    • -
    -
  • -
  • Constants -
      -
    • the directions - NORTH, EAST, SOUTH, WEST, STILL
    • -
    -
  • -
-

Of course, if changes to this API will make the starter package fit more nicely into your language, feel free to make them. A Java API will not translate directly into Lisp nicely.

- -

Networking Overview

- -

Bots communicate with the environment via stdin and stdout using series of space separated integers. There are two stages of communication - initialization and turn formats, and these are detailed below.

- -

Initialization

- -

At the beginning of the game, bot is sent the following, with each item newline-terminated: -

    -
  1. A single integer representing their own tag within the game.
  2. -
  3. Two integers representing the WIDTH and HEIGHT of the map.
  4. -
  5. The production map.
  6. -
  7. The initial game map.
  8. -
- -

Every bot is expected to respond with a string representing their name (newline-terminated) within fifteen seconds.

- -

Turn

- -

Every turn, every bot is sent the the present game map (newline-terminated). Every bot is expected to respond with a set of moves (newline-terminated) within one second.

- -

Networking Specifics

- -

Input Game Map Format

- -

The state of the map (including owner and strength values, but excluding production values) is sent in the following way: -

    -
  • One integer, COUNTER, representing the number of tiles with the same owner consecutively.
  • -
  • One integer, OWNER, representing the owner of the tiles COUNTER encodes.
  • -
-

The above repeats until the COUNTER total is equal to the area of the map. It fills in the map from row 1 to row HEIGHT and within a row from column 1 to column WIDTH. Please be aware that the top row is the first row, as Halite uses screen-type coordinates.

-

This is then followed by WIDTH * HEIGHT integers, representing the strength values of the tiles in the map. It fills in the map in the same way owner values fill in the map.

-

Consider the following 3x3 map as an example (where [O=x,S=y] represents a tile owned by player x with strength y):

[O=0,S=122] [O=1,S=25] [O=1,S=18]
-[O=0, S=13] [O=0,S=45] [O=1,S=22]
-[O=2,S=255] [O=2,S=85] [O=0, S=0]
-

This map would be encoded using the following string: -

1 0 2 1 2 0 1 1 2 2 1 0 122 25 18 13 45 22 255 85 0
- -

Input Production Format

- -

The production values of the map are sent using WIDTH * HEIGHT integers which fill in the production values of the map from row 1 to row HEIGHT and within a row from column 1 to column WIDTH -Consider the following 3x3 production map as an example (where [x] represents a tile with x production):

[2][3][4]
-[1][2][3]
-[0][1][2]
-

This map would be encoded using the following string:
-

2 3 4 1 2 3 0 1 2
- -

Output Move Set Format

- -

Bots should send their moves as a list of integers in sets of 3. In each set, every first integer is the x location (starting at 0) of the site the bot desires to move, every second integer is the y location (starting at 0) of the site the bot desires to move, and every third integer is the direction the bot wishes to move the site in. The order of the sets does not matter.

- -

Valid directions include: -

    -
  • 0 - STILL
  • -
  • 1 - NORTH
  • -
  • 2 - EAST
  • -
  • 3 - SOUTH
  • -
  • 4 - WEST
  • -
-

Please note that these directions correspond most directly to screen coordinates; that is, NORTH decrements the y value of the site by 1 and SOUTH increments the value by 1. Attempts to move nonexistent or enemy pieces or to move pieces in nonexistent directions will be ignored. If multiple separate moves are issued for the same piece, the lower direction value will be preferred.

-

Consider the following case as an example:
I wish to order a piece located at (3, 4) to move EAST, a piece located at (4, 0) to remain STILL, and a piece located at (4, 5) to move NORTH.
This would be encoded with the following string:

3 4 2 4 0 0 4 5 1

- -

Note: if you would like an alternate way of communicating with the environment, please see a future post on the forums for how to communicate with the environment over sockets instead of pipes if you need to use a debugger or similar to work on your bot.

- -

Submitting Your New Starter Package

- -

Fork our repo, place your starter package in the airesources/ folder, and send us a pull request! If we accept your PR, your starter package will be added to the site.
Note: please include the runGame.sh and runGame.bat scripts (each run a 30 by 30 game between MyBot and RandomBot) and the MyBot and RandomBot files (both just random bots).

- -
-
- -
- - - - - - - diff --git a/website/basics_faqs.php b/website/basics_faqs.php deleted file mode 100644 index e6e74b39f..000000000 --- a/website/basics_faqs.php +++ /dev/null @@ -1,91 +0,0 @@ - - - - - FAQs - - - - - - -
- -
- -
-

Frequently Asked Questions

- -

About

- -

What is Halite?

-

Halite (the game) is a multiplayer turn-based strategy game played on a rectangular grid; the objective of the game is to take over the entire grid and eliminate the other players in the game.
Halite (the tournament) is an online programming competition where human coders write bots that play the Halite game against each other.

- -

Where does the game come from? Who invented it?

-

The Halite game was created by Benjamin Spector and Michael Truell during a summer internship at Two Sigma in 2016.
The game format is inspired by the 2011 Ants AI Challenge sponsored by Google.

- -

Why did you invent it?

-

Halite’s creators heard about the Ants AI Challenge a few years too late :-(
They couldn’t find any other competitions quite like it, so they decided to create one.

- -

About the Tournament

- -

What's the goal of the competition?

-

The goal of Halite is to provide a fun and deep testbed to try new ideas and compete in problem-solving. Furthermore, Halite is being used for recruitment of talent by its sponsors.

- -

Who is running the tournament?

-

The Halite game has been designed and implemented by Two Sigma, a highly-innovative, technological investment firm based in New York City.
The Halite tournament is jointly run with Cornell Tech, a new graduate school that brings together faculty, business leaders, tech entrepreneurs, and students in a catalytic environment to produce visionary results grounded in significant needs that will reinvent the way we live in the digital age.

- -

How long is the tournament?

-

The tournament will run from November 2, 2016 to February 2, 2017.

- -

How are rankings computed?

-

Rankings are based on the outcome of organized games where bots play against each other. A good analogy is the Elo rating system used for chess.
More precisely, rankings are computed using a Bayesian algorithm variant of the Glicko system, specifically using the TrueSkill Python library available here.

- -

How are the winners decided?

-

Winners are simply the highest ranked players on the leaderboard at the end of the competition. So, submit early and often!

- -

Is there a prize for the winners?

-

Pride! Bragging rights! Internet royalty!
The results of the competition will be officially announced with a link to best players Github profiles.

- -

What information do you store about me?

-

We store the email, username, and unique identifier that Github provides when you login to the halite.io website via Github OAuth.

- -

How do you determine my organization?

-

We check to see if the domain of the email associated with your Github account is on our whitelist.

-

Is your organization not on there? Edit the whitelist and send us a pull request! We'll make sure to tag all members of your organization who have already signed up.

- -

Bot Programming

- -

Do I need to be a programmer to play the game?

-

Yes. Halite is a programming competition. You need to program a bot that will play the game in the Halite tournament.
However, you definitely don’t have to be a very good programmer to play Halite effectively. Success is more about coming up with a good strategy to play the game than coding this strategy expertly.

- -

What languages does the game support?

-

Any and all! If the language can read from stdin and print to stdout, we can support it.
We provide out-of-the-box starter packages for the following languages: Python, Java and C++. See here for our growing list of starter packages.
We’re counting on the community to add support for as many languages as people want. Visit this page for more information on writing your own starter package and the protocol used by the game environment to talk to your bot. - -

How do I submit my bot?

-

To submit your bot, you'll first need to zip your source code. Then, after signing in, click the "Submit" button on the top-right part of the page. Then, simply select your zipped source code to submit.

- -

The Code behind the Tournament

- -

Is the code open source?

-

Yes.
Check out our Github repo and you are also welcome (even encouraged) to open issues and/or submit pull requests.

- -

How do I contribute to the game and/or report an issue?

-

You can open an issue or submit a pull request on our Github Repo. If you are looking for things to do, checkout our open issues.

- -

Other

- -

I cannot find an answer to my question, what do I do?

-

Please check/post on the Halite forums or contact-us at halite@halite.io. - -

-
- -
- - - - - - - diff --git a/website/basics_improve_random.php b/website/basics_improve_random.php deleted file mode 100644 index 4f513c2d9..000000000 --- a/website/basics_improve_random.php +++ /dev/null @@ -1,96 +0,0 @@ - - - - - Improving the Random Bot - - - - - - -
- -
- -
-

Improving the Random Bot

-

In this tutorial, we'll go through the code that powers the random bot and add a couple heuristics to it. This will hopefully help you fully understand Halite and set you on your way to leaderboard domination.

- -

The code in this tutorial can be found at the following links for Python, Java, and C++.

-

Prerequisites

-

Make sure that you have read Introducing Halite and followed the setup procedures described there.

-

Now open up the MyBot file in your favorite editor and let's get started!

- -

Import Considerations

-

When writing a halite bot, be sure to stay away from functions like System.out.print, cout, print, etc. Bots use stdout and stdin to communicate with the game environment. You will be ejected from a game of Halite if you print debugging info to stdout. Instead, print to a log file.

- -

A Look At the Random Bot

-

Now that you know how the game works, how do the two random starter bots work? How does one code a Halite bot? Here is the source from the main file of our python starter bot:

- -

Let's walk through it line by line.

- -

First we import a couple of helper files that are included in the starter packages:

- - - -

Then we get our ID (each player has a unique identifier that is associated with their pieces) and the game initial map from the environment.

-

We send back the name of our bot. This is used in game replays.

- - - -

Now we start our game loop. Each frame let's initialize a list of moves and get the current map:

- - -

Let's cycle through all of the pieces on the map. If a piece is owned by us, let's order it to move in a random direction.

- - - -

Finally, let's send all of our moves to the environment:

- - - -

And that's random bot!

- -

Utilizing Our Production

- -

From the rules outlined in Introducing Halite, we know that when a piece moves, it gains no strength and leaves behind a piece with zero strength. It easily follows from this that moving zero strength pieces is a terrible idea, since:

-
    -
  • A zero strength piece that moves will necessarily stay at zero strength, because pieces don't gain strength for any turn that they move.
  • -
  • A zero strength piece won't ever conqueror any territory, because it has no strength with which to damage other pieces.
  • -
-

Let's wrap the movement logic inside a function of its own. This function will take the location of a piece and will return the piece's movement.

-

Now we can improve our bot by making sure that we tell all of our zero strength pieces to remain still.

- - -

Our bot still moves its pieces around a lot (only a bit over one out of five turns will a piece stay still). This costs us a lot of strength (since a piece doesn't gain any strength on turns that it moves). To increase our utilization of our production, let's have pieces only move once their strength equals their production times some factor X. We're using 5 as the value of X in this example, but this is arbitrary.

- - -

Moving to Our Borders

-

When building a Halite bot, one of our goals should be moving strength out of your territory quickly and with little production loss. Our current bot is terrible at this. Its pieces move randomly around our territory, going nowhere, costing us production, and often losing strength to the strength cap.

-

To improve this, let's just mandate that our pieces move only north and west. Since the map is wrap-around, we can still capture all of the board with this strategy!

- - -

Improving our Attack

-

Once our pieces get to our borders, we don't want them to randomly attack just any square (or worse, move back into our territory), as we do now. One problem with this random strategy is that we may attack a map square that has more strength than us. This is unproductive (pun implied) since moving onto the map square costs us a turn of production and we don't actually gain anything. We just diminish the squares strength.

-

To improve on our current combat, if there is an enemy or map square that is adjacent to one of our pieces with less strength than our piece, let's take it.

- - -

What Next?

-

That's really up to you! How you improve your bot from here is where you step into the competition.

-

That said, if you're looking for more ideas or a stronger starting base, nmalaguti wrote a tutorial here that we highly recommend.

-

Good luck!

- -
-
- -
- - - - - - - - - diff --git a/website/basics_intro_halite.php b/website/basics_intro_halite.php deleted file mode 100644 index 6b8ab89b2..000000000 --- a/website/basics_intro_halite.php +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Introducing Halite - - - - - - -
- -
- -
-

Introducing Halite

-

In the last tutorial, we showed how to submit a demo bot to the leaderboard. In this short tutorial, we will go over the files included in a starter package, running a game of halite, and the rules of halite.

-

A look at the starter package

-

Your starter package should contain these files.

- - - - - - - -
FilenameDescription
MyBotYour main file. Starts containing the code for a random bot.
RandomBotA random bot to test changes to your bot against.
runGame.shScript to run a game on Linux/macOS
runGame.batScript to run a game on Windows. Assumes halite.exe is in the same folder.
- -

The file you need to change is MyBot. Regardless of what you do with your code, MyBot will be considered your main file on our game servers.

- -

Testing your bot

-

To play games of Halite locally, you will need the game environment. As of this writing we support Windows, Linux and OSX platforms. You can download the game environment here. Place the downloaded binary (halite or halite.exe) in your starter kit folder.

-

To simulate a game, simply runGame.sh (Linux and macOS) or runGame.bat (Windows). This command will run a game between my MyBot and RandomBot (both are just copies of each other at this point) on a grid of size 30x30.

-

The output should look like this and the details of the game will be stored in a file with the "hlt" extension (35538-124984302.hlt in the example below).

- -
$ . runGame.sh 
-python3 MyBot.py
-python3 RandomBot.py
-Init Message sent to player 2.
-Init Message sent to player 1.
-Init Message received from player 1, MyPythonBot.
-Init Message received from player 2, RandomPythonBot.
-Turn 1
-Turn 2
-Turn 3
-Turn 4
-…
-Turn 299
-Turn 300
-Map seed was 124984302
-Opening a file at 35538-124984302.hlt
-Player #1, MyPythonBot, came in rank #1!
-Player #2, RandomPythonBot, came in rank #2!
- - -

Visualizing a game

-

The console output from the game environment gives just the outcome of the game. To replay the game, drag and drop the file to the visualizer to get a visualization like this one:

-
- -

Halite game rules

-

What do all of these pretty squares mean?

-

Halite is played on a rectangular grid. Players own pieces on this grid. Some pieces are unowned and so belong to the map until claimed by players. Each piece has a strength value associated with it.

-

At each turn, bots decide how to move the pieces they own. Valid moves are: STILL, NORTH, EAST, SOUTH, WEST. When a piece remains STILL, its strength is increased by the production value of the site it is on. When a piece moves, it leaves behind a piece with the same owner and a strength of zero.

-

When two or more pieces from the same player try to occupy the same site, the resultant piece gets the sum of their strengths (this strength is capped at 255).

-

When pieces with different owners move onto the same site or cardinally adjacent sites, the pieces are forced to fight, and each piece loses strength equal to the strength of its opponent. When a player's piece moves onto an unowned site, that piece and the unowned piece fight, and each piece loses strength equal to the strength of its opponent.

-

When a piece loses all of its strength, it dies and is removed from the grid.

- -

How do we program a bot?

-

Move on to Improving the Random Bot.

-
-
- -
- - - - - - - - diff --git a/website/basics_quickstart.php b/website/basics_quickstart.php deleted file mode 100644 index 68520512c..000000000 --- a/website/basics_quickstart.php +++ /dev/null @@ -1,54 +0,0 @@ - - - - - Getting Started - - - - - - -
- -
- -
-

Getting Started

-

In this short tutorial, we will explain how to submit your first bot and get your name on the Halite leaderboard.

- -

Register using Github

- -

You will need a Github account in order to participate in the Halite tournament. If you don't have a Github account, please create a new account here. Sign up for Halite by clicking "Login with Github" at the top right of this page.

- -

Download a Starter Package

- -

Download a starter package for your language of choice from the downloads page.

- -

Each starter package consists of a zip file that includes: (a) one code template for your your first bot (the MyBot file), (b) one code sample for a random bot (the RandomBot file), (c) some support libraries for the bot and (d) some tools to test your bot locally.

- -

Getting on the Leaderboard

- -

To get on the leaderboard, you need to submit a bot to the Halite tournament.

-

Click the "Submit" button in the navigation bar. In general, you need to package your submission as a zip file that contains everything needed to run your bot (your bot’s source code, starter package source files, supplemental libraries, etc.). For your first submission, you can simply upload the zipped starter package that you just downloaded. You will receive an email notification that your submission has been received.

-

The Halite servers will compile the source code of your submission and continuously play your bot against other contestants, which will generate your leaderboard ranking. If the compilation of your source code fails, we will email you.

-

To track your bot's progress, navigate to your homepage.

- -

Next Steps

-

Congratulations. You are now an official contestant!

-

It may be up to 10 minutes before your bot has played a few games. In the meantime, move onto Introducing Halite.

- -

Need Help? Have Feedback? Want to Talk?

-

Please post on the forums. For more unstructured conversations, join our discord.

-
-
- -
- - - - - - - - diff --git a/website/bot_overview.php b/website/bot_overview.php new file mode 100644 index 000000000..207010cc2 --- /dev/null +++ b/website/bot_overview.php @@ -0,0 +1,32 @@ + + + + + <?php echo ucwords(str_replace('_', ' ', basename(__FILE__, '.php'))); ?> + + + + + + + +
+ +
+ +
+

+ text(file_get_contents(__DIR__ . "/learn/bot/a_bots_life.md")); ?> +
+
+ +
+ + + + + + + + + diff --git a/website/composer.json b/website/composer.json index e8245069e..4383e9327 100644 --- a/website/composer.json +++ b/website/composer.json @@ -2,6 +2,7 @@ "require": { "lusitanian/oauth": "~0.3", "swiftmailer/swiftmailer": "^5.4.3", - "aws/aws-sdk-php": "^3.19" + "aws/aws-sdk-php": "^3.19", + "erusev/parsedown": "^1.6.1" } } diff --git a/website/developing_a_bot.php b/website/developing_a_bot.php new file mode 100644 index 000000000..1ddafa844 --- /dev/null +++ b/website/developing_a_bot.php @@ -0,0 +1,38 @@ + + + + + <?php echo ucwords(str_replace('_', ' ', basename(__FILE__, '.php'))); ?> + + + + + + + +
+ +
+ +
+

+ text(file_get_contents(__DIR__ . "/learn/developing/local_development_environment.md")); ?> + text(file_get_contents(__DIR__ . "/learn/developing/submitting_a_bot.md")); ?> +
+
+ +
+ + + + + + + + + + + + + + diff --git a/website/faqs.php b/website/faqs.php new file mode 100644 index 000000000..805f1346d --- /dev/null +++ b/website/faqs.php @@ -0,0 +1,32 @@ + + + + + <?php echo ucwords(str_replace('_', ' ', basename(__FILE__, '.php'))); ?> + + + + + + + +
+ +
+ +
+

FAQs

+ text(file_get_contents(__DIR__ . "/learn/faqs.md")); ?> +
+
+ +
+ + + + + + + + + diff --git a/website/game_overview.php b/website/game_overview.php new file mode 100644 index 000000000..b077a1f3d --- /dev/null +++ b/website/game_overview.php @@ -0,0 +1,44 @@ + + + + + <?php echo ucwords(str_replace('_', ' ', basename(__FILE__, '.php'))); ?> + + + + + + + + +
+ +
+ +
+

+ text(file_get_contents(__DIR__ . "/learn/game/what_is_halite.md")); ?> + text(file_get_contents(__DIR__ . "/learn/game/game_rules.md")); ?> +
+
+ +
+ + + + + + + + + + + + + + diff --git a/website/guides_development.php b/website/guides_development.php deleted file mode 100644 index d85681951..000000000 --- a/website/guides_development.php +++ /dev/null @@ -1,42 +0,0 @@ - - - - - Bot Development Guide - - - - - - -
- -
- -
-

Bot Development Guide

-

In this guide, we will detail a couple of useful practices to follow when building your Halite bot.

-

Using a Log File

-

Stdout and stdin in are used to communicate with the game environment. As such, you cannot use functions like System.out.println, print(), or std::cout. Instead, print debugging information to a log file.

-

Local Bot Evaluation

-

Before submitting a new bot to the online leaderboard, we recommend running some games against the version of your bot that is currently on the leaderboard. If your new bot consistently wins, then put it up!

-

Disabling the Timeout Flag

-

When debugging latency issues with your bot, it can be helpful to disable game environment timeouts. To do so, append the -t flag to your environment command (e.g. ./environment -d "30 30" "python3 MyBot.py" "python3 RandomBot.py" -t).

-

Understanding Game Logs

-

When your bot times out or errors on our game servers, we save and display a log file with debugging information including the time your bot took each turn, its output each turn, and its final output from stdout and stderr.

-

To find these log files, visit your homepage: https://halite.io/user.php. Just click the download log button to grab your error log for a game:

-

Debugging with an IDE

-

There is a community contributed method for running a Halite bot from a custom debugger locally. More on this can be found here on the forums.

-
-
- -
- - - - - - - - - diff --git a/website/guides_libraries.php b/website/guides_libraries.php deleted file mode 100644 index 8a3892d53..000000000 --- a/website/guides_libraries.php +++ /dev/null @@ -1,51 +0,0 @@ - - - - - Using 3rd Party Libraries - - - - - - -
- -
- -
-

Using 3rd Party Libraries

-

If you add a bash file named install.sh to the same directory as your bot source, it will be run with internet access and write access to its current directory before any bot compilation. It may run for a maximum of 10 minutes.

- -

Package Managers

-

You must install all libraries locally, even if through a package manager. Because of this, package managers that only support global installation (such as apt-get) may not be used.

-

The following package managers are installed ahead of time on the Halite game servers:

-
    -
  • pip3
  • -
  • bundler
  • -
  • npm
  • -
-

- If you would like us to add another package manager to this list, post on the forums. -

- -

Here is an example install.sh file for a bot that uses the numpy library:

- -

It's just one line!

- -

Compilation

-

If your library isn't on a package manager that supports local installation, you are going to have to compile it on our game servers. Include the source of you library in your bot's zip file and put compilation instructions in the install.sh file.

-
-
- -
- - - - - - - - - - diff --git a/website/guides_strategy.php b/website/guides_strategy.php deleted file mode 100644 index 4167b79e3..000000000 --- a/website/guides_strategy.php +++ /dev/null @@ -1,60 +0,0 @@ - - - - - Strategy Considerations - - - - - - -
- -
- -
-

Strategy Considerations

-

In this short tutorial, we describe how to evaluate the position of player during a game, how to think about combat and remind the reader of a few subtleties of the game.

- -

Evaluating a player's position in Halite

-

Just like for other board games like Chess or Go, not all Halite positions (i.e. the game state) are equally valuable. For a given player, there are 3 components which are most important in defining the quality of their position. These are: -

    -
  • Territory - the number of sites of the map which the player controls.
  • -
  • Production - the sum of the productions of the sites of the map which the player controls.
  • -
  • Strength - the sum of the strengths of the sites of the map which the player controls.
  • -
- Let's go over each of these in a bit more detail.

- -

Territory

-

Territory is the measure of how close a player is to winning the game, since the goal of the game is to capture the full grid.
The ultimate goal of a player should be focused on maximizing its own territory and minimizing the territory of other players.
Simply controlling a lot of territory is not enough to give a player a high degree of certainty of winning, as the other characteristics (production and strength) can be just as influential in determining the outcome of a game, but controlling territory can also provide subtle advantages to a player which will be outlined later.

- -

Production

-

Production is the measure of a player's capacity to produce new strength.
It tends to determine the long-term outcome of a player's position, as a player with a high total production can often just wear down other players in a war of attrition and then take their territory once their strength is reduced to zero.

- -

Strength

-

Strength is the measure of a player's capacity to immediately capture new territory.
It tends to determine the short-term outcome of a player's position, as a player with a high total strength can immediately attack and take new territory.
Players should note that the placement of this strength is relevant; strength in the center of a player's territory cannot be utilized nearly as quickly as strength near the border.

- -

Combat Guide

-

In Halite, a single piece can deal damage to as many as 4 other pieces simultaneously, this means that it can output up to 4 times its own strength in damage. This single principle (we call it `overkill`) is at the core of Halite tactics.

- -

Minor Characteristics

-

This is a short (and far from complete) list of some less-important but still valuable characteristics of the game to be aware of when playing Halite. -

    -
  • Perimeter to area ratio: A player with a high perimeter to area ratio will be able to move newly produced strength to borders more quickly and with less waste than a player with a low ratio, but may also be more vulnerable to attack.
  • -
  • Not all production is created equal: High-production zones located directly between spawn points may be a source of contention for players on many-player games. High-production zones nestled deep inside already-controlled territory may be more valuable because they are much more difficult to attack. However, production further from a border takes longer to move to combat regions and so may also be wasted on large maps.
  • -
  • Strength found near a specific border may be useful in strengthening that border from assault, but will consequently take longer to move to another border if that border comes under heavy assault.
    Also remember that pieces have their strength capped at 255; if a player moves their pieces too often, they'll waste possible production (since sites do not produce when moving), but if they don't move often enough, they'll be forced to combine pieces with too high a strength and lose strength to the 255 cap. This can be very difficult to optimize well, and many players lose a significant amount of their production to this effect.
  • -
-
-
- -
- - - - - - - - - diff --git a/website/includes/dropdowns.php b/website/includes/dropdowns.php index 05daedc7d..4c8fdc17d 100644 --- a/website/includes/dropdowns.php +++ b/website/includes/dropdowns.php @@ -1,5 +1,5 @@
  • - Learn + Learn
  • Download @@ -15,4 +15,4 @@
  • About -
  • \ No newline at end of file + diff --git a/website/includes/learn_sidebar.php b/website/includes/learn_sidebar.php index 5e945e42b..339e3a607 100644 --- a/website/includes/learn_sidebar.php +++ b/website/includes/learn_sidebar.php @@ -25,19 +25,20 @@ } /* active & hover links */ - .bs-docs-sidebar .nav>.active>a, - .bs-docs-sidebar .nav>li>a:hover, + .bs-docs-sidebar .nav>.active>a, + .bs-docs-sidebar .nav>li>a:hover, .bs-docs-sidebar .nav>li>a:focus { - text-decoration: none; - background-color: transparent; + text-decoration: none; + background-color: transparent; + border-left-color: #63ceca; } /* nested active links */ - .bs-docs-sidebar .nav .nav>.active>a, + .bs-docs-sidebar .nav .nav>.active>a, .bs-docs-sidebar .nav .nav>.active:hover>a, .bs-docs-sidebar .nav .nav>.active:focus>a { font-weight: 700; - border-left-color: #63ceca; + border-left-color: #63ceca; font-weight: 500; } @@ -45,65 +46,85 @@