Real Castle Generator - Procedural Medieval Castle & Fortress Generator
u3d
$22.00
$44.00
50%OFF
(no ratings)
Jump AssetStore
Generate walkable medieval castles from a seed: hollow towers, a working gatehouse, keep, baileys, a moat with drawbridge, ruins. Realistic or Cartoon, in the Editor or at runtime. URP, Unity 6.3.URP only: Unity 6000.3.21f1 with URP 17.3. HDRP and the Built-in pipeline are not supported. The moat water uses the URP Depth Texture and, for refraction, the Opaque Texture (the sample's URP asset has both on).Generate a complete medieval castle from a seed — curtain walls, hollow towers with cones, pyramids and turrets, a gatehouse with working gate leaves and a portcullis, a keep, inner buildings, baileys and an optional hand-dug moat with a working drawbridge — and walk it from the road to the top of its towers. Right in the Editor without Play mode or live at runtime, for the Universal Render Pipeline (URP) in Unity 6.3 (6000.3.21f1).Two looks in one asset: switch the finished castle between Realistic (full PBR stone without visible tiling, dirt, damp, moss and wear, real water in the moat) and Cartoon (low-poly, hand-painted) with one setting, and pick the wall stone and roof colours — the materials change on the spot, nothing is rebuilt. Each style brings its own colour grade, the Realistic one with a cinematic depth of field.Pick a preset or set your own parameters and press Generate. Every seed gives a new, believable castle, and the same seed always gives the same one, in the Editor and in your builds. Drag a slider and the castle rebuilds while you drag: size, corners, wall height, the number of towers, storeys, baileys, the moat, ruin.A whole fortification, not a kit of parts- Curtain walls of 3 to 8 corners, regular or irregular, 28 to 160 m across and 4 to 14 m high, with a wall walk, battlements and an inner parapet.- Round, square or mixed towers at every corner and along the walls, of varied height: crenellated platforms, conical roofs on round towers, pyramid roofs on square ones, and small corner turrets on the keep, the gatehouse and square towers.- Every tower is hollow: a ground room, a chamber at the level of the wall walk, a vice (spiral stair) up to the roof platform, and arrow loops with splayed embrasures in every room.- A gatehouse with an arched passage and double timber gate leaves on strap hinges with a draw bar; where the hall above the passage is tall enough, a portcullis in its slot, raised by a windlass with chains and a counterweight. The gatehouse faces any compass bearing.- Posterns through the wall and open stone stairs up to the wall walk from every ward.- A keep of 2 to 7 storeys, a great hall, a chapel, a timber gallery, stables, a kitchen, houses and workshops, a garden and a well.- Sub-castles: up to two baileys, walled courts against the main ring with their own towers and a gate tower from the main court.- Age from intact to ruin: breaches in the walls, collapsed tower tops and roofless buildings.Walk your castle- The wall walk runs on through every tower chamber and through the gatehouse hall, with doors from the courtyard and onto every wall; colliders sit under every step, stair and vice.- Tour camera (F3): a ride from the road through the gate and the courtyard, up a stair, along the walls and through the towers, scriptable frame by frame for trailers.- First-person walker (F4): a CharacterController sample that starts on the road at the gate: walk, run, look and hop, and hand the camera back with F4.- Always walkable: every building door, stair, postern and breach stays reachable from the gate; the tests walk every castle's tour every 0.4 m against its colliders.Moat, bridges and the gate at work (optional)- A dry ditch or a water moat around every ward, 5 to 18 m wide and 1.5 to 6 m deep — surveyed with parallel banks, or hand-dug with wandering banks, uneven slopes and a spoil heap.- At the main gate a drawbridge of oak planks that raises on its chains, a deck that rolls back into the gate passage, or a stone bridge; timber footbridges at the posterns and earth causeways at the breaches.- Work the gate from code, from the runtime panel or with the keys: F9 the bridge, G the gate leaves, P the portcullis, and Shift+F9 seals or opens the whole gate in order — leaves, draw bar, portcullis, bridge.Realistic and Cartoon materials- Realistic: a masonry shader that lays out its own courses and stones, so no texture repeat shows; every stone has its own patch of texture, colour, roughness and tilt. Dirt and occlusion gather at the foot of walls, rain streaks run down from ledges, moss and damp sit low, edges wear, and a waterline marks the moat. Full PBR oak for the gates and bridges.- Moat water with small waves, wind ripples, reflections of the sky and the castle, refraction, depth absorption and foam along the banks.- Cartoon: the same castle as low-poly, hand-painted stone with bold mortar, bright roofs and flat stylised water.- Wall stone (Natural, Limestone, Sandstone, Granite, Red Sandstone, Whitewashed) and roof colour (Natural, Slate, Terracotta, Copper, Blue, Charcoal) in both styles.- Simple versions of every material for low quality levels, and material sets you can duplicate and restyle.Light, sky and colour grade- Post-processing that follows the style: Realistic (ACES filmic, warm highlights and cool shadows, subtle bloom), Realistic Cinematic (a bokeh depth of field with auto focus, F10) and Cartoon (brighter, softer colours). It changes only its own Volume.- An HDR sky of a clear day with fair-weather cumulus, rendered for this package in Blender Cycles.- Rolling hills out to the horizon with a glacis and a meadow around the castle, fading into the haze, and grass on the site and the meadow that keeps off the paths, the moat and the buildings. Grass quality Low, Medium or High, or switch the hills and the grass off.Six presetsCourtyard Castle, Square Fortress, Hill Fort Ruin, Fortified Manor, Bailey Castle and Grand Fortress. A preset is only a starting recipe: every setting stays editable, and any castle can be copied as a small JSON recipe and pasted back.In the Editor and in your game- Editor: a generator inspector with Generate, New seed, a seed lock, the preset, Live and one foldout per settings group; every change is undoable. Save to scene turns the castle into meshes, materials and a prefab that live without the generator, with optional lightmap UVs.- A baked demo castle included — bake your own in one click: Save & Bake Lighting saves the castle and bakes its lightmaps, light probes and reflection probes (Draft or Presentation, CPU or GPU), and the style and colour switches keep working on the saved castle.- Runtime: a uGUI panel (no IMGUI) with presets, seed, every setting, a status bar, a Gatehouse row (Bridge, Gate, Grille, Copy / Paste of the recipe) and an Explore row (Tour, Walk). Plan and geometry run on a worker thread and the objects are created in time slices, so the frame rate holds and the screen never shows a half-built castle.- Export the plan of any castle as an SVG drawing: walls, towers, gates, buildings, stairs, doors and routes.Built for your code- Engine-free C# for the planner, the geometry compiler and the walking tour (no UnityEngine reference), deterministic and testable.- One component, CastleGenerator, with a small public API: LoadPreset, SetParam, Generate, Randomize, RecipeJson, the bridges and the gate (SealCastle, OpenCastle, CloseGate, DropPortcullis), the Built and MaterialsChanged events and a build report.- Every generated castle carries its plan ids and tags on each element, colliders, and markers for gates, the spawn point, camera spots, ivy anchors on wall faces and the moving bridges.AI Ready. Built to be driven by AI coding agents as well as by hand. Documentation/AGENTS.md gives Claude Code, Codex, Cursor or a Unity MCP bridge the exact entry points: the CastleGenerator component and its public API (LoadPreset, SetParam, Generate, RecipeJson, the gate controls), the six presets and every setting as plain data in CastlePresets and CastleParams, the tour camera, the walker and the colour grade, the Tools > Real Castle Generator menu commands, task recipes, and a Verify section with a ready batch check that plans, compiles and checks every preset and ends in a PASS line. An agent can build, tune and check castles without guessing.Technical details- Unity 6000.3.21f1, URP 17.3 only. HDRP and the Built-in pipeline are not supported. The moat water uses the URP Depth and Opaque Textures.- Triangles per castle (moat, bridges, tower rooms and the gate works included): about 22,500 (Fortified Manor) to 110,600 (Grand Fortress); the landscape hills add at most 60,000, the grass is GPU-instanced.- No models to import: all geometry is generated. Own URP shaders (masonry, ground, water, Cartoon, grass, horizon) with PNG maps up to 2048 px.- Two sample scenes: the live generator, and a baked Courtyard Castle with lightmaps, light probes and reflection probes.- Media: the background forest in the video is Real Millions of Trees 2D (sold separately). This package contains no trees; its landscape has hills and grass.CreditsThe interface uses the font Source Sans Pro by Adobe under the SIL Open Font License 1.1; see ThirdPartyNotices in the package.SupportQuestions and bug reports: the Real Castle Generator thread on Unity Discussions, or cgteamorg@gmail.com. Please include your Unity version and the recipe (Copy recipe).More from this family- Real Horror Hospital — procedural hospital and asylum horror level generator, the same live-generator architecture: https://assetstore.unity.com/packages/slug/415078- Real Underwater — the screen-space underwater effect whose water surface the moat builds on: https://assetstore.unity.com/packages/slug/406038- Dynamic Ivy — grow climbing plants over your castles: https://assetstore.unity.com/packages/slug/407934- Real Earth Planet — real-world terrain, roads and railways generator: https://assetstore.unity.com/packages/slug/412072- Built and tested on Unity 6000.3.21f1 with URP 17.3, and URP only: HDRP and the Built-in pipeline are not supported. The moat water uses the URP Depth and Opaque Textures.- Tested on Windows desktop (Editor and a standalone player). No mobile, console or WebGL claims.- Dependencies: URP and uGUI. Optional: the Input System (the controls use it when present, the Input Manager otherwise).- Generation in the Editor without Play mode (an inspector with every setting) and at runtime (a uGUI panel, no IMGUI).- Content: 6 presets, 2 sample scenes (the live generator, built from 6 prefabs; a baked Courtyard Castle with lightmaps, light and reflection probes), two material styles (Realistic and Cartoon, each with Simple versions for low quality levels), 3 post-processing profiles (Realistic, Realistic Cinematic with depth of field, Cartoon), own URP shaders (masonry, ground, water, Cartoon, grass, horizon), PNG maps up to 2048 px, one EXR sky, no model files (all geometry is generated; the baked demo keeps its generated meshes in one mesh asset), no JPG.- Walkable castles: hollow towers with rooms, vices and arrow loops; wall walks through the towers and the gatehouse hall; a tour camera (F3) and a first-person CharacterController walker (F4).- Gate works: gate leaves with a draw bar, a portcullis with its windlass and the moving bridge, sealed and opened in order from code, the panel or the keys (G, P, F9, Shift+F9).- Save & Bake Lighting: saves a castle and bakes its lightmaps, light probes and reflection probes in one click (Draft or Presentation, Progressive CPU or GPU), also from code and the command line.- Geometry: about 22,500 (Fortified Manor) to 110,600 (Grand Fortress) triangles per castle at seed 1, moat, bridges, tower rooms and gate works included; colliders on walls, floors, stairs and tower shells. Landscape hills at most 60,000 triangles; grass drawn with GPU instancing (Low / Medium / High).- Deterministic: the same seed and settings give the same castle in the Editor and in Mono and IL2CPP builds.- Rebuild: plan and geometry on a worker thread, objects created in 10 ms time slices; a style or colour change swaps materials without a rebuild. In the Editor a preset rebuilds in 0.6-1.5 s with the landscape on our test PC (the grass is most of it); times depend on your hardware.- Fonts: Source Sans Pro (SIL Open Font License 1.1) for the runtime panel, in Resources/RCG/Fonts.- Source: about 27,000 lines of C# in 3 assemblies (an engine-free core with the planner, the walking tour and the geometry compiler, the Unity runtime with the landscape and grass, the editor).- Everything ships under Assets/RealCastleGenerator. Download about 155 MB; on disk about 167 MB, of which the texture maps are 140 MB and the baked demo scene 23 MB.Yes - AI was used in the creation of this package.Code and documentation were written with AI coding assistants and reviewed and tested by the publisher: engine-free test harnesses for the plan (determinism, reachability, 10,000 fuzzed recipes), the geometry and the walking tour, Unity EditMode tests, standalone player runs and Unity's Asset Store validator.No AI-generated art is bundled. All castle geometry is generated by the package's own code. The textures are the publisher's own procedural maps (Houdini and Python scripts), the sky is the publisher's own render in Blender Cycles, and the grass blades come from the publisher's own procedural grass. No image in the package carries generator metadata (every PNG scanned); the EXR files are the Blender sky and the demo scene's lighting baked by Unity.


