Killing Floor

Killing Floor

Realtime Shadows Mutator
47 Comments
Mutant  [author] 7 Jan, 2021 @ 9:17am 
It has been quite some time but from what I remember, this might either be hard or impossible since there is custom code controlling the shadows.
Reptid 8 Nov, 2020 @ 2:18pm 
Nice mod, also i have a question, is possible to turn this mod client-side functional? i remember the old ut2004 shadows mutator worked online, but im not sure through..
Mutant  [author] 9 Feb, 2017 @ 6:20am 
Well, for this old engine, it seems to be possible. :UT2004flak:
Boltte man 7 Feb, 2017 @ 11:47pm 
Hah - you reckon a GTX980M bottlenecks an i7-4710HQ?! :steammocking:
Mutant  [author] 7 Feb, 2017 @ 11:43pm 
Haha, nice analogy. Sure, the engine is not optimized for that. For the shadows it is like that: The CPU calculates how the shadows change (every tick), the drawing itself is a GPU thing. If the GPU is the bottleneck, then use lower resolutions, if it's the CPU then disabling DynamicLightShadows and/or reducing the ShadowsPerPawn setting can help you out.

Yep, you got the trick with the Disabled setting, it is a client only thing. :UT2004flak:
Boltte man 7 Feb, 2017 @ 8:59pm 
So for example, my serverside ini file looks like this currently as I'm testing:
[KFRealtimeShadows.KFRealtimeShadowsMut]
ShadowResolution=2
ShadowsPerPawn=3
bDynamicLightShadows=True
bSunShadows=True
bRagdollShadows=True
bDisabled=True

But client side, it would look like the default settings, so:
[KFRealtimeShadows.KFRealtimeShadowsMut]
ShadowResolution=0
ShadowsPerPawn=1
bDynamicLightShadows=False
bSunShadows=True
bRagdollShadows=True
bDisabled=True

And THEY need to change this(if they knew about the fact that the server uses realtime shadows and knows how to config it), but first they need to exit out of the game, config, then restart the game and rejoin the same server for the effects to take place.
Boltte man 7 Feb, 2017 @ 8:57pm 
Here's another analogy: Your job is to carry water from the lake to your house. You know you have a bucket to do the job, BUT you are told to *explicitly* use only your hands to carry the water from the lake to your house.

That's what I'm getting from this game with this addon....

Anyways, did some further testing regarding something else I asked and even if editing the line:
bDisabled=True from False as to disable serverside, or at least expecting that is so, it's still enabled client side - therefore my conclusion is that all the server has to do is turn it on or off, and the client does the configuration, regardless what is configured serverside in that ini file....

Boltte man 7 Feb, 2017 @ 8:47pm 
It's like you have drill, right? You have 30x speed, but you are told to NOT go any faster than 10x speed - but if you COULD, you could drill the hole faster with 30 times the normal speed, rather than your boss saying "NO ONE IS ALLOWED TO GO FASTER THAN 10X speed on their hand drills!" See - artifical limit analogy in real life....

As for CPU....it seems to be the same.....CPU utilization for my i7-4710HQ never exceeds 16% for KF1.......perhaps the issue is that the GPU is WAITING for the CPU to move stuff faster? And thus the GPU is then ABLE to increase fps to 150? So it looks like there is an artifical limit for CPU usage as well!!
Boltte man 7 Feb, 2017 @ 8:44pm 
Ok so did some more testing with shadows on and off whilst having GPUZ and Process Explorer running in the background to log stuff and no, it doesn't appear to be CPU realm, but rather GPU as my GPU utilization practically doubled! From around 20 to 30 % to 60%.......this is with 32 clots on the screen at once.

And fps dropped from 150 to 60......and GPU still doesn't seem to be working harder to keep that 150 fps up but rather as if it's artifically limited to work a certain load and anymore load on top of that even if the GPU *can* handle it to keep the fps up to 150 with this realtime shadows on, it doesn't ... for some reason....perhaps game engine is too old to be optimized for newer gen tech......?
Boltte man 7 Feb, 2017 @ 5:36pm 
But both the server's ini file AND clients' file must be enabled before shadows is enabled for the client?

Heh - My setting was three shadows per entity and High settings..... :P

Oh - I thought shadows is calculated GPU side because it's a GPU thing? No? Well then in that case it's it's my i7-4710HQ CPU that seems to be having trouble keeping up then! hahaha

