Castle Story Rippoff - Inprogress

I fixed the time problem yesterday, tho I didn’t have time to upload images of it so here is some images of a heightmap world created very fast:

http://i42.tinypic.com/2q1vuc4.png

http://i43.tinypic.com/24qs8pu.png

1 Like

Heres a much nicer sight :slight_smile:

I fixed so that only the toplayer is made of grass, the rest is dirt all the way :slight_smile:

http://i41.tinypic.com/2ugjwy0.png

Going to add Stonedirt aswell, heres my texture that I made for that:

http://i43.tinypic.com/f0n7gh.png

I used some jME resources but I’m sure thats fine :stuck_out_tongue:



I think I must create some sort of biom interface/abstract to handle the world creation. Just to keep it all clean…

Done!

http://i43.tinypic.com/blo94.png

Yeaaah!!

1 Like

Now those huge islands is minecraft like.

I’m not making minecraft, im making castle story thus the islands must float :smiley:

So I created a method called strip. It will simply strip the island from bottom up, removing blocks

according to a simple distance formula.

Here’s an image demonstrating diffrent formulas and their affect:





My next target is to share verts, both to save cpu but also to be able to smooth the terrain painlessly.

Tell me what you think :slight_smile:

You can’t really share any vertexes because they have different texture coordinates… or are you giving them texture coordinates like 1, 2, 3, 4? That’s the only way to adjacent polys can share a vertex.



…and you’ll find that it won’t save you that much, I think.

Humm… So I must use texture atlas to share vertexes, and if so then the grass must be next to dirt to enable the transformation from grass to dirt block…

How about this!

I create the top layer out of a heightmap!

Or not… that might be a bad idea considering caves etc…



Well, I need to make the surfaces smooth, not solid. Just applying closest neighbor algorithm will smooth the model,

but the faces needs to gradiently change their shading in order to make that smooth surface. And to do that jme needs to know which faces are connected to eachother right?

Two faces can have smooth shading unless they are connected with same vertexes right?

You do not need to share vertexes to have smooth terrain… they just need to be located in the same place and have the same normals. But as far as I can tell you aren’t even using lighting yet… so you only need them in the same place and they will be smooth since they will have the same coloring regardless of orientation.



And an atlas won’t help you, anyway. That’s for sharing textures not vertexes.



It’s a basic fundamental thing, if you have two quads next to each other then texture coordinates will tend to be like:

[java]



0,1 — 1,1 0,1 — 1,1

| | | |

0,0 — 1,0 0,0 — 1,0

[/java]



Note that the texture coordinates are not the same for the co-located vertexes.

Yes but when I create vertices I do like this:

[java]Vector3f [] vertices = new Vector3f[4];

vertices[0] = new Vector3f(0,0.5f,0.5f);

vertices[1] = new Vector3f(0,0.5f,-0.5f);

vertices[2] = new Vector3f(0,-0.5f,0.5f);

vertices[3] = new Vector3f(0,-0.5f,-0.5f);[/java]

I create a new vector for each position.

Instead my idea was to create an 3d array of vectors and refere to that array instead of creating a new vector.

Like this:

[java]

void createFace(int x, int z, int y)

Vector3f [] vertices = new Vector3f[4];

vertices[0] = array[x][z][y];

vertices[1] = array[x+1][z][y];

vertices[2] = array[x][z][y+1];

vertices[3] = array[x+1][z][y+1];[/java]

Thus changing one vector in the 3d array would affect all faces having a vertices at that point (once updating the model ofcourse).

Sorry if I’m slow to understand what you’r saying, but as for now, I don’t see why this solution wouldnt work…



Also, I do use Lighting.j3md material but for some reason they all get same lighting…

Well, you will find that keeping two copies of all of your data in memory will be really limiting as far as how much stuff you can have in your scene at once. And you still have to duplicate it all for sending to the actual Mesh.



It would be better if you had a consistent way of smoothing the points in the first place (for example your height map is a higher resolution than your grid or something). Even still, matching neighbors for smoothing would only take a scan at the nearby cells… which you are already doing for figuring out where the solid sides are anyway.



When you talked about sharing vertexes I thought you meant in the mesh itself.

no more updates? :stuck_out_tongue: did your interest die?



cheers