Author Topic: PS is laggy: what can be done?  (Read 3767 times)

Giraut Mawhrin

  • Traveller
  • *
  • Posts: 30
    • View Profile
PS is laggy: what can be done?
« on: July 02, 2009, 01:24:00 pm »
Hello everybody,

I'm checking out PS again for the first time since 0.3.20 on my measly computer, and I'm finding it more and more unplayable. Let me explain: the rendering speed is sub-par, but that's okay, my computer just doesn't cut it. But even so, the game would be playable if it wasn't for the terrible lag.

What I mean by lag is, when I arrive in an area with a lot of objects (NPCs, objects, other clients, ALs), then the game becomes jerky, and often simply freezes for several seconds while it does things. So essentially, the game is unplayable around the Hydlaa plaza, and not very nice elsewhere anyway.

I know the lag issue has something to do with GEMClientActor and GEMClientItem objects being created, i.e., when lots of them come into range, the engine mass-creates them and everything freezes while it's doing that. In the past, the biggest culprit code was the label creation code, and I had a patch to disable it and make the game okay. With 0.4.03 however, it's not even that anymore: something else creates the lag somewhere around pscelclient.cpp, but I haven't figured out what quite yet.

I figured my computer was just not good enough, so out of curiosity, I installed PS on my work machine and gave it a spin (shhh, don't tel the boss :) ). The machine in question is a Intel Core2 Quad 2.66MHz with 8 gigs of ram and a Nvidia quadro FX 1500 video card. Sure enough, everything was fast and smooth on empty maps, but in Hydlaa with stuff and clients all over the place, it's still noticeably jerky and slow and generally unpleasant.

This brings three questions:

- Aren't any of you guys ever bothered by PS' poor performances? or have you gotten used to them over the years? Because quite frankly, my work machine isn't exactly an underachiever, and even heavy 3D applications I use for work like SolidWorks or Pro/ENGINEER work a lot better than PlaneShift. That should tell you something is very wrong in the PS codebase. I have trouble believing everybody in the dev team is oblivious to the speed and lag issues.

- Anybody knows what specific areas of the code may cause the pauses and jerkiness? I must admit, I have a nagging urge to play PS every now and then, but I can't because it's plain nasty on my home computer, and it's frustrating. I sort of had the idea of getting a better computer, but I have no need for a fast machine apart from playing PS, and the experience of running PS as it is today on my work machine tells me I definitely should keep my hard-earned cash for something else. However, if there are things that I could do to improve things in the code that you guys are aware of, I might just convince myself to try and fix them.

- Last question, not really related but still: anybody knows if it's possible to disable lighting in CS? lighter2 just kills performances on older machines. I'd be happy enough with the old fullbright rendering if it made things faster.

Before everybody jumps on me, please understand that this is not a rant. I just want to know if I'm the only person in the world who finds PS just not very nice to play, or if it's officially expected that one should plop down hundreds of euros for a nice computer and get used to the quirks, or if I'm too demanding or something. And yes, I know, it's officially alpha, it's community-supported project, nobody gets paid, developers don't have time, there aren't enough developers, it's free so I shouldn't complain, or that I must recompile using this-or-that fix, or do code profiling, yada-yada. But I'm not complaining: if you guys thinks I make unreasonable remarks, I'll forget PS for now and I'll try it out again in a year or two. If not, is there something I can do to the code to make it enjoyable on an honest home computer?

Take care y'all!

weltall

  • Moderator
  • Veteran
  • *
  • Posts: 1671
    • View Profile
    • http://weltall.heliohost.org
Re: PS is laggy: what can be done?
« Reply #1 on: July 02, 2009, 01:30:14 pm »
well the problem is the map itself... too many lights...

Sen

  • Hydlaa Notable
  • *
  • Posts: 746
    • View Profile
Re: PS is laggy: what can be done?
« Reply #2 on: July 02, 2009, 02:07:56 pm »
Until now I thought it is (apart for cs being probably really not fast...) mainly a driver problem... so Im surprised that you have such bad performance with a NVidia card. Im running ps on a GeForce 9600GT and some mobile NVidia on my laptop - both completely without problems (using linux).
Within a house I needed to turn shadows off, though, to make the game run from unplayable to rather smooth - maybe we are lucky and this helps for some reason on other maps, too.

Sen
.....also a saddle that won't pinch the tail. One day!

Giraut Mawhrin

  • Traveller
  • *
  • Posts: 30
    • View Profile
Re: PS is laggy: what can be done?
« Reply #3 on: July 02, 2009, 02:43:45 pm »
I don't really have a problem with rendering speed per se. My previous machine had a Nvidia 9600 GS, my current one has a Nvidia Ion chipset, and my work box, as I said, has a Nvidia Quadro FX 1500. All these machines render well enough considering their respective capabilities. My real problem is the hiccups the game experiences when approaching an area with many objects/clients. On the fast machine, it is bearable, just not very nice. On lesser machines (lesser in terms of CPU that is), the hiccups make playing impossible.

This is not new though: I recall RPing in Akkaio once, suddenly a huge group of people turned up at a guildhouse sale not far from where I was standing, and the whole game froze for 20 solid seconds. It's just worse now.

Don't you experience these freeze-ups and jerks when you enter Hydlaa Plaza?

I know the code has to register new object coming into range, but that much slowdown isn't right.

Sen

  • Hydlaa Notable
  • *
  • Posts: 746
    • View Profile
Re: PS is laggy: what can be done?
« Reply #4 on: July 02, 2009, 02:57:57 pm »
I don't recall any hiccups like these since quiet some time, but I will have a look later the day. The effect that you describe of lag when several people appear could be tested e.g. at the octarch's house when enough gather for it :)

