PaintDream

  • Content Count

    38
  • Joined

  • Last visited

Community Reputation

58 Excellent

About PaintDream

  • Rank
    Junior Member
...

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Enable
  1. Thanks a lot! I think I could try it if I got a Mac ...
  2. By now, the only bug existed is that some mods use compiled-binary code from luac to "hide" thier details (luadec: ?), which are not recognized on LuaJIT.
  3. I could simply set LD_PRELOAD environment to load my shared library for linux (much easier than on Windows): LD_PRELOAD=libpreload.so dontstarve_steam I've published this mod 4 years ago to a Chinese Game Club called 'Don't Starve Game Bar'. All reported bugs that can be fixed were fixed. It's seems to be stable now but I still need a lot of tests. It's really simple for Klei to integrate my mod: just clone my modified luajit version from repository and replace it. BTW: The graphic module is need to be refractoried to improvement performance. I could provide any help if Klei got any problems on shader optimization & GPU instancing.
  4. I am searching for a good injecting approach for Linux/macOS. As you know, the game requires steam to launch it (except Dedicated Server), so I need to inject my mod just before game starts. But by now I have no good idea. (Hacking game binary file would be OK but not portable for game upgrading and it's not a beautiful way)
  5. I wrote a long summary on this mod but it's in Chinese: https://zhuanlan.zhihu.com/p/24570361 . Maybe you could read it with Google Translate (Highly recommended) ... Here's the outline in English: 1. Locate lua functions by machine code searching (it's a really hard work...); 2. Solve the problem caused by missing of arg table in LuaJIT by inserting a statement to AST. (In lua, arg is usually a grammar sugar for { ... } which can be captured through closure, however LuaJIT does not support it). 3. Remove extra character-encoding support from LuaJIT. Lua suppresses slash '\' with illegal type. Therefore '\u' would not cause any error and would be converted into 'u' in Lua. However, LuaJIT support '\u1234' to indicate unicode characters. In some mods, we can find such a string 'use \umbrella to xxxx'. It is illegal in LuaJIT, causing exception and crashes the game. 4. Fix RunInSandboxSafe implementation. 5. Fix hash table iteration inconsistent problem by porting string hash algorithm and table insertion for initializer list. (Most interesting) 6. Fix different behavior for unpack() with 'nil hole' in it. e.g: function foo(...) return {...} end print(unpack(foo(1, 2, 3, nil, 5))) Lua: 1 2 3 nil 5 LuaJIT 1 2 3 7. Fix crash when deserializing a big save slot. LuaJIT only support at most 65535 constant in a lexical scope. 8. Fix Ice Flingomatic Trap failure by porting buggy version of table.reverse to luajit. (Yes, Ice Flingomatic Trap relies on table.reverse bug in Klei's implementaion)
  6. That's not true. Don't Starve relies on serveral undefined behaviours of lua, which are implemented differently on LuaJIT. For example, the strategy of constructing table with initializers is different, as well as string hashing algorithm. However some code requires a certain order when iterating a table. (e.g. RPC call id generation, mouse-clicking operation selection). As a result, the IDs of RPC are not consistent, leading connection failure as communicating with server / other clients. In my implementation of DontStarveLuaJIT mod, I elimates these differences by porting lua's implementations to LuaJIT so it works fine.
  7. I've been trying to migrate LuaJIT for Dont'Starve via binary modding: https://github.com/paintdream/DontStarveLuaJIT since 2016. It supports DS, DST and Dedicated Server for Linux now. This mod replaces builtin lua engine with LuaJIT 2. Various incompatibilities between LuaJIT and Lua are fixed. I would like to share my migration details/sugguestions if Klei were planning to do the same thing in official way. (BTW, the most significant performance issue in Don't Starve may be the lack of GPU Instancing in rendering. It could be nice if Klei did it in official build.)