Creating infinite Voxel land using Noise?

I want to create a Minecraft clone using jME, downloaded the Cubes framework http://wiki.jmonkeyengine.org/doku.php/jme3:contributions:cubesand I’m doing my first tests! But I can not create infinite worlds and the framework Cubes do not have it. Help me!

I’m gonna help you, but maybe not in the way you think.
Here is how your message is percieved on this forum.

Let’s say this is an origami forum. Everybody here is interested in origami, and some members are even able to make that kind of pieces of origami :

You come around and say :
Hey guys I’ve seen that one of your users made a sheet of paper… So I took this sheet of paper and achieved this :
http://scienceblogs.com/startswithabang/files/2009/08/FP5N6U1YP0EY95VDQ7.MEDIUM.jpg

Now I’d like to do this :

Help, please.

There are very experienced developers around and IMO there is not more than a couple of them capable of doing what you ask by themselves, alone.
You seem fairly inexperienced in game developement and you try right away to do one of the most difficult thing in the gaming industry. Maybe you should try to start with something more basic to hone your skills first…

4 Likes

Thank you for response, but with a little research I found everything I needed: How to Use Perlin Noise in Your Games – Dev.Mag

Hi Dimalenus!

Not that I want to dishearten you, but PerlinNoise is just a little part of this topic. I think you have to dig deeper. Perlin noise helps much by creating hightmaps and so on, but has nothing to do with infinity! Btw. Minecraft hasn’t a infinite terrain. There are world-borders too. You won’t reach them soon, cause the world is really big, but technically the worlds are limited to a maximum size. The big problem of infinite terrains, is the fact, that computers are limited to maximum numbers, which they can calculate. So in most cases it will lead to terrains, which are nearly infinite for the player but are technically limited to the e.g max-size of an integer and so on. A workaround to this could be a terrain which is pinnend on a sphere. So when you reach the furthest point, you automatically get back to the beginning. But trust me, this sounds easier than it is.

My two cents:
Like nehon said, even the big developers sometimes struggle with this problem. Maybe you should gear down a little bit and start with something easier. You could play around with TerrainQuad-system within jme and alter this by using perlin noise. These TerrainQuads are limited too by system-properties, but for first tests this should be enough.

Keep in mind, that every computer is limited to a certain max-size of numbers. In case of Java, the maxSize of an integer (32 bit) is 2^31 which are the numbers between -2147483648 and 2147483647. As soon as you get out of this range, some strange things happen :wink: Using a long instead of an integer wouldn’t help much. The range would be bigger, but the problem is still the same. That’s why e.g. Minecraft works with subdivisions. There are 16 blocks (in one direction), which form a chunk. This is made to keep the numbers small.

To create a world of blocks Cubes (Created by @destroflyer), you must use the following code:

BlockTerrainControl blockTerrain = new BlockTerrainControl (CubesTestAssets.getSettings (this), new Vector3Int (1, 1, 1));

Where 1, 1, 1 is a world the size of Vector3Int in chunks, as you might have guessed, there can create infinite worlds with him, since you need to specify the size of the world, and if I use a very large value as 500, 500, 500 and screen lock and get a Java memory error. So solve this Cubes decompile the code to try to solve this problem, however this is a great challenge for me.

Because infinite worlds do not create the whole world at once. They create smaller sections and only load what they need at any given time.

Some people decide they want to create a block world because they think it’s an easy place to start. Understand that it’s one of the single HARDEST places to start. There is so much you have to already know how to do and so much you will need to build from scratch that it’s not a good place to start game development for beginners.

…i guess most folks doing such attempts, are based on fact that, typical development time of games is mostly consumed by developing very good looking art assets, which is tough, so dealing with ‘just cubes’ is somewhat deceiving, because while from art point of view everything seems to be rather trivial, tech side of things become much more difficult than one could expect…

Its an good point, you are right about that.
But this kind of game has also some art… In the code :slight_smile:

I did this a few months ago. It was also my first gaming project. My code is on github and you are welcome to use it as a starting point.

Here is the link: GitHub - jcraft-team/jcraft2: Rewrite of JCraft

The reason I started my game development with a cubes type game was because I knew that my challenges would be programming and not graphics. That’s what I’m good at. I’m not a graphics guy. Plus I love Minecraft. So everyone should keep that in mind when a new comer starts with this kind of project.

I knew it would be very difficult but I still wanted to try. My project has much room for improvement for improvement but it has infinite terrain and baked lighting. There are some bugs on chunk boundaries but they aren’t horrible.

I started with the cubes framework and expanded it to support my needs. For instance I made it not draw vertices on chunk boundaries under the surface. I also did my own basic physics for performance reasons.

My advice, take it slow and have fun. When you add a new feature test a bunch and create a branch/tag between big features so you can get back to a working version if you introduce a big problem.

Good luck!

