Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ jobs:
run: |
set -o pipefail
gradle --no-daemon build --stacktrace 2>&1 | tee build-verification.log
- name: Verify distribution and export actual reference blocks
shell: bash
run: |
python3 scripts/verify-artifact.py fabric/build/libs/castleforge-fabric-0.3.0-alpha.3.jar
java -Xmx512m -cp core/build/classes/java/main:core/build/classes/java/test dev.castleforge.core.ReferenceExport build/reference
- uses: actions/upload-artifact@v4
with:
name: castleforge-fabric-26.1.2
Expand All @@ -39,4 +44,7 @@ jobs:
build-verification.log
core/build/reports/
fabric/build/reports/
build/reference/
build/JAR_SHA256.txt
if-no-files-found: warn

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
.vscode/
*.iml
*.class
__pycache__/
*.pyc
*.log
*.jar
*.zip
!gradle/wrapper/gradle-wrapper.jar
hs_err_pid*
replay_pid*

76 changes: 70 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,49 @@
Terrain-aware procedural castles and independent culture regions for Minecraft.
Original idea: Emre's brother. Concept and project direction: Emre (`badmon61`).

## Status: 0.2.1-alpha.1 — identity and architectural diagnostics
## Status: 0.3.0-alpha.3 - connected wall-walk study, not visually accepted

**Experimental, opt-in, disposable test worlds only. No automatic generation.**

**The owner rejected Falkenwacht v1's visual quality after an in-game trial.**
V2 adds real residential partitions, wider framed facade bays, roof lights,
gable joinery, a furnished court and corrected hall furniture proportions.
It remains a fixed-layout study, below the intended hand-built benchmark.
V3 adds a modeled three-wide wall-walk circuit through the four corner towers
and upper gatehouse, a court stair, explicit parapets and post-furnishing checks.
The independent elevated centreline is 340 blocks; this is not a measured
Minecraft traversal duration. See [v3 evidence and focused test](docs/REFERENCE_V3_WALLWALK.md).
See [the rejection and design decision](docs/ADR_0002_VISUAL_REJECTION_AND_DETAIL_STUDY.md),
[v2 comparison and evidence](docs/REFERENCE_V2_STUDY.md) and the preserved
[long-term product direction](docs/PRODUCT_DIRECTION.md).

0.3 adds one independently authored reference castle, Falkenwacht. A typed
architecture model defines building masses, room functions, floor levels,
connections, stair flights, windows and roofs before any block placement.
The new module and interior passes create a dominant keep, a great hall,
residential/service wings, a framed gatehouse and a courtyard, with protected
routes and final geometry checks. No schematics or third-party templates.

Use `/castleforge preview reference [x z]`. Snapshot and preflight work run over
several server ticks; pure planning runs on a bounded worker. **Wait for
`PREVIEW READY`**, then use `/castleforge inspect` and `/castleforge build confirm`.
The reference surveys 109 x 109 already-loaded columns; its default centre is
58 blocks north of you. `/castleforge status` reports preparation and placement;
`/castleforge cancel` also cancels reference preparation.

This is one maintained central-European architectural study, independent of the
site's culture identity. Existing culture regions, 7x scale and saved settings
are unchanged. Furniture uses safe single-block primitives, not inventories or
multi-block beds/doors. Hearths are decorative. The original classic and terraced
paths remain available and retain their regression tests.

See [reference architecture, limits and manual test](docs/REFERENCE_ARCHITECTURE.md),
[design decision](docs/ADR_0001_REFERENCE_ARCHITECTURE.md) and
[verification evidence](docs/REFERENCE_VALIDATION.md). Technical images are
rendered from generated block data; they are **not Minecraft screenshots or
proof of visual acceptance, block physics, actual collision shapes or FPS**.

## Previously: 0.2.1-alpha.1 — identity and architectural diagnostics

**New in 0.2.1:** Seed-stable, culture-dependent castle names and regional dynasties, symbolic heraldry, age, chronological construction milestones, and a condition-derived *planned* occupancy category. These are narrative metadata only: **no NPCs, loot, actual banners or timeline simulation are spawned**. The two existing castle shapes and culture map remain unchanged. Different regions may coincidentally share generated names; uniqueness is not promised.

Expand Down Expand Up @@ -40,19 +82,25 @@ Automatic exploration-time generation; automatically measured biome scaling; arb
Target remains **Minecraft Java 26.1.2**, **Java 25**, **Fabric Loader 0.19.5+**, **Fabric API 0.155.3+26.1.2**.

1. Use a separate Prism/Fabric instance and a new disposable Creative world with commands enabled.
2. Install `castleforge-fabric-0.2.1-alpha.1.jar` from a successful branch Actions build plus the matching Fabric API. Replace the old CastleForge JAR; do not install two versions or a `-sources.jar`.
3. Start on superflat to verify the build workflow, then test a second disposable world with open, gradual slopes. The new survey is 105 × 105 blocks; the whole site must already be loaded.
2. Install `castleforge-fabric-0.3.0-alpha.2.jar` from a successful branch Actions build plus the matching Fabric API. Replace the old CastleForge JAR; do not install two versions or a `-sources.jar`.
3. Start on superflat to verify the reference workflow, then test a second disposable world with shallow, open terrain. Reference uses a 109 × 109 survey; legacy terraced uses 105 × 105. The whole site must already be loaded.
4. Execute separately:

```mcfunction
/castleforge region
/castleforge preview terraced
/castleforge preview reference
/castleforge status
```

After `PREVIEW READY`:

```mcfunction
/castleforge inspect
/castleforge build confirm
/castleforge status
```

The default new site is centred 56 blocks north of you. Its entrance may face another direction because the planner rotates to fit terrain. Explicit coordinates work with `/castleforge preview terraced <x> <z>`. Preview is a **text report**, not a visual ghost building. Confirmation expires after 120 seconds. Stay near the entire build area.
Reference is centred 58 blocks north of you; legacy terraced is centred 56 blocks north. Reference orientation is deterministic from seed and position. Explicit coordinates work with `/castleforge preview reference <x> <z>` and `/castleforge preview terraced <x> <z>`. Preview is a **text report**, not a visual ghost building. Confirmation expires 120 seconds after readiness. Stay near the entire build area.

The original generator is still selected by `/castleforge preview` or `/castleforge preview <x> <z>`; its default centre remains 28 blocks north of you.

Expand All @@ -63,7 +111,11 @@ The original generator is still selected by `/castleforge preview` or `/castlefo

Cancel leaves a partial building. Undo only covers the last build in this server session and is lost on server shutdown, world close, crash or the next build. It skips conflicting later edits, with the documented exception for automatically recomputed stair shape. It does not journal every neighboring physics effect. **Undo is not a backup.**

All commands require moderator permission/cheats. No chunks are force-loaded. Terrain sampling and planning are bounded but synchronous: a preview can still briefly stall a tick. Placement uses the existing cooperative per-tick budget; a single Minecraft block update can exceed it.
All commands require moderator permission/cheats. No chunks are force-loaded.
Reference snapshot/preflight use cooperative tick budgets and its pure planner
runs on a worker. Legacy previews and final confirmation checks remain
synchronous. Placement uses the existing cooperative per-tick budget; a single
Minecraft operation can exceed it. This is not a hard real-time or FPS guarantee.

## Generation settings

Expand All @@ -84,6 +136,17 @@ The CI uses pinned Gradle; a Gradle wrapper is not yet checked in. Pure generato
bash scripts/verify-core.sh
```

Windows PowerShell (JDK 21+ on PATH):

```powershell
./scripts/verify-core.ps1 -ExportReference
```

The additional `verifyReference` suite checks the separate architecture and final
furnished blocks, deterministic rotations, bounded sites, deliberate invalid
fixtures and the terrain approach. Exact cases and results are recorded in
[reference validation](docs/REFERENCE_VALIDATION.md).

