Uniblocks: cube-based infinite voxel terrain engine

Uniblocks Voxel Terrain, a cube-based infinite voxel terrain engine.

Asset store link | Video demonstration

Screenshots:



Features:

  • Infinite procedurally generated terrain
  • Fast realtime loading and saving of terrain, efficient terrain storage on disk
  • Multiplayer features: streaming terrain data from server, synchronizing voxel changes
  • Support for custom non-cube voxel meshes
  • Fully compatible with Unity’s built-in physics engine, including standard colliders, raycasting, etc.
  • Fully compatible with Unity’s built in lighting, including dynamic shadows and custom shaders
  • Easy scripting using the event system (OnMouseDown, OnBlockPlace, etc)
  • Clean, simple and well-documented code (all C#)
  • A Block Editor window for easily adding and editing blocks
  • Example code demonstrating some common gameplay implementations and terrain generation

Infinite, procedurally generated terrain
The terrain is generated procedurally at runtime. The engine comes with a simple perlin noise based terrain generator algorithm, which you can expand/modify or swap out for a custom one. Multiple worlds can be stored on disk.

Fast performance
Uniblocks supports modifying blocks at runtime with no lag, as well as fast streaming of terrain data from disk at runtime.

Multiplayer
Built-in multiplayer functionality allows you to stream voxel data from a master server and synchronize voxel changes between players. The multiplayer solution uses the standard Unity networking and comes with in-depth documentation, making it easy to modify or port to a third-party networking solution as needed.

Custom meshes
Up to 65535 block types are supported. A block can use either the standard cube shape, or a custom mesh of any shape and
size, as well as different collider types (cube/custom mesh/trigger).

Easy scripting
The engine comes with a game-ready block scripting system. Simply attach a custom script component to a block type, override an event function (exactly as you would with the standard Unity functions such as OnTriggerEnter, OnMouseDown, etc), and execute custom code within that function. Uniblocks comes with events capturing camera look, mouse clicks, mouseovers, collisions, as well as placing and destroying blocks, and you can add your own events easily.
Various basic functions for converting between voxels and world position, voxel raycasts, etc, are also provided.

Clean, simple code
The source code is fully accessible and easy to modify. All code is heavily commented, and the individual parts of the engine are neatly organized into separate modules. An in-depth user manual and scripting reference are also provided.

Universal
Uniblocks is designed to be compatible with many different types of games. The events scripting system allows you to easily implement different gameplay features, and some example gameplay features are provided. Lots of performance options allow you to accommodate a wide range of systems.

Demo
Web Demo (note: WebPlayer performance can be significantly slower than a standalone build)
Standalone Demo (better performance, save/load enabled)

(controls: wasd+space = move, left click = destroy block, right click = place block, 1-9 = switch active block)

[Android Demo](Dropbox Android Demo.apk)
(controls: drag bottom left of the screen to move, drag bottom right to look around, tap the screen to break blocks, double tap to jump)

Documentation
https://www.dropbox.com/s/p9nfjw4dalq8v66/Uniblocks 1.4 Documentation.zip?dl=0

Warning
Anti-aliasing not supported with forward rendering path. Water not included.

Please feel free to post any questions here, or contact me at rawlionworkshop@mail.com

2 Likes

Whats the performance like on mobile? If it work well, this is a huge plus and up near the top of my to purchase list.

I walked for like 15 seconds, and jumped around, nothing special and then this happend: Screenshot - 7f29eb0349e4c7ad65f39a0bcb6a13ca - Gyazo

With the settings turned way down you can probably expect about 10-20 FPS, which might be playable depending on the type of game you’re making, although really this asset is meant for desktop use, and I can’t guarantee satisfactory results on mobile. Unfortunately, voxels are just very performance-intensive.

Edit: I’ve put together a quick Android demo, so you can check mobile performance for yourself.
https://www.dropbox.com/s/t0p623ykawbc2wx/Uniblocks%20Android%20Demo.apk

Looks like the top of the hill got cut off due to the chunk height limit in the webplayer version. I guess I forgot to configure the terrain generator properly to match the height limit. You shouldn’t see anything like this in the standalone demo.

1 Like

Do you intend to add multiplayer functionality? Maybe just a demo with Photon Cloud or Photon Server, allowing players to alter the world together?

Yep, I am indeed planning on adding multiplayer some time in the future, though probably not very soon, I want to make sure the single player version doesn’t have any major issues first.

By the way, Uniblocks is now available on the asset store. Check the link in the first post!

  1. Does it need to use unity’s lighting system? Does it use minecraft-like lighting calculations?
  2. Is there any documentation or support website?

Suggestions:

  • Put a link on uniblocks asset store’s page to this thread
  • I saw there are two PDF files inside your asset store’s package. Why not post them here? I would be a great to clarify its features and if we would have trouble changing from another solution (Minepackage in my case)…

Thank you for the suggestions, I added a download link for the documentation to the first post, and the asset store description should be updated soon.

Nope, there are no per-voxel light calculations.

A support website might be coming in the future depending on the demand. In any case, I’ll be expanding the documentation as new questions and issues come up.

Hello,

There don’t seem to be any water, am I right ?

Do you plan to add water at some point ?

Do you plan to add more features ? In that case, what is your road map, what are your priorities ?

I have to say, I am very excited to finally see a Minecraft-like voxel terrain generator on the asset store :slight_smile:

Thanks a lot !

That’s correct, there is no native water system.

The problem with water is that there are many ways of doing it, and it will depend largely on what kind of game you’re making. For example, there’s the Minecraft system, which, let’s be honest, sucks, because it’s not very realistic, but a proper Dwarf Fortress style finite water system is very resource-intensive. I don’t necessarily want to force any particular implementation of water on the users. Uniblocks is meant to be a universal engine, not just a Minecraft clone.

I might implement some water system in the future, but I think it would be in the form of a plugin rather than a core part of the engine, for reasons stated above.

By the way, it should be perfectly possible to implement a water system in the current version just using the basic functions provided, without modifying any engine code. The code gives you easy access to things like checking adjacent voxels, including seamless checks between different chunks. And you can use custom voxel meshes to render the water.

Multiplayer is the big one that I definitely want to add. Before that though I want to focus on polishing and bugfixing in the single player version, expanding documentation, etc.

I saw there is a block editor.
Our game have dynamic blocks, defined in a file and created at runtime. Is there a way to create the prefabs and link them to uniblocks before it runs? I.e. is there a way to create a block pallete dynamically?

Yes, in order to that you would need a custom script which reads your file and creates the block prefabs, then replicate the ApplyBlocks function of the block editor and call it right before Engine.Awake.

To create the prefabs, one easy way would be to instantiate a template prefab (for example, block_0), then modify it’s attributes based on your file data, and save it as a new prefab (using PrefabUtility.CreatePrefab). The prefabs must have the Voxel component, and must be named “block_x” where x is their ID number.

Hey that looks really impressive.
So I tested the standalone version and it looks pretty good.
But one small thing is there what I’ve found, in case you change the settings from the standalone version to fantastic, this
will happen over the complete world:

Thanks for pointing that out. I’ve found that it’s caused by certain anti-aliasing settings. I think Minecraft has similar issues with this as well.
Enabling adaptive anti-aliasing in my AMD driver settings seems to have fixed the problem for me, while still allowing anti-aliasing.

And another Voxel creation “engine” with no fluid… Seriously… Do you now know how to do, or really just not interested? Because honestly, voxel terrain with no water, really is useless

Yeah fixed it for me, too. :wink:
I really like your system, it could be something that I’m searching for.
I’m really looking forward for auto-foliage generation and for sure, biomes.
Generation of caves and stuff like that would be a nice big plus, but not necessary.

But at the moment the system is a little overpriced for me, please don’t get me wrong, I know
whats a hard work that is in the background. I think a good idea is, to start with a smaller price
to get more “day one supporter” and with upcoming updates you increase the price.
Just my two cents. :slight_smile:

EDIT: Another little thing that I figured out, everything that I’m created in the standalone
demo its not saved out. At the next start of the demo, nothing is left from my testbuildings.

Some posts above yours, he pointed out, why he doesn’t implemented this for now.

Greetz the X

I have heard that exact line from every single “Voxel” developer out there. I don’t believe it!

My original intention was to provide an engine that’s universal, low-level and not specific to any type of game, basically handle the saving and loading of infinite worlds, rendering blocks, chunk communication, etc, and leave the higher level gameplay stuff for the user to implement, according to their needs.

I can see now that there might be some demand for some specific game features, so that’s something that I’ll probably be moving towards in the future. I definitely want to expand Uniblocks to match the users’ needs, so I really appreciate all your feedback.

Yep, I hear you, I’m not really sure of the current price myself, it’s quite possible I’ll be trying out different pricing in the future.

Press V on your keyboard to save the world (and wait a few seconds for the saving to complete). I forgot to mention that in the first post.
Chunks will also save when they are unloaded from memory, so if you walk away far enough from your buildings, they should save too.

Mmmh, yeah, the original idea is good.
I think the really best way to keep the “core” clean is to make extensions for your system, as you said.
Lower price for the core, for all devs out there they need a basic cube voxel system.
And extensions for people they need more, like water, dungeons, biomes and so on.
So anyone have the chance to pick up the right personal package for her project start.
Just some ideas.

Nice to hear, I definitely keep an eye on it in the future.

Thanks, works perfect and thanks for your great response. :slight_smile:

Greetz the X