Page 1 of 1

[1.6.5] [patch] game doesn't start without luajit2

Posted: Wed Dec 25, 2019 7:24 pm
by lifanov
Edit: there are a lot more issues with trying to use portable Lua than this.
This used to work before, but the build option should probably just be removed now.
See below post that updates luajit2 instead.


With all official addons (orcs, cults, ashes, possessors), the game runs against the memory limit in luajit2
frequently. This is the easiest to reproduce by going below level 50 in Infinite Dungeon as a technomancer
or just possessing everything in sight as a possessor with 14+ body storage capacity. I switched to lua=default,
but the game no longer starts in this configuration. It crashes as soon as I get to character creation screen.
Below is needed to get the game to start without luajit2:

Code: Select all

diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua
index ae57364eb..5a42992b7 100644
--- a/game/modules/tome/class/Game.lua
+++ b/game/modules/tome/class/Game.lua
@@ -725,7 +725,7 @@ function _M:updateCurrentChar()
 
 	local class_evo = ""
 	if self.descriptor and self.descriptor.class_evolution then class_evo = " ("..self.descriptor.class_evolution..")" end
-	profile:currentCharacter(self.__mod_info.full_version_string, ("%s the level %d %s %s"):format(player.name, player.level, player.descriptor.subrace, (player.descriptor.subclass or "")..class_evo), player.__te4_uuid)
+	profile:currentCharacter(self.__mod_info.full_version_string, ("%s the level %d %s %s"):format(player.name, player.level, (player.descriptor.subrace or ""), (player.descriptor.subclass or "")..class_evo), player.__te4_uuid)
 
 	if core.discord and self.zone then
 		local all_kills_kind = player.all_kills_kind or {}
In case above one-liner is copywritable, I assign copyright to darkgod.

Re: [1.6.5] [patch] game doesn't start without luajit2

Posted: Wed Dec 25, 2019 10:14 pm
by lifanov
There are a lot of other issues with trying to use vanilla lua. Instead, please look at an update
to bundled luajit2 to the latest release from OpenResty's branch. This seems to be the most
active branch since 2017 and introduces (optional) support for 64 bit pointers, arm64, and mips64.

The patch is too big to attach here:
https://lifanov.com/files/patches/te4-l ... date.patch

The bundled tome.patch file has been updated. I built it with 64 bit pointers and am currently
happily running a Possessor through Infinite Dungeon using Psychic Crush and possessing
and mulching everything in sight.

Re: [1.6.5] [patch] game doesn't start without luajit2

Posted: Thu Dec 26, 2019 3:08 am
by lifanov
After playing for a few more hours, my possessor is still unplayable. The game doesn't crash or corrupt the save file, but it becomes very slow without saving and exiting every map.

However, my high-level technomancer is now snappy and not crashing anymore!

Re: [1.6.5] [patch] game doesn't start without luajit2

Posted: Thu Dec 26, 2019 5:28 pm
by darkgod
Hum well luajit may need update, I'll go check that out; but the memory bloat is not normal in any cases though.

Could you post me the savefile of the technomancer & the possessor? I need to analyze what's taking so much space.

Thanks for the details report ! :)