For TE4 1.0.4, the program executable was reverted to the binaries compiled for the 1.0.1 release. The executables built for 1.0.2 through 1.0.4 run significantly slower that the ones for 1.0.1 and previous releases. I've recently been able to do some testing and found out some interesting things.

Recent builds of T-Engine have used LuaJIT2 2.0.1. The TE4 1.0.1 release uses LuaJIT2 2.0.0-beta8. After reverting several commits to t-engine's C code base and recompiling, it became pretty clear that this upgrade to luajit2 has been causing most of the slowdown. Recompiling with luajit2 2.0.0-final exhibited the same symptoms. It appears something changed with luajit2 starting with 2.0.0-beta9 that causes t-engine to run much slower relative to luajit2 2.0.0-beta8.

While testing out the performance of each luajit2 library, I noticed another interesting thing. Under win32, while resting, it takes significantly less time to finish resting when the in-game FPS is lowered. For users with an older computer or weak graphics card, TOME 1.0.2 must have been infuriating to play.

Here are some rough performance comparisons. More that one test was run per configuration, but testing was not exhaustive. To generate the numbers, I created an arcane blade in TOME in cheat mode, enabled semi-godmode, teleported to elven ruins level 3, found a spot where some monsters could sense me but not interrupt resting, and finally set my max mana to 4000. For each configuration, I then drained my mana to zero and measured the amount of time to restore to full via resting.

So, we must fix two things to achieve better performance in the long run for t-engine. First is to determine why recent version of luajit2 runs so much slower than 2.0.0-beta8. Second is to find out where the rendering bottleneck is and either remove it or circumvent it (perhaps by switching to reduced FPS while resting). Alleviating both issues, according to rough measurements, would look to make resting five times as fast. That's a big quality of life improvement while playing a game of TOME.

Update: I've found the luajit2 commit which causes a slowdown in t-engine4's execution. The offending commit is located here. By specifically reverting this commit, we can run trunk luajit2 2.0.x at the same speed of execution as 2.0.0-beta8. Now to find out exactly why this commit affects t-engine's performance so much...

Here's a patch which adds resting and running FPS dividers to t-engine. It additionally applies the running FPS divider to tome's autoexplore.

These dividers simply divide the game's requested FPS by their respective values while resting or running. They can be set under options->video options. Setting these dividers to something greater than one can substantially reduce the amount of time required to finish resting/running on older computers.

If you run t-engine at 30 FPS requested, I recommend setting the resting divider to 15 (2 FPS while resting) and running divider to 5 (6 FPS while running/autoexploring). Just be careful when resting on an escort mission...

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum