Cubes – A Block World Framework [Update Preview]

Yeah, I meant for the use of hashmaps to store chunks and blocks you will have to override hashCode

I will store entire Nodes there, I’m thinking bigger, not having to fix the framework but creating and managing a set of nodes that will provide the entire terrain alltogether

Can’t assign negative values to Vector3Int.

Example, generating a tree trunk at Vector3Int(0,0,0) to Vector3Int(0,6,0) then trying to assign a branch at Vector3Int(-1,6,0) does not create a branch block at that position.

Hi.

I’m kind of new to this, so as a first step I generated a small 16x16 chunk with trees and basic terrain. However, the max amount of terrain generated for me is always one chunk. How can I allow multiple chunks to render?

Also, how do I modify the terrain.png and what tools do I use? (eg. WinRAR, Paint, etc.)

Sorry if this question seems kind of basic, from what I can see, everybody else has already generated huge complex terrains. 0_o

Any help would be appreciated and thanks!

<cite>@squizzle said:</cite> Can't assign negative values to Vector3Int.

Example, generating a tree trunk at Vector3Int(0,0,0) to Vector3Int(0,6,0) then trying to assign a branch at Vector3Int(-1,6,0) does not create a branch block at that position.


You shouldnt need negative values, make all positive and y you need, move the parent node so the blocks finish on the right position

<cite>@Sempor said:</cite> I'm kind of new to this, so as a first step I generated a small 16x16 chunk with trees and basic terrain. However, the max amount of terrain generated for me is always one chunk. How can I allow multiple chunks to render?

Also, how do I modify the terrain.png and what tools do I use? (eg. WinRAR, Paint, etc.)

Sorry if this question seems kind of basic, from what I can see, everybody else has already generated huge complex terrains. 0_o

Any help would be appreciated and thanks!


When you create the TerrainControl, you pass the amount of chunks that you can assign (x,y,z) You may have (1,1,1)

the terrain texture (terrain.png) its a bitmap graphic, so yes, you should use a bitmap editor like paint

Thanks!!! :slight_smile:

@destroflyer , ALL

New URLs for plugins. You should be able to upload new versions of the framework

NBAndroid: http://nbandroid.org/release72/updates/updates.xml
jMonkeyEngine SDK Stable: http://updates.jmonkeyengine.org/stable/3.0RC2/plugins/updates.xml
jMonkeyEngine SDK User Contributions: http://updates.jmonkeyengine.org/contributions/updates.xml

You should ask any of the team to get to upload a new version to the repo
There you go, regards!

Hi again.

Now I’m having a bit of trouble with serialization. XD :slight_smile:
When I run my program and try to load a file, I get an Uncaught Exception Thrown and a Null Pointer Exception.
The incorrect area of my program seems to be where I try to read a byte array containing the terrain back from a file:


Scanner keyboard = new Scanner(System.in);
System.out.println(“Would you like to load an existing game or create a new one?”);
System.out.println(“Type: ‘LOAD’ to load an old existing game file.”);
String loading = keyboard.nextLine();
if (“LOAD”.equals(loading)) {
System.out.println(“Please enter the world name you wish to access.”);
String loadingname = keyboard.nextLine();
try {
ObjectInputStream inputStream = new ObjectInputStream(new FileInputStream(loadingname));
byte[] serializedTerrainData = (byte[]) inputStream.readObject();
BlockTerrainControl blockTerrainClone = new BlockTerrainControl(CubesTestAssets.getSettings(this), new Vector3Int());
CubesSerializer.readFromBytes(blockTerrain, serializedTerrainData);
} catch (FileNotFoundException e) {
System.out.println(“Error. Cannot find data file. Loading aborted.”);
} catch (ClassNotFoundException e) {
System.out.println(“Error. Problem with file input. Loading aborted.”);
} catch (IOException e) {
System.out.println(“Error. Problem with file input. Loading aborted.”);
}
System.out.println(“End of program.”);
}


I believe it may be having an issue with un-serializing the byte array, but am not sure why.

