Page 1 of 1

[b35] massive computer slowdown with confusion

Posted: Fri Dec 02, 2011 3:54 am
by jaega1
Forgive me if this has already been reported but with b35 (and no addons) I am having a significant problem.

When an enemy hits my player character with confusion the game runs insanely slowly until it wears off. It likely is caused by the whatever makes the screen blur. The graphical change is pretty neat but the slowdown in the game is very unpleasant. It sometimes takes ten seconds for the game to register a single key press. This makes the game almost unplayable whenever this happens.

Does this happen to anyone else?

Re: [b35] massive computer slowdown with confusion

Posted: Fri Dec 02, 2011 10:33 pm
by Laerte
Happens to me too. Invisibility also makes the game very slow.

I'm using Linux (Arch) with an ATI card and the radeon opensource drivers.

Re: [b35] massive computer slowdown with confusion

Posted: Fri Dec 02, 2011 11:59 pm
by tiger_eye
Yeah, this has bothered me too. My gfx card isn't that great, and it kinda falls short with these particular effects. So, here is a patch (also attached) that adds an option do disable blurring effects:

Code: Select all

Index: game/modules/tome/load.lua
===================================================================
--- game/modules/tome/load.lua	(revision 4706)
+++ game/modules/tome/load.lua	(working copy)
@@ -61,6 +61,7 @@
 end
 if config.settings.tome.gfx.tiles == "mushroom" then config.settings.tome.gfx.tiles="shockbolt" end
 if type(config.settings.tome.weather_effects) == "nil" then config.settings.tome.weather_effects = true end
+if type(config.settings.tome.blur_effects) == "nil" then config.settings.tome.blur_effects = true end
 if type(config.settings.tome.smooth_fov) == "nil" then config.settings.tome.smooth_fov = true end
 if type(config.settings.tome.daynight) == "nil" then config.settings.tome.daynight = true end
 if type(config.settings.tome.hotkey_icons) == "nil" then config.settings.tome.hotkey_icons = true end
Index: game/modules/tome/dialogs/GameOptions.lua
===================================================================
--- game/modules/tome/dialogs/GameOptions.lua	(revision 4706)
+++ game/modules/tome/dialogs/GameOptions.lua	(working copy)
@@ -131,6 +131,15 @@
 		self.c_list:drawItem(item)
 	end,}
 
+	local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"Enables or disables effects that blur the screen.\nDisabling it should gain a performance increase while under the effect of confusion, invisibility, etc.#WHITE#"}
+	list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Blur effects#WHITE##{normal}#", status=function(item)
+		return tostring(config.settings.tome.blur_effects and "enabled" or "disabled")
+	end, fct=function(item)
+		config.settings.tome.blur_effects = not config.settings.tome.blur_effects
+		game:saveSettings("tome.blur_effects", ("tome.blur_effects = %s\n"):format(tostring(config.settings.tome.blur_effects)))
+		self.c_list:drawItem(item)
+	end,}
+
 	local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"Select the interface look. Metal is the default one. Simple is basic but takes less screen space.\nYou must restart the game for the change to take effect."}
 	list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Interface Style#WHITE##{normal}#", status=function(item)
 		return tostring(config.settings.tome.ui_theme2):capitalize()
Index: game/modules/tome/class/Player.lua
===================================================================
--- game/modules/tome/class/Player.lua	(revision 4706)
+++ game/modules/tome/class/Player.lua	(working copy)
@@ -281,14 +281,14 @@
 		end
 
 		-- Blur shader
-		if self:attr("confused") then game.fbo_shader:setUniform("blur", 2)
+		if self:attr("confused") and config.settings.tome.blur_effects then game.fbo_shader:setUniform("blur", 2)
 --		elseif game:hasDialogUp() then game.fbo_shader:setUniform("blur", 3)
 		else game.fbo_shader:setUniform("blur", 0) -- Disable
 		end
 
 		-- Moving Blur shader
-		if self:attr("invisible") then game.fbo_shader:setUniform("motionblur", 3)
-		elseif self:attr("lightning_speed") then game.fbo_shader:setUniform("motionblur", 2)
+		if self:attr("invisible") and config.settings.tome.blur_effects then game.fbo_shader:setUniform("motionblur", 3)
+		elseif self:attr("lightning_speed") and config.settings.tome.blur_effects then game.fbo_shader:setUniform("motionblur", 2)
 		else game.fbo_shader:setUniform("motionblur", 0) -- Disable
 		end
 	end

Re: [b35] massive computer slowdown with confusion

Posted: Sat Dec 03, 2011 5:35 pm
by darkgod
Why not use the option already existing to disable shaders ?

Re: [b35] massive computer slowdown with confusion

Posted: Sat Dec 03, 2011 7:23 pm
by tiger_eye
darkgod wrote:Why not use the option already existing to disable shaders ?
Because there are other shaders that don't slow my computer down at all, and the low hitpoint shader is extremely useful and is something I don't want to do without.

Re: [b35] massive computer slowdown with confusion

Posted: Sat Dec 03, 2011 9:29 pm
by eronarn
I get this with just the confusion and invisibility shaders on Ubuntu.

Re: [b35] massive computer slowdown with confusion

Posted: Sun Dec 04, 2011 7:05 pm
by darkgod
THen you can instead edit the shaders themselves, comment/remove the if controlling blur/invis/... from the, so your game wont invalidate.
It's in data/gfx/shaders/main_fbo.frag

Re: [b35] massive computer slowdown with confusion

Posted: Wed Dec 07, 2011 4:15 am
by tiger_eye
darkgod wrote:THen you can instead edit the shaders themselves, comment/remove the if controlling blur/invis/... from the, so your game wont invalidate.
It's in data/gfx/shaders/main_fbo.frag
Yeah, I know. The above patch was faster to make and test (about 2 minutes) than the addons attached below (about 5 minutes).

So, if you want to use shaders but don't want the fullscreen blurring effects that occur with confusion and invisibility, then download one of the attached addons below (for b35 or for b36), unzip it, then put the resulting folder in "game/addons/". Viola! That's it! This will most likely work for future versions too, you'll just need to modify the version number in the file "tome-no_screen_blur/init.lua".

One final note: if you turn off shaders completely, then the game will most likely feel "snappier", but you'll miss out on some useful shaders like the low hitpoint warning (which I view as a lifesaver!).
tome-no_screen_blur-b35.zip
(2.99 KiB) Downloaded 86 times
tome-no_screen_blur-b36.zip
(2.98 KiB) Downloaded 93 times

Re: [b35] massive computer slowdown with confusion

Posted: Mon Feb 03, 2014 9:19 pm
by malboro_urchin
I know this thread is ancient, but I'm having issues with the game's confusion shader; whenever I get confused, my frame rate tanks. I have yet to use Lightning Speed or Invisibility, but those would probably cause similar issues. I don't want to invalidate my game, but after finally figuring out how to access the shaders, I can't figure out which lines to comment out for invisibility, lightning speed, & confusion.