14
2013
Heightmap Chunk
Saw this in the forums (simpleminecraft), sounds interesting!. Havent looked at their sources yet, but made own test version first..
Current version:
– Single chunk..
– Chunk creator (random or perlin)
– 2D array for grid heights
– 3D array for grid cell types
– Using texture atlas (current texture is from some minecraft texture pack..)
– Using grid movement from unifywiki: player can move around, if target pos it not too high (modified the script so that it moves first up or down, if need to)
– Basic camera switch
– Basic Vertex color lightness calculation (if neighbours are higher, make this block darker..)
– Added better controls (w = move forwards, a/d = move sideways, q/e = rotate)
– Added basic laser effect for “cutting” a block in front
– Added basic terrain editing (press space to eat block in front of you, blocks above it will go down instantly..)
– GridMove was too sensitive, modified:
// before
input = new Vector2(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"));
// after
input = new Vector2(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical"));
– Added version 3.0 webplayer
– Added health guitexture (hearts, you can see it decrease when player digs ground..just for testing)
– Added some metal textures to player (low res substances from here)
– Added firepower guitexture (mousescroll to adjust it)
– Added basic cannon (rotates slowly towards mouse, taken from deflector proto test)
– Added basic shooting (rigidbody sphere) & missile collision checker
– Adjusted fog color
TODO:
– Better world generation (+biomes..)
– Fix rounding errors.. using Vector3()..values start to get away from exact 0.5 steps.. maybe this: Rounding values to 0.5
– Collisions?
– Animate falling blocks?
– Multiple chunks
– Physics? (no need caves, so if you remove a block, other blocks from top of it should fall down)
– 2D version? (then could use the watersim fluids for it)
– Fake shadows, ao..etc (since we are in fixed grid..could be easier) *Some tools here: VertexAo
– Use 3D A* pathfinder!? (mouseclick target, then player moves there? or for enemies..)
– Add something to collect..coins..
– FPS view? Camera follow?
– 1 chunk is 1 room? (add teleport as a goal >>> moves to next level after tasks are done?)
– Terrain mesh normals, tangents (tangentsSolver)
– Water block?
– Cap grid borders
– Grid visibility ?
– Health (lose health if fall from high)
– Better camera (dont go inside blocks)
– Enemies?
– Building something?
– Toolbar / inventory
Webplayer:
http://unitycoder.com/upload/demos/HeightMapChunkCraft1/ (v3.0 updated: 19.4.2013 )
Download sources:
https://github.com/unitycoder/PlanecraftMeshTerrain
—
Image#2: Randomized terrain
—
Image#3: Vertex colors for darkening.. (using vertex color shader from here)
—
Image#4: Version 3.0
Related Posts
1 Comment + Add Comment
Leave a comment
Recent posts
- Adding Real World Location to Ice Fishing Prototype
- [web tool] Image Channel Inspector : AlphaScope
- Editor Tool: Smart Recompile (don’t recompile if edit comments)
- Editor Tool: Scene Size Analyzer
- LudumDare 60: Old Tech
- uBasic Scripting Language for Unity
- GreaseMonkey+Editor Plugin: 1-Click Copy script from ChatGPT (Web) to Unity Editor (as script)
- Editor Tool: Property Watcher
- .unityignore : Hide files from Project window
- PostBuild Script to Create Single exe Standalone File
- Game Loop Designer
- Favorites in PackageManager
Recent Comments
Coin:
CUgDSbRqFcAumDSAcdKDvuXsw26VdkJe8C8WGUQHBAGS
An article by
















Source added:
https://github.com/unitycoder/PlanecraftMeshTerrain