JME3 Terrain system

theprism said:
Jme 2 was fine - see skapeworld.com
Dont know how you refernce your tile ( terrain blocks ) but presume they are on some sort of grid system, this is all you need to relate your coordiantes to. Its a fail for MMO's without

It is in a grid system, almost exactly the same as in JME2 and its TerrainPage/Block system. So if that is all you need then it should work fine.

It works fantastic in my computer with my old graphics card (+200fps with Ati HD3470).

The only problem I’ve seen is with some vertices of the mountains and their union with the ground.

thanks for your effort.

Is the terrain deforming feature selective?

I mean, may I choose where to affect terrain and where to don’t?

It’s important, some part of the game may require the player to walk on a terrain wich height acts like a ladder to something else, if in that point the terrain is being deformed by an eplosion or so the player may get stuck and unable to go on with the level.



Bye, Berserk.

.

ivanpg said:
The only problem I've seen is with some vertices of the mountains and their union with the ground.
thanks for your effort.

hmm, are you seeing holes? Is this in wireframe view or regular polygon view?
berserk said:
Is the terrain deforming feature selective?
I mean, may I choose where to affect terrain and where to don't.

It isn't selective where you deform terrain. What you would probably have to do is where you are choosing to deform the terrain, check each point you are modifying, check the slope at that point, and if it is too steep, then don't deform it. Or have some invisible zones that would limit deformation that.
The terrain will come with some external deformation tools that you can customize and change. As for the terrain system itself, it really just boils down to getHeight() and setHeight() at particular points.

It's definitely a good thought and it's great to hear these early on to help make the design more robust. Thanks!
Sploreg said:
hmm, are you seeing holes? Is this in wireframe view or regular polygon view?

Ah those. You can ignore them. :slight_smile:

They are degenerate polygons that are part of the triangle strip algorithm. The video card removes them for almost free so they don’t impact performance. And you only see them in wireframe view because that material converts the polygons to lines, but before any degenerate polygons are culled out. (a degenerate polygon being a triangle with two of the same point)

I could modify the algorithm to “hide” those degenerates, but it won’t effect performance and would only be applicable in wireframe view.

Sploreg said:
Ah those. You can ignore them. :)
They are degenerate polygons that are part of the triangle strip algorithm. The video card removes them for almost free so they don't impact performance. And you only see them in wireframe view because that material converts the polygons to lines, but before any degenerate polygons are culled out. (a degenerate polygon being a triangle with two of the same point)
I could modify the algorithm to "hide" those degenerates, but it won't effect performance and would only be applicable in wireframe view.

If not improve performance do not waste your time :).
What is the next step? Editor? Deformation?
ivanpg said:
If not improve performance do not waste your time :).
What is the next step? Editor? Deformation?

Next step is a little cleanup and making it more pluggable in terms of 'calculating lod change' algorithms.
Then it is getting it into JMP with a deformation editor. I should be starting that this weekend.
After that, painting tools and bumping up the texture support to 16. Plus adding in some lighting support.
Sploreg said:
Next step is a little cleanup and making it more pluggable in terms of 'calculating lod change' algorithms.
Then it is getting it into JMP with a deformation editor. I should be starting that this weekend.
After that, painting tools and bumping up the texture support to 16. Plus adding in some lighting support.

Hello Sploreg,

I have a question, about physics. Im new to jme and i can't seem to manage bullet to take the terrain in a PhysicsNode, is it possible to do it as a physnode or is there another way?

Thanks, Seth
Setekh said:
... i can't seem to manage bullet to take the terrain in a PhysicsNode, is it possible to do it as a physnode or is there another way?

you're venturing into new territory my friend :) I haven't tried it with physics yet, although I thought it would work right out of the box. Care to venture into the code and see why the physics isn't finding and colliding with the mesh? It might be a bounding box issue too.

Currently you can create a MeshCollisionShape from any jme mesh, so it should be possible to create one from the terrain (theres a mesh somewhere in there, right? :slight_smile: ). I also still have the heightmap collision shape code for bullet but I did not add a HeightmapCollisionShape class yet. I will have to look more into the terrain engine before I implement it, but I guess it should work fine grabbing the data for it from a terrain.

Cheers,

Normen

Yep terrain uses meshes. I’m assuming bullet physics will dig through a node tree until it finds a MeshCollisionShape?

Probably no need for heightmap collision, unless it would be faster. But it would have to account for any scaling done on the terrain, not impossible though.

I will take a look at it this weekend Setekh.

Physics nodes have collision shapes. They are independend from the geometry but can be generated using geometry. Dont know exactly what you mean by “dig through the scene” but the physics update itself and registering of physics objects happens in the physicsspace. If the physics node is not added to a physicsspace the collision shape is not used at all.

ah ok I gotcha. It shouldn’t be too difficult to add in the physics for terrain.

Thanks Normen

Well I’v tried the mesh collision shape and… didn’t work. >< (IOB Exception)

Also the only geometric objects i found (containing the mesh data) is the TerrainPatch, i made some methods getting them from the root TerrainQuad node, that lead to no instance of a TerrainPatch in that Quad… only more Quads, i tried more ideas, more methods ended up with silly exceptions.



Well i guess ima wait for the HeightmapCollisionShape, theres no rush.



Thanks you vary much for answering my question guys. :slight_smile:



PS: I got like only 3 days studding jme3, starting from scratch (<3 this game engine)

Im confused - has the terrain system been released yet then?!

renegadeandy said:
Im confused - has the terrain system been released yet then?!

It's been committed yes, so if you have the latest source code from svn you will get it.
I'm still making some rather large changes to it but those should be done tonight, an official announcement will come after that.
Look for TerrainTest.java

By now it should also be in jMP, given you update from the nightly update center.

Aha - got it using JMP cheers sploreg and normen. Im looking forward to the editor!