2021-08-30 01:27:41 +03:00
|
|
|
Swarm
|
|
|
|
=====
|
|
|
|
|
2022-10-06 01:52:52 +03:00
|
|
|
[![Build Status][build-status]][actions]
|
|
|
|
[![Contributor Covenant][badge-covenant]](CODE_OF_CONDUCT.md)
|
|
|
|
[![ircchat][badge-ircchat]][ircchat]
|
|
|
|
![GitHub Contributors][contribs]
|
|
|
|
|
|
|
|
[build-status]: https://github.com/swarm-game/swarm/actions/workflows/haskell-ci.yml/badge.svg
|
|
|
|
[actions]: https://github.com/swarm-game/swarm/actions
|
|
|
|
[badge-covenant]: https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg
|
|
|
|
[badge-ircchat]: https://img.shields.io/badge/chat-on%20libera-brightgreen.svg
|
|
|
|
[ircchat]: https://web.libera.chat/?channels=#swarm
|
|
|
|
[contribs]: https://contrib.rocks/image?repo=swarm-game/swarm
|
2021-09-19 21:40:47 +03:00
|
|
|
|
2021-08-30 01:27:41 +03:00
|
|
|
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
|
2022-09-24 22:13:04 +03:00
|
|
|
complex programs. Check out the [installation
|
|
|
|
instructions](https://github.com/swarm-game/swarm#installing) below,
|
|
|
|
join the [IRC channel](COMMUNITY.md), take a look at the
|
|
|
|
[wiki](https://github.com/swarm-game/swarm/wiki), or [see how you can
|
|
|
|
contribute](CONTRIBUTING.md)!
|
2021-08-30 01:27:41 +03:00
|
|
|
|
2021-11-07 18:03:20 +03:00
|
|
|
![World 0 after scanning a tree and making a log.](images/tutorial/log.png)
|
2021-08-30 01:43:52 +03:00
|
|
|
|
2022-09-17 18:28:13 +03:00
|
|
|
Features include:
|
2021-08-30 01:27:41 +03:00
|
|
|
|
2021-09-23 11:23:34 +03:00
|
|
|
* Practically infinite 2D procedurally generated worlds
|
2021-09-09 22:37:14 +03:00
|
|
|
* Simple yet powerful programming language based on the polymorphic
|
|
|
|
lambda calculus + recursion, with a command monad for describing
|
2021-08-30 01:27:41 +03:00
|
|
|
first-class imperative actions
|
2021-11-07 18:03:20 +03:00
|
|
|
* Editor support with LSP and highlighting
|
2022-06-04 21:36:45 +03:00
|
|
|
* In-game tutorial
|
2021-08-30 01:27:41 +03:00
|
|
|
* Multiple game modes:
|
|
|
|
- In Classic mode, you start with the ability to produce only very
|
|
|
|
basic, limited robots; collecting resources allows you to
|
|
|
|
bootstrap your way into programming more sophisticated robots
|
|
|
|
that can explore more of the world, collect more resources, etc.
|
2022-03-16 05:00:35 +03:00
|
|
|
- Creative mode places no restrictions: program robots to your
|
2021-08-30 01:27:41 +03:00
|
|
|
heart's content using whatever language features you want,
|
|
|
|
without worrying about collecting resources.
|
2022-06-04 21:36:45 +03:00
|
|
|
- There are also challenge scenarios where you attempt to program
|
|
|
|
robots in order to solve pre-designed puzzles or challenges.
|
2021-08-30 01:27:41 +03:00
|
|
|
|
2022-09-17 18:28:13 +03:00
|
|
|
Installing
|
|
|
|
==========
|
2021-08-30 01:27:41 +03:00
|
|
|
|
2022-09-18 15:04:33 +03:00
|
|
|
There will _soon_ be a release of Swarm on Hackage and in a binary form!
|
|
|
|
If you are interested in Haskell or functional programming, you can install
|
|
|
|
it from source (see below) or, once it is released, with the Cabal tool.
|
|
|
|
For instructions on how to install the binary directly, check the releases.
|
2022-09-17 18:28:13 +03:00
|
|
|
|
|
|
|
Installing from Source
|
|
|
|
----------------------
|
2021-08-30 01:27:41 +03:00
|
|
|
|
2021-09-25 02:04:42 +03:00
|
|
|
**NOTE**: Swarm requires a POSIX-style environment that supports
|
|
|
|
`terminfo`. On Linux and OSX, the below instructions should work
|
|
|
|
natively. On Windows, see [the comments on this GitHub
|
2022-03-14 22:09:47 +03:00
|
|
|
issue](https://github.com/swarm-game/swarm/issues/53) for instructions
|
2021-09-25 02:04:42 +03:00
|
|
|
getting it to work under the Windows Subsystem for Linux.
|
|
|
|
|
2022-09-17 18:28:13 +03:00
|
|
|
To install Swarm from source:
|
2021-08-30 01:27:41 +03:00
|
|
|
|
|
|
|
1. Clone the Swarm repository, e.g.
|
|
|
|
|
2022-03-14 22:09:47 +03:00
|
|
|
git clone https://github.com/swarm-game/swarm.git
|
2021-08-30 01:27:41 +03:00
|
|
|
|
2021-09-23 16:44:15 +03:00
|
|
|
1. If you don't already have the `stack` tool:
|
2021-09-25 02:04:42 +03:00
|
|
|
1. Get the [`ghcup` tool](https://www.haskell.org/ghcup/), a handy
|
|
|
|
one-stop utility for managing all the different pieces of a
|
|
|
|
Haskell toolchain.
|
2021-09-23 16:44:15 +03:00
|
|
|
1. Use `ghcup` to install `stack`:
|
2021-08-30 01:27:41 +03:00
|
|
|
|
2021-09-23 16:44:15 +03:00
|
|
|
ghcup install stack
|
2021-08-30 01:27:41 +03:00
|
|
|
|
2021-09-24 19:14:16 +03:00
|
|
|
1. It is recommended that you use a relatively large terminal window (*e.g.*
|
|
|
|
132 columns x 43 rows or larger).
|
|
|
|
* To find out the size of your terminal, you can type `stty size`.
|
|
|
|
|
2021-09-23 16:44:15 +03:00
|
|
|
1. Now use `stack` to build and run Swarm:
|
2021-08-30 01:27:41 +03:00
|
|
|
|
|
|
|
cd /path/to/the/swarm/repo
|
2021-09-08 06:07:07 +03:00
|
|
|
stack run
|
2021-08-30 01:27:41 +03:00
|
|
|
|
2021-09-23 16:44:15 +03:00
|
|
|
1. Go get a snack while `stack` downloads a Haskell compiler and
|
|
|
|
all of Swarm's dependencies.
|
2022-07-28 16:51:49 +03:00
|
|
|
1. Have fun!
|
2021-08-30 01:27:41 +03:00
|
|
|
|
2021-11-11 19:15:17 +03:00
|
|
|
|
2022-09-17 18:28:13 +03:00
|
|
|
Configuring your editor
|
|
|
|
=======================
|
2021-11-11 19:15:17 +03:00
|
|
|
|
2022-09-17 18:28:13 +03:00
|
|
|
Although you can write commands and definitions directly in the Swarm
|
|
|
|
REPL, once you get beyond the basics you'll probably want to use an
|
|
|
|
external editor for writing Swarm programs. Swarm has support for
|
|
|
|
external editors with highlighting and LSP integration:
|
2021-11-11 19:15:17 +03:00
|
|
|
|
|
|
|
![Editor with problem popup](images/editor.png)
|
|
|
|
|
|
|
|
See the `editors` folder for details on how to configure your editor.
|
2022-09-17 18:28:13 +03:00
|
|
|
Currently, Emacs and VS Code are officially supported, but more can be
|
|
|
|
added.
|
2021-11-11 19:15:17 +03:00
|
|
|
|
2021-09-29 21:45:57 +03:00
|
|
|
Community
|
|
|
|
=========
|
2021-08-30 01:27:41 +03:00
|
|
|
|
2021-09-29 21:45:57 +03:00
|
|
|
Check out the [COMMUNITY](COMMUNITY.md) page for ways to connect with
|
|
|
|
others in the community.
|
|
|
|
|
|
|
|
If you want to contribute, you're most welcome! There are *lots* of
|
2021-08-30 01:27:41 +03:00
|
|
|
ways to contribute, regardless of your Haskell background. For
|
|
|
|
example, even someone with no Haskell experience whatsoever could
|
2022-09-17 18:28:13 +03:00
|
|
|
still help with *e.g.* game design, playtesting, and creating
|
|
|
|
challenges and scenarios. Check out the [CONTRIBUTING](CONTRIBUTING.md)
|
|
|
|
file for more specific information about how to contribute.
|