About low fps issues

When I generate 40000 Quad it’s only 40fps and I’m like only how should I troubleshoot where the pressure is when the fps is too low or is there a tool that can help me with that?

I miscounted. It should be 40,000 quad.

There are built in tools in jME, such as DetailedProfilerState. And jVisualVM always works.

But what you are doing is illegal and there should be a law against it. Use batching, instancing (maybe not in this case as it does nothing to object count) and custom meshes to avoid such a high object count. This obviously looks like a test, since that could be just ONE quad, solving your issue…

1 Like

I’m not sure what you mean. Are you saying I have too many objects?

1 Like

you can easly use libs like blocks and see how its done there

every Geom = drawcall, so you should have not much Geoms, tho 200 geoms should not be too much anyway. The thing is on screenshot i see 7000+ objects since you probably use shadows/filters that multiple it very much. Or you just have too many Geoms, idk.

In fact with 200 Quads shhould be as 1 Geom rly.

Like suggested you can also see with profiler state to see and solve problem you got.


That picture has a LOT more than 200 quads. I mean, there are 100 quads just here alone:

So maybe you don’t mean quads but you can still see over 7000 objects in the stats.

Yes, generally speaking, 7000+ objects is too many objects.

For example, this scene has plenty going on and has far fewer objects at just 548:


I’m surprised, if I remember correctly your game has a very large number of boxes why are there so few objects? Or are you generating multiple meshes in one object?

I’m guessing that each of your squares is not a BOX object

Thanks for the reply I will give it a try

1 Like

keyword: voxel chunks

Also imagine Table game model object. it have 999 tris lets say. Its still 1 Object, not 999 of them.

Ofc, this are voxels, and even more there are many types of voxel worlds. and many optimization techniques like greedy meshing or LODs or etc. Its a BIG topic. When you add physics space to it and other things, its very very huge topic.

Even light is usually calculated different way in voxel worlds.

I understand, I was told about the BatchNode and InstancedNode APIs, I’ll go back and read the docs later to try to understand these things, all I can probably think of right now is that there’s too much darwcall I should try to merge the Geometry

We should start from “What you want to make?”

Then we can continue really. Every game and every idea require different approach.

I want to generate a grid cell with 1000*1000 steps of 5,
The screenshots you see in the theme each quad is an object, I seem to understand the problem if you have a better way to generate these cells let me know if you want :grinning:

i understand that.

But what is your final goal? some game type? etc?

1 Like

Take a look at the tutorial about custom meshes.

Ultimately, that will be the only satisfying way to do what you want to do.

1 Like

These are the building grids, if you have played some RTS type games or construction games you should have seen the buildings that need to be placed in these grids.

Yes, but for most at least modern RTS games, imo it use different techniques to paint grids than mesh grids.

You can use for example [Texture Projection/Terrain decals] to paint them.

Or you can perform it on terrain mesh itself.

Or you can just have terrain shader with overdraw grid texture.

1 Like

Put another way, why does your grid need to be thousands of quads instead of just one big quad?

The answer to that question will be informative about what you are actually trying to do.

1 Like

It’s a simple idea, I can’t come up with a very satisfactory solution all at once,.
For example, the mesh shown in the previous screenshot is actually capable of placing buildings, and I only noticed the fps decrease when I changed the values of the mesh generation, and that’s when I realized that there was a problem, so I raised the issue in the community.

I realized the problem by replying.

I already understand what the problem is I’ll modify the way the mesh is generated such as using batchnode or advancednode and set up the mergeGeometries manually, but it depends on what I need at the end of the day it’s all still in the planning stage!

So thank you very much for your guidance and replies.

You mean placing buildings instead of the quads?

Whether there is a tiny quad under a building or a big giant quad under the building does not matter at all.

So either there is another reason you need it or you don’t need it at all.

Yes at first I was going to start some units that could interact with the ground so I wanted the ground to be a maneuverable unit, but now I should change that idea!
But we’re not there yet.

I’m using [BatchNode] and so far it’s looking good. (It’s a marker.)