The classic suite checks 50 seeds. A third suite checks narrative identities across 100 seeds and eight cultures, coherent chronology, region-level dynasties, diagnostic counts and reporting. The new suite checks **32 seeds × 5 synthetic terrains = 160 combinations**, all eight culture profiles, all four rotations, roofs and condition states, determinism, navigation, bounded supports, rejection cases, negative/world-edge coordinates and concurrent planning. A golden geometry digest detects unintended generator drift. Repeated per-voxel assertions are not millions of different test scenarios.

Passing these checks is **not a Minecraft launch, entity-pathfinding, block-physics or visual test**. See [terraced architecture and acceptance checklist](docs/TERRACED_ARCHITECTURE.md), [original architecture](docs/ARCHITECTURE.md), [classic test checklist](docs/TESTING.md), [initial alpha validation](docs/VALIDATION.md), and [long-term roadmap](docs/ROADMAP.md).
Expand All @@ -93,3 +156,4 @@ Passing these checks is **not a Minecraft launch, entity-pathfinding, block-phys
A redistribution license has not been selected. Public visibility does not grant a redistribution license. No Mojang binaries, third-party schematics or texture assets are included.

Not an official Minecraft product. Not approved by or associated with Mojang or Microsoft.

3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ plugins {
}
allprojects {
group = 'dev.castleforge'
version = '0.2.1-alpha.1'
version = '0.3.0-alpha.3'
repositories { mavenCentral() }
}
tasks.named('build') { dependsOn ':core:build', ':fabric:build' }

11 changes: 10 additions & 1 deletion core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,13 @@ tasks.register('verifyIdentity', JavaExec) {
maxHeapSize = '512m'
mustRunAfter verifyTerraces
}
tasks.named('check') { dependsOn verifyCore, verifyTerraces, verifyIdentity }
tasks.register('verifyReference', JavaExec) {
dependsOn testClasses
classpath = sourceSets.test.runtimeClasspath
mainClass = 'dev.castleforge.core.ReferenceVerification'
maxHeapSize = '512m'
mustRunAfter verifyIdentity
}

tasks.named('check') { dependsOn verifyCore, verifyTerraces, verifyIdentity, verifyReference }

Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
package dev.castleforge.core.architecture;

import dev.castleforge.core.CastlePlanner.Pos;
import static dev.castleforge.core.architecture.ArchitectureModel.*;
import static dev.castleforge.core.architecture.ReferenceBlock.*;

