Maslak Posted April 2, 2016 Share Posted April 2, 2016 Hello! My PC isn't very good, which means that I can't play many games. Thanks Klei, Don't Starve runs quite smoothly with 25 fps. But when there are loads of rock lobsters, 200 grass tufts and 200 saplings on my farm, heavy rain or it's just Shipwrecked and those damned monkeys are near, fps can drop down to something like 3-6. My idea is to make mod which will disable certain animations, like swaying of trees, grass, saplings, bamboos etc... That'd be great to have some configuration page, where one can choose which animations will "play" and which not. The more animations on disabling/enabling list the more fps one can achieve. Too bad, I have no idea about modmaking, so I hope someone will help me. Okay, maybe not help me, but make a mod like this I will love The Great Maker for the rest of my life! Love you all! Link to comment https://forums.kleientertainment.com/forums/topic/66007-request-disabling-certain-animations-to-boost-fps/ Share on other sites More sharing options...
Mobbstar Posted April 2, 2016 Share Posted April 2, 2016 Honestly, I don't think the animations matter that much. Things like AI, periodic checks and huge amounts of active entities can cause severe lag. Link to comment https://forums.kleientertainment.com/forums/topic/66007-request-disabling-certain-animations-to-boost-fps/#findComment-742963 Share on other sites More sharing options...
Maslak Posted April 2, 2016 Author Share Posted April 2, 2016 So, the fps drops happen because there are ****loads of grass on the screen, not because it sways all the time? I'm not sure, once I had 90 berry bushes planted very close to each other and fps were the same like on desert (for example). I know, 90 bushes is not 200 grass + 200 twigs, but it still should lag a bit according to what you said. Link to comment https://forums.kleientertainment.com/forums/topic/66007-request-disabling-certain-animations-to-boost-fps/#findComment-742982 Share on other sites More sharing options...
Tulingu Posted April 2, 2016 Share Posted April 2, 2016 (edited) I'm curious whether this issue is related to the graphics card or CPU (aka processor). Launch dxdiag and check what graphics card you got. Look for the names AMD or NVIDIA, that means you've got some kind of graphics card. If you find e.g INTEL you're stuck with integrated graphics (cpu). If you're running a game on integrated graphics you'll most likely get lags because that poor CPU of yours must calculate AND run a game at the same time. Example image below: Edited April 2, 2016 by Miss Link to comment https://forums.kleientertainment.com/forums/topic/66007-request-disabling-certain-animations-to-boost-fps/#findComment-743033 Share on other sites More sharing options...
Mobbstar Posted April 2, 2016 Share Posted April 2, 2016 (edited) I suppose it's worth testing. I will spawn 100 grass and take down the FPS. Then I will disable the animation and reload the world. If you are right, the FPS should be significantly better. UPDATE: It definitely improved the framerate (from 7 fps to 12). Oddly enough, it seems to me that burning the grass didn't make it significantly worse again. Still, heavy rain shouldn't cause a significant drop in framerate. Edited April 2, 2016 by Mobbstar Link to comment https://forums.kleientertainment.com/forums/topic/66007-request-disabling-certain-animations-to-boost-fps/#findComment-743034 Share on other sites More sharing options...
simplex Posted April 2, 2016 Share Posted April 2, 2016 (edited) @Mobbstar If you'd like to implement this, you can use this code: Spoiler --// Maps prefab names to tables with animation overrides. --// --// Each of these override tables should map each an animation to another --// animation to play instead. Animations not listed are played normally. --// --// If a replacement animation takes arguments, the full argument list may --// be expressed as an array in place of the animation name (e.g., --// '{"idle", true}'). local tweaked_prefabs = { grass = { idle = {"anim", true}, rustle = {"anim", true}, }, } --- --// AnimState methods to patch with animation override. --// The only requirement is that they receive the animation argument right --// after the 'self' one. local patched_methods = { "PlayAnimation", "PushAnimation", } ----------------------------------------------------------------------------- --// --// Here we hook everything up. --// ---// --// Imports _G = GLOBAL local _G = _G local assert, error = _G.assert, _G.error local type = _G.type local pairs, ipairs = _G.pairs, _G.ipairs local unpack = _G.unpack ---// --// Code --// --// Maps each patched AnimState object to its prefab name. --// --// An entry is set on a prefab postinit, and cleared on an "onremove" --// callback. --// local patched_animstates = {} local function update_animstate_patched(inst, p) local animstate = inst.AnimState if not animstate then local msg = ("Prefab '%s' does not have an AnimState!"):format(tostring(inst.prefab)) return error(msg) end if p then patched_animstates[animstate] = assert( inst.prefab ) else patched_animstates[animstate] = nil end end local function patch_method(oldmethod) assert( oldmethod ) return function(self, animname, ...) local prefab = patched_animstates[self] if prefab then local overrides = assert( tweaked_prefabs[prefab] ) local override = overrides[animname] if override then if type(override) == "table" then return oldmethod(self, unpack(override)) else return oldmethod(self, override) end end end return oldmethod(self, animname, ...) end end local function patch_animstate_index(animindex) for _, k in ipairs(patched_methods) do animindex[k] = patch_method( animindex[k] ) end end local function new_animstate_setter(p) return function(inst) return update_animstate_patched(inst, p) end end local set_animstate_patched = new_animstate_setter(true) local clear_animstate_patched = new_animstate_setter(false) local function patch_prefab(prefab) return AddPrefabPostInit(prefab, function(inst) set_animstate_patched(inst) inst:ListenForEvent("onremove", clear_animstate_patched) end) end --- for prefab in pairs(tweaked_prefabs) do patch_prefab(prefab) end patch_animstate_index(assert( _G.AnimState )) Put it in a modmain (or a file modimport'ed from it). It's easily extensible by adding new entries to the 'tweaked_prefabs' table at the top of the script. Currently what it does is to disable grass motion, but this behavior is automatically extended based on what's in 'tweaked_prefabs'. I just won't take this mod upon myself because I'm really not looking forward to maintaining a list of problematic prefabs and the associated animations. Edited April 2, 2016 by simplex better syntax highlighting Link to comment https://forums.kleientertainment.com/forums/topic/66007-request-disabling-certain-animations-to-boost-fps/#findComment-743141 Share on other sites More sharing options...
Maslak Posted April 2, 2016 Author Share Posted April 2, 2016 Thanks for answers. I think I should check fps when grass is unharvested (and sways in the wind) and check after harvest. In it harvested stade, there is some "time calculation" running, so it should lag even worse if it's a thing. @Miss I'm not using integrated graphics card, I guess. I know that disabling some animations will boost fps to 50-60, but if even small increase can be achieved it's worth trying. I know it's easy to say and much harder to make, so I don't demand anything. Link to comment https://forums.kleientertainment.com/forums/topic/66007-request-disabling-certain-animations-to-boost-fps/#findComment-743173 Share on other sites More sharing options...
Tulingu Posted April 2, 2016 Share Posted April 2, 2016 (edited) On 2016-04-02 at 0:05 AM, Maslak said: @Miss I'm not using integrated graphics card, I guess. I know that disabling some animations will boost fps to 50-60, but if even small increase can be achieved it's worth trying. I know it's easy to say and much harder to make, so I don't demand anything. GeForce GT 430 used to be a low-end GPU back in the days. It can handle video playback and lightweight games, that's about it... I'm no mod expert or LUA coder but I do know my way around computers so I'll suggest over-clocking the graphics card. There are plenty of tutorials on le interwebz. Avoid those that wants you to use additional software because it'll slow down your system even more. Over-clocking is something you want to do in BIOS. There's a second option as well - get a better graphic card. The 400 series are really old by technology standards and you can probably get a cheap card from (the less overheating) 500 series. Nvidia GeForce GTX 570M will do, 560 and 550 will probably make it as well. Don't spend too much on old laptops Edited April 4, 2016 by Miss what is english Link to comment https://forums.kleientertainment.com/forums/topic/66007-request-disabling-certain-animations-to-boost-fps/#findComment-743239 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now