Skip to content

Commit

Permalink
Fix distribution of attribute ranges.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: eb33295203246bd10c56710108c1b38c4d8b5a43
  • Loading branch information
cpojer committed May 7, 2024
1 parent f66bbdc commit 42cf39d
Show file tree
Hide file tree
Showing 11 changed files with 7 additions and 279 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
**/node_modules/
/dist/
/node_modules/
/package-lock.json
/yarn.lock
ares/.enum_manifest.json
ares/.src_manifest.json
ares/**/__generated__
Expand All @@ -13,9 +11,9 @@ ares/vite.config.ts.timestamp-*
artemis/prisma/pothos-types.ts
coverage
electron/demo
electron/log-output
electron/offline
electron/out
electron/log-output
halting-problem-failure.json
source_strings.json
tests/testSetup
Expand Down
10 changes: 0 additions & 10 deletions .vscode/extensions.json

This file was deleted.

22 changes: 0 additions & 22 deletions .vscode/settings.json

This file was deleted.

131 changes: 0 additions & 131 deletions CODE_OF_CONDUCT.md

This file was deleted.

111 changes: 5 additions & 106 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,118 +1,17 @@
# Athena Crisis

<p align="center">
<a href="https://athenacrisis.com">
<img alt="Athena Crisis Logo" src="./deimos/public/athena-crisis.svg" style="width: 70%;" />
</a>
</p>

