Questions to devs about performance
Questions to devs about performance
I'm having some weird performance problems in my mod. It's not that bad, but I'd still like to know why the performance drops in certain places as I can't figure out why it happens.
In one location for example when I look in a certain direction the framerate drops by at least 25% (from vsynced 60 to 45, I use triple buffering). But there is absolutely nothing in that direction that would explain the performance loss. Just a few basic tiles, very few deco elements, and the only light is a healing crystal. Nothing else. In other places with a lot more going on (more deco, tons of enemies, 3+ lights) the framerate stays at 60.
I think I noticed that this happens especially in the middle of the map and that it gets worse the larger a map grows. In locations that didn't have performance problems before I got them later on after I added more stuff miles away from that location. And in both level 2 and level 3 (both of which use as much of the available space as possible) of my dungeon I get those problems in the middle of the map only.
I always thought the game renders up to 8 tiles ahead in whatever fov it uses (90°?). And as long as I make sure I don't have too many lights, models, enemies etc in one direction I'm safe. But apparently there is more to it. I understand that the more enemies, scripts etc I add to the whole dungeon the more it will tax the CPU, but that doesn't seem to be my problem. It almost seems as if the game renders everything around the player (360°) in a certain distance and that's why the performance drops in the middle of a map for no apparent reason. But I can hardly believe that.
Any ideas what my problem is or why the framerate behaves like it does? I would really like to optimize my dungeon, but I have no idea how. Is the only way to make smaller levels with a more spread out layout?
In one location for example when I look in a certain direction the framerate drops by at least 25% (from vsynced 60 to 45, I use triple buffering). But there is absolutely nothing in that direction that would explain the performance loss. Just a few basic tiles, very few deco elements, and the only light is a healing crystal. Nothing else. In other places with a lot more going on (more deco, tons of enemies, 3+ lights) the framerate stays at 60.
I think I noticed that this happens especially in the middle of the map and that it gets worse the larger a map grows. In locations that didn't have performance problems before I got them later on after I added more stuff miles away from that location. And in both level 2 and level 3 (both of which use as much of the available space as possible) of my dungeon I get those problems in the middle of the map only.
I always thought the game renders up to 8 tiles ahead in whatever fov it uses (90°?). And as long as I make sure I don't have too many lights, models, enemies etc in one direction I'm safe. But apparently there is more to it. I understand that the more enemies, scripts etc I add to the whole dungeon the more it will tax the CPU, but that doesn't seem to be my problem. It almost seems as if the game renders everything around the player (360°) in a certain distance and that's why the performance drops in the middle of a map for no apparent reason. But I can hardly believe that.
Any ideas what my problem is or why the framerate behaves like it does? I would really like to optimize my dungeon, but I have no idea how. Is the only way to make smaller levels with a more spread out layout?
- Skuggasveinn
- Posts: 562
- Joined: Wed Sep 26, 2012 5:28 pm
Re: Questions to devs about performance
I'm going to keep an eye on this one.
Are there any console commands to see performance (I'm using fraps atm to see drops).
Also it would be super nice to see some kind of breakdown between different aspects like how much cpu is going into surface drawing vs running lua scripta etc (I know its a tall order
)
Skuggasveinn.
Are there any console commands to see performance (I'm using fraps atm to see drops).
Also it would be super nice to see some kind of breakdown between different aspects like how much cpu is going into surface drawing vs running lua scripta etc (I know its a tall order
Skuggasveinn.
Re: Questions to devs about performance
Is this in editor or in exported game? I get framerate hits in editor that go away once the game is exported.
Re: Questions to devs about performance
It happens in game. In the editor the relations are the same as far as I can tell, with the only difference that the overall framerate is far worse than in game (which is understandable and doesn't bother me at all). In fact I first noticed this in the editor after I completed my first level - the starting area would run at perfect 60 fps when I tested it, and later, when I added a lot of stuff at the other side of the dungeon and tested again the framerate was far worse. Gladly the framerate was still ok in game (constant 60), but on levels 2 and 3 I have these problems now even in game. And in both levels it only happens in the ~8x8 tiles in the middle of the map for no apparent reason.Batty wrote:Is this in editor or in exported game? I get framerate hits in editor that go away once the game is exported.
Re: Questions to devs about performance
Here is a old thread i had about enabling in game fps:
viewtopic.php?f=12&t=2574
Also, are you using prison wall set which dramatically changes fps as far as I've seen.
viewtopic.php?f=12&t=2574
Also, are you using prison wall set which dramatically changes fps as far as I've seen.
The FORCE is with me!!!
Re: Questions to devs about performance
Without debugging it's hard to give a concrete answer but this certainly sounds odd. Shadow casting lights are heavy but they should be culled away behind walls. Models are culled by testing their bounding boxes against the view frustum. Incorrect bounding boxes in models (e.g. if they used incorrect scaling) could result in models being rendered all the time. I can only give theories without taking a look at the issue.
Are you CPU or GPU bound? Does smaller resolution speed it up?
Are you CPU or GPU bound? Does smaller resolution speed it up?
Re: Questions to devs about performance
I think I figured it out. Seems like it is caused by shadow casting lights. Especially overlapping lights seem to decrease performance a lot, and that also of course means lights that only theoretically overlap (even with a wall in between in my case?...see below). At least with high shadow settings, with medium or low setting I had no performance problems at all (other settings didn't help, turning off SSAO for example made no difference). I reduced the light range of my custom lights to 9 (from 15) and removed a few of them to make sure none overlap. Now I get 60 FPS everywhere. Doesn't look that good, but I guess that's how it is.petri wrote:Without debugging it's hard to give a concrete answer but this certainly sounds odd. Shadow casting lights are heavy but they should be culled away behind walls. Models are culled by testing their bounding boxes against the view frustum. Incorrect bounding boxes in models (e.g. if they used incorrect scaling) could result in models being rendered all the time. I can only give theories without taking a look at the issue.
Are you CPU or GPU bound? Does smaller resolution speed it up?
You say that lights are culled behind walls. Would it be a problem that my custom light is 'above' the ceiling? I made a light shaft and the light is at (0, 5.5, 0) position. There is a model in the way of course (the shaft), but not a ceiling or a wall above/beneath it. Could it be that the light is never culled because it is outside of the tileset? I ask because I think my custom lights cause more performance loss than for example torch holders with torches. Would it help if I put a cap on the light shaft (right now it's open)?
I'm using a custom tileset. Got the worst framerate in the original game in prison as well (only place where it dropped below 60), but I guess it was the fault of the numerous (overlapping) lights in the boss levels and not of the tileset itself.Brodie301 wrote: Also, are you using prison wall set which dramatically changes fps as far as I've seen.
Re: Questions to devs about performance
Ok, that makes sense. Because there are many more torch holders than ceiling lamps in the original dungeon, we spent more time optimizing their performance. It could be that ceiling lamps don't have the "culled by walls" optimization enabled at all. It's probably best to avoid placing too many ceiling lamps close together.
Re: Questions to devs about performance
Ah, ok. Thanks for the answer and explanation, I'll simply make sure not to place too many custom lights!petri wrote:Ok, that makes sense. Because there are many more torch holders than ceiling lamps in the original dungeon, we spent more time optimizing their performance. It could be that ceiling lamps don't have the "culled by walls" optimization enabled at all. It's probably best to avoid placing too many ceiling lamps close together.
Re: Questions to devs about performance
Since we are speaking about performance, I'll post my small issue.
I have a desktop and a laptop, my desktop is pretty old, (I think 5 years old) and Grimrock, just like any other game I own, works fine at 1920x1080 max details.
My laptop is not even 1 years old, and it's nearly as powerful as my desktop, I can run many games with it at 1920x1080 with medium-high details.
The games that are coming to my mind are: left 4 dead 2, borderlands, killing floor, fallout new vegas, battlefield bad company 2, but I think my laptop simply hate Grimrock!
I have to play it at 1280x720 at minimun details and still having some frame issues.
My laptop model is an Asus N55S series, with core i7 2.2Ghz, 6Gb Ram, graphic card is geforce GT 555M 2Gb. Now I have win 8 on it, I had to update the graphics drivers, but this issue still persists!
Do you have any advice or suggestions?
Just to be clear: I don't mind playing in such way, I can still play fairly well with the framerate drop, but it's just annoying
I have a desktop and a laptop, my desktop is pretty old, (I think 5 years old) and Grimrock, just like any other game I own, works fine at 1920x1080 max details.
My laptop is not even 1 years old, and it's nearly as powerful as my desktop, I can run many games with it at 1920x1080 with medium-high details.
The games that are coming to my mind are: left 4 dead 2, borderlands, killing floor, fallout new vegas, battlefield bad company 2, but I think my laptop simply hate Grimrock!
I have to play it at 1280x720 at minimun details and still having some frame issues.
My laptop model is an Asus N55S series, with core i7 2.2Ghz, 6Gb Ram, graphic card is geforce GT 555M 2Gb. Now I have win 8 on it, I had to update the graphics drivers, but this issue still persists!
Do you have any advice or suggestions?
Just to be clear: I don't mind playing in such way, I can still play fairly well with the framerate drop, but it's just annoying