24
2013
Perlin Dungeon Maker
Perlin noise generated dungeons / caves! (w.i.p)
Webplayer:
http://unitycoder.com/upload/demos/PerlinDungeons1/ (v1.0 : some bugs in webplayer build: floor & roof normals / tangents broken?, minimap is broken..)
Current version info:
– Creates 2D texture and array with perlin noise (not needed, since you could check x,y perlin values directly anyways..)
– First pass, create floors (with basic RLE – to save few vertices.. 1 floor can be long as seen in the image):
-> If we hit empty grid point, save x & y values
-> Until we hit a filled grid point (wall), then draw floor mesh from saved x & y values until here
-> Scale UV based on floor piece length (so that tiling is still correct)
– Second pass: Similar thing for walls (currently single pieces..would save vertices to draw long walls as 2 faces only)
– Maximum: 256×256 grid (mesh cannot have more than 65k vertices..could split it to new mesh)
– Adjustable wall height
– Added: basic minimap (guitexture with texture2D & setpixel..)
– Walls, floor, roof are separate meshes, easier to adjust their texturing (current textures are from opengameart.org)
– Added: Tangents for floor & roof meshes (so can use normal maps), founded the info from minecraft thread.
– Added: Footstep sounds (script & sounds from: bootcamp demo, modified the script to play sounds with autofire timer..)
– Added: Ambient cave sound (from: http://www.freesfx.co.uk )
– Added: waterdrop particles from roof
– Added: Cave mesh saving from playmode
– Added: HeadBobber (had to move fps camera under dummy gameobject and assign bobber to that gameobject..)
– Tried: GridMove, works fine but rather use free moving for now..
Ideas:
– Actually floor and ceiling could be just single plane..
– For texturing..use secondary perlin noise for “terrain” variation? (moss, rocky, sand..)
– Its single mesh, needs texture atlas for multiple materials?
– Generate mob spawned locations too? Other objects too?
– Generate floors and stairs and holes to other floors? (needs 3D perlin noise, currently using Mathf.PerlinNoise();)
– Level saving as an asset? (or could use OBJ save from angry bots?)
– Digging/breaking the walls?
– Volumetric fog or other effects? (since we are inside limited 2D grid, could do visibility casting & fake shadow stuff too?)
– Tesselation shaders (must use for something?! rounding the objects? or with wall displacement mapping?)
—
Image#1: 8×8 “dungeon”
—
Image#2: 256×256 cave/labyrinth (adjusted perlin noise scale to make larger walkways) *click to view full size
—
Image#3: FPS Controller view (still needs variation for texturing..)
—
Image#4: Now wall, floor, roof are separate meshes. Added basic minimap also.
—
Image#5: Testing fog with particles.. (doesnt look so good then turning..)
—
Image#6: Particles with Clipsafe shader (also moved the emitter down, so the smoke is more at floor level and particle type is vertical billboard)
Related Posts
4 Comments + Add Comment
Leave a comment
Recent posts
- MotionVector Effect: Object “disappears” when paused
- [GreaseMonkey] Unity Forum Fixer
- UnityHub: Make Hub application background Translucent
- Customize SpriteShapeRenderer quality (but has issues)
- Editor tool: Copy selected gameobject’s names into clipboard as rows (for Excel)
- Editor tool: Replace string in selected gameobject’s names
- UnityHub: Enable built-in Login Dialog (no more browser login/logout issues!)
- Use TikTok-TTS in Unity (with WebRequest)
- Create Scene Thumbnail Image using OnSceneSaved & OnPreviewGUI
- webgl+javascript TTS
- Using Moonsharp (LUA) + Unity Webgl
- Using 3D gameobject prefabs with Unity Tilemap + NavMesh Surface
Recent Comments
- [Asset Store] Point Cloud Viewer & Tools on
- [Asset Store] Point Cloud Viewer & Tools on
- Vector3 maths for dummies! on
- UnityHub: Make Hub application background Translucent on
- UnityHub: Make Hub application background Translucent on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- [Asset Store] Point Cloud Viewer & Tools on
Added webplayer. (^note: some bug there..)
Interesting stuff,
Random Dungeon Generator for Unity
http://forum.unity3d.com/threads/174147-Random-Dungeon-Generator-for-Unity
Generator
http://www.myth-weavers.com/generate_dungeon.php
Were you able to do anything with this? I’ve been looking into doing this exact thing, but haven’t really figured it out yet.
Nothing yet, this was the latest test using it: http://unitycoder.com/blog/2013/01/27/realm-of-something-proto/