[Athena Crisis](https://athenacrisis.com) is an Open Core video game developed by [Nakazawa Tech](https://nkzw.tech) and published by [Null](https://null.com). The source code in this repository is licensed under the [MIT License](./LICENSE.md) and can be used to improve Athena Crisis, build additional tools, study game development with JavaScript or create entirely new turn-based strategy games.

Content like the single-player campaign, multiplayer, art and music are not open source. You can try a demo at [athenacrisis.com](https://athenacrisis.com) and you can wishlist or purchase [Athena Crisis on Steam Early Access](https://store.steampowered.com/app/2456430/Athena_Crisis/) or [buy Athena Crisis directly](https://app.athenacrisis.com/checkout) to play the full game.

If you like Athena Crisis, [please consider a sponsorship to support its development](https://github.com/sponsors/cpojer).

<a href="https://athenacrisis.com">
<img alt="Athena Crisis Gameplay" src="https://github.com/nkzw-tech/athena-crisis/assets/13352/800717e7-fda9-4265-9e0f-25c6c99326ce">
</a>

## Setup

Athena Crisis requires [Node.js](https://nodejs.org/en/download/package-manager) and the latest major version of [`pnpm`](https://pnpm.io/installation).

```bash
pnpm install && pnpm dev:setup
pnpm dev
```

Visit [localhost:3002](http://localhost:3002/) to see the landing page.

## Packages

The codebase is split into multiple packages to enforce the separation of concerns. We suggest starting with these packages to get an end-to-end overview:

- `athena` → Data structures and algorithms for manipulating _map_ state (_client/server_).
- `apollo` → Data structures and algorithms for manipulating _game_ state (_client/server_).
- `hera` → Game engine and rendering (_client_).
- `ui` → Design system (_client_).
- `deimos` → Landing page (_client_).

These are secondary packages focused on specific domains:

- `art` → Handling of assets (_client/build_).
- `codegen` → Run `pnpm codegen` when changing game `Action`s or `ActionResponse`s to generate encoded actions and formatters (_build_).
- `athena` → Data structures and algorithms for manipulating _map_ state (_client/server_).
- `codegen` → Run `pnpm codegen` when changing game `Actions` or `ActionResponses` to generate encoded actions and formatters (_build_).
- `deimos` → Landing page (_client_).
- `dionysus` → AI code (_client/server_).
- `hephaestus` → Iterator and Immutable data structures (_client/server_).
- `hera` → Game engine and rendering (_client_).
- `hermes` → Campaign related data structures and algorithms (_client/server_).
- `i18n` → Internationalization (_client/build_).
- `offline` → Offline splash screen for app (_client_).
- `tests` → e2e tests.

# Q&A

## What is open source and what isn't?

About 75% of all non-content related Athena Crisis code is open source, including the core data structures, algorithms, game engine, rendering, AI, landing page and the map editor. Backend implementations such as user management, database, APIs, multiplayer, realtime spectating, translations, third-party integrations like Discord, server configuration and application wrappers for Steam or app stores are not open source. We aim to open source more of the game over time, but the content will remain the intellectual property of Nakazawa Tech KK and therefore not be open source. You can buy and enjoy [Athena Crisis on Steam Early Access](https://store.steampowered.com/app/2456430/Athena_Crisis/) or [buy it on athenacrisis.com](https://app.athenacrisis.com/checkout).

## Why did you open source Athena Crisis?

[Nakazawa Tech](https://nkzw.tech) is an Open Core company. See [the Athena Crisis is Now Open Source blog post](https://cpojer.net/posts/athena-crisis-open-source) for more information.

## How is this codebase used at Nakazawa Tech?

We use a monorepo for Athena Crisis at Nakazawa Tech and are syncing a portion of the codebase to this repository. Code merged into this open-source repository is automatically synced to the internal monorepo, and vice versa. Athena Crisis always runs the latest version of code from this repository in production.

### Why are some folders almost empty?

To simplify dependency management with [`pnpm`](https://pnpm.io/), most of the internal `package.json` files and the `pnpm-lock.yaml` are public. This makes it easier to share code between the internal monorepo and this repository, but also means that there are some placeholders in this repository, most notably the `ares` and `artemis` packages.

## Why are packages named after Greek gods?

Why not!? At some point it became necessary to split the codebase into multiple packages to share code between the client and server. The first package was named `athena`, and it was hard to come up with meaningful names for the other packages. We decided to name them after Greek gods because it seemed cute.

Over time many pieces are expected to be extracted into separate packages and published on npm under the `@nkzw` organization. Please send a Pull Request if you find a piece of code that you think should be extracted into a separate package.

## How do assets work in this codebase?

Assets are not part of this codebase. For testing, development and browsing, all assets are loaded remotely from the Athena Crisis servers.

## I would like to build a commercial project based on this codebase. Can I?

Yes, you can. However, any content such as art, music, story, characters and their descriptions are not open source and are the intellectual property of Nakazawa Tech KK. You can use the codebase to build your own game, but you must replace all content with your own. For example, you have to replace all references to assets in [`Images.tsx`](https://github.com/nkzw-tech/athena-crisis/blob/main/hera/render/Images.tsx) or change character descriptions in [`Unit.tsx`](https://github.com/nkzw-tech/athena-crisis/blob/dc1c06b7f033e4c52a29db1524dc08226eacf63a/athena/info/Unit.tsx) if you want to publish your own game.

If you'd like to use content from Athena Crisis for commercial or non-commercial purposes, you must obtain a license from Nakazawa Tech KK by emailing [email protected].

# Contributing

We welcome contributions to Athena Crisis. Here are some guidelines to get you started:

- The style guide is enforced through tests and linting. Please run `pnpm test` to run all checks. If they pass, you are good to send a Pull Request.
- Check out [The Perfect Development Environment](https://cpojer.net/posts/the-perfect-development-environment) and [Fastest Frontend Tooling](https://cpojer.net/posts/fastest-frontend-tooling-in-2022) for tips on how to optimize your environment setup.
- We suggest adding tests to Pull Requests. You can find many examples in the [`tests` folder](https://github.com/nkzw-tech/athena-crisis/tree/main/tests).

Here are some types of contributions which we greatly appreciate:

- Bug fixes.
- AI improvements.
- New game features.
- Balancing improvements.
- Tests to cover untested functionality.
- Performance Improvements to core data structures.
- Separation of concerns into smaller libraries that can be published on npm and consumed by other projects.

# More information

Check out these videos to learn more about the tech behind Athena Crisis:

- [How NOT to Build a Video Game](https://www.youtube.com/watch?v=m8SmXOTM8Ec)
- [Building the AI for Athena Crisis](https://www.youtube.com/watch?v=0V9XaIK0xlQ)

# Supporters

| <a href="https://www.hetzner.com/?mtm_campaign=athenacrisis_sponsoring&mtm_source=athenacrisis_community&mtm_medium=referral&mtm_content=sponsoring_link"><img src="./infra/assets/hetzner.svg" alt="Hetzner" style="width: 320px;"></a> | <a href="https://crowdin.com/project/athena-crisis" style="display: block;"><img src="./infra/assets/crowdin.svg" alt="Crowdin" style="width: 320px;"></a> |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <a href="https://polar.sh" style="display: block;"><img src="./infra/assets/polar.svg" alt="Polar" style="width: 320px;"></a> | <a href="https://null.com" style="display: block;"><img src="./infra/assets/null.svg" alt="Null" style="width: 320px;"></a> |

<a href="https://athenacrisis.com">
<img alt="Athena Crisis Keyart" src="./deimos/public/athena/keyart.jpg" />
</a>
- `ui` -> Design system (_client_).
1 change: 0 additions & 1 deletion deimos/public/athena-crisis.svg

This file was deleted.

Loading

0 comments on commit 42cf39d

Please sign in to comment.