Announcement

Collapse
No announcement yet.

How Valve Made L4D2 Faster On Linux Than Windows

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • kwahoo
    replied
    John R. Hall: Programming Linux Games http://web.archive.org/web/200407161...-this-time.pdf

    Leave a comment:


  • Wildfire
    replied
    Originally posted by Dr.Paneas View Post
    where can I find more information about porting games from Windows to Linux? I am trying to understand all these terms (such as abstract layer, dynamic translate, wrapper, API etc).
    None of these terms are specific to porting games; all of these are basic programming terms. If you don't know what an API, wrapper, etc. is, I would recommend you try to learn about basic programming first, before picking such an advanced topic.

    I don't have any books I can recommend, but here's a quick explanation:
    API (Application Programming Interface): Simply put, an API is an interface between your code, and someone else's code and/or hardware. For example OpenGL is an API that lets you talk to graphics cards (or rather, their drivers). Thanks to this, you do not need to write specific code for each and every GPU out there. You write code against the OpenGL API, and the driver does the work of translating these calls to the underlying hardware.

    Abstraction layer: An abstraction layer is a piece of code (e.g. an API) that "abstracts away" some of the complexity of another system by providing a simplified interface. You can think of OpenGL as an abstraction layer for graphics hardware, because OpenGL hides the actual hardware from you and provides a simplified, generic interface that can be used for any hardware that provides OpenGL compatible drivers. The downside is that you can only use features supported by OpenGL. That is, you can't use vendor specific hardware features that aren't supported by OpenGL.

    Dynamic translation: In the context of this discussion dynamic translation means that calls to the Direct3D API are translated to OpenGL calls while the application is already running. The alternative would be to have some kind of offline-translator, that takes your source code and alters it before it is compiled (which is probably quite complex). Or you could rewrite your code by hand to support both Direct3D and OpenGL. Or you could write your own API which takes care of calling either.

    Wrapper: Similar to an abstraction layer, a wrapper is used to either reduce complexity, or to provide a common interface for otherwise incompatible systems/interfaces/APIs. An abstraction layer is basically a collection of wrappers.

    The problem discussed here is, there's more than one platform (Linux, Windows, PS3, ...) and more than one API (DirectX, OpenGL, ...) to do the same things (basically). If you want a game to be as platform independent as possible you'll typically end up writing your own API (or abstraction layer) which "wraps" these APIs. This lets you put all the platform specific code (if system=="windows" do X else if system=="linux" do Y) in one place. In the rest of your code you'll no longer have to worry whether you need to use X or Y, you simply use Z which then takes care of whether X or Y needs to be used. Depending on how this is done it might either incur an overhead (thus slowing things down slightly) or it might require you to recompile your code, which means there are different binaries for each platform.

    Leave a comment:


  • Dr.Paneas
    replied
    There is no serious Linux PC gaming. I hope Valve to change that.

    Leave a comment:


  • artivision
    replied
    1. OpenGL is faster not because of Linux, but because parts of the protocol are hard-coded inside GPUs (ARB). And you don't need assembly to accelerate.

    2. OpenGL is super-threaded, it can run on many instruction sets at the same time.

    3. OpenGL is royalty-free, there are no fees to implement it. Free specification (how it works), not free code.

    4. OpenGL exist on every GPU driver on the planet and there are not compatibility problems. Compilers don't matter, developers write GLSL code. Even precompiled-preoptimized byte-code of a console (ps3) can be turn back to GLSL and then back to different byte-code, and all this statically. Wine does that.

    5. http://nvidia.fullviewmedia.com/gtc2...5-B-S0610.html No one will give another piece of their technology to Microsoft because monopoly has lost on this area. D3D is over.

    Leave a comment:


  • entropy
    replied
    Originally posted by AJSB View Post
    ...and how many games do you played in those 2 years ?

    Lately i also don't have problems , but this can happen when a new game is launched and that game makes weird things with graphics...
    (then again lately i don't have problems because...)

    I used Windows for gaming since 2006 but now i ditched it...

    I played maybe +60 games in those 6 years...not counting with the mods for them.

    In ETQW alone i have more than 800 hours of online play and i had a period that i didn't played it for 1-2 years at all.

    I can play easily 4-6 hours per day and at Sundays it can go up to a number that i don't want to tell
    Admittedly I'm not a hardcore gamer.
    Nevertheless, I have quite a big list of games released on Steam that I play now and then.
    All *I* can say is that W7 feels like quite a good OS.
    Even the AMD Radeon 4850 driver has been rock stable while I heard lots of bitching about it.
    Only minor graphics corruptions occurred with Rage but this is known issue.
    Apart from that, seems like everything is fine *here*.

    Still, I hope Steam with a steadily increasing catalogue of native (AAA) games will find the way soon to Linux.

    Leave a comment:


  • AJSB
    replied
    Originally posted by entropy View Post
    I use W7 for gaming since two years and
    never experienced a single crash. It just behaves fine.

    I'm a Linux/UNIX guy but claiming W7 is a bad OS seems to be heavily biased, really.
    ...and how many games do you played in those 2 years ?

    Lately i also don't have problems , but this can happen when a new game is launched and that game makes weird things with graphics...
    (then again lately i don't have problems because...)

    I used Windows for gaming since 2006 but now i ditched it...

    I played maybe +60 games in those 6 years...not counting with the mods for them.

    In ETQW alone i have more than 800 hours of online play and i had a period that i didn't played it for 1-2 years at all.

    I can play easily 4-6 hours per day and at Sundays it can go up to a number that i don't want to tell

    Leave a comment:


  • entropy
    replied
    I use W7 for gaming since two years and
    never experienced a single crash. It just behaves fine.

    I'm a Linux/UNIX guy but claiming W7 is a bad OS seems to be heavily biased, really.

    Leave a comment:


  • AJSB
    replied
    Originally posted by RealNC View Post
    I never had freezes in W7. Not a single time. Application crashes, yes. System freezes, never.
    Both in Windows XP and 7 i had:

    Application Crashes

    System Freezes

    System Freezes that not even pressing the RESET botton can clear !

    System Freezes that not even pressing the POWER botton in the front panel of the PC tower can clear ! Yeah, the PC got so locked that I had to switch off in the rear of the PC !!!

    Leave a comment:


  • curaga
    replied
    Originally posted by RealNC View Post
    I never had freezes in W7. Not a single time. Application crashes, yes. System freezes, never.
    Lucky you. I've too seen both behaviors, the errors it recovers from in a few seconds and the hard crashes.

    Leave a comment:


  • kraftman
    replied
    Originally posted by smitty3268 View Post
    I also had it hard crash the system for a while - it was whenever it tried to decode h264 content, which was extremely annoying. I finally ended up just playing everything through an app which didn't trigger the GPU decoding assistance, until they fixed that driver bug.
    This nicely reflects situation in Windows. There aren't any "special" crash protection mechanisms like Elanthis' imagination wants, but they just try to iron out some bugs in drivers.

    Leave a comment:

Working...
X