Skip to content

Repository files navigation

OpenCiv tile_city

example workflow Lines of Code Discord

alt text

About

OpenCiv is a love letter to turn-based strategy games inspired by Sid Meier's Civilization. The game mainly focuses on Civ 5 features and strives to improve on certain aspects that were lacking in the series.

The main objective of this project is to allow players who enjoy Civilization games to play it directly on a web browser.

How do I build and run this?

  1. Install either 'Docker' or 'Node.js with npm installed'.

  2. Clone the repo at: https://github.com/RyanGrieb/OpenCiv.git

    3. Using docker

    Ensure Docker is installed, then run: docker compose up -d

    4. Using your local machine

    Install dependencies and start the application: npm run install-all npm start

Once running, open your browser and go to http://localhost:1234 to play.

How do I play this?

Currently, the project is being rewritten so no playable version is available without building the project.

How do I run tests?

  1. From the root directory of the repository, run npm run install-all
  2. Navigate to the server directory cd server
  3. Execute the test command npm run test

Development workflows

  • Typecheck before pushingcd client or cd server, then npx tsc -p tsconfig.typecheck.json --noEmit. This is the same check CI runs.
  • Start the server with game options — from server/, npm start -- --no-allowBarbarians --numCityStates=0 sets game options at launch instead of toggling them in the client's UI. npm start -- --help lists every option with its default and range. The same overrides can be passed as GAME_OPTIONS="allowBarbarians=false,numCityStates=0" when argv is awkward (root npm start, docker compose up).
  • Format the reponpm run format (Prettier, run from the root).
  • Add or edit a sprite — drop a .png under client/assets/sprites/<category>/<NAME>.png, then run npm run generate-sprites from the root and commit the regenerated client/src/generated/SpriteManifest.ts.
  • Generate API docsnpm run generate-docs (Typedoc for both projects, output in documentation/).

See CLAUDE.md for more on the project's architecture and conventions.

Keybinds

ARROW KEYS or LEFT-CLICK DRAG - Camera Movement

SCROLL - Zoom In/Out

LEFT-CLICK Unit RIGHT-CLICK Tile - Unit Movement

SPACEBAR - Skip turns

ESC - View settings

Special thanks to the following:

Contributors - Will Pewitt

Artists

Artist Contribution
lucasyoung988 Commissioned game art
brysia Commissioned game art
pratamacam Commissioned game art
CharlesGabriel Message boxes
BatzelChaos Shield icon

Releases

Packages

Used by

Contributors

Languages