Author Topic: GFX Mod: Fuzzy Lines b'gone - with 3.011 obsolete  (Read 2296 times)

Offline eRe4s3r

  • Core Member Mark II
  • *****
  • Posts: 2,825
GFX Mod: Fuzzy Lines b'gone - with 3.011 obsolete
« on: January 15, 2010, 11:43:15 am »
Mod has been made obsolete by 3.011 - performance issues are gone! ;p

This mod is only for advanced users

A very weird mod for sure, these 2 files COMPLETELY remove ALL fuzzy lines being drawn in the game, it includes tractor beams, constructor beams, and damage boost beams. And it does reduce brightness of the CTRL drawn lines by factor 5 (so 2000 ships in move order do not black out your entire tactical view anymore). This is not something you should install lightly unless you are advanced enough not to care for either of these lines (like me, its pretty obvious when your ships are tractored or damage boosted ,p).

You may now wonder what the mighty heck thats good for..

let me tell you - this mod will improve your close-up performance by a laughable 3000% , yes you read that right.

Before -
close zoom 1000 ships tractored - 4000 ships damage boosted 2fps - 300ms compute time

After -
close zoom 1000 ships tractored - 4000 ships damage boosted 20 fps - 300ms compute time (AI is locked at 20fps)

This mod is only for advanced users

It removes - ALL fuzzy lines (engineers + Tractor lines + damage boost lines)
It does make normal lines 5 times less visible - meaning you can see where you are going while holding ctrl now - but the small lines are all still there. So you can still see where your ships are going or what they attack (so don't worry bout that ;p)

On average this will make unplayable combat scenes (when zoomed in) perfectly playable now

LineFuzzy.png = Tractor/Damage boost/Engineer is the performance killer or solver
Line.png = Is the normal (small) lines with less opacity so that they don't white out the screen anymore

If you only care for performance gains in close-up you only need the linefuzzy.png (which is basically an empty png)
« Last Edit: January 16, 2010, 07:28:31 am by eRe4s3r »
Proud member of the Initiative for Bigger Weapons EV. - Bringer of Additive Blended Doom - Vote for Lore, get free cookie

Offline Trurl

  • Newbie Mark III
  • *
  • Posts: 26
Re: GFX Mod: Fuzzy Lines b'gone - 3000% performance increase
« Reply #1 on: January 15, 2010, 11:52:48 am »
Wow. I'm surprised those lines are made up of little images like that. I bet the line drawing code could be optimized to use some kind of graphics card accelerated vector drawing operation instead.

Offline eRe4s3r

  • Core Member Mark II
  • *****
  • Posts: 2,825
Re: GFX Mod: Fuzzy Lines b'gone - 3000% performance increase
« Reply #2 on: January 15, 2010, 11:54:53 am »
Well these small sprites are very effective but drawing 20000 lines this way over each other will kill the performance no matter what, and i have a really bad case of this (i am warping in a fortified world with lots of MK3 tractors AND my damage boosted ships, short of not zooming at all i can NOT issue orders in that situation because i can't click on anything)

So this mod is more or less something for me to finish my game ;) I am sure there'll be a fix to the issue at the core of this (which is the millions of fuzzy lines damage boosters, and i don't just mean my own, draw)

By the way - if you want a less drastic approach check these files - makes fuzzy lines less fuzzy ,p but with the full performance hit, just makes them a slight bit narrower (so this post is a beauty mod after you wonder where all the lines b'gone to, so the files attached here, they make the lines not gone again. But with the same performance issue ;p

These files will also make the galaxy map readable again (which i accidently killed with the fuzzy line remover as well) ;p

again, this is not a graphics mod that "improves" graphics, its a fix for the situations where your entire fleet warps in something and is tractor locked and you can no longer target said tractors because of 1 fps or less)

- So to avoid confusion - the top post includes files that allow you play through such a situation with full performance, and the post you are reading now makes these lines appear again, so you can continue playing after a huge battle (its annoying, but it helped me ,p)

Please do not hate me that the mod really does do what it says (ie, removing lines) ,p Do not even play with the thought of using this unless you fully understand that its a dirty hack that does what it says and that it does well. But you can NOT play this way all the time, its a mod for a specific situation
« Last Edit: January 15, 2010, 01:16:06 pm by eRe4s3r »
Proud member of the Initiative for Bigger Weapons EV. - Bringer of Additive Blended Doom - Vote for Lore, get free cookie

