swarm/README.md

117 lines
4.5 KiB
Markdown
Raw Normal View History

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
![World 0 after scanning a tree and making a log.](images/tutorial/log.png)
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
* Editor support with LSP and highlighting
* 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.
- 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
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.
Installing from Source
----------------------
2021-08-30 01:27:41 +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
issue](https://github.com/swarm-game/swarm/issues/53) for instructions
getting it to work under the Windows Subsystem for Linux.
To install Swarm from source:
2021-08-30 01:27:41 +03:00
1. Clone the Swarm repository, e.g.
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:
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
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.
1. Have fun!
2021-08-30 01:27:41 +03:00
Configuring your editor
=======================
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:
![Editor with problem popup](images/editor.png)
See the `editors` folder for details on how to configure your editor.
Currently, Emacs and VS Code are officially supported, but more can be
added.
Community
=========
2021-08-30 01:27:41 +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
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.