Setup
Setup
Requirements
| Requirement | Notes |
|---|---|
| Unity Editor | 6000.4.0f1 (Unity 6) — see First Principles/ProjectSettings/ProjectVersion.txt |
| Input | Input System package (com.unity.inputsystem in Packages/manifest.json); Player → Active Input Handling is Input System Package. Assets/Scripts/Input/UiInputModuleBootstrap.cs swaps StandaloneInputModule → InputSystemUIInputModule after each scene load so uGUI matches that setting (gameplay already uses UnityEngine.InputSystem). |
| Disk | Large Library/ folder; safe to delete and regenerate |
| OS | Windows / macOS / Linux (editor-supported) |
Optional: Git LFS if you add large assets later (not required for the scripts-focused workflow).
Clone the repository
git clone https://github.com/GameGenesis/First-Principles.git
cd First-Principles
If you fork the repo, use your fork URL instead.
Open the correct Unity project
The Unity project lives in a subfolder with a space in the name:
First-Principles/First Principles/
In Unity Hub → Add → choose:
.../First-Principles/First Principles
You should see Assets, Packages, and ProjectSettings at the root of the added project.
Typography (Quicksand + multilingual fallbacks)
UI copy uses Quicksand (Google Fonts, SIL OFL 1.1 — Assets/Fonts/LICENSE-Quicksand-OFL.txt) as the primary TextMesh Pro face. Arabic, Hindi, Urdu, Bengali, and CJK still render through Noto + Nanum Gothic (나눔고딕) at runtime (TmpGlobalFallbackBootstrap loads TTFs from Assets/Resources/Fonts/).
- Open the project in the Unity Editor (close any other Unity instance using the same project).
- Menu: First Principles → Fonts → Apply Quicksand for all TextMesh Pro (recommended UI).
This generates Assets/Fonts/Quicksand SDF.asset if needed, sets it as TMP Settings → Default Font Asset, keeps Liberation Sans as a fallback slot, and assigns Quicksand on all TextMeshPro / TextMeshProUGUI under Assets/Scenes and Assets prefabs.
CLI (optional, project closed in the Editor):
"/Applications/Unity/Hub/Editor/6000.4.0f1/Unity.app/Contents/MacOS/Unity" -batchmode -quit -projectPath "/path/to/First Principles" -executeMethod QuicksandFontProjectSetup.GenerateAndApplyAllBatch
Alternate looks: Apply Inter for all TextMesh Pro (InterFontProjectSetup.GenerateAndApplyAllBatch), or Apply Outfit (OutfitFontProjectSetup.GenerateAndApplyAllBatch).
Common mistake: adding only First-Principles (parent) will not load the Unity project correctly.
First open / packages
- Open the project in Unity and wait for import and package restore.
- If you use TextMesh Pro for the first time, import TMP Essentials when prompted (GameObject → UI → Text - TextMeshPro often triggers the importer).
Clean restore (corrupted Library / packages)
If you see compile errors about immutable packages, missing UGUI types, or broken test framework assemblies:
- Quit Unity.
-
From the repo root run:
./clean-unity-library.sh - Reopen the project.
See Troubleshooting for details.
Run the game
- Open scene
Assets/Scenes/Menu.unity(or build settings entry scene). - Play from the Editor.
Flow: Menu → Level select → Game (chosen level index is passed via LevelSelection).
Optional: local documentation site
From the docs/ folder (Ruby + Bundler required):
cd docs
bundle install
bundle exec jekyll serve
Browse to http://localhost:4000/First-Principles/ (include baseurl path if configured).
LaTeX math on the doc site
Pages load MathJax 3 via _includes/custom-head.html. In Markdown, use standard delimiters, for example:
- Inline:
\( f'(x) \)→ ( f’(x) ) - Display:
\[ \int_a^b f(x)\,dx \]or$$ \sum_{k=0}^{n} a_k $$
The Unity game does not run MathJax; it uses TmpLatex to turn the same \(\cdots\) delimiters into TextMesh Pro rich text (subset: fractions, sub/sup, Greek, common operators). Keep in-game strings in that format when you want pretty equations.