Offline TheWordWillSetYouFree

  • Jr. Member
  • **
  • Posts: 52
Re: GFX Mod: Fuzzy Lines b'gone - 3000% performance increase
« Reply #3 on: January 15, 2010, 01:33:26 pm »
I take it this can be used mid save?
Good catch there actually, as when 2+ player's whole shipcap warps into an AI home world, all the lines can slow the game to an unplayable level.

Surely there is a way to not draw some lines when there is obvious system lag?
Maybe a fps monitor and when this drops below 4-5 then drop 1/2 of the fuzzy lines?
Anywho, thanks for the mod!

Offline eRe4s3r

  • Core Member Mark II
  • *****
  • Posts: 2,825
Re: GFX Mod: Fuzzy Lines b'gone - 3000% performance increase
« Reply #4 on: January 15, 2010, 01:38:53 pm »
You can use this mid save, yes.. and revert after a big battle (you will have to, since fuzzy lines are used elsewhere in the game ,p)

I had a little lapse when i wrote the topic title though, this doesn't improve the simulation speed of the game itself, so the game will run slower the more ships are on screen, but it *does* improve your frame rate because those beams are not actually drawn. The difference for me in a big battle was massive, but its a hack and should be regarded as such.

I hope i don't cause a massive support fallout now  ;D

This only increases RAW FPS - not simulation speed of the game beyond what your cpu power allows.
Proud member of the Initiative for Bigger Weapons EV. - Bringer of Additive Blended Doom - Vote for Lore, get free cookie

Offline TheWordWillSetYouFree

  • Jr. Member
  • **
  • Posts: 52
Re: GFX Mod: Fuzzy Lines b'gone - 3000% performance increase
« Reply #5 on: January 15, 2010, 01:42:00 pm »
Right thanks for clarifying.
I still think it's pretty neat though, a great way to get you through those massive wormhole warp tractors.

Offline I-KP

  • Hero Member
  • *****
  • Posts: 681
  • Caveat Pactor
Re: GFX Mod: Fuzzy Lines b'gone - 3000% performance increase
« Reply #6 on: January 15, 2010, 01:42:51 pm »
There must be a more efficient way of drawing lines than dumping thousands of pngs onto the screen.  I'm surprised to learn this is how it's done currently.
Atmospheric & Lithospheric Reticulator,
Post-accretion Protoplanet Aesthetic Seeding Team,
Celestial Body Design & Procurement Division,
Magrathea Pan-Galactic Planets Corp.,
Magrathea.

Offline eRe4s3r

  • Core Member Mark II
  • *****
  • Posts: 2,825
Re: GFX Mod: Fuzzy Lines b'gone - 3000% performance increase
« Reply #7 on: January 15, 2010, 02:15:20 pm »
Hah, welcome to the world of problems that lines bring to a game (As a 3d-artist, you will face the dreadful problems of non-hw accelerated dx or hw accel. opengl lines. all the time) Its best to never use lines in a game in large scope. You can draw waypoints via connected looping pngs together and its extremely effective to do, for 1 line.. but not for 10k or more...

You know this issue is only really coming up now because of the very late increase of the damage boost range.. before these values were 250/500 but now they are 2000 each. And if you have 8 ships drawing these lines, you can imagine how that will kill performance once you are in a situation where those ships are tractor locked + under attack from other damage boosted ships.

Graphic cards aren't really made to draw things like these...

