about optimization

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
hyteria
Posts: 266
Joined: Sat Dec 29, 2012 8:22 pm

about optimization

Post by hyteria »

hello

i noticed that with all news mods and custom stuff , our dungeons became bigger and more complexe making the game lagging
so i just want to ask if its change something about loading and using ram if i put a script who destroy all complexe model after changing lvl or one who made pop complexe model every time someone enter or leave a room ? well a system who made thing appear or deseaper depend where the player is

well sorry for my english hard for me to explain , i hope you will understand waht i mean

thx
User avatar
antti
Posts: 688
Joined: Thu Feb 23, 2012 1:43 pm
Location: Espoo, Finland
Contact:

Re: about optimization

Post by antti »

The game does not have streaming. What this basically means is that any unused assets will not be unloaded from memory when they cease to exist in the game world. Since that's just how the engine works there's not much you can do about this expect freeing some memory by not using some of the standard assets (which is not something we advice but which might be necessary in extreme cases).

But when it comes to rendering performance (eg. framerate), destroying assets theoretically could help with the framerate in some scenarios but I would say it's not worth the effort, not to mention that there's a huge potential for bugs there! 3D Models themselves usually have a really minuscule impact on performance (environment assets, monsters, items etc.). Lights typically have the biggest impact on rendering performance but they are hidden by the engine if they are not visible. So if they are off screen or behind a wall, they will not be rendered, but note that doors (including secret doors) will not help here: only solid walls do. So the only thing you should care about is that there's not a lot of lights in the same open area.

To put it simply, my "performance optimization tips for modders" would be the following:

1. If there are no issues, don't do anything. :)
2. If framerate is slow, make sure that you don't have a ton of lights visible at the same time.
3. Make sure that you don't have some custom assets that are not made optimally (like a monster with a bazillion polygons or a particle effect that emits a large number of particles that cover a big portion of the screen)
4. If memory is an issue, make sure that custom assets don't use huge textures. Or just generally cut back on the amount of custom assets that you use in the dungeon.
Steven Seagal of gaming industry
hyteria
Posts: 266
Joined: Sat Dec 29, 2012 8:22 pm

Re: about optimization

Post by hyteria »

many thx antti this will really help and it was a complete awnser !
User avatar
Leki
Posts: 550
Joined: Wed Sep 12, 2012 3:49 pm

Re: about optimization

Post by Leki »

...in other words just do your mod simply clever :-)
I'm the Gate I'm the Key.
Dawn of Lore
User avatar
Komag
Posts: 3654
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: about optimization

Post by Komag »

good info, thanks!
Finished Dungeons - complete mods to play
User avatar
undeaddemon
Posts: 157
Joined: Fri Mar 02, 2012 3:38 pm

Re: about optimization

Post by undeaddemon »

2. If framerate is slow, make sure that you don't have a ton of lights visible at the same time.
So uh... do you have any hard numbers related to "a ton"? Are we talkin' 8 or 18 or 28?

:)
User avatar
odinsballs
Posts: 288
Joined: Thu Dec 20, 2012 4:25 pm
Location: south of heaven

Re: about optimization

Post by odinsballs »

try using cff explorer (freeware) to make te game large memory adress aware (handle more than 2 gig mem) .
User avatar
HaunterV
Posts: 676
Joined: Mon Apr 16, 2012 9:54 pm
Location: Barrie, Ontario, Canada

Re: about optimization

Post by HaunterV »

odinsballs wrote:try using cff explorer (freeware) to make te game large memory adress aware (handle more than 2 gig mem) .
ah! forgot that this is a thing.
Grimrock Community 'FrankenDungeon 2012. Submit your entry now!: http://tinyurl.com/cnupr7h
SUBMIT YOUR ASSETS! Community Asset Pack (C.A.P.): http://tinyurl.com/bqvykrp
Behold! The HeroQuest Revival!: http://tinyurl.com/cu52ksc
User avatar
antti
Posts: 688
Joined: Thu Feb 23, 2012 1:43 pm
Location: Espoo, Finland
Contact:

Re: about optimization

Post by antti »

undeaddemon wrote:
2. If framerate is slow, make sure that you don't have a ton of lights visible at the same time.
So uh... do you have any hard numbers related to "a ton"? Are we talkin' 8 or 18 or 28?

:)
Compared to the original game, 8 is already plenty but of course we were targeting low spec machines as well and mods necessarily don't have to be as accommodating (although that definitely is a good idea)
Steven Seagal of gaming industry
User avatar
Phitt
Posts: 442
Joined: Tue Aug 14, 2012 9:43 am

Re: about optimization

Post by Phitt »

A few things I noticed:

1. Only torches seem to get culled behind walls. Any other light source will not get culled, at least in my case where the light source was above ceiling level (more or less confirmed by devs btw). So light sources other than torches are even worse for performance than torches, make sure you use as few of them as possible for the best effect and don't use huge values for light range.

2. 8 light sources visible at a time will already destroy performance on low end system and cause a very noticeable framerate loss on average systems. I have a pretty good testing system (which means it is far from high end, but not total crap either - ATI 4890 and Core2Duo e8400) and from my experience there shouldn't be more than 3-4 light sources (3 in a highly detailed environment, 4 in a less detailed environment) visible at a time or my framerate will go below 60, which only happens in the prison levels in the original game (prison levels also have a lot of lights that are no torches, framerate goes very slightly below 60). In my mods I try to stay close to the performance of the original game and in my personal opinion that's what every modder should do.

3. If I'm not mistaken the game renders up to 8 tiles ahead and has a pretty large fov (at least 90°). That is the area that is 'visible'.

4. Keep in mind that some monsters also emit light (slimes, Uggardians, Shrakk Torr, Goromorgs and possibly some others), if you plan to have lots of these in an area you can use even less regular lights.
Post Reply