Don't Starve

Don't Starve

Customize your wilderness adventure!
Create and upload new mods to add new characters, items, and game mechanics to Don't Starve. Explore new ways to survive in the wilderness, or create new challenges for yourself and others. Click here to learn more and get started!
PaintDream 1 19 Jun, 2016 @ 10:22pm
LuaJIT patch for DS, RoG, SW (win32): Goodbye lagging! 缓解单机版卡顿PATCH
Hello everyone!

I'm here to release a new test patch DontStarveLuaJIT for windows systems.

As a binary patch for Don't Starve, DontStarveLuaJIT replaces the lua engine in Don't Starve running process with a just-in time compiler named LuaJIT (by Mike Pall, see http://www.luajit.org/ for more details).

LuaJIT is much more faster than official one. It can solve the lagging problems caused by too many awake objects and mods.

Since the main executable of Don't Starve exports none of lua functions. The patch has to search/replace them via binary features. It may not be compatible with all revisions of Don't Starve.

Introduction, Installation, Issues, Download and Source at: https://paintdream.github.io/DontStarveLuaJIT/



Once more, It's only a TEST VERSION now, PLEASE BACKUP YOUR SAVES BEFORE APPLYING THIS PATCH.

饥荒游戏默认采用了lua 5.1.4作为脚本引擎,在优化不到位的情况下,如果游戏当前活动对象过多(可以通过Backspace查看左上角的awake得到),就会出现明显的卡顿现象。加之游戏本身是单线程的,所以满载只能跑满一个CPU核心,经常CPU占用只有20%,但是游戏已经卡得不能玩。

LuaJIT是一个Just-in Time的lua引擎,由Mike开发。它可以将lua代码编译成CPU指令而不是虚拟机指令直接执行,在速度上比官方lua要快非常多(相差一到两个数量级)。具体的性能测试可到luajit官方网站(luajit.org)上看。

这个MOD的作用就是使用LuaJIT替换掉原有的lua引擎,可以缓解因为对象数过多/MOD数过多引起了卡顿问题。但是由于饥荒主程序并没有导出lua函数,因此这个替换的过程是使用了特征码匹配的。
特征码匹配没有办法保证它在所有版本的游戏中都可以正确运行,我仅仅在发贴时最近的steam正版Don't Starve v181038+ 上进行了测试。因此我需要收集一部分测试反馈。

如果您想测试它的话,请确保您已经备份好所有的存档。如果程序出现了闪退或者崩溃,请将Steam\SteamApps\common\dont_starve\bin下的扩展名为.mdmp的文件贴到github issue上。

项目主页:https://github.com/paintdream/DontStarveLuaJIT
测试版本:https://github.com/paintdream/DontStarveLuaJIT/releases
GITHUBIO:https://paintdream.github.io/DontStarveLuaJIT/

在测试之前,请认真阅读README.md


====
顺便说一句,如果想提升游戏的载入速度的话,请将饥荒安装在SSD硬盘上~
Last edited by PaintDream; 19 Jun, 2016 @ 10:29pm
< >
Showing 1-15 of 21 comments
月繁 19 Jun, 2016 @ 10:53pm 
——正在使用中,感觉上没以前卡,暂时还没有mod崩溃的现象。
然后我竟然是第一个评论。。
聆听 5 24 Jun, 2016 @ 8:33pm 
表示一打开就崩了
Rincewind 3 Jul, 2016 @ 2:18pm 
intersting, any palns for x64 and linux?
Henry Turner 3 Jul, 2016 @ 5:33pm 
Originally posted by Rincewind:
intersting, any palns for x64 and linux?
haha, it is not x64, it is 64-bit.
PaintDream 1 5 Jul, 2016 @ 8:48am 
Originally posted by Rincewind:
intersting, any palns for x64 and linux?
Don't Starve for Windows is a 32-bit application. So this patch can be applied regardless of which Windows version you have.

As far as I know, there are much more players of Don't Starve who run their game under windows than linux, especially in China. Writing a linux version may be a harder challenge because the binary searching techniques of Windows version must be reworked.
Henry Turner 10 Jul, 2016 @ 1:58am 
Originally posted by Rincewind:
intersting, any palns for x64 and linux?
What's "intersting" and "palns"?
PaintDream 1 10 Jul, 2016 @ 10:32am 
Originally posted by home zom.:
Originally posted by Rincewind:
intersting, any palns for x64 and linux?
What's "intersting" and "palns"?

"interesting" and "plans" maybe
蒜味咖啡 29 Jul, 2016 @ 2:27am 
哇哦,迫不及待的想试一试了
LC-BX 11 Aug, 2016 @ 12:13am 
来支持一波
小明他爸 5 Sep, 2016 @ 10:54pm 
这么好的资源居然没回复:steamsad:
景言 25 Dec, 2016 @ 4:37am 
thanks.在使用,很不错。
小鸭momo 1 18 Jun, 2017 @ 6:03am 
支持一下,希望有linux版本,毕竟专服更加需要
Winy·Han 14 Sep, 2017 @ 10:21pm 
来一波666,China NO.1
PaintDream 1 21 Sep, 2017 @ 10:53am 
Originally posted by Winy·Han:
来一波666,China NO.1
吃鸡乱入……
晨光暮曲 16 Nov, 2017 @ 7:47am 
这个PATCH还是跟进新版本的更新吗?老爷机卡顿的只能调进程实时优先级,要是这个还在跟进更新就好了:steamhappy:
< >
Showing 1-15 of 21 comments
Per page: 1530 50