Towards #1797 Hosts an online repository of scenarios, against which solutions may be submitted. This is the foundational layer that may support more structured "tournaments", scenario ranking, or other social activity. # Demo ## Live server http://swarmgame.net/list-games.html One can use the [`submit.sh`](https://github.com/swarm-game/swarm/pull/1798/files#diff-450877e3442a0ec1c5cbe964808a263d67f1e680d3aa3c3bf9ae6f51eca682fb) script and see valid uploads reflected live on the website. ## Local testing ### Automated tests These are database-agnostic. scripts/run-tests.sh swarm:test:tournament-host ### Manual tests These test database interactions. It requires first setting up a local Postgres server. 1. Start `tournament/scripts/demo/server-native.sh` in one console 2. Run `tournament/scripts/demo/client/test-cases/local/good-submit.sh` in another # Features * Upload and validates scenarios * Download scenarios with solution redacted * Submit, validate, execute, and score solutions # Key components * Servant server * Hosted on AWS in a Docker container * Stores to a Postgres database in Amazon RDS * Shares some code with the integration tests for evaluating scenarios and solutions The production database uses IAM to manage logins. The web app uses the AWS API to fetch a "token" which can be used to log in instead of a password. This avoids having to store a password on the server. # TODO - [ ] User authentication (GitHub OpenID?) |
||
---|---|---|
.github | ||
.vscode | ||
app | ||
data | ||
docs | ||
editors | ||
example | ||
images | ||
scripts | ||
src | ||
test | ||
tournament | ||
web | ||
.gitignore | ||
.hlint.yaml | ||
.mergify.yml | ||
.restyled.yaml | ||
.stan.toml | ||
cabal.haskell-ci | ||
CHANGELOG.md | ||
CODE_OF_CONDUCT.md | ||
COMMUNITY.md | ||
CONTRIBUTING.md | ||
cspell.json | ||
DESIGN.md | ||
feedback.yaml | ||
fourmolu.yaml | ||
hie.yaml.stack | ||
LICENSE | ||
NOTICE | ||
pull_request_template.md | ||
README.md | ||
scenarios | ||
stack.yaml | ||
swarm.cabal |
Swarm
Swarm is a 2D programming and resource gathering game. Program your robots to explore the world and collect resources, which in turn allows you to build upgraded robots that can run more interesting and complex programs. More info can be found on the Swarm website.
Contributing
See CONTRIBUTING.md for information about various ways you can contribute to Swarm development!
Building
If you just want to play the game, head over to the Swarm website for installation instructions. If you want to build Swarm from source (e.g. in order to contribute, or to test out the latest bleeding-edge unreleased features), read on.
-
Clone the Swarm repository, e.g.
git clone https://github.com/swarm-game/swarm.git
-
If you don't already have the
stack
tool:-
Get the
ghcup
tool, a handy one-stop utility for managing all the different pieces of a Haskell toolchain. -
Use
ghcup
to installstack
:ghcup install stack
-
-
Now use
stack
to build and run Swarm:cd /path/to/the/swarm/repo stack run
-
Go get a snack while
stack
downloads a Haskell compiler and all of Swarm's dependencies. -
You might also want to check out the
scripts
directory, which contains an assortment of useful scripts for developers.