game (parent module)
├── domain - Core business entities and models
│ ├── model - Domain model classes
│ └── util - Utility classes and helpers
├── service - Business logic and application services
│ ├── spi - Service Provider Interfaces (Filesystem, Save/Load, etc.)
│ └── world - World management and game state
├── client - User interface and presentation layer
│ ├── command - Command parsing and handling
│ ├── controller - Controllers for application flow
│ ├── runtime - Runtime and game loop
│ └── view - UI/View components
└── resources - Game data files (rooms, items, monsters, etc.)
- domain: No dependencies on other game modules (foundation layer)
- service: Depends on domain
- client: Depends on service and domain
To quickly set up the repo on your local machine for development, follow the steps below.
- Install JDK 21 (Temurin recommended).
java -versionshould show 21.x - Clone the repo:
git clone ... - Run:
./gradlew --version# wrapper downloads Gradle - Run:
./gradlew spotlessApply clean check# build + tests + style checks - IntelliJ: Use the Gradle wrapper and set Gradle JVM = JDK 21.
- Install Java 21 (Temurin):
winget install EclipseAdoptium.Temurin.21.JDK.java -versionshould show 21.x - Clone the repo:
git clone ... - Run:
.\gradlew.bat --version - Run:
.\gradlew.bat spotlessApply clean check
Notice that for Windows, the Gradle command will differ slightly. The rest of this document uses the command for Mac/Linux. If using Windows, just replace the
./gradlewwith.\gradlew.batunless if using Git Bash (recommended) or WSL2.
If using IntelliJ on Windows...
- File → Settings → Build Tools → Gradle → Gradle JVM → set to
JDK 21 - EditorConfig support on (on by default)
This project uses Spotless to auto-format your code. Code that does doe follow the formatting specifications cannot be committed to the repo. Refer to the config/checkstyle document for more information.
To auto-format your written code + build + test, run the following command in a terminal within the project's root:
./gradlew spotlessApply clean check
- Sync and branch from
development:git checkout development git pull origin development git checkout -b feature/<short-name> - Code + commit (follow commit/branch conventions detailed further below).
- Before you push:
./gradlew spotlessApply clean check - Open a PR (Pull Request) →
development. Fill the PR template. Fix any CI failures../gradlew spotlessApply./gradlew clean check
- Reviewer approves → merges to
development.
Maintainers will periodically raise a PR from
development→mainfor release/tags.
- Branches:
main= always green, release-readydevelopment= integration branchfeature/<short-name>fromdevelopment
- PRs:
- Target
development - Must pass CI (
spotlessCheck, tests, Checkstyle) - Must be approved
- Squash merge only
- Target
- Commit messages:
- Conventional Commits (e.g.,
feat(parser): add verb synonyms) - Can also include ref number to specific card on tracking board (Trello or other? → TBD)
- Conventional Commits (e.g.,
- Google Java Style is enforced by Spotless (same output on all machines).
- Auto-format:
./gradlew spotlessApply(run this before every commit) - Check only:
./gradlew spotlessCheck
- Auto-format:
- Checkstyle (Google checks) catches naming/Javadoc/import rules that formatters don't.
- Full pipeline:
./gradlew spotlessApply clean check - Reports (output):
- Tests →
build/reports/tests/test/index.html - Checkstyle →
build/reports/checkstyle/main.html - Coverage →
build/reports/jacoco/test/html/index.html
- Tests →
- Full pipeline:
Google Checkstyle Guide: https://checkstyle.sourceforge.io/styleguides/google-java-style-20250426/javaguide.html
For Javadoc comments in code, refer to Google Checkstyle Guide: Javadoc.
Mac OS / Linux:
./gradlew runWindows:
.\gradlew.bat runThe game will launch with a main menu where you can:
- [1] Start Game - Begin a new adventure
- [2] Load Game - Continue from a saved game
- [3] Help - View in-game help and commands
- [4] Exit - Quit the game
Alternatively, you can run the game using the generated JAR file located in build/libs/:
./gradlew clean buildThen run:
java -jar build/libs/game-<version>.jar- Exploration: Navigate through dungeons, discover rooms, and uncover secrets
- Combat: Battle monsters with attack, defend, and summon commands
- Puzzles: Solve various puzzles to unlock rewards and progress
- Inventory: Manage items, equipment, and artifacts
- Equipment: Equip weapons, armor, and artifacts to boost your stats
- Shadow Army: Recruit shadow allies and summon them in combat
- Auto-Save: Game automatically saves every 3 minutes
- Map System: View explored areas and navigate dungeons
- Multiple Saves: Up to 10 save slots
| Command | Description | Example |
|---|---|---|
go <direction> |
Move in a direction (north/south/east/west/up/down) | go north |
explore |
Look around the current room | explore |
map |
View nearby explored areas | map |
map full |
View complete exploration map with room directory | map full |
Direction Shortcuts:
n,s,e,w,u,d- Quick shortcuts for directions
| Command | Description | Example |
|---|---|---|
attack <monster> |
Engage a monster in combat | attack iron-fanged lycan |
defend |
Block incoming attack (reduces damage) | defend |
summon |
Call upon Shadow Army to attack (if you have allies) | summon |
ignore <monster> |
Avoid fighting a creature | ignore high orc chief |
run <monster> |
Run away from a creature (same as ignore) | run gravemaw |
Combat Tips:
- Summon deals damage based on:
(50 + player_attack × 0.10) × ally_count - Defend reduces incoming damage significantly
- Use ignore/run to avoid difficult fights
| Command | Description | Example |
|---|---|---|
inventory |
View your items and equipment | inventory |
pickup <item> |
Take an item from the room | pickup frost sigil |
drop <item> |
Drop an item in current room | drop minor healing potion |
use <item> |
Use a consumable item | use minor healing potion |
inspect <target> |
Examine an item or monster | inspect demon king's crown |
equip <item> |
Equip weapon/armor/artifact | equip lich's staff |
unequip <slot> |
Remove equipped item (weapon/armor/artifact) | unequip weapon |
activate <artifact> |
Activate an artifact's passive power | activate demon king's crown |
Inventory Tips:
- You can equip 1 weapon, 1 armor, and 1 artifact at a time
- Artifacts must be activated to grant passive bonuses
- Consumables restore health or provide temporary effects
| Command | Description | Example |
|---|---|---|
solve <answer> |
Answer an active puzzle | solve puzzle |
hint |
Get a hint for current puzzle | hint |
ignore |
Skip puzzle (no rewards) | ignore |
Puzzle-Specific Commands (use when prompted):
kneel statue,step rune,activate pillar,say arise, etc.embrace shadows/resist shadows(for destiny choice)input code(for code-based puzzles)
Puzzle Tips:
- Some puzzles require specific items in your inventory
- Failed attempts may result in instant death or lockout
- Ignoring a puzzle lets you bypass it but you get no rewards
- You can return to ignored puzzles later
| Command | Description | Example |
|---|---|---|
help |
Show available commands | help |
stats |
View character stats, equipment, allies | stats |
save |
Save your progress | save |
load |
View available save files | load |
quit |
Save and exit the game | quit |
System Tips:
- Game auto-saves every 3 minutes
- Maximum of 10 save slots
- Save files are stored in
./saves/directory - Use main menu to load different save files
TODO: Testing strategy/implementation TBD, this will be updated.
- Build + tests + style:
./gradlew clean check - Tests only:
./gradlew test - Run tests + generate coverage report:
./gradlew test jacocoTestReport - View coverage report:
Open
build/reports/jacoco/test/html/index.htmlin a browser. - Run specific test class:
./gradlew test --tests "com.example.MyTestClass" - Run specific test method:
./gradlew test --tests "com.example.MyTestClass.myTestMethod"
(what PR reviewers expect)
Also in tandem with PR template:
.github/workflows/PULL_REQUEST_TEMPLATE.md
- Branch from
development, PR todevelopment - Ran
./gradlew spotlessApply(auto-formatter) -
./gradlew clean checkpasses locally - Tests added/updated for new behavior
- Brief Javadoc comments included
- Docs updated if behavior/commands changed (
/docsand/or README) - No game data in views (MVC separation)
- Linked issues / milestone (e.g., "Fixes #123")
To mark an item as completed/checked when filling out the PR, replace space between brackets with "x"
[x]
-
Branches
main– release-only, protected.development– integration branch. All feature/fix PRs targetdevelopment.
-
Merge policy
- Use Merge commits. No rebase. No squash on protected branches.
- Linear history is not required.
-
Daily flow
-
Sync
developmentgit switch dev git pull origin dev
-
Start work
git switch -c feat/<topic> # or fix/<topic>
If creating a branch based on an issue, you can copy/paste the issue from github using the "create branch" button available on the issue page (but add
feat/chore/fix/etc.before the copied text). Example:git switch -c feat/19-implement-core-game-loop
-
Commit small changes
git add -A # adds all local changes git commit -m "feat: <what> <why>"
-
Push and open PR → base=
developmentgit push origin feat/19-implement-core-game-loop
-
Keep your branch up to date using merge
git fetch origin git merge origin/dev # resolve conflicts, commit, push -
After approval and green CI, click Merge in GitHub. Branch will automatically be deleted.
-
Then switch back to
developmentand pull latest changes:git switch dev git pull origin dev
-
-
Release flow
- Open PR
development→mainwhen stable. - Ensure CHANGELOG or Release Notes are updated.
- Click Merge. CI must pass.
- Open PR
-
Commit and PR rules
- Link issues: “Fixes #123”.
- Keep PRs focused. Prefer < ~500 lines changed.
- Run CI locally before pushing:
./gradlew spotlessApply clean check
Hooks in .githooks/ so everyone shares the same checks.
What runs on commit
pre-commit: formats code with Spotless and runs./gradlew clean check. The commit is blocked if checks fail.
One-time setup after cloning
- Mac/Linux or Git Bash:
git config core.hooksPath .githooks chmod +x .githooks/pre-commit || true
- Windows (Command Prompt):
git config core.hooksPath .githooks
Verify it's active
git config --get core.hooksPath # should print .githooksSkip when needed (rare or never)
- One commit only:
git commit --no-verify
git merge origin/dev
# edit files to resolve conflicts
git add <resolved files>
git commit # completes the merge
git push- Edit PR → change base to
development
Conventional branch names for non-feature changes → use:
chore/docs/fix/hot-fix/test/refactorprefixes.
- Features:
feature/<short-slug>- Example:
feature/combat-parser
- Example:
- Bug fixes (normal):
fix/<tracker-id>-<short-slug>- Examples:
fix/trello-42-null-save,fix/13-map-content-loader
- Examples:
- Hotfixes (urgent bugs in main):
hotfix/<version>-<short-slug>- Example:
hotfix/1.0.1-npe-on-start
- Example:
- Chores / Docs / Refactors / Tests:
chore/<slug>,docs/<slug>,refactor/<slug>,test/<slug>
Use conventional commit messages:
fix: ...,feat: ...,chore: ...,docs: ..., etc.
# get the latest code from the dev branch
git checkout dev && git pull
# create a new branch for the issue/bug/fix
git checkout -b fix/trello-42-null-save
# code + tests + commit your work
# "Trello-42" would be the id of the appropriate Trello card
git add -A && git commit -m "fix(save): handle null save slots (Trello-42)"
git push -u origin fix/trello-42-null-save
# then open a PR to devIn most cases, bugs will be fixed on the dev branch using the previous workflow above. The workflow below is for extreme cases only and will be coordinated by maintainers.
git checkout main && git pull
git checkout -b hotfix/1.0.1-npe-on-start
# code + tests + commit work
git commit -m "fix(startup): prevent NPE on empty args"
git push -u origin hotfix/1.0.1-npe-on-start
# PR to main, merge, tag v1.0.1, then:
git checkout dev && git pull
git merge origin/main
git push# Open a PR from dev -> main in GitHub, get approvals, merge
# After merging dev -> main
git checkout main
git pull
# Choose next version (tag a release). Examples:
# v0.2.0 = playable prototype, v1.0.0 = final
git tag -a v0.2.0 -m "Playable prototype"
git push origin v0.2.0CI will build and attach the JAR to the tag's release. At the time of writing this, a baseline/skeleton "Scaffold only" exists (Pre-release, v0.1.0).
- Patch:
vX.Y.Zfor small fixes - Minor: bump (increment) Y for meaningful features/milestones (prototypes → feature complete).
- Major:
v1.0.0for final submission.
- Gradle not executable:
chmod +x gradlew(Mac/Linux).- Windows users must have
gradlew.baton PATH (it is in repo root).
- Windows users must have
- "Gradle 9 / deprecated" messages: Make sure you run
./gradlew ...(wrapper), notgradle ... - If pre-commit hooks don’t fire, re-run
git config core.hooksPath .githooks - Wrong Java version: Set Project SDK/Gradle JVM to 21 in your IDE
java -versionshould show 21.x - Formatting fails in CI: run
./gradlew spotlessApply, then./gradlew clean check, then re-commit. - Checkstyle errors: open
build/report/checkstyle/main.htmlto see the exact rule and file/line. - Still having issues? Kill the running daemons and try again:
./gradlew --stop rm -rf build .gradle ./gradlew clean check
- Undo local changes:
git checkout -- .(warning: discards uncommitted changes) - Delete local branch:
git branch -D <branch-name> - Sync local branch with remote:
git fetch originthengit reset --hard origin/<branch-name>(warning: discards uncommitted changes) - Undo last commit but keep changes staged:
git reset --soft HEAD~1(useful if you forgot to runspotlessApplybefore committing or want to change commit message) You can always reach out to team members for troubleshooting help and questions via our Discord server (any channel, will update this when appropriate/specific channels are completely set up).
Any and all questions/requests welcomed.
- Code:
src/main/java/... - Tests:
src/test/java/... - Docs:
/docs(gameplay spec, architecture, test plan, release notes) - Config:
.editorconfig, Spotless/Checkstyle are inbuild.gradle(Google style)
- Keep PRs small (easy to review)
- Address PR review comments.
- If you're blocked by something, ask for help early (label PR/Issue
status:blocked, add comments, ping on Discord).