1.18.11 • Published 12 days ago

@jeremyckahn/farmhand v1.18.11

Weekly downloads
660
License
GPL-2.0-or-later
Repository
github
Last release
12 days ago

Farmhand

Logo art by Kairi

Current Farmhand version Gitpod ready-to-code

A farming game by Jeremy Kahn

Play Farmhand in your browser!

CI Release New Version

Community links:

  • Discord link: Discord
  • Reddit link: r/FarmhandGame
  • Instagram link: @FarmhandGame

Storefront links:

Farmhand is a resource management game that puts a farm in your hand. It is designed to be both desktop and mobile-friendly and fun for 30 seconds or 30 minutes at a time. Can you build a thriving farming business? Give it a try and find out!

This is an open source project built with web technologies. It is implemented as a Progressive Web App, which means it can be played in your web browser or installed onto your device for offline play.

State of the project

Farmhand is completely playable and stable. However, the game should not be considered "finished," inasmuch as it will never be finished. It is an ongoing open source project that will grow and improve organically over time. Stability and cohesiveness are top priorities for the project. It'll only ever get better and have more content over time!

This GitHub project is used for tracking and organizing work. If you'd like to suggest a feature or ask a question, please open a GitHub issue, or join the Discord.

Versioning system

Farmhand uses a SemVer-like versioning system. It differs from SemVer because Farmhand is a game and doesn't expose a public API. Rather than the game version being based on an API, it reflects the internal data structure, farmhand.state.

  • major: Is incremented when farmhand.state has been changed in a backwards-incompatible way.
    • When these releases are made, automatic migration functionality will keep this transparent to the player.
  • minor: Is incremented when farmhand.state has been changed in a backwards-compatible way.
  • patch: Is incremented when farmhand.state has been not been changed. This also includes gameplay features and bug fixes that do not result in changes to farmhand.state.
    • This implies that significant game changes may only result in patch-level releases.

Branch structure

  • Active development takes place in develop.
  • main is updated when develop is stable.
  • gh-pages contains the built assets and is updated automatically when main is updated.

Project overview

  • This project is built with Create React App, so please refer to the documentation of that project to learn about the development toolchain.
  • Farmhand uses Piskel for the art assets.

Running locally

Requires:

  • Node/NPM
  • Docker
  • nvm (or alternatively asdf)

In your shell, run this to ensure you're using the correct Node version and install all of the dependencies:

nvm i
npm ci --legacy-peer-deps

If npm ci --legacy-peer-deps errors out due to PhantomJS installation errors (this has been seen in some WSL/Linux environments), try npm_config_tmp=/tmp npm ci instead. See this related comment. Alternatively, try npm ci --no-optional --legacy-peer-deps.

To run the game locally with the API, Redis database, and peer pairing server, run:

npm run dev

To run the native app locally, run:

npm run dev:native

Note that you will need a Vercel account and be logged into locally for this to work (at least until Vercel fixes this). Alternatively, if you just want to run the front end with no API or backend, you can run:

npm start

In this case, the local app will be using the Production API, database, and pairing server. However you boot, Farmhand will be accessible from http://localhost:3000/.

Coding conventions

Multiplayer system architecture

The system design for Farmhand's multiplayer functionality has been detailed in this blog post.

CI/CD

Automation is done with GitHub Actions. All changes are tested and built upon Git push. Merges to main automatically deploy to Production (the gh-pages branch) upon a successful test run and build.

Smoke testing

All are welcome to help with smoke testing Farmhand to ensure the game is stable! All you need is to be logged into GitHub and open a new Smoke Test Report issue. This issue will have interactive checkboxes that you can use to track your progress. Once smoke testing is complete, please close the issue.

It would be a good idea to perform a smoke test whenever there is a significant change to the codebase (such as a major new feature or refactor). The process is intended to catch defects before making a Production release. If any issues are encountered during testing, please leave a comment on the Smoke Test Report issue explaining what you experienced. Non-trivial issues should be addressed by the dev team before releasing to the Production environment.

Releasing updates

Use this GitHub Action to deploy a new version of Farmhand: Release New Version

As an authenticated repo owner or collaborator, click "Run workflow" and enter the argument to be passed to npm version and press the green "Run workflow". For updates that do not change farmhand.state (which is most of them), use the default patch version. This workflow will deploy Farmhand to:

The Action will also publish the latest release to GitHub.

The process will take several minutes to complete and it will notify the Discord server's #updates channel. It is customary to explain what you just shipped in the #updates channel as well.

Feature flags

Farmhand supports feature flags for code that should only be enabled in specific environments. To create a feature flag, add a line that looks like this in the relevant .env file:

REACT_APP_ENABLE_[FEATURE_NAME]=true

Where [FEATURE_NAME] is replaced with the name of your feature. So, adding this to .env.development.local:

REACT_APP_ENABLE_MINING=true

Would enable the MINING feature only for the local development environment. You can access the enabled feature flags at runtime by importing the features Object from config.js. See Adding Custom Environment Variables for more information on how to use environment variables.

In addition to enabling features via environment variables, players can manually enable them in the browser (such as for beta testing). This can be done by manually constructing a URL query parameter that looks like ?enable_[FEATURE_NAME]=true. For example, to enable the MINING feature, players could use the URL https://www.farmhand.life?enable_MINING=true.

License

All Farmhand code and is licensed under GNU GPL v2. All media assets (such as game art) are licensed under CC BY-NC-SA 4.0.

1.18.11

12 days ago

1.18.10

2 months ago

1.18.9

3 months ago

1.18.8

3 months ago

1.18.7

4 months ago

1.18.6

5 months ago

1.18.1

7 months ago

1.18.0

7 months ago

1.18.5

