Author Topic: A solution to speed-up PlaneShift on slow computers  (Read 2455 times)

Vornne

  • Testers
  • Hydlaa Resident
  • *
  • Posts: 189
    • View Profile
Re: A solution to speed-up PlaneShift on slow computers
« Reply #15 on: December 10, 2007, 11:34:28 am »
I have run psclient with valgrind --tool=callgrind, the major slowdown is entity labels being created, not when they are shown... I don't think chat bubbles even come on the radar ;)

I am working to get some temporary fixes into svn, to help loading times... currently the labels are always created when the character or item is in range to be visible, but the labels are not shown until you are much closer, and have the mouse on them if you have that set. So I changed it to only create the label just before it is shown, if it does not exist already - this causes a momentary freeze when you move your mouse over for the first time, but that is in my opinion better than lagging for a minute or two waiting for 50 labels to be created, when you are just running through the map and will never see them.

The next thing to do is to make the label creation process faster, but that is not so easy...

Tontow

  • Hydlaa Resident
  • *
  • Posts: 189
    • View Profile
Re: A solution to speed-up PlaneShift on slow computers
« Reply #16 on: December 10, 2007, 07:09:26 pm »
Some Ideas:
Create all the labels while the map is loading?
Or just have one label that is used for all objects, but the text changes when each object is viewed.
Or replace labels with a modified version of the chat bubbles system since chat bubbles aren’t even on the radar of recourses.


(sorry if I’m overstepping my bounds)
Tontow's MapMaker Tool 2.0 : http://hydlaaplaza.com/smf/index.php?topic=33954.0 - Make your own maps by walking around and useing the /pos Command!
Site: http://sites.google.com/site/tontowmerlin/

Vornne

  • Testers
  • Hydlaa Resident
  • *
  • Posts: 189
    • View Profile
Re: A solution to speed-up PlaneShift on slow computers
« Reply #17 on: December 11, 2007, 10:38:34 am »
OK, jorrit came into #planeshift-build and was answering some questions of Ragnarin about this:

<@jorrit> Best is to avoid SetRenderTarget.
<@jorrit> It is not needed for this.

<@jorrit> You put ALL entity labels in one single mesh.

<@jorrit> But I think this is the best solution. A few facts:
<@jorrit>   - More meshes -> slower
<@jorrit>   - Less materials -> faster
<@jorrit>   - Render2Texture -> slow
<@jorrit> So a single mesh with a single material for entity labels -> fast

<@jorrit> Plus that the labels will even work when PS window is iconified.
<@jorrit> Currently that's not the case.
<@jorrit> Labels generated while PS window is obscured contain garbish.
(this is the reason planeshift is very slow to respond after switching back to it from another application, in windowed mode - all the entity labels are recreated)

I found it interesting... and the developers are working on it :)

As for "Create all the labels while the map is loading?" this is what currently happens, well, when the model appears... and is part of the major lag when entering a sector like hydlaa plaza...
"Or replace labels with a modified version of the chat bubbles system since chat bubbles aren’t even on the radar of recourses."
Hmm well, I probably wasn't very clear about what I meant, and thinking later probably why they did not show up in the callgrind.out was because there were around 50 entity labels, and only 5 or so chat bubbles probably... I will test properly later by making a npc talk a lot, and turn labels off and see if it runs the 'bad' part of the code or not... it may, as they are both coded in a similar way...

Tuxide

  • Hydlaa Notable
  • *
  • Posts: 715
    • View Profile
    • Banker
Re: A solution to speed-up PlaneShift on slow computers
« Reply #18 on: December 23, 2007, 11:47:31 pm »
Thought I would mention that Giraut's patch works on MinGW, so there is hope for Windoze users after all.