/** Original masonry/joinery vocabulary applied to declared bays, partitions and court ensembles. */
final class ArchitecturalDetails {
static void build(ArchitectureModel model,OwnedBlockBuffer b) {
for(Partition p:model.partitions()) {
Box a=p.wall();
for(int x=a.minX();x<=a.maxX();x++)for(int z=a.minZ();z<=a.maxZ();z++)for(int y=a.minY();y<=a.maxY();y++) {
Pos pos=new Pos(x,y,z);
if(p.portals().stream().anyMatch(portal->portal.contains(pos))) continue;
boolean post=a.width()==1?Math.floorMod(z-a.minZ(),4)==0:Math.floorMod(x-a.minX(),4)==0;
b.put(p.moduleId(),x,y,z,post||y==a.maxY()?Kind.TIMBER:Kind.PLASTER);
}
}
for(FacadeBay bay:model.facadeBays())bay(bay,b);
gableJoinery(model,b);
hallStructure(model,b);
for(Dormer d:model.dormers())dormer(d,b);
for(CourtFeature f:model.courtFeatures())court(f,b);
}
private static void gableJoinery(ArchitectureModel model,OwnedBlockBuffer b) {
for(String id:new String[]{"residence","service"}) {
var m=model.module(id);Box a=m.bounds();int mid=(a.minX()+a.maxX())/2;
for(int z:new int[]{a.minZ(),a.maxZ()})for(int x=a.minX();x<=a.maxX();x++)for(int y=a.maxY()+1;y<=a.maxY()+12;y++) {
Pos p=new Pos(x,y,z);ReferenceBlock old=b.at(p);
if(old==null||old.kind()!=Kind.STONE)continue;
boolean frame=x==mid||y==a.maxY()+2||Math.abs(x-mid)==y-a.maxY()-2;
b.put(id,x,y,z,frame?Kind.TIMBER:Kind.PLASTER);
}
}
}
private static void dormer(Dormer d,OwnedBlockBuffer b) {
int front=d.frontX(),mid=d.centerZ(),base=d.baseY();String id=d.moduleId();
// The rear edge meets the existing roof at its own height. No cross-owner crop or overwrite.
for(int x=front-4;x<=front;x++)for(int z=mid-2;z<=mid+2;z++) {
int oldRoof=base-1+front-x;
for(int y=oldRoof+1;y<=base+3;y++) {
boolean frontWall=x==front,side=Math.abs(z-mid)==2;
b.put(id,x,y,z,frontWall?(side||y==base?Kind.TIMBER:Kind.GLASS):side?Kind.TIMBER:Kind.AIR);
}
}
for(int x=front-4;x<=front+1;x++)for(int z=mid-3;z<=mid+3;z++) {
int y=base+3+(3-Math.abs(z-mid));
// Preserve the dominant roof where it rises above the subordinate eave.
int parentRoof=base-1+front-x;
if(y<=parentRoof)continue;
if(x==front)for(int fill=base+4;fill<y-1;fill++)b.put(id,x,fill,z,Kind.PLASTER);
b.put(id,x,y-1,z,Kind.TIMBER,Facing.EAST);
b.put(id,x,y,z,z==mid?Kind.ROOF_SLAB:Kind.ROOF_STAIRS,z==mid?Facing.NONE:z<mid?Facing.SOUTH:Facing.NORTH);
}
}
private static void bay(FacadeBay bay,OwnedBlockBuffer b) {
Window w=bay.window();Box a=w.opening();Facing out=w.outward();String id=w.moduleId();
int tx=out.dz==0?0:1,tz=out.dx==0?0:1;
int cx=(a.minX()+a.maxX())/2,cz=(a.minZ()+a.maxZ())/2;
// One-block reveal with jambs, continuous sill and a stepped hood. Glazing remains recessed.
for(int side:new int[]{-2,2})for(int y=a.minY()-1;y<=a.maxY();y++)
b.put(id,cx+tx*side+out.dx,y,cz+tz*side+out.dz,Kind.TRIM);
for(int t=-2;t<=2;t++) {
b.put(id,cx+tx*t+out.dx,a.minY()-1,cz+tz*t+out.dz,Kind.STONE_SLAB);
int h=a.maxY()+1+(bay.style()==BayStyle.HALL_LANCET&&Math.abs(t)<2?1:0);
b.put(id,cx+tx*t+out.dx,h,cz+tz*t+out.dz,Kind.TRIM);
if(h>a.maxY()+1)b.put(id,cx+tx*t,a.maxY()+1,cz+tz*t,Kind.TRIM);
}
}
private static void hallStructure(ArchitectureModel model,OwnedBlockBuffer b) {
var hall=model.module("hall");Box a=hall.bounds();
// Buttresses are between the window bays; capitals align with the cornice and roof trusses.
for(int x:new int[]{-18,-12,-6,0,6,12})for(int z:new int[]{a.minZ()-1,a.maxZ()+1}) {
if(x==0&&z==a.maxZ()+1)continue; // principal portal
for(int y=0;y<=12;y++)b.put("hall",x,y,z,y==0||y==4||y==11?Kind.TRIM:Kind.STONE);
b.put("hall",x,13,z,Kind.STONE_SLAB);
}
for(int x=a.minX()+1;x<a.maxX();x++)for(int z:new int[]{a.minZ()-1,a.maxZ()+1})
b.put("hall",x,14,z,Kind.TIMBER,Facing.EAST);
// A clearly framed main portal, recessed into the facade, with a small stone canopy.
for(int x:new int[]{-3,3})for(int y=0;y<=6;y++)b.put("hall",x,y,-10,Kind.TRIM);
for(int x=-3;x<=3;x++)b.put("hall",x,7,-10,Kind.STONE_SLAB);
for(int x=-2;x<=2;x++)b.put("hall",x,6,-11,Kind.TIMBER,Facing.EAST);
// Hearth flue crosses the roof as a deliberately owned masonry junction.
for(int x=12;x<=13;x++)for(int z=-27;z<=-26;z++) {
for(int y=6;y<=22;y++)b.put("hall",x,y,z,Kind.STONE);
b.put("hall",x,23,z,Kind.TRIM);
}
for(int x:new int[]{12,13})b.put("hall",x,24,-27,Kind.STONE_SLAB);
}
private static void court(CourtFeature f,OwnedBlockBuffer b) {
String id="court-"+f.id();Box a=f.bounds();int cx=(a.minX()+a.maxX())/2,cz=(a.minZ()+a.maxZ())/2;
for(int x=a.minX();x<=a.maxX();x++)for(int z=a.minZ();z<=a.maxZ();z++)for(int y=1;y<=a.maxY();y++)b.airIfEmpty(id,x,y,z);
b.box(id,a.minX(),0,a.minZ(),a.maxX(),0,a.maxZ(),Kind.PAVING);
switch(f.use()) {
case COVERED_WELL -> {
for(int x=cx-1;x<=cx+1;x++)for(int z=cz-1;z<=cz+1;z++)
b.put(id,x,1,z,x==cx&&z==cz?Kind.ROOF:Kind.TRIM);
for(int x:new int[]{cx-2,cx+2})for(int y=1;y<=5;y++)b.put(id,x,y,cz,Kind.TIMBER);
for(int x=cx-2;x<=cx+2;x++)b.put(id,x,5,cz,Kind.TIMBER,Facing.EAST);
b.put(id,cx,4,cz,Kind.TIMBER); // stylized covered winch, no fluid or moving block
for(int x=a.minX();x<=a.maxX();x++)for(int z=cz-2;z<=cz+2;z++) {
int h=5+(2-Math.abs(z-cz));
b.put(id,x,h-1,z,Kind.ROOF);
b.put(id,x,h,z,z==cz?Kind.ROOF_SLAB:Kind.ROOF_STAIRS,z==cz?Facing.NONE:z<cz?Facing.SOUTH:Facing.NORTH);
}
}
case HERB_GARDEN -> {
for(int x=a.minX();x<=a.maxX();x++)for(int z=a.minZ();z<=a.maxZ();z++) {
boolean edge=x==a.minX()||x==a.maxX()||z==a.minZ()||z==a.maxZ();
if(edge)b.put(id,x,1,z,Kind.STONE_SLAB);
else if(x!=cx&&z!=cz)b.put(id,x,0,z,Kind.GARDEN);
}
for(int x:new int[]{a.minX()+2,a.maxX()-2})b.put(id,x,1,cz,Kind.WOOD_STAIRS,Facing.SOUTH);
}
case SEATING_ARBOR -> {
for(int x:new int[]{a.minX(),a.maxX()})for(int z:new int[]{a.minZ(),a.maxZ()})
b.box(id,x,1,z,x,5,z,Kind.TIMBER);
for(int x=a.minX();x<=a.maxX();x++)for(int z:new int[]{a.minZ(),a.maxZ()})b.put(id,x,5,z,Kind.TIMBER,Facing.EAST);
for(int x=a.minX();x<=a.maxX();x+=2)for(int z=a.minZ();z<=a.maxZ();z++)b.put(id,x,6,z,Kind.TIMBER,Facing.NORTH);
for(int x=a.minX()+1;x<a.maxX();x++)b.put(id,x,1,a.maxZ()-1,Kind.WOOD_STAIRS,Facing.SOUTH);
for(int x:new int[]{a.minX()+2,a.maxX()-2})b.put(id,x,5,cz,Kind.LANTERN);
}
}
}
private ArchitecturalDetails() {}
}
Loading
Loading