Patan Explorer is a browser-first, first-person 3D vertical slice of Patan Durbar Square in Lalitpur, Nepal. The current milestone centers on an original, detailed Krishna Mandir exterior surrounded by a simplified environment for testing scale, movement, collision, lighting, browser loading, and performance.
The playable environment is limited to a 120 m by 90 m core and includes:
- The detailed Krishna Mandir exterior with textured materials and collision
- Simplified Vishwanath Temple and Char Narayan Temple exteriors
- The Garuda column ensemble
- A simplified palace frontage and Newari facade shells
- Plaza surfaces, paths, visual boundaries, lighting, and haze
- First-person walking, running, jumping, mouse look, and cursor capture
- A custom Brotli-compressed WebGL loading page
The MVP intentionally excludes NPCs, quests, combat, inventory, multiplayer, authentication, backend services, runtime AI, procedural city generation, interiors, and mobile controls.
| Input | Action |
|---|---|
WASD or arrow keys |
Move |
| Mouse | Look around |
Left or right Shift |
Run |
Space |
Jump |
| Left mouse button | Capture the cursor |
Escape |
Release the cursor |
| Fullscreen button | Enter browser fullscreen mode |
Keyboard and mouse are required for this milestone.
Install the following before opening or building the project:
- Unity Hub
- Unity Editor
6000.3.23f1with Web Build Support - Git and Git LFS
- Python 3 for the local WebGL server
- A current desktop browser with WebGL 2 support
The project also uses:
- Universal Render Pipeline
17.3.0 - Unity Input System
1.20.0 - Blender
5.2.1LTS for source art work - Optional QGIS
3.44LTR for offline geographic preprocessing
The exact Unity version is pinned in Unity/PatanExplorer/ProjectSettings/ProjectVersion.txt. Opening the project with another Unity version can rewrite scenes, materials, or project settings.
Git LFS is required because the Krishna Mandir FBX is stored as an LFS object.
git lfs install
git lfs pullRun these commands from the repository root after cloning. Confirm that this is a real FBX rather than an unresolved LFS pointer:
git lfs ls-filesThe expected Unity project directory is:
PatanExplorer/Unity/PatanExplorer
It is the inner directory containing Assets, Packages, and ProjectSettings.
The easiest way to run the game on Windows is to double-click this file in the repository root:
Run-PatanExplorer.cmd
The launcher performs the following workflow:
- Verifies the Unity project and local server script.
- Uses the existing complete WebGL build when one is available.
- Builds and validates the public milestone automatically when no WebGL build exists.
- Detects whether Patan Explorer is already running on the selected port.
- Starts the Brotli-aware Python server when required.
- Opens
http://127.0.0.1:8080in the default browser. - Keeps the server running until Enter is pressed in the launcher window.
If the launcher encounters an error, its window stays open and displays the missing dependency, occupied port, Unity lock, build log, or Git LFS action needed to fix it.
The equivalent PowerShell command is:
powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File .\Deployment\Run-PatanExplorer.ps1The default workflow does not rebuild when a complete local build already exists. Force a fresh WebGL build of the current scene, validation, server start, and browser launch after changing Unity content with:
.\Run-PatanExplorer.cmd -Rebuildor:
powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File .\Deployment\Run-PatanExplorer.ps1 -RebuildThe launcher builds the current saved scene without regenerating or overwriting it. Stop an existing Patan Explorer server before forcing a rebuild. To intentionally recreate the deterministic scene, use Patan > Create Public Milestone in Unity after committing, stashing, or backing up manual scene edits.
Use another port when 8080 is unavailable:
.\Run-PatanExplorer.cmd -Port 8081The reusable workflow implementation is in Deployment/Run-PatanExplorer.ps1. The .cmd file only provides reliable double-click behavior when Windows does not execute .ps1 files directly.
- Open Unity Hub.
- Select Installs.
- Install Unity Editor
6000.3.23f1if it is not already available. - In the Editor installation options, add Web Build Support.
On the configured Windows workstation, the Editor is expected at:
%USERPROFILE%\Unity\Hub\Editor\6000.3.23f1\Editor\Unity.exe
If Unity Hub installed it somewhere else, use that location when running command-line builds.
- Open the Projects section in Unity Hub.
- Choose Add or Open project from disk.
- Select
Unity/PatanExplorerinside this repository. - Ensure Unity Hub selects Editor
6000.3.23f1. - Open the project and wait for package restoration, asset import, shader compilation, and script compilation to finish.
The first import can take several minutes because Unity must import the FBX and textures and create its local Library cache.
- In the Project window, open
Assets/Patan/Scenes/PatanSquare.unity. - Confirm there are no red errors in Window > General > Console.
- Press the Unity Play button.
- Select the Game view.
- Click inside the Game view to capture the cursor.
- Use the controls listed above.
- Press
Escapeto release the cursor and stop Play mode when finished.
You do not need to regenerate the scene simply to play the checked-in version.
Use Patan > Create Public Milestone to recreate the deterministic scene from the Editor builder.
Warning: This command overwrites
Assets/Patan/Scenes/PatanSquare.unity. Commit, stash, or back up manual scene edits before running it.
The generated public scene requires the detailed model at:
Assets/Patan/Art/KrishnaMandir/Models/KrishnaMandir.fbx
The builder fails rather than falling back to the old placeholder if that model or its material textures are unavailable.
Unity WebGL cannot be run reliably by double-clicking index.html. The compressed data, JavaScript, and WebAssembly files must be served over HTTP with the correct MIME types and Content-Encoding: br headers.
- Open the project through Unity Hub.
- Open File > Build Profiles.
- Select or add the Web (
WebGL) build profile. - Choose Switch Platform and wait for Unity to finish importing for WebGL.
- Save or commit any manual scene changes.
- Select Patan > Build Web Release.
- Wait for Unity to report a successful build in the Console.
- Select Patan > Validate Public Milestone.
Warning: Build Web Release regenerates
PatanSquare.unitybefore building it.
The generated browser build is written to:
Builds/WebGreybox
The directory name is retained for compatibility with the existing deployment configuration, even though the public build now contains the detailed Krishna Mandir.
Close any Unity Editor instance that already has the project open, then open PowerShell in the repository root:
Set-Location "C:\path\to\PatanExplorer"
$unityEditor = "$HOME\Unity\Hub\Editor\6000.3.23f1\Editor\Unity.exe"
$projectPath = "$PWD\Unity\PatanExplorer"
$buildDirectory = "$PWD\Builds"
New-Item -ItemType Directory -Force -Path $buildDirectory | Out-Null
$buildArguments = @(
'-batchmode',
'-quit',
'-projectPath', $projectPath,
'-buildTarget', 'WebGL',
'-executeMethod', 'PatanExplorer.Editor.PatanMilestoneBuilder.BuildWebRelease',
'-logFile', "$buildDirectory\WebGreybox-build.log"
)
$buildProcess = Start-Process `
-FilePath $unityEditor `
-ArgumentList $buildArguments `
-PassThru `
-Wait
if ($buildProcess.ExitCode -ne 0)
{
throw "WebGL build failed. Read Builds\WebGreybox-build.log."
}
$validationArguments = @(
'-batchmode',
'-quit',
'-projectPath', $projectPath,
'-buildTarget', 'WebGL',
'-executeMethod', 'PatanExplorer.Editor.PatanMilestoneValidator.ValidateMilestone',
'-logFile', "$buildDirectory\GreyboxValidation.log"
)
$validationProcess = Start-Process `
-FilePath $unityEditor `
-ArgumentList $validationArguments `
-PassThru `
-Wait
if ($validationProcess.ExitCode -ne 0)
{
throw "Milestone validation failed. Read Builds\GreyboxValidation.log."
}Successful validation creates:
Builds/GreyboxValidation.json
The report includes renderer, material, collider, input-action, missing-script, triangle, hero-height, and compressed-build measurements.
From the repository root, run:
python Deployment/serve_web.py --directory Builds/WebGreybox --port 8080Keep that terminal open and visit:
http://127.0.0.1:8080
Press Ctrl+C in the server terminal to stop it.
To use another port:
python Deployment/serve_web.py --directory Builds/WebGreybox --port 8081Then open http://127.0.0.1:8081.
If Builds/WebGreybox already exists and is current, only the server command is required:
python Deployment/serve_web.py --directory Builds/WebGreybox --port 8080Builds is ignored by Git, so a fresh checkout normally needs a new WebGL build first.
Use the included server rather than python -m http.server. Check the compressed responses with:
curl.exe --head http://127.0.0.1:8080/Build/WebGreybox.data.br
curl.exe --head http://127.0.0.1:8080/Build/WebGreybox.framework.js.br
curl.exe --head http://127.0.0.1:8080/Build/WebGreybox.wasm.brExpected headers:
| File | Content-Type |
Content-Encoding |
|---|---|---|
.data.br |
application/octet-stream |
br |
.framework.js.br |
application/javascript |
br |
.wasm.br |
application/wasm |
br |
Also verify that the loading screen reaches 100%, the detailed Krishna Mandir renders, the browser console has no application errors, cursor capture works, and the player cannot pass through the temple collision.
Netlify hosting is configured through Deployment/Netlify/_headers, which sets the Content-Encoding and Content-Type headers the Brotli-compressed WebGL build needs. Netlify cannot run the Unity build itself, so build locally first, then upload the finished Builds/WebGreybox directory.
- Install the Netlify CLI once:
npm install -g netlify-cli. - Sign in once:
netlify login. - Link this repository to a Netlify site once:
netlify sites:create --name <site-name> --manual(ornetlify linkfor an existing site). - Build the current scene:
.\Run-PatanExplorer.cmd -Rebuild. - Deploy:
.\Deployment\Deploy-Netlify.ps1for a draft preview, or.\Deployment\Deploy-Netlify.ps1 -Prodto publish to the production URL.
The script copies _headers into Builds/WebGreybox before calling netlify deploy, so the Brotli headers are always current. Draft deploys require a Netlify login to view; only a -Prod deploy is reachable at the site's public URL.
Close the Unity Editor instance using Unity/PatanExplorer before starting a batch build. Do not run two Unity processes against the same project directory.
Retrieve the Git LFS objects and reopen Unity:
git lfs pullCheck that Assets/Patan/Art/KrishnaMandir/Models/KrishnaMandir.fbx is a binary FBX and not a small text pointer.
In Unity Hub, open the settings for Editor 6000.3.23f1, select Add modules, and install Web Build Support.
Open File > Build Profiles, choose the Web/WebGL profile, and select Switch Platform before using Patan > Build Web Release.
Do not open index.html directly and do not use a generic static server without Brotli configuration. Start Deployment/serve_web.py and inspect the response headers described above.
Stop the process currently using the port or start the server on another port such as 8081.
Stop and restart the local server, then perform a hard refresh with Ctrl+F5. The included server sends Cache-Control: no-cache, but Unity data can also be retained in browser storage.
Review these files first:
Builds/WebGreybox-build.log
Builds/GreyboxValidation.log
Builds/GreyboxValidation.json
Also check the Unity Console and the browser developer console for the first error rather than later follow-on messages.
Unity/PatanExplorer: Unity projectUnity/PatanExplorer/Assets/Patan/Art/KrishnaMandir: public optimized Krishna Mandir FBX, textures, and materialsArtSource: Blender and source texture workWorldData: OSM provenance, survey metadata, and local world anchorDocs: MVP scope, performance budgets, and survey/source policyLicenses: asset ownership, licensing, and attribution recordsDeployment: Brotli-aware local server and static-host configurationBuilds: generated local WebGL builds, logs, and validation reports; ignored by Git
The optimized Krishna Mandir shipping asset is original project artwork recorded as All rights reserved in Licenses/AssetRegister.csv. Public repository access does not grant reuse rights beyond those explicitly provided by the copyright holder.
Survey scans, restricted photographs, third-party references, and other source material must not be committed unless their terms explicitly permit redistribution. Keep restricted source material in the ignored locations documented by the project policy.