And something else, the best way to draw lines, is never to draw lines.... use polygon with a stretched 1pixel x 3pixel png base (so that would be a 3 pixel wide line with a gradient at the side - if you stretch it now the uvw of the polygon will adapt to that length without a single artifact all the while using the very same png for the whole range (it'll cause problems with AF though) and you get a 4 points and 2 triangles, in exchange for a fully working and instancing able 3d object (which looks like a line) ,p Maybe this'll be the possible fix for this. Its how i draw lines in a 3d-rendering

The best thing to do is entirely remove these lines from damage boosters and replace them with a different icon border effect, or somesuch

Anyhow i am blowing this up too much, its really only a dirty hack that simply wipes the png clean, and thus doesn't draw anything on screen = saves performance
« Last Edit: January 15, 2010, 02:45:48 pm by eRe4s3r »
Proud member of the Initiative for Bigger Weapons EV. - Bringer of Additive Blended Doom - Vote for Lore, get free cookie

Offline Kaptein

  • Jr. Member
  • **
  • Posts: 62
Re: GFX Mod: Fuzzy Lines b'gone - 3000% performance increase
« Reply #8 on: January 15, 2010, 03:10:35 pm »
back in the day writing 2d game engines, line drawing was pixel by pixel :) still, screenmodes were much lower
and the game engines were made for rpg'ish stuff where you wouldnt see more than 12 npc's / enemies at one time :P
id appreciate it though if he could use some kind of accelereation, seeing as (such as) opengl doesnt require much of a computer
in fact i think every gamer on this planet has opengl support, of some kind... perhaps 2.0 ?

Offline eRe4s3r

  • Core Member Mark II
  • *****
  • Posts: 2,825
Re: GFX Mod: Fuzzy Lines b'gone - 3000% performance increase
« Reply #9 on: January 15, 2010, 03:40:28 pm »
Slim.dx doesn't support opengl.. otherwise it would be slim.opengl, no? ;)

Actually thats a good question though..
Proud member of the Initiative for Bigger Weapons EV. - Bringer of Additive Blended Doom - Vote for Lore, get free cookie

Offline orzelek

  • Hero Member Mark III
  • *****
  • Posts: 1,096
Re: GFX Mod: Fuzzy Lines b'gone - 3000% performance increase
« Reply #10 on: January 15, 2010, 04:46:27 pm »
I think that drawing lines simply through OpenGL( or DirectX of course) should be faster. 10k lines gives 20k vertices to send and draw which shouldn't be that much for GPU's currently and maybe faster.

I remember x4000 writing something about lines versus textures when discussing range circles - and lines were actually slower there. But for lines like these geometry should be better.

Also all of the graphics here is rendered through DirectX 3D so it's already accelerated.
« Last Edit: January 15, 2010, 04:48:04 pm by orzelek »

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: GFX Mod: Fuzzy Lines b'gone - 3000% performance increase
« Reply #11 on: January 15, 2010, 08:32:12 pm »
Trust me, my normal png-based line drawing is vastly faster (I'm talking 4x faster at least) than the method that Direct3DX extensions use.  The only reason the replacement fuzzy images here makes any difference is because of the alpha blending on the fuzzy part being saved.  I think that if lines started disappearing when the framerate stuttered, that would cause more confusion than anything else -- generally the lag there is caused more by the simulation than the graphics, anyway though of course that can vary.  I don't see any general ways to improve this at the moment while still retaining a good effect on the fuzzy lines -- the mod here certainly wouldn't hurt anything beyond that drop in visual blending, though.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: GFX Mod: Fuzzy Lines b'gone - 3000% performance increase
« Reply #12 on: January 15, 2010, 09:05:19 pm »
Please note that with the resize of the base image in this mod can actually cause some crashing on (very) older graphics cards that don't support non-power-of-two images.  Probably would not affect anyone who can run the game anyway, but just in case.  That also can cause a minor bit of performance differential, too, but with images that small it's probably moot.

However, this mod is no longer going to be needed as of the next version, anyway:

-When there are more than 100 "fuzzy lines" being drawn on the screen (as with tractor beams, etc), the game now switches to a lower-fidelity mode for those lines until fewer of them are being drawn.  This helps performance quite a lot during large battles that include many tractor beams.

Best of both worlds: it looks pretty when there are few, and then it does indeed perform much better when the screen is full of tractors.  At any rate, the smaller image I am using is 2x2 and provides a less-faint line and perhaps even better performance (not that I've profiled, but given the general rules about power of two textures).  Anyway -- bottom line, great idea eRe4s3r, this is definitely a solid improvement and not something I would have thought to look at anytime soon.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Harry

  • Jr. Member Mark III
  • **
  • Posts: 88
Re: GFX Mod: Fuzzy Lines b'gone - 3000% performance increase
« Reply #13 on: January 16, 2010, 12:58:02 am »
Glad to hear you're making that change, X4000!  For a long while I had no performance issues at all, but now that my fleets have gotten large, things have slowed down a bit -- not dramatically, but enough to be noticeable.  I hope the new line stuff will help.

Offline I-KP

  • Hero Member
  • *****
  • Posts: 681
  • Caveat Pactor
Re: GFX Mod: Fuzzy Lines b'gone - with 3.011 obsolete
« Reply #14 on: January 16, 2010, 10:18:57 am »
Excellent.
 ;D
Atmospheric & Lithospheric Reticulator,
Post-accretion Protoplanet Aesthetic Seeding Team,
Celestial Body Design & Procurement Division,
Magrathea Pan-Galactic Planets Corp.,
Magrathea.