View Full Version : Extreme lag when using Lich
Akaylas
12-26-2021, 07:50 PM
Hello friends,
I started playing again about a month ago. Since then, whenever using Stormfront + Lich, I'm experiencing some pretty gnarly lag that's starting to negatively impact my hunts. Sometimes it's definitely client-side, with stuttering/pauses when typing commands into the text prompt (but before hitting enter). Other times, there's a delay on new messages/strings coming into my screen. For instance, when running a ;go2 command, I'll see narost update my characters significantly faster than the text coming into the screen, with upwards of a 5 second delay before my client catches up. When entering commands, sometimes there's a significantly delay between it registering with the client and the result outputting to the Story terminal.
Here's my version.lic:
!>;version
--- Lich: version active.
Ruby version........: 2.6.6
Ruby platform.......: i386-mingw32
Ruby engine.........: ruby
Lich version........: 5.2.1
SQLite3 version.....: 1.4.2
Gtk version.........: 3.24.24
Cairo version.......: 1.17.4
;version Version....: 0.53
LICH_DIR............: C:/Users/Akaylas/Desktop/Lich5
SCRIPT_DIR..........: C:/Users/Akaylas/Desktop/Lich5/scripts
DATA_DIR............: C:/Users/Akaylas/Desktop/Lich5/data
TEMP_DIR............: C:/Users/Akaylas/Desktop/Lich5/temp
LOG_DIR.............: C:/Users/Akaylas/Desktop/Lich5/logs
MAP_DIR.............: C:/Users/Akaylas/Desktop/Lich5/maps
BACKUP_DIR..........: C:/Users/Akaylas/Desktop/Lich5/backup
Ruby location.......: C:/Ruby4Lich5/bin/rubyw.exe
MapDB filename................: map-1640458453.json
MapDB last modified...........: 2021-12-26 14:20:50 -0500
gameobj-data last modified....: 2021-12-15 01:44:33 -0500
spell-list last modified......: 2021-12-15 01:44:32 -0500
Running scripts.....: infomon, lnet, linktothefast, containers, uberbarv_d, uberspells, roomcreature, spellcaster, recolor, reverb, no-pronoun-links, sorter, rnum3, prettiernum, version
Downstream hooks....: inventory_boxes_off, fix_gameobj_status, lnet-watch-forage, recolor_room_hook, no-pronoun-links, SLootGameObjWatcher, sorter, rnum3, prettynumber
Upstream hooks......: inventory_boxes_toggle, infomon, alias-service, lnet, containers, #{Script.current.name}_upstream_hook, recolor_room_hook, reverb::upstream
Current threads.....: 27
I'm not running anything crazy, but I'm sometimes wrecked by 10+ seconds of lag while hunting, resulting in me being unable to defend myself. There's no clear correlation on when this happens or what. I'm on a pretty good Windows 10 PC with 8-core 3.6GHz, 16 GB ram; my CPU doesn't really go beyond 40% utilization and I don't really use more than 10gb of ram at a time. That being said, I should be able to run Gemstone + Lich with 500mb free and even a fraction of a single core. I can play lots of other games, both 3d-accelerated and not, fine with no lag, stuttering etc.
I'm pretty good with computers, so any suggestings on fixing, triaging or investigating this would be helpful. If it's helpful, I can post a video of a hunt and show what happens. tia~
Alastir
12-26-2021, 07:51 PM
I would start by listing which scripts you're running, and then reading them to see if you have some kind of loop that is going non-stop.
dzulthu
12-26-2021, 08:09 PM
what are you hunting? I usually get nailed with lag when there are a ton of things in a room that can be interacted with via StormFront's point/click
Tgo01
12-26-2021, 08:22 PM
Go to your Lich folder, then Data folder, and see how big is your lich.db3 file?
I used to have a problem similar to what you're having and it was because my lich.db3 file grew extremely large, over 160MB.
It's not a common problem but it's a possibility depending on the types of scripts you have been running.
Akaylas
12-26-2021, 08:26 PM
I would start by listing which scripts you're running, and then reading them to see if you have some kind of loop that is going non-stop.
The list is in the version.lic outpout, but I'm not running anything too obscure, and I was hoping to avoid reading 10+kloc to figure out what's going on. I killed everything and I'm still getting input stutters. I'll try hunting but I've been getting v. lucky with gem bounties tonight.
what are you hunting? I usually get nailed with lag when there are a ton of things in a room that can be interacted with via StormFront's point/click
Nelemar, top floor. I pre-emptively turned off interactive links with LostRanger's LinkToTheFast (keeps the highlights, disables the interactivity). But I can experience these lag spikes with even a single monster in the room that I disable before it can do anything.
Akaylas
12-26-2021, 08:28 PM
Go to your Lich folder, then Data folder, and see how big is your lich.db3 file?
I used to have a problem similar to what you're having and it was because my lich.db3 file grew extremely large, over 160MB.
It's not a common problem but it's a possibility depending on the types of scripts you have been running.
184kb, but this is good to know. Thanks.
Akaylas@DESKTOP-GDSTAC2 MINGW64 ~/Desktop/Lich5/data
$ ls -la lich.db3
-rw-r--r-- 1 Akaylas 197121 188416 Dec 26 20:25 lich.db3
Rinualdo
12-26-2021, 10:13 PM
Looking at all the hooks you are running, you have quite a few scripts which are trying to do something with every piece of stream info you are are sent.
Try pairing down those scripts and uberbar and see if that improves
Akaylas
12-27-2021, 12:12 AM
Looking at all the hooks you are running, you have quite a few scripts which are trying to do something with every piece of stream info you are are sent.
Try pairing down those scripts and uberbar and see if that improves
This was the hunch I had. If each script has to inspect each line of input, transform it, and pass it to the next script, and the game itself is blocking on that input, it's going to slow everything down. But that seems like an innate limitation of Lich and the nature of the game.
Does everyone just try to keep those kinds of scripts limited?
Tgo01
12-27-2021, 12:20 AM
This was the hunch I had. If each script has to inspect each line of input, transform it, and pass it to the next script, and the game itself is blocking on that input, it's going to slow everything down. But that seems like an innate limitation of Lich and the nature of the game.
Does everyone just try to keep those kinds of scripts limited?
I think it really depends on what those scripts are doing with the game lines. If it's simply taking a game line and changing the wording around a bit it probably wouldn't affect much at all. If it's taking each game line and doing a hundred different things behind the scenes before spitting the game line back out then it might cause some problems, especially if multiple scripts are doing this.
I'm pretty sure I used to run around with more downstream and upstream hooks and never noticed a problem.
Akaylas
12-27-2021, 12:40 PM
I think it really depends on what those scripts are doing with the game lines. If it's simply taking a game line and changing the wording around a bit it probably wouldn't affect much at all. If it's taking each game line and doing a hundred different things behind the scenes before spitting the game line back out then it might cause some problems, especially if multiple scripts are doing this.
I'm pretty sure I used to run around with more downstream and upstream hooks and never noticed a problem.
Intuitively, as long as they're not crazy bad, it doesn't seem like a pipeline of string manipulations should cause much problem. Is there a, uhh, definitive guide to the architecture behind Lich? Or has anyone experimented with hooking up a profiler to the Ruby process/threads so that I can see where whatever latency is coming from? I've got the software chops, but Ruby isn't something I've worked in extensively.
Methais
12-27-2021, 04:03 PM
Unrelated but not thread worthy:
I have this weird issue with just Methais to where if I don't log in and then manually quit and then log back in (disconnecting myself via logging in a 2nd time doesn't seem to fix it most of the time), almost every time at some point, my game window will stop updating but everything in the game is still happening and still scrolls fine on my alts' windows. It only seems to happen once per day. Maybe twice, but that's rare.
Been a thing for years now and I've never had the first clue wtf could cause that.
I don't really give a shit about fixing it, just curious if anyone has any idea what would cause that.
Alashir
12-27-2021, 04:25 PM
Unrelated but not thread worthy:
I have this weird issue with just Methais to where if I don't log in and then manually quit and then log back in (disconnecting myself via logging in a 2nd time doesn't seem to fix it most of the time), almost every time at some point, my game window will stop updating but everything in the game is still happening and still scrolls fine on my alts' windows. It only seems to happen once per day. Maybe twice, but that's rare.
Been a thing for years now and I've never had the first clue wtf could cause that.
I don't really give a shit about fixing it, just curious if anyone has any idea what would cause that.
Have you upgraded to lich 5?
Rinualdo
12-27-2021, 04:29 PM
Are you using bigshot?
Methais
12-27-2021, 04:45 PM
Have you upgraded to lich 5?
No but I need to. This predates Lich 5 though, but thanks for the reminder, hopefully that'll fix it. If not then I just have an insane amount of clutter, which wouldn't be surprising. I forgot Lich 5 was a thing.
Akaylas
12-27-2021, 05:50 PM
Unrelated but not thread worthy:
I have this weird issue with just Methais to where if I don't log in and then manually quit and then log back in (disconnecting myself via logging in a 2nd time doesn't seem to fix it most of the time), almost every time at some point, my game window will stop updating but everything in the game is still happening and still scrolls fine on my alts' windows. It only seems to happen once per day. Maybe twice, but that's rare.
Been a thing for years now and I've never had the first clue wtf could cause that.
I don't really give a shit about fixing it, just curious if anyone has any idea what would cause that.
This is similar to my experience. I'll have the occasional experience where the client lags, no screen scroll, for 15-30 seconds, and then the client catches up and I see everything that happened.
So now that I think about it, it definitely sounds like some I/O blocking behavior.
m444w
12-27-2021, 06:05 PM
This is similar to my experience. I'll have the occasional experience where the client lags, no screen scroll, for 15-30 seconds, and then the client catches up and I see everything that happened.
So now that I think about it, it definitely sounds like some I/O blocking behavior.
I think something is broken on Simu's side, because I had this problem with my login script the other day and it doesn't use Lich at all and it hung for 40 minutes until the CI service timed the job out.
Lavastene
12-28-2021, 08:35 AM
This is similar to my experience. I'll have the occasional experience where the client lags, no screen scroll, for 15-30 seconds, and then the client catches up and I see everything that happened.
So now that I think about it, it definitely sounds like some I/O blocking behavior.
This happens to me frequently.
Methais
12-28-2021, 10:15 AM
This is similar to my experience. I'll have the occasional experience where the client lags, no screen scroll, for 15-30 seconds, and then the client catches up and I see everything that happened.
So now that I think about it, it definitely sounds like some I/O blocking behavior.
Mine stays hung up indefinitely until I log out and back in, then it's fine 99% of the time.
Strangely enough, the only time this seems to ever happen on my alts is when I'm running DR. They ghost through it all though so they still get credit at the end of the run. Just weird how it seems to happen on my alts when I'm in DR.
i always put it down to script hunters totally wiping clean the whole third floor of Nelemar. It's so bad up there when it's packed that I get literal screen tear while watching the lag
Methais
12-31-2021, 12:34 PM
i always put it down to script hunters totally wiping clean the whole third floor of Nelemar. It's so bad up there when it's packed that I get literal screen tear while watching the lag
I don't ever get any lag up there, but I'm pretty sure it's the only area in the game that still reminds me of hunting in GS3 where finding something to kill can be a pain in the ass because there are retards in almost every room.
Fortunately most people are too scared to hunt the 2nd floor, so I can clean up there pretty quickly.
Good call, i totally forgot there was a second floor [lol]
tried to do a laughing face but did some kind of accidental goatse - left it there cos I know you <3 that
Overlordz
12-31-2021, 11:45 PM
This is similar to my experience. I'll have the occasional experience where the client lags, no screen scroll, for 15-30 seconds, and then the client catches up and I see everything that happened.
So now that I think about it, it definitely sounds like some I/O blocking behavior.
Haven't played in awhile, but when I did I had this on occasion.
If it's an I/O issue I wonder if running Lich in a RAMdisk would change anything.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.