I did this a few months ago. It was also my first gaming project. My code is on github and you are welcome to use it as a starting point.

Here is the link: GitHub - jcraft-team/jcraft2: Rewrite of JCraft

The reason I started my game development with a cubes type game was because I knew that my challenges would be programming and not graphics. That’s what I’m good at. I’m not a graphics guy. Plus I love Minecraft. So everyone should keep that in mind when a new comer starts with this kind of project.

I knew it would be very difficult but I still wanted to try. My project has much room for improvement for improvement but it has infinite terrain and baked lighting. There are some bugs on chunk boundaries but they aren’t horrible.

I started with the cubes framework and expanded it to support my needs. For instance I made it not draw vertices on chunk boundaries under the surface. I also did my own basic physics for performance reasons.

My advice, take it slow and have fun. When you add a new feature test a bunch and create a branch/tag between big features so you can get back to a working version if you introduce a big problem.

One more thing.

If you look at my code and want to focus on world generation I have an interface called Feature that has one method called generate that takes the chunk x and y and a 3d byte array for the blocks. My framework uses a decorator pattern so you can have any number of features like for example a SeaLevel feature may generate water and sand at a defined sea level. An OreFeature may decorate the world with ores. Then you may have a PlantFeature, TreeFeature and so on. You should be able to find where to register them with the world.

Happy programming!

I can not thank for that source code it will help me a lot in my project, thank you!

Another thing which might help you: Get the stuff form Minecraft Forge project. They provide a… let’s call it: a modding-interface for modders. :smile: It’s meant to write new mods with it, but can be used to examine the minecraft-sources. They are partly obfuscated, but this only affects the function-names. Reading it carefully enough and you should guess what these functions are doing.

Hi

Nothing is infinite in computer science (Tankwart explained it better than me). You’re a beginner, you should start from the beginning, it’s logical. I started programming my first person shooter 9 years ago, I had already some years of experience in 2D and 3D game programming. You should start with a more simple project, really. jchappelle’s project is good but if you don’t understand his code, it will be useless for you (not for more experienced developers).

That used to be true, but I think it was modified in some later update (when the farlands got fixed I think?), now the perlin noise just loops around and the worlds are only limited to your disk space (and probably the value that holds the coordinates). Although I know this isn’t completely true, it’s as close to infinity as you can possibly get.

I’m pretty sure that the infinity he had in mind was one not limited by some arbitrary limits, but by physical capablities of the hardware. There is no such thing as infinity even in real life.

As for you @Dimalenus, since you haven’t taken the hint about the high difficulty of this game type I guess that means you are determined and you think you are up to the challenge. So instead of trying to deteer you I’ll give you this advice: I think that some of our doubts come from the fact that your profile picture is a 10 year old kid and you talk in broken english. That combination doesn’t really make you look very smart. I you fix at least one of those two things, then people ought to take you a bit more seriously.

Your posts also appear to have a sort of commanding tone. If you want people to help you, you should perhaps ask nicely and not order them to do it. This appears to me as a kid throwing a tantrum. I was probably associated to that by your profile picture, see what I meant before now?

Hello, I finally found what I was looking for: a small source code Minecraft clone made in jME, I can use it as a base! Anyone who wants to follow the link: GitHub - tmfulton/JMonkey-Minecraft-Clone: A clone of Minecraft done for an independent Project in Highschool. Still very much a work in progress. I speak broken English because I’m not English, while my age, I’m 13 years.

And intelligence has nothing to do with profile photos or age, but ability to formulate hypotheses.

You visibly lack of experience and it has almost nothing to do with your age. You should really start game programming with something easier than a Minecraft clone. If you’re unable to program a 2D Tetris clone, don’t even try to clone Minecraft. By the way, I’m not English, I started learning this language and computer programming at almost 6 years old, I do my best and I understand the viewpoints of others. Why do you think that you can use this project as a base if you don’t have the necessary knowledge to understand it? There are a very few comments in its source code, it doesn’t help :frowning:

@Dimalenus

…if you have such big desire to do Minecraft type game, then, you just go and do that, but be open to suggestions others pointing out, related to how difficult that actually is…eventually, if you stuck, simply revert back to Pong clone game and learn few things…pong is good not because of anything minecraft does but because of touch and feel of engine you working with, you will gain as a result…your age is just fine, don’t let that stop you…just be open to suggestions you read here from a bit more experienced comrades :slight_smile: thats all :wink: cheers and happy coding man…

Really, if you want to make clone of minecraft the best place to start is making mods for original using MCP (hard way, more knowledge gained) or Forge(easy way, less knowledge gained). Going this way you’ll gather knowledge about how things work and you’ll have full pack of decompiled sources (illegal to use for making profit but ideal for learning). And then, when you’ll more or less understand what to do, come back to JME.

When I ask a question on the forum, because you simply do not answer the question you asked?