6 months ago

1.18.4

6 months ago

1.18.3

6 months ago

1.18.2

6 months ago

1.17.6

8 months ago

1.17.5

8 months ago

1.17.4

8 months ago

1.17.3

9 months ago

1.17.2

10 months ago

1.16.1

12 months ago

1.17.1

11 months ago

1.17.0

11 months ago

1.15.27

1 year ago

1.15.28

1 year ago

1.16.0

12 months ago

1.15.25

1 year ago

1.15.26

1 year ago

1.15.8

1 year ago

1.15.9

1 year ago

1.15.10

1 year ago

1.15.11

1 year ago

1.15.12

1 year ago

1.15.13

1 year ago

1.15.18

1 year ago

1.15.19

1 year ago

1.15.14

1 year ago

1.15.15

1 year ago

1.15.16

1 year ago

1.15.17

1 year ago

1.15.21

1 year ago

1.15.22

1 year ago

1.15.23

1 year ago

1.15.24

1 year ago

1.15.20

1 year ago

1.15.4

2 years ago

1.15.3

2 years ago

1.15.7

2 years ago

1.15.6

2 years ago

1.15.5

2 years ago

1.15.2

2 years ago

1.14.1

2 years ago

1.14.0

2 years ago

1.14.5

2 years ago

1.14.4

2 years ago

1.14.3

2 years ago

1.14.2

2 years ago

1.14.8

2 years ago

1.14.7

2 years ago

1.14.6

2 years ago

1.15.0

2 years ago

1.15.1

2 years ago

1.12.6

2 years ago

1.13.1

2 years ago

1.13.0

2 years ago

1.12.5

2 years ago

1.12.3

2 years ago

1.12.4

2 years ago

1.12.2

2 years ago

1.12.1

2 years ago

1.12.0

2 years ago

1.11.10

2 years ago

1.11.8

2 years ago

1.11.7

2 years ago

1.11.6

2 years ago

1.11.5

2 years ago

1.11.9

2 years ago

1.10.31

2 years ago

1.11.4

2 years ago

1.11.3

2 years ago

1.11.2

2 years ago

1.11.1

2 years ago

1.11.0

2 years ago

1.10.30

3 years ago

1.10.29

3 years ago

1.10.28

3 years ago

1.10.26

3 years ago

1.10.27

3 years ago

1.10.24

3 years ago

1.10.25

3 years ago

1.10.22

3 years ago

1.10.23

3 years ago

1.10.21

3 years ago

1.10.20

3 years ago

1.10.19

3 years ago

1.10.18

3 years ago

1.10.16

3 years ago

1.10.17

3 years ago

1.10.15

3 years ago

1.10.14

3 years ago

1.10.12

3 years ago

1.10.11

3 years ago

1.10.5

3 years ago

1.10.4

3 years ago

1.10.3

3 years ago

1.10.2

3 years ago

1.10.9

3 years ago

1.10.8

3 years ago

1.10.7

3 years ago

1.10.6

3 years ago

1.10.10

3 years ago

1.6.4

3 years ago

1.6.3

3 years ago

1.6.2

3 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.7.8

3 years ago

1.7.7

3 years ago

1.7.6

3 years ago

1.7.5

3 years ago

1.7.4

3 years ago

1.9.1

3 years ago

1.9.0

3 years ago

1.6.6

3 years ago

1.6.5

3 years ago

1.10.1

3 years ago

1.10.0

3 years ago

1.8.0

3 years ago

1.5.39

3 years ago

1.7.3

3 years ago

1.7.2

3 years ago

1.7.1

3 years ago

1.7.0

3 years ago

1.5.38

3 years ago

1.5.37

3 years ago

1.5.36

3 years ago

1.5.35

3 years ago

1.5.34

3 years ago

1.5.33

3 years ago

1.5.32

3 years ago

1.5.31

3 years ago

1.5.30

3 years ago

1.5.29

3 years ago

1.5.28

3 years ago

1.5.27

3 years ago

1.5.26

3 years ago

1.5.14

3 years ago

1.5.13

3 years ago

1.5.16

3 years ago

1.5.15

3 years ago

1.5.18

3 years ago

1.5.19

3 years ago

1.5.20

3 years ago

1.5.25

3 years ago

1.5.24

3 years ago

1.5.10

3 years ago

1.5.11

3 years ago

1.5.0

3 years ago

1.4.22

3 years ago

1.4.20

3 years ago

1.4.21

3 years ago

1.4.17

3 years ago

1.4.16

3 years ago

1.4.19

3 years ago

1.4.18

3 years ago

1.4.15

3 years ago

1.4.14

3 years ago

1.4.8

3 years ago

1.4.13

3 years ago

1.4.7

3 years ago

1.4.6

3 years ago

1.4.5

3 years ago

1.4.4

3 years ago

1.3.5

3 years ago

1.4.3

3 years ago

1.3.4

3 years ago

1.4.2

3 years ago

1.3.3

3 years ago

1.4.1

3 years ago

1.3.2

3 years ago

1.4.0

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.29

3 years ago

1.2.23

3 years ago

1.2.24

3 years ago

1.2.22

3 years ago

1.2.27

3 years ago

1.2.28

3 years ago

1.2.25

3 years ago

1.2.26

3 years ago

1.2.21

3 years ago

1.2.20

3 years ago

1.2.19

3 years ago

1.2.18

3 years ago

1.2.17

3 years ago

1.2.16

3 years ago

1.2.15

3 years ago

1.2.13

3 years ago

1.2.14

3 years ago

1.2.12

3 years ago

1.2.11

3 years ago

1.2.10

3 years ago

1.2.8

3 years ago

1.2.7

3 years ago

1.2.9

3 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago