Optimizing my game

Ok,
it didn’t show any errors, but what was supposed to happen when a ray hit something just didn’t.
Oh, and how do I build it myself? Or is there an installer for the latest version?

thanks it is awesome .
for F6 to work first I added
stateManager.attach(new BasicProfilerState(true)); in my SimpleInitApp() method .

It is in green state. Seems OK! :wink:
My Graphic card is AMD Radeon HD 6300M .

1 Like

I always have a constructor in my simple app extension that does something like:

    public Main() {
        super(new StatsAppState(), new DebugKeysAppState(), new BasicProfilerState(false),
              new AnimationState(),
              new OptionPanelState(),
              new EntityDataState(new DefaultEntityData()),
              new TimeState(),              
              new DecayState(),  // important for decay to happen as early as possible    
              new PlayerDbState(),
              new AchievementsState(),
              new PhysicsState(),
              new ModelState(),
              new SoundState(),
              new LevelSelectionState(),
              new OptionConfigurationState(),
              new IntroductionState(),
              new StarFieldState(),              
              new ScreenshotAppState("", System.currentTimeMillis())); 
    }


(Notice the first line)… so I forget that the profiler isn’t added by default.

Edit: though that one is a bit of an outlier (that’s from MathAttack) and 90% of my constructors look exactly like:

    public Main() {
        super(new StatsAppState(), new DebugKeysAppState(), new BasicProfilerState(false),
              new MainMenuState(),
              new ScreenshotAppState("", System.currentTimeMillis())); 
    }

…for like almost every JME game I make it looks exactly like that.

2 Likes

Well, any news on raycasting in 3.1?
Or on optimizing?
Oh, and is it better to add or to link the .j3o in the scenecomposer when I want to do batching?

As far as I’m aware, and I cast a lot of rays, it’s working just fine. This needs to be brought up in another thread if not already done so we can examine what’s not working for you with rays. Preferably a small isolated test case would be brilliant.

Are you using the downloadable SDK or are you building the libs from sources?
If so, could you please tell me how to (because the docs are still talking about svn)?

I just run the latest jars from the Maven repo. I do not use the SDK at all.

Would you be so nice as to point me to the jars?

Sure thing: http://updates.jmonkeyengine.org/maven/

Thank you.

Another thing on this:
I haven’t switched to 3.1 yet (it might be that the skybox is attached to a node on the rootnode that rays don’t work (they collide with the rootNode), I’ll see to that when I have time),
but is there any advice on lights?
I’d like to add street lamps etc. which will of course introduce many lights. Can this be done so that it doesn’t disrupt performance? (I read a post about deferred lighting, could that be something, is it in JME?)

A first thing would be to try single pass lighting (JME 3.1)

renderManager.setPreferredLightMode(TechniqueDef.LightMode.SinglePass);
renderManager.setSinglePassLightBatchSize(8); // Modify as you see fit
1 Like

Well, I have to migrate to 3.1 then.
Thanks for the answer.

Think about if you really need all those lights to be dynamic. A lightmap is a great solution and can even be updated in game…

3 Likes

@DannyJo Thank you. Although I don’t see any performance gain. :wink:

I’m rewriting stuff now so that the ray only collides with children of an entityNode.
And when I got the animations fixed, I have successfully migrated to 3.1.

Another question on this topic: The water filter is eating about 30-40 FPS, is there any way to make it perform better or replace it with something (may be lower quality)?

It is usual since the water Filter renders the whole scene twice.

We have two water Filters though, try the more Basic one

There are a lot of toggle options on the water filter to trade off quality for performance. Try them and see which one helps.

There are a lot of toggle options on the water filter to trade off quality for performance. Try them and see which one helps.

Thank you. I have now ~700 FPS on lowest settings.