2D-"Voxel", millions of blocks, multiplayer and more!

Hello fellow artists!

I’m working on a 2D-“Voxel” implementation for blender, as my work have come to the point where you can actually see it’s result I decided to show of the current progress here.

The Goal of the project are to be able to run giant randomly-generated 2D worlds at high fps in blender.
In the final version these features are planed, those whit a “#” afterwards are already working:

*Generate worlds
**“Voxel” the world blocks #
**Generate caves #
**Generate trees #
**Generate buildings/dungeons #v.i.p

***Group generation to different biomes
*save/load worlds #
*generate on-the-go (generate more content when you are close to the current end) will only work in single-player
*edit worlds in the ge
**add blocks
**remove blocks #v.i.p
*detect collision on the world #
*support up to 1024 different blocks #
*run on high fps on low/mid end computers #
*paint non-visible blocks black (shadow blocks that the player can’t reach)(this is a hard one)
**dynamic lights? (is it possible?!)
*multiplayer
**sync worlds #v.i.p
**sync players #v.i.p
**sync player actions #v.i.p
*More…

here are a video of my current status:

the world in this video contains ~ 3.5 million blocks, and are running at constant 60 fps. on the minimap you can see how the world chunks are spawned and de-spawned dynamically. this world took about 10 min to generate (only needed once) and are after that almost instantly loaded when the game starts.

UPDATE
here is an updated video showing the w.i.p multiplayer, here are worlds downloaded from a server and players synced.
the penguin’s are just placeholders

so now, how is this made?
I won’t explain everything as it is complex and also a w.i.p, but what i’m doing is basically having some pre-made planes (24 for now but all are not needed) with 3232 faces, these planes are my world chunks
my “engine” is re-arranging the faces and the uv’s of the chunk’s, so that when the game is running there are always 9 chunks spawned, as the player moves these are moved and re-made (by moving faces and uv’s)
doing this i get a minimum of 32
32*9 = 9216 “blocks” on the map at once, all drawn by the engine in only 9 draw-calls.

As this implementation have taken a lot of time and hard work i’m not planing to give away my code for free when it’s done, if i’m giving it away, it will be whit a price. I’m writing this now so that I don’t disappoint anyone in the future.

now plz tell me what do you think of the work so far? have you any idea’s on features to add that’s not yet listed? or just general ideas?

nice one, is it possible to animate voxel “players”?
and is there a way to place voxels where I want or only generate it via math/random?

I would love to play this.Although i like 3d voxel videogames better.Are you going to be selling it or will it be free?
You could make it so you can mine ore and fight monsters.And build a place to stay.Buy sell items in shops in towns.
Talk to npc’s go on quests.Could you make water.Could you make driveable vehicles?That are air,sea and land vehicles.Could you make it so the player can use hand to hand weapons,guns and lasers?Could you make it so that the your videogame has single player and multiplayer mode?Could you make it so you have to make fuel for vehicles?
Could you make it so you have to make bullets for your guns?And make power source for your laser and house for its lights.Could you make it so you have to eat and rest to live?Could you make night and day cycles?Could you make it so you have to sleep sometimes?But you will have to find a safe place to sleep.

whoa! what happens if you generate them on the x,y, and z axis? BGE Minecraft?

Glad you like it! If you mean to animate player then yes, if u mean animate textures then no. Animated textures won’t be possible due to the way my voxel is implemented. It will how ever probably be ways to work around this limit. Blocks will have the ability to be placed wherever you like, not only by the generator :slight_smile:

I have not desided on how/if I’m going to give it away or sell it, that depends on the outcome when I’m done :slight_smile:
You got alot of nice ideas, most of them are probably also doable. As most of the ideas depend on the engine being completed I can’t say if they will be implemented or not. Thx for the comment and the ideas! :slight_smile:

I think a bge minecraft is possible in a similar way, with some changes to the algorithm. If you are interested in how to do it in 3D i know there have been some different implementation around.

just a quick update, I now got a collision detection working, it is still a w.i.p but it does the job, and still at 60 fps!
here are a video:

I’m currently experimenting with modifying a terrain mesh generation code to use blocks and set their z position to make a 3d version of your demo.

That is cool, tell me if you get it to work! :slight_smile: I know that this have already been done before with good results, so it is probably not that hard to re-make. Here is a demo by solarlune that probably can help you out. Do however note that there are major difference in how he’s Implementation is done and how i’m doing it. But as you are looking for 3D he’s work is probably what you should get inspiration from, as mine is purely made for 2D.

Take a look at the block easy demo on this link Nicholas_A.I really loved playing with it.With this the framerate really drops if dig to far in the ground.Or you are in that deep hole. https://blenderartists.org/forum/showthread.php?363462-dig-world-problem/page3&highlight=block+easy+demo

Thank you. That is very useful and I will see what I can do with it. Regardless, here is what I have achieved with modifying the procedural terrain code:


What is the framerate you get in firstperson?

What do you mean? It would be the same.

I did not see that.So you get a framerate of 60.You are going to have to see what the framerate is when the player digs far down.
You should make it so the player can only dig close by.

Guys, I love to see what ya all are up to, but plz try keep this thread centered around my 2D-voxel. If you would like to show of your own work post it in a new thread, and if you like to show it to only me, or have questions not related to my 2D-voxel setup, send me a pm :slight_smile:

I begun implementing a remove block feature today, video:

made a basic implementation of the network, I can now download maps and sync players, still at 60 fps.
this implementation is a WIP and is still missing a lot of features.

here is a video of me and my gf running around^^, there are some minor issues but overall it works well.
(the penguin is a lie)

Could i see the npc go underground with the player?

There is no Npc (no player character ) the two characters in the video is both controlled by humans. The first one is me and the one spawning in later is my gf. This short videos shows a w.i.p multiplayer implementation.

The characters can go under ground but removing/placing blocks is not implemented just yet.

Hope that answered your question :slight_smile: