GithubHelp home page GithubHelp logo

voxelmetric1's Introduction

Voxelmetric

Join the chat at https://gitter.im/AlexSTV/Voxelmetric

Voxelmetric an open source voxel framework for unity3d. It's meant to be an easy to use, easy to extend solution for voxel games. Voxelmetric is currently in alpha so expect breaking changes and incomplete documentation. I am currently maintaining it alone and making changes as I learn but if anyone else wants to help they should feel free to make a pull request. Also use the issues to highlight bugs and suggest features.

For more information and documentation visit AlexSTV.com - Voxelmetric

Features

Terrain Generation

Generate realistic looking terrain with caves and landmarks like trees.

Ambient Occlusion

Darkening in the corners between blocks makes the terrain look more realistically lit.

Saving and Loading

Save and load your changes to the world at will.

Infinite Terrain

Terrain generates around a given object and is removed when you move too far away, there are no borders or limits.

Threading

Threading chunk updates and terrain loading means the voxels take full advantage of your hardware to generate fast without hurting framerate.

Define New Block Types

Define new blocks in the scene with your own textures and even your own 3d mesh for the block's geometry.

Pathfinding

3d voxel aligned pathfinding for units makes it possible for AI to move around the terrain.

Development

Voxelmetric is in development and is not yet at a 1.0 release, this means things are liable to change fast without notice or be broken and documentation will struggle to keep up.

voxelmetric1's People

Contributors

alex-irt avatar alexstv avatar gitter-badger avatar thegreatpl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

voxelmetric1's Issues

Function to create a GameObject based on a block

It should be possible to create a gamobject with a mesh generated based on a block in the world. This could be used to display the block after breaking it or used as a 3d preview of the block. The function needs to return the correct random texture if there is one.

Rotate Parameter for Set Block

When setting blocks should be allowed to rotate freely as floats for custom mesh objects and for block objects only 90 degrees or just 90 degree rotations all together.

Complex Caves

Would love to have complex caves like minecraft. My understanding is that Perlin Worms and libnoise are the way to do this.

Overhaul block data storage

Block data storage is currently a boolean, a short and 4 bytes intended to be used to store per block data, as pointed out by /u/Sleakes on Reddit this isn't a good system and needs to be overhauled. Only a few things use this data so far so it's still a good time to change. Still not sure what to replace it with though.

Ability to use separate textures

Ability to use separate textures instead of a sheet. These textures could possibly be stiched together to a spritesheet on runtime.

Random textures

Allow voxels to take multiple textures as a parameter, upon placing a block a random texture is selected. This creates variety in the voxel world. A possible way to keep the randomness consistent is using the terrain seed or creating a noise map.

Visual Biome Editor for Voxelmetric

So in order to make Voxelmetric more accessible to artists like myself. I am proposing a Visual Biome Editor inside the Unity Editor. I can see this being a low priority but a massive productivity booster for both artists and programmers. That said I would be willing to help out on the art side of things.

See video below for reference -

https://www.youtube.com/watch?v=1LJauth8EFc

So basically here is what I am asking -

  • Loads a pre-defined default biome for editing, modification and saving.
  • A series of sliders with a variety of ranges, tick boxes, and options for making each biome different. (See the video for reference)
  • The ability to import art assets such as 3D art and Scripts for Biome specific events, AI, etc. into the editor.

Connected textures bug when using non-solid

When setting a block to non-solid (for leaves, glass etc.) and using connected textures it'll generate the wrong textures 'inside' the blocks resulting in borders where there should be none. In this example, the glass shouldn't have borders inside.

Sample

Chunk Prefab

A way to alter or have a pre made single chunk and then reuse that chunk like a prefab.

Solid color blocks

I feel as this is a very simple question, but I have been trying for ages. Is there any way I can use Voxelmetric to have solid color blocks. I have placed a checkbox and a color input in my Definition script, but I can't for the life of me figure out how to make my block a solid color. I am trying to avoid a texture of any kind, because I want the color different depending on the location. In the long run I want to have the ability to select a color, and it will be slightly different depending on the location / biome.

I am not asking anybody to make this for me, I would just like pointers in the right direction.

Multiplayer

Add support to sync chunk data and changes over the network.

Support for liquid blocks