Sen
.....also a saddle that won't pinch the tail. One day!

kiou

  • Hydlaa Resident
  • *
  • Posts: 112
    • View Profile
Re: PS is laggy: what can be done?
« Reply #5 on: July 02, 2009, 04:39:57 pm »
same problem all the way through. It seems to have gotten worse since mu last reinstall.
http://thewhitecorps.webs.com/
my guild website, still being worked on~
* kiou thinks gms should be elected and reviewed~
"Im very smart in some ways, and much stupider in infinitely more ways"

Sen

  • Hydlaa Notable
  • *
  • Posts: 746
    • View Profile
Re: PS is laggy: what can be done?
« Reply #6 on: July 02, 2009, 07:00:06 pm »
I walked out of hydlaa until the map change to the bdr1 map and returned then to hydlaa. I didn't experience these hiccups; just a bit less performance than usual what might have to do with a hundred trees that someone out just outside the city :P
Did you ever check if you have a lot of io operations when game works bad? (In Linux you can look for example with iostat)

Sen
.....also a saddle that won't pinch the tail. One day!

kaerli2

  • Hydlaa Resident
  • *
  • Posts: 163
    • View Profile
Re: PS is laggy: what can be done?
« Reply #7 on: July 03, 2009, 03:46:01 am »
I've noticed the same problem: maybe we should run PSclient under oprofile and/or iostat and try this case (lots of objects appearing on screen at once).  This also aggravates the existing PS/CS draw problems (partly caused by the cap on visibility, which is caused by lack of full LoD support).

kiou

  • Hydlaa Resident
  • *
  • Posts: 112
    • View Profile
Re: PS is laggy: what can be done?
« Reply #8 on: July 03, 2009, 04:17:44 am »
i just told it basically to not use textures at all,  ;D
it runs now
but looks terrible
heh, i dont mind too much
http://thewhitecorps.webs.com/
my guild website, still being worked on~
* kiou thinks gms should be elected and reviewed~
"Im very smart in some ways, and much stupider in infinitely more ways"

Nykolai Raskaniov

  • Hydlaa Resident
  • *
  • Posts: 191
    • View Profile
Re: PS is laggy: what can be done?
« Reply #9 on: July 03, 2009, 07:54:44 am »
There is a blog entry from a dev on this topic made a while back. Some of the previous lag issues were addressed (like the guild system messages improvements or the inventory system rewrite).

http://devcast.ps-mc.net/?p=22 [Right now it seems to be kind of down, but I recall it worked last week or so]


My non-programmer intuition tells me these last few issues with lag are more linked to rendering (CrystalSpace engine) rather than database operations going on in the background.

You might want to join IRC on irc.freenode.net, #planeshift-build channel and discuss with some of the developers present there. You certainly seem to have the skills, perhaps you can even lend a hand to the project?
"Skiing combines outdoor fun with knocking down trees with your face."

Giraut Mawhrin

  • Traveller
  • *
  • Posts: 30
    • View Profile
Re: PS is laggy: what can be done?
« Reply #10 on: July 03, 2009, 08:03:23 am »
It's not an I/O problem, and it's also not when objects appear on screen, but when they get registered (so, sometimes way before you can see them). I've got a piece of code that watches the list entities known to the client, and hiccups almost always occur when the list suddenly grows. For instance, when you go from the tower to the plaza, somewhere near the small staircase with an arch on top of it, all 40 apples around Harnquist, along with a number of object/actors that hang around there get registered, and the game hiccups. On a fast machine, it's just a bit jerkier; on a slow machine, it's a major fun killer.

weltall

  • Moderator
  • Veteran
  • *
  • Posts: 1671
    • View Profile
    • http://weltall.heliohost.org
Re: PS is laggy: what can be done?
« Reply #11 on: July 03, 2009, 10:31:22 am »
usually i got these only when loading models from disk the first time (and a bit more frequently with the threaded loader on trunk) could you run an oprofile in order to figure out the problem? if possible without the printf you've stated above: printf is a killer command in performance even more if you use font anti aliasing for the terminal

Giraut Mawhrin

  • Traveller
  • *
  • Posts: 30
    • View Profile
Re: PS is laggy: what can be done?
« Reply #12 on: July 03, 2009, 12:34:40 pm »
usually i got these only when loading models from disk the first time (and a bit more frequently with the threaded loader on trunk)

I have my client setup to preload the models. But yes, you're right, those are a killer too if they're not preloaded.

Quote
could you run an oprofile in order to figure out the problem? if possible without the printf you've stated above: printf is a killer command in performance even more if you use font anti aliasing for the terminal

Who said I did printfs? :) My entities watch code uses a paws window and listbox - which can't possibly be any faster than a single printf incidentally. But anyway, the slowdowns occur just the same with the watch code bypassed.

I'll try to profile it later today, or this week-end if I have last minute work to do tonight.

weltall

  • Moderator
  • Veteran
  • *
  • Posts: 1671
    • View Profile
    • http://weltall.heliohost.org
Re: PS is laggy: what can be done?
« Reply #13 on: July 03, 2009, 08:36:00 pm »
i forgot if possible enable the call checking in oprofile.

Tomislav

  • Traveller
  • *
  • Posts: 29
    • View Profile
Re: PS is laggy: what can be done?
« Reply #14 on: July 08, 2009, 11:42:48 am »
Disable shadows and your performance in areas with lots of objects should increase a lot.
This is very noticable during parties when people drop lots of food and drinks.