Jump to content
reepblue

Other ways to optimize?

Recommended Posts

Hey all, I'm working on a map and I'm running into some slow down with my map.

 

2016-08-02_10.26.28.jpg

 

I did the following from past topics to get the framerate back up.

  1. I only have 3 spotlights Static+Dynamic+Buffered and anything with mass (minus debris which don't cast a shadow) have their shadows set to Dynamic. Everything else ether doesn't cast a shadow or is static.
     
  2. Everything in the map has the view range of ether medium or near. I also did the automated AABB system as a test, no luck.
     
  3. Killing the lights with my fullbright command shoots the framerate back up. Which is why I think it's a shadow issue.
     
  4. I left any Occlusion Culling modes to their default settings.
     
  5. No volumetics.
     
  6. It's not my resolution as windowed mode has the same results.
     
  7. There is only a fog post process shader.

One thing I think might be causing an expense is that I have some lamps hanging from a point by a ball joint. Batches seem to go up around to 230 in that room so I guess I can remove that.

 

These are my settings:

<?xml version="1.0"?>
<settings>
<display screenwidth="1024" screenheight="768" fullscreen="1" center="1" forcenativeres="1" vr="0" />
<graphics lightquality="1" multisample="1" terrainquality="1" tessellation="1" vsync="0" fov="70" />
<controls show_console="0" />
</settings>

 

If there is anything else I can try, let me know. I'll be uploading the project after I temp fix the player input. As the new input system Matt made seems to be a bit busted. I also will have to use my mobile data so if there is any ideas, I'd like to try before I upload it.

 

Thanks, I'll get right to uploading the project...

Share this post


Link to post

Here it is, sorry for the delay.

https://dl.dropboxusercontent.com/u/16218991/Requests/framerateissue.7z

 

 

Instructions:

 

1. Extract the project to anywhere on your Harddrive.

2. Run "run.bat". This will launch the game (Release) in fullscreen, and devmode. (you can edit this if you want.)

3. It tilde to open the console, and enter "map den01" and press enter.

4. Once in the map, open the console again, and type in "stats 2" to show stats.

5. Waik around, and look at numbers. (The door to the hallway opens with "e".)

 

You can also open the project in the editor.

 

Thanks, I hope something can be found. I'm working on something that might help with this, or at least test my hypothesis,

Share this post


Link to post

As often as this comes up, there really should be an official tutorial from Josh on this with every optimization under the sun, including editor and code settings. Right now there are just a bunch of threads with individual suggestions, some more helpful than others.

Share this post


Link to post

As often as this comes up, there really should be an official tutorial from Josh on this with every optimization under the sun, including editor and code settings. Right now there are just a bunch of threads with individual suggestions, some more helpful than others.

God yes, I've been struggling to get my (simple)game to run well on my laptop's 7670m.

Share this post


Link to post

Nothing happens when you type map dem01 in console

Also on my norwegian keyboard Ø seems to start a console not ~

Share this post


Link to post

I have started working on preparing a video tutorial for optimizing your game.

 

Right now I am setting up the scene with deliberate mistakes in order to show users how to tackle performance problems.

In this wiki topic I have severall articles listed which take care of a lot of the common problems. If you see any thing missing, please send me pm. http://leadwerks.wikidot.com/wiki:optimize-your-map

Share this post


Link to post

Ok, great. Keep in mind that I do have some things in check on my application side of things. For example, anything that has mass, automatically get's it's shadow mode set to Dynamic. From your list, I can agree I have a lot of modular bits, so I guess I can take a look at that. Can't wait for the video too.

 

I've also just got done with my portal volume system. It basically acts like a manual area portal that collects all entities in it's volume then hides/shows them. on command. I've gain about 20fps after implementing it. biggrin.png

Share this post


Link to post

Since I have some problems with FPS too in my game (is not even that kind of AAA gfx game) I noticed something related to the multisample

 

When I use

self.camera:SetMultisampleMode((System:GetProperty("multisample","0")))

I get 40 FPS

 

And when I set the multisample to 16 I get 60 FPS blink.png

 

I think the engine let our GFX cards on underclock when we are not usign higher multisample? Can someone try this too?

 

My card is a R9 390

 

EDIT

Did some more tests

 

Multisample values - FPS get

 

0 = 40 FPS

2 = 40 FPS

4 = 40 FPS

8 = 60 FPS

16 = 60 FPS

 

Multisample = 0

 

FDXbh2l.jpg

 

Multisample = 16

 

GrORtQO.jpg

 

Notice the memory clocks

Share this post


Link to post

I agree with gamecreator. If there aren't going to be profiling tools (which there really should be), then there needs to be an extensive documentation for this. The only one who knows how the engine is designed in Josh, so he's the only person who can definitely say where the engine performs well and where it doesn't. I really shouldn't be expected to upload a project every time I encounter a performance issue.

Share this post


Link to post

I agree with gamecreator. If there aren't going to be profiling tools (which there really should be), then there needs to be an extensive documentation for this. The only one who knows how the engine is designed in Josh, so he's the only person who can definitely say where the engine performs well and where it doesn't. I really shouldn't be expected to upload a project every time I encounter a performance issue.

 

Looks like your concerns is the same as mine, and I think the community share the same concerns. Just take a look on the increasing number of threads about performance.

 

Sometimes is really hard to tell what is going now, even with drawstats().

 

Please keep this thread alive so Josh can see that we are all worried about the current performance of Leadwerks.

Share this post


Link to post

I've spent the last 2 days working on this map. I've gotten the map to run atleast 60fps. I first implemented my Portal Volume. This is a class I've coded that turns a Brush into a volume that detects entities within it's bounds. That helped me find the main drain of the map by section as I could manually hide everything in a room if I wanted too.

 

Next up, I merged some models, and set more stuff to use no shadows. I only saw little improvement when after doing this. My batches went down a bit, but I was still seeing 60 frames tops in that last room. I also disabled shadows on the second spotlight.

 

I went to the other spotlight, and turns out that it's shadows being redrawn each time, regardless that all other lights are ether not being drawn, or have their shadow mode set to none. It's weird, because I thought the engine could handle a spotlight casting on a rotating fan and be fine, but it turns out that's too expensive.

 

So I went back and re-lit the room. It's not what I intended, but I get 80-90fps in this room now. I also have a bit of volume effects on point lights to make the fan holes pop out more, but I see no performance dip having them on or off. To make up for not having a dynamic shadow, I'll take the volume effect.

 

screenshot40.jpg

Share this post


Link to post

Your biggest bottleneck is probably the giant spotlights. Their AABBs probably enclose the entire map.

 

In fact, all your spotlights have a very wide cone which makes them very big, which means at any given time you have a lot of lights being drawn onscreen.

 

I would be looking carefully at the shadow polys.

Share this post


Link to post

Your biggest bottleneck is probably the giant spotlights. Their AABBs probably enclose the entire map.

 

In fact, all your spotlights have a very wide cone which makes them very big, which means at any given time you have a lot of lights being drawn onscreen.

 

I would be looking carefully at the shadow polys.

Can you tell us what size spotlight (and other light types if applicable) is reasonable or what size is in danger of significantly impacting performance?

Share this post


Link to post

There is no hard and fast rule. It's all relative.

 

Cool, what about the multisampling issue I showed?

I think your computer was performing another task in the background that interfered with your measurements.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...