I realise this is quite a big feature. I've tried dabbling with some ideas a bit and been stumbling just as much. Maybe liquid blocks are best done in an iterative fashion? There are a few things needed:

  • Transparent (0-1) blocks. (see #9) They should neither be solid (like stone) nor non-solid (like leaves). If you have a 4x4x4 cube of liquid blocks you want to be able to see through them to the back-facing (i.e. stone) blocks, but you don't want the inner blocks to render their faces as this would provide a weird additive effect. This also would apply to e.g. glass that looks more realistic than the cutout solution Minecraft uses.
  • Blocks with animated faces. Not a requirement, but without it liquid would look rather stale. Would also help in creater other more refined blocks (e.g. a glittering magic block, a smoldering magna block etc).
  • Block physics (e.g. falling blocks). Would be a first step in creating water that spreads. Also would apply to blocks like "sand" and "gravel" in Minecraft lingo.
  • Liquid spreading/physics. This is probably the hardest one to solve. Blocks replicating themselves to air blocks under/beside them isn't super difficult, but any liquid spreading that wants to look better than that will need a mesh that updates over time as the water spreads and water level changes.

Like I said I realise this is quite a big one - just wanted to write it down here for future reference and discussion.

Chunk deletion causing stutter

Chunk deletion is causing a noticeable stutter when moving very quickly, it should be possible to make this much more efficient.

Breaking More Than One Block At A Time

In-game, When i use the SetBlock function to remove blocks, if i try and make it so more than one block is removed (eg. adjacent block is destroyed aswell), 90% of the time the chunk can no longer be modified and the rendering for that chunk glitches out a tad.
if there's a slight delay in the breaking of the blocks, it works, but at some point in my game blocks will be removed simultaneously, so how could i fix this?

Regards,
Kinggrinyov

missing .meta file

when i import the project, it has a lot of "missing mono script" error.
Do you think perhaps the meta file should be included ?

Merging Blocks

I am currently trying to make a system where if blocks are of the same type and form a 2 by 2 by 2 grid then they will turn into one big block. The main thing would be making a block type that is more than one square big.

Leak between block

The mesh between 2 blocks have some sort of leak.
screen shot 2015-05-16 at 10 49 01 pm

The problem is because how chunk is constructed, mesh between blocks are disconnected.
The solution is quite straight forward, just remove duplicate vertices from meshData.vertices and rearrange meshData.triangle.

Do you have any intention or idea to fix this problem.

Use global block positions everywhere

Currently some parts of the code use local block positions and others use the global positions. Blocks and chunks use block positions relative to the chunk position and the World script uses positions relative to 0,0,0. Converting everything to global positions will make the system less complicated.

Feature request: Wrap-around world

Like old school 2D RPGs, make it so that you can walk completely around your world, like it's a round planet.

The only difficult part of this would be making the terrain generation look natural at the point where it wraps around.

Texture filtering and mipmap support

The texture atlas should support bilinear and trilinear filtering as well as mipmaps because the point filtering looks pretty shabby over long distances. This will need the texture atlas to be padded. Unfortunately I can't see anyway for mipmap and filtering settings to be per texture.

voxel patches?

Would it be possible in the future to have an alternative to just a single large infinite world.

Like another method of just setting up voxel patches defined in size either directly in the inspector with width height depth..or more visually with a cube that you can resize. Tnen you just setup that gameobject like you do as its own miniworld, maybe with its own blocks, terrain types etc.. and it saves changes to its own world path if enabled.

I'm kinda wanting to have a hybrid terrain world environment as personally feel its much easier to use other methods of making terrain and worlds in other applications.. its just the voxel element is still needed for player mining, terrain destruction or building areas(at least using voxels anyway)

Haven't really come across anything in unity assets that allows this, I'm sure not even that hard a feature for some to develop though its out of scope for me.

Also is there any plans for this project to implemented smooth terrain?

Other things.. anti aliasing? does it work or am I missing something? same with AO, doesn't seem like I'm getting anything like that around the block edges from the demo scene anyway.

Connected meshes

To be able to create fences and other meshes that connect to each other, have an option that hides/shows parts of a mesh depending on the connection.

In the sample below, the mesh on the left is the actual mesh file. The fences on the right display how parts of the mesh are hidden to create a connected mesh, black is hidden/white is shown.

Sample

Fixed world size

How would you deal with having a fixed world size using your chunk system that is built mostly on an infinite world? Would you end up making it where a chunk isn't generated when you reach an edge during the distance check? Also, have you thought of using an object pool rather than creating and destroying chunk game objects like that? On a modern computer, it gives no overhead, but on something like a mobile or less powerful devices, I can see this being quite the slowdown.

Add option to set random texture occurance

I'd like to see an option/value that can be altered to set the random texture occurrence. In the sample below a few random tiles have been added with flowers in different set-ups. Because there are so many flower tiles now, the chance of generating a flower tile is way higher than a 'normal' grass tile.

A value that sets the chance of a random texture being selected other than the base one would fix this.

Sample

Check free blocks around a block

I'm not sure if there is this feature already, but it would be a good feature to check what blocks are free around a certain block. For instance, if you Raycast onto a block, it would return the blocks next to it that would be free. For example:
xxx
xBx
xyy

B = Block
x = There is no block here (well, there is air)
y = There is a block here

It would be cool to have a feature for only "air" and also to return all blocks. You could then check if the block is free, and add a block next to it (I'm planning on this for farming).

Would be nice to have this with the random update/schedule system that is being made now too.

A way to load custom meshes at run time

Currently custom mesh blocks can only be created in the editor, it uses AssetDatabase.LoadAssetAtPath which cannot be called outside of the editor. It would be nice make it possible to get the mesh at runtime so that the models could be edited or changed outside of unity. I am not sure though how to get a file from a folder and fetch its data at runtime though.

Issue with Documentation on AlexStv Website

The "Interacting with Voxelmetric" section of the docs is missing. when i click on the link/button given, it leads to an 'Error 404". I'd really like to know what info i'm missing out on! its like the most important part :P
untitled

Separated voxel environments

(Please note; while this is a feature request of some sort I do absolutely understand that this might be huge undertaking, and possibly never make it in)

Allow for separated voxel environments from the main terrain. Simple example: a boat base, on which the player can place voxels. The boat (as it is a separated game object) can then move around the main world.

Example

Fixed size worlds

As an addional option to unlimitet worlds i would suggest to also implement fixed size worlds (limited on x/y/z). This would allow more classic "level" oriented gametypes in additon to the open world style.

Furthermore i would suggest to unchain the terrain oriented generation from the world and allow different options for both fixed size "Level" and open "World" style.

Possible options to fill the world/level should include:

  • random terrain (is atm the standard)
  • flat map (one solide plane of blocks at Y, so you could start building on or beneath this plane)
  • blank (would be usefull with for example with a small level where users can generate "Brushes" of blocks and save them - like a tree - that could be stamped into other levels)

...

Scheduled behaviour for blocks

As well as Issue #31's random behaviour for blocks it would be useful to be able schedule a function call to a block for things that take a set amount of time or need to be precise. This could be implemented by creating a timer and a list of scheduled block updates paired with times and checking if the time is lesser than the timer each frame for each scheduled change. This will be less efficient that the random behaviour so should be used sparingly. It could be used for blocks that fall apart after a set period.

Support for singleton World class

A feature toggle should make it possible to use the world class as a singleton so that Voxelmetric functions don't need the World object passed in as a parameter. The world should still be an optional parameter to support multiple worlds is a scene.

Variable to change block size in config

A current time, all blocks except those that have their own mesh are the same fixed size. Being able to change the block size in the config file would allow for smaller blocks, such as games like Cube World have, than the current size.

random terrain generation

i am decently new to coding and was wondering if there was any way to have this do random terrain generation, because at the moment the terrain that appears is always exactly the same

Block sides fail to render on chunk border

bug

I could only make this happen after creating a script for spam-removing blocks quickly. It only happens upon removing blocks that are next to a chunk border. The block on the other side of the chunk border then doesn't update to display the newly exposed side. If I then modify that chunk in some other location (or a block adjacent to the chunk) the exposed side will be updated to render the missing quad. So it seems the Chunk is missing an UpdateChunk call in some way when spammed. Note that this only seems to happen if I remove blocks multiple times per second, so it might not be noticed in practice.

I built some minor debug tools to help me verify and reproduce this problem. You can find them here: http://arpi.se/unity/VoxelMetricDebugTools.unitypackage

Just disable any other camera/movement script, drop the VmDebugCamera and VmDebugCanvas into the scene and play. Try removing blocks on chunk borders with Ctrl+LMB. A chunk border is easy to find with the debug window.

little lines between blocks

If i change the textures to a constant color, remove the textures completely or apply the standard shader, these little lines become visible:
1
2
I think it has something to do with the mesh generation, maybe some vertices/edges aren't connected.

Random behaviour for blocks

Block controllers need a virtual function which has a random chance of being called. This could be implemented by having chunks choose a random block each FixedUpdate() and calling the random function on the given block. This is meant as a way to randomize behaviour in the world and as an efficient way to have blocks update over time. This feature could be used to make grass spread or grow over time.

Texture config

Textures need details about the texture type, connected texture types and random spawn chance. Using the file name is quickly becoming unwieldy so a texture config is needed where all these things can be specified. In addition the texture index should split fetching textures, fetching these files and then building an atlas out of the textures+configs. This will allow extending of the texture config system. This system should have default settings to use if a texture doesn't have any specified.

Block physics

I am making a game where blocks that you interact with need to be influenced by physics (Like Minecraft sand). For example if you dig out the blocks around a center block, the center block should fall. Currently thinking the only way to do this would be to make every block an individual block gameobject instead of just being part of the chunk. Any thoughts or ideas about this would be much appreciated.

Mesh blocks in addition to voxels

Allow using custom meshes in addition to normal voxels. These meshes can be used to create plants and detailed blocks like fences.

Voxel lighting

To be complete this needs to get initialized on chunk load. Updating lighting on changes is already working.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.