Fayd

Hi all.
I’m really new to jMonkey so I don’t know if this is the right place to post.
Anyway … with this post I want to announce my game I am currently starting with.
It is called Fayd and it will be kind of like a mix between Fable and Elder Scrolls.
I just started development and I am really new to 3D programming so I thought I start this post so whenever I have problems I would post them here.
I am also happy if I could use some of your methods and ideas because like I said I’m really new to 3D programming.
But before you post any of your work I want you to know that I want my game to be commercial since I’m still a student :).

So if you have questions or want to help me just post under this topic, send me a message or send me an e-mail (which doesn’t work sometimes because a lot of e-mails go into my junk folder).

3 Likes

Quick suggestion for when problems arise:

If they are game specific (i.e. has nothing to do with JME functionality, classes, etc), do post them here… it’s a great way of keeping your thoughts organized.

If they are not game specific, you will likely not get an answer in a timely fashion, as the devs and other members won’t realize it is a JME specific question. So, this case, I would suggest starting a separate thread.

The game sound really interesting, I’m looking forward to seeing/hear about your progress as you go!

1 Like

I don’t know where to post this so I just post it here …
I have been playing around with terra monkey and post processed water and sgolds’ SkyControl.

Here’s the result:

So I have a few questions concerning these methods.
First, can you make the water infinite or make a bottom skydome which looks like water because I think it looks ugly when the sky dome starts above the water.
Second, should I rather make a whole big world for my game or should I make instances?
Third, is it possible to get the FPS higher?

I’m really new to making games and I don’t really have a plan of what I’m doing :stuck_out_tongue: … so please help me.
Thanks :smiley: .

1 Like

It’s almost always possible to get the FPS higher. The first step would be to identify the main performance bottleneck(s).

For instance, if you disable SkyControl and the FPS changes from 23 to 25, then you know SkyControl is not a big bottleneck. If FPS jumps from 23 to 166, then it is.

Similarly, try disabling other features (terrain, filters, user-interface, and so on) and see how much they are impacting performance. That will tell you where to focus your optimization efforts.

1 Like
@sgold said: It's almost always possible to get the FPS higher. The first step would be to identify the main performance bottleneck(s).

For instance, if you disable SkyControl and the FPS changes from 23 to 25, then you know SkyControl is not a big bottleneck. If FPS jumps from 23 to 166, then it is.

Similarly, try disabling other features (terrain, filters, user-interface, and so on) and see how much they are impacting performance. That will tell you where to focus your optimization efforts.

Also keep in mind that FPS changes are relative:

4000 to 3000 fps &
4 to 3 fps

would be the same ratio… i.e. that same performance hit.

So, if you add a single some filter (like FXAA) and see a 300 fps hit
the add another FXAA Filter and see the a different ratio

It tells you your implementation may be the problem.

1 Like

Well… technically you’re better off reciprocating the FPS into time.

4000 FPS = 0.25 ms
3000 FPS = 0.3333 ms
… so frame time increased 0.083 ms (not too much)

But 4 FPS = 250 ms
and 3 FPS = 333 ms
…so frame time increased 83 ms… and that’s a much bigger drain than with 4000 to 3000. I consistent drop from 4 to 3 would be something to look into for sure. But a drop from 4000 to 3000 is nothing… not even worth looking into.

The big thing is the “OMG I LOST 1000 FPS” reaction which sounds much worse than it is. “OMG I lost 0.000083 of a second” doesn’t sound so bad.

4 Likes

Kind of off topic, but is there a way to display the frame time in milliseconds on the screen instead of fps so I dont have to do the calculations myself?

1 Like
@8Keep123 said: Kind of off topic, but is there a way to display the frame time in milliseconds on the screen instead of fps so I dont have to do the calculations myself?

Not built in. FPS is not a very exacting measure anyway as it will vary a lot from frame to frame.

It’s just important to remember that losing 1000 FPS on 4000 is not a big deal. Losing 30 FPS off of 100 probably is. You gain a feel for it after a while… and users will want to see FPS anyway.

1 Like
@8Keep123 said: Kind of off topic, but is there a way to display the frame time in milliseconds on the screen instead of fps so I dont have to do the calculations myself?

You are not interested in the time per frame, but in the slowest frame the last x seconds.
As this is the frame making microlags/stutters. Having 1k frames in 500ms and then a 500ms lag is not worth anything.
Then you are interested in the ratio between slow frames and fast enough frames. (eg overall slowdown or microlags)
As 1 is mostly a complexity/draw call /cpu limit, while the second points to either GC or inefficient methods that run every few frames (like a network update, or physictick)

Back to the topic, the post processing water is really demanding on certain cards in my expirience.

1 Like
@Fissll said: First, can you make the water infinite or make a bottom skydome which looks like water because I think it looks ugly when the sky dome starts above the water.

Making the bottom dome look like water is difficult but possible. If you’ve made the terrain’s water extend as far as you can, the next thing to do would be to use SkyControl’s setCloudsYOffset() to bring the clouds down to the water’s edge.

1 Like

Ok … I looked at my code step by step and I think that the terrain is the main problem.
When I run the game without it it runs at about 70 FPS.
When I just run the terrain it runs at about 60 FPS.
So running every shader and updates are as consuming as just showing the terrain with some light?

Here’s what I did to make the terrain:

  1. Made an empty scene.
  2. Added a terrain Node (Total Size: 2048 ; Patch Size: 16 ; Image Based with max. Smooth ; Height Scale: 1 ; Alpha-blend texture size: 2048)
  3. Added it to the simpleInit()
    [java]Spatial terrain = assetManager.loadModel(“Scenes/Fayd.j3o”);
    terrain.setLocalTranslation(500, -45, 0);
    rootNode.attachChild(terrain);[/java]
@Fissll said: Ok ... I looked at my code step by step and I think that the terrain is the main problem. When I run the game without it it runs at about 70 FPS. When I just run the terrain it runs at about 60 FPS.

Those numbers don’t convince me. If I understand you correctly, adding terrain increases the time per frame by 17%. If I were you, I’d be looking to see what the code is doing the other 83% of the time.

1 Like

Sorry but I don’t really understand you … Here again some FPS stats:

nothing = 2900 FPS
terrain + boatModel + directionalLight + ambientLight = 60 FPS
SkyControl + PostProcessedWater + boatModel + directionalLight + ambientLight = 70 FPS
everything = 25 FPS

So actually the times per frame increase by 64% after adding the terrain if I calculated right :stuck_out_tongue: .

Hope this helps … should I post all of the code from my classes? … I don’t want to spam this forum if it isn’t necessary.

1 Like

I see now. If you’re not using TerrainLodControl, you should try that. If you’re already using TerrainLodControl, you may want to tune the parameters or make your terrain smaller or less detailed.

I’m also curious about your frames-per-second with SkyControl only (no water or lights).

Oh … I thought LOD would be integrated in the Scene.j3o … I will try to integrate it into my code.

@sgold said: I'm also curious about your frames-per-second with SkyControl only (no water or lights).

It runs at about 170 FPS with these settings:

[java]
@Override
public void init() {
SkyControl sc = new SkyControl(assetManager, cam, 0.9f, true, true);
rootNode.addControl(sc);
sc.getSunAndStars().setObserverLatitude(37.4046f * FastMath.DEG_TO_RAD);
sc.getSunAndStars().setSolarLongitude(Calendar.FEBRUARY, 10);
sc.setCloudiness(FastMath.rand.nextFloat());
sc.setEnabled(true);
sc.setCloudYOffset(0.4f);
BloomFilter bloom = new BloomFilter(BloomFilter.GlowMode.Objects);
bloom.setBlurScale(2.5f);
bloom.setExposurePower(1f);
Misc.getFpp(viewPort, assetManager).addFilter(bloom);
sc.getUpdater().addBloomFilter(bloom);
}

@Override
public void update(float tpf) {
    SkyControl sc = rootNode.getControl(SkyControl.class);
    float hour = fayd.timeOfDay.getHour();
    sc.getSunAndStars().setHour(hour);
}

[/java]

1 Like

And what about if you delete the bloom filter? How does that change the FPS?

@sgold said: And what about if you delete the bloom filter? How does that change the FPS?

About 400 FPS.
Before you ask … when I disable all bloom filters I get about 35 FPS with everything on.

1 Like

How doe sthe water chang eit eg enabled disable? As post processing can easily kill anything that is not high end.

@Empire Phoenix said: How doe sthe water chang eit eg enabled disable? As post processing can easily kill anything that is not high end.

Everything without bloom and without water = 60-70 FPS
Everything without water = 40 FPS