Hang on, let me pull up GPUZ and Process Explorer to see if having shadows enabled hit GPU or CPU according to them...... I'll be back....
Mutant  [author] 7 Feb, 2017 @ 12:20pm 
The shadows are disabled by default until the client enables them in it's ini file. This is to prevent people connecting to the server from having the shadows being used against their will. This setting shouldn't have any effect on a server.
I used to run 2 shadows per entity at medium settings and never had serious FPS issues on my 580GTX. The problem is that the shadows are calculated on the CPU, so the GPU doesn't matter that much here.
Boltte man 7 Feb, 2017 @ 4:42am 
Also I'm guessing both the server's ini must be enabled alongside the client's created ini file too for the shadows to work and not server's ini enabled but client's ini disabled = no shadows for the connected client, mmm?
Boltte man 7 Feb, 2017 @ 4:41am 
....And this is coming from a laptop running a GTX980M graphics card too!
Boltte man 7 Feb, 2017 @ 4:40am 
...brought my fps down to the teens(from over 130) when everything was going on....
Boltte man 7 Feb, 2017 @ 4:38am 
Ok, did some testing and I have already restarted the server(I'm guessing you need to restart both client and server for the effect to enable after having it on disable on default?) to see if it would take affect and to spot any differences, and here are some screenshots for comprison purposes(split into two links a set, the top most link is with it not loaded whilst the bottom link is with it loaded):
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=858990433
https://steamhost.cn/steamcommunity_com/id/Boltte/screenshot/84842927286545203
Boltte man 7 Feb, 2017 @ 12:53am 
Is there a difference between this and the standard shadows we get ingame anyways if you're running on maximum preset? Got a video demostrating the difference so I can see? Or....no?
Mutant  [author] 29 May, 2016 @ 12:34pm 
The shadows only work if you have chosen "Full shadows" in the game settings. If you ahve chosen "Blob shadows", then they won't be attached as a performance measure.
freshwater-crocodile 29 May, 2016 @ 12:27pm 
I have maxed out shadows, but rarely host my own server. This mod probably hasn't caused any issues, I recall shadows as simple "blobs".
Mutant  [author] 29 May, 2016 @ 12:21pm 
The mod does not affects gibs, as it only adds dynamic shadows to living entities like players and monsters.
If you're using the lowest shadow resolution and only one shadow per entity, there should be like no performance hit compared to the default game. Both options can have a high impact if set on high, just play around to find your optimum.
The mod can only be used on servers that have the mutator installed.
freshwater-crocodile 29 May, 2016 @ 7:30am 
How high is the performance hit and does this mod work on all servers? I've played with the mod from the start and I'm having performance issues. Wouldn't be suprised if this mod also affects gibs.
Mutant  [author] 3 Mar, 2015 @ 5:45am 
Thanks for the heads-up. Seems that I deleted it by accident. Link restored.
Mirror is broken.
"404
The page you were looking for appears to no longer be there."
Kosh 2 Nov, 2014 @ 10:35am 
@Drassel, this difference is only in your mind.
Drasselll™ 28 Oct, 2014 @ 7:10am 
@mutant,
Yes I do! It must be me since I took the time to notice while testing your mod.
Unless you pay attention you won't notice. But it is particularly noticeable when the shadows are pretty tall or they move alot around the characer.
Mutant  [author] 28 Oct, 2014 @ 2:16am 
That's actually a good idea, I will put it on my update list.
Let's hope there will be a new whitelisting round (but this can take up to a year).
Thank's for the feedback! :UT2004flak:

Strange is that I also play at 60FPS and don't notice it, have you also "Triple Buffering" enabled?
Drasselll™ 27 Oct, 2014 @ 7:55pm 
@Mutant ,
Is it possible in future updates to get the option to set a custom refresh rate for the shadows?
I play on ULTRA settings with V-sync on at 60 FPS. It's only odd to see the shadows refreshing at a lower rate than the picture. It feels a bit buggy on my opinion.
Mutant  [author] 27 Oct, 2014 @ 9:37am 
@Drassell,
the shadows have a capped refresh rate of ~24 fps to relieve CPU/GPU. However, I have never noticed that ingame (maybe because I have V-Sync on to force a constant refresh rate).
Furthermore, the shadows fade out there are fewer light source around, but some lights have large radii.

@Dronis,
you ahve to enable the shadows first to see the difference (disabled by default).
Dronis 27 Oct, 2014 @ 12:14am 
Не пойму в чем отличие ? И без мутатора тень от мобов и игроков падает.

I do not understand what is the difference? And without a shadow of a mutator mobs and players falls.
Drasselll™ 26 Oct, 2014 @ 11:49pm 
Works like a charm! I tried 3 shadows on high def and everything checked, my 6-core AMD FX-6350 takes it without any problem.
However, I just wanted to point out that sometimes when there is only one light source, all 3 shadows will still appear! Or also, the shadows do not move totally fluidly; as if they were refreshing at a lower rate than the rest of the picture, if you see what I mean.
Keep up the good work!
Kosh 26 Oct, 2014 @ 2:33pm 
Ok. You told about server, not about network. I agree about network. Network is the thing that client and server both involved.
Izzybee 26 Oct, 2014 @ 6:47am 
Alright, what had happened was, I downloaded an addon before this one and loaded the game, it didnt download the realtime shadow one but it downloaded the other one. Then I went looking for files and shit, and I just got myself confused..
Mutant  [author] 26 Oct, 2014 @ 12:46am 
@MatlaS,
Press subscribe which should trigger the download (maybe you have to start the game to trigger the download, just stay in the main menu until it has finished and hthen restart), open the game, go to solo and open the mutators tab. Add Realtime Shadows, press configure mutators (bottom-right), choose the settings you want and uncheck the disabled flag.

@Gatekeeper,
I play with 2 shadows at medium resolution which is enough imo (580GTX, Core i7 2600K). The dynamic light shadows option is also quite a CPU heavy thing.
Dronis 25 Oct, 2014 @ 11:43pm 
Thank! спасибо!
Gatekeeper 25 Oct, 2014 @ 11:34pm 
I got it working. I think the problem was I hadn't started the game up again after switching to D3D. I started a solo session with bots and immediately realized two things: three shadows on each entity was WAY too much for my GPU, and three shadows doesn't look nearly as good as it sounds. Sorry about the non-issue.
Izzybee 25 Oct, 2014 @ 3:14pm 
MAy I get some instructions on how to install this ._.
Mutant  [author] 25 Oct, 2014 @ 2:26pm 
Afaik, (shadow)projectors are not supported in OpenGL, so it is a DX only feature.
Give me some more details about how you set things up, maybe the RealtimeShadows.ini (which hold the settings configuration) is read-only and thus the flag won't be saved as false?
Gatekeeper 25 Oct, 2014 @ 12:50pm 
It doesn't seem to work. I've maxed all the settings, changed the disabled flag to False, I've tried DX9 and OpenGL, and it doesn't seem to be working, even in single-player. I have a GT 610, so I'm fairly certain that's not the issue. Any tips on what to check? I really want to get this working.
Mutant  [author] 25 Oct, 2014 @ 12:35am 
The most expensive process is the drawing process which must be done on each client that has the shadows enabled.
Furthermore, those shadows are realtime calculated (capped at about max. 24 updates per second). So when I outsource the other calculations to the server it had to supply 6 clients (assuming there are no spectators) with (32+5)*3 (-1 as you don't see own shadows) = 111 shadows per update and client, which is 2664 shadow updates to be send per second to each client. This makes all in all 15984 updates per second the server has to flush to all clients (maximum calculation, assuming every player/monster is relevant to networking).
One update consists of a set of different data (rotator, drawdistance, etc...) which resluts in a massive and constant flood of data.
I have never tried it but I think that it is too much for UScript and UE2 to handle.
Kosh 25 Oct, 2014 @ 12:02am 
The thing is server not doing calculations isn't advantage. Client should not be powerful, server is.
/Flex 22 Oct, 2014 @ 11:18pm 
Very usefull!
Mutant  [author] 21 Oct, 2014 @ 11:53pm 
It works for every monster except for the Scrake (a bug in the shader prevents that).
**Devtros** 21 Oct, 2014 @ 5:37pm 
Does it also work for stalker's shadows or character's only?
DannyArt 21 Oct, 2014 @ 12:31am 
Very Nice Indeed! :UT2004health:
76561198027781948 20 Oct, 2014 @ 8:17am 
Lord Gibson smiles down upon you.
Vee 19 Oct, 2014 @ 5:52pm 
nice! good job! :)
Mutant  [author] 19 Oct, 2014 @ 3:17pm 
Realtime Shadows Mutator has been whitelisted in v1061!