If anybody could help me with this, it’d be great. :slight_smile:

Thanks again!

A stack trace is always helpful.

Is here any way to add half height blocks or 1/4 1/8 height blocks and stack them up until they fill whole block? and are block with slopes planned? :slight_smile:

a rather naive question…

is there a way to lay my hands on the source of this framework? there are so many things that I would like add and extend on it…

Hi,

when I’m trying to install the plugin I get the following message:
“The Plugin Installer found problem timeout of loading Cubes[com.cubes/1.0.1010] while install the following plugins: Cubes”

What to do?

EDIT:

Managed to install it now. The problem was related to this issue:
http://hub.jmonkeyengine.org/forum/topic/updatingplugins-issue-with-jme-3-0-stable-linux-64bit/

After fixing that problem, I was able to install the plugin smoothly.

Spot

Ah yes, still working on this. Although, I have to admit, we did put it on the shelf for a bit. If anyone is still out there, I was wondering if I could somehow get the other sides of my planet to grow grass on it xD. So basically just taking the dynamic grass texture part and having it apply to open sides on the surface. As much as we all like having our Minecraft planets look like giant grass blocks. :smiley: I was just confused on how to even go about something like this. I saw the isBlockOnSurface function in the BlockChunkControl, without even seeing a boolean array before xD. So just some pointers or a solution would be great! ^-^

-echo

Oh that’s looking nice - how do you do the transparency? Does it work with differently-colored cubes behind each other?
I was dabbling with transparency a while ago but found I’d have to do more shader stuff than I could do at that time, then other things interfered.

Grass… that depends entirely on how Cubes is managing directions and textures.
I’m remembering some details that would make that essentially impossible on a per-block basis, but I think that was from Blockworld, not Cubes.

An easier approach might be to partition the world into six. Each surface and the blocks below them go into one part, giving you six inverted pyramids, and six block scenes with a uniform “top” direction that Cubes can work with.
The pyramids will, of course, all have the same orientation, so you’ll need to rotate and translate them so their tips meet in the planet’s center and their bottoms form the outside of the newly formed planet.
(I hope I explained that well enough. Geometric transformations are so easy to visualize and so hard to put into words.)

There’s one downside: This does not properly handle edge blocks.
A block at the edge of two planet surfaces would have to have two grass sides.
I’m not sure whether Cubes can do that at all, so maybe that’s a problem you’d have to live with anyway.

We’ve actually already done that for gravity on the planet :smiley: If you go look at the example block configuration in the plugin webpage, it goes and figures out what is on top. Of course, with this, you have multiple surface planes. I just don’t understand how the isBlockOnSurface function works in destro’s code.

EDIT: Btw @toolforger, all I did for transparency on the planet’s atmosphere is took its material color alpha tag and tweaked it.

@echospot Ah okay. I guess I’ll still have to reactivate my currently dormant voxel rendering project then.

Yeah this project can be considered in the attic and I really need to create a game with this, a real game, not a tech demo. Also I don’t want to re-invent the wheel and do everything myself with this, I need to focus on developing mi voxel/cube game, no spending time with figuring out chunking and what not.
I’ve tried to give feedback to @destroflyer so he feels proud of his work, but IRL what matter is more important.

:-o

I completely forgot about Cubes… Sorry guys, I’ll look through the thread today and try to upload my already done fixes. I remember there were some troubles with the plugin updates in the SDK, hopefully they are gone in the meantime.

1 Like

No problem, looking forward to it, It wasn’t meant to poke you destro, but one does need to make use of (some) engine and looking back in retrospective, you don’t get any money from this.

I hope you have success in your endeavours.

Alright, I managed to commit the newest version with the transparency fix (The mesh should have the correct normals now). :slight_smile:
It should be contained in the next nightly update, if those work. (I don’t know if they do in the meantime)

Otherwise, the *.jar’s should be here.

EDIT: The next things I’m looking at will contain infinite terrain and something else I will present soon^^