A Case Study, Cont

Now that we've seen what can happen when we reach the 2GB barrier and how easy it can be to pass it, let's talk about what it took to remove it in the first place for Supreme Command. Supreme Commander is unfortunately not compiled as being large address aware and must be modified so that Windows thinks that it is. Microsoft supplies a tool as part of the Visual Studio suite, Editbin, that can do just this by rewriting the file header to report to Windows that it is in fact large address aware.

To the best of our knowledge Supreme Commander was programmed using proper programming practices and can handle the larger address space, and this is merely an issue of turning it on. However on a more pragmatic note this can break future patches, and disturbingly it doesn't set off any sort of multiplayer cheat detection in the game in spite of the fact that we have modified the executable in a very visible way. Out of the changes we need to make to deal with the 2GB barrier though, this is the safer of the two.

Update: Gas Powered Games contacted us and let us know that the modified executable not setting off any cheat detection is intentional. The game code is all in a DLL, and the executable is just a launcher; it's left unchecked because of the various Digital Rights Management systems used change the exectuable.

Changing Windows on the other hand to allocate more of the virtual address space to applications is in practice just as dangerous as we theorized earlier. We initially set our copy of Windows Vista to adjust the split to 1GB kernel mode, 3GB user mode, only for Vista to encounter a BSOD while booting. We had to settle for a 1.4GB/2.6GB split before Vista would boot, and even then Vista still periodically encounters a BSOD upon booting at that allocation or any other allocation other than 2GB/2GB. While what problems may occur and with what values is highly variable from system to system, this is why trying to move the barrier at all can be dangerous.

Having made the above changes, we also used the chance to take a look at system performance both in and outside of Supreme Commander, taking interest in to the effect of allocating more user mode space. As we theorized before, taking space away from the kernel may impact performance, and this is something that needs to be tested. For this we ran a cut-down version of our normal system test suite, with allocations of 1.4GB/2.6GB, 1.7GB/2.3GB, and the default 2GB/2GB.

Software Test Bed
Processor AMD Athlon 64 4600+
(2x2.4GHz/512KB Cache, S939)
RAM OCZ EL Platinum DDR-400 (4x512MB)
Motherboard ASUS A8N-SLI Premium (nForce 4 SLI)
System Platform Drivers NV 15.00
Hard Drive Maxtor MaXLine Pro 500GB SATA
Video Cards 1 x GeForce 8800GTX
Video Drivers NV ForceWare 158.45
Power Supply OCZ GameXStream 700W
Desktop Resolution 1600x1200
Operating System Windows Vista Ultimate 32-Bit
.

Starting with Supreme Commander, the only test here that can even utilize more than 2GB of user space, we do find a minor but consistent variation in performance. Increasing the user space improved Supreme Commander performance by about 1 frame per second, which at around a 3.5% performance improvement is right along the edge of either being significant or a normal variation. We repeated this test several times just to make sure that it wasn't a variation and the results remained consistent, so it doesn't appear to be a variation. With that said the instability caused by adjusting the user space size does not justify the extremely minor performance improvement.

Going down the list of benchmarks, we find that there is no notable change in performance in any of our benchmarks. Since none of these benchmarks are capable of using more user space we weren't expecting an increase, but this puts to rest the idea of a performance decrease. There does not appear to be a performance decrease in adjusting the user space size; if it boots it'll perform well.


A Case Study: Supreme Commander Other Problems, Other Solutions
Comments Locked

69 Comments

View All Comments

  • miahallen - Saturday, July 14, 2007 - link

    What I found extremely interesting is that you had problems modifying your boot.ini file for a lsrger than 2.6GB app space. I have an almost identical configuration, and have modded almost all my games headers, and my boot.ini is set to 3GB app space. When I modded the boot.ini, I was unaware of the possible problems, but since it didn't cause any, I've been perfectly happy with it.

    A8N-SLI Delux
    Opty 165 @ 2.5GHz
    2GB DDR400
    8800GTX (768MB VRAM)
    Vista x86

    I've modded the headers for:
    STALKER
    C&C3
    CoH
    Dark Messiah M&M
    DiRT
    FSX
    Silent Hunter 4
    TDU

    Thanks Ryan, for the great article!
  • MadBoris - Sunday, July 15, 2007 - link

    quote:

    I've modded the headers for:
    STALKER
    C&C3
    CoH
    Dark Messiah M&M
    DiRT
    FSX
    Silent Hunter 4
    TDU


    This should be made clear to people.
    If an application is not Large Address Aware there is usually very good reason the developers did not include it that way. There maybe things you break in the game or cause stability problems by adding it.

    So people should not be just adding this to all their games, especially considering many games don't come close to the 2GB ceiling in the first place, so their is no benefit only potential negatives.
  • ChristopherO - Monday, July 16, 2007 - link

    This is true... One shouldn't go setting the binary flag because they *can*.

    I will however confirm that C&C3 and FSX run into the 2GB barrier. FSX is fine once it is patched.

    However, C&C3 is so poorly written that it can easily pass 2GB and run into the revised 3GB barrier on any multiplayer map with the maximum number of AI and/or opponents. Detail settings as low as the "medium" preset do nothing to alleviate this problem.

    Unfortunately C&C apparently has absolutely no code to purge and re-use memory as I've been in huge games, on the downward slope in terms of remaning opponents/units, and the app still hits a revised 3GB memory space and crashes.

    As a developer myself, memory management is *not* that complicated. It takes some forethought, but the EA people apparently never bothered. This is a huge letdown since I've been a C&C fan since the first game came out my first year of college.
  • miahallen - Saturday, July 14, 2007 - link

    I have to add one more thing about my system, may be important.....most of my games I play at 2048x1536, as opposed to you test rig at 1600x1200. That and you were using Vista Ultimate, I'm using Home Premium. Do you think this is what is effecting the results? If so, Home Premium (or even Home Basic) is the x86 OS of choice for gamers, not Ultimate!
  • miahallen - Sunday, July 15, 2007 - link

    I was hoping you would comment on this Ryan, do you think the difference in our boot.ini mod was due to the version of Vista we run? Any thoughts?
  • sheh - Thursday, July 12, 2007 - link

    ...and disturbingly it doesn't set off any sort of multiplayer cheat detection in the game in spite of the fact that we have modified the executable in a very visible way.

    The game probably checks the code (and maybe data) section(s) in memory, and not the actual EXE file (makes sense considering you can use memory patchers). The header might not be important for cheat prevention.
  • MadBoris - Thursday, July 12, 2007 - link

    quote:

    ...and disturbingly it doesn't set off any sort of multiplayer cheat detection in the game in spite of the fact that we have modified the executable in a very visible way.

    Yeah, I remember thinking that the first day I did it, actually in those days it was Securom protected which I was actually more suprised about bypassing. But seriously the exe header should not be something that cheat protection should look for. I can only say glad it didn't or crashing would be a constant problem. ;)
  • atlr - Thursday, July 12, 2007 - link

    I thoroughly enjoyed this article. Good job.
  • atlr - Thursday, July 12, 2007 - link

    A lot of good comments have helped edit and tune this article too. (meh, not this one though) Yayyy, community.
  • JetBlack69 - Thursday, July 12, 2007 - link

    From a programming perspective, what is a programmer to do? I assume this can happen in a program when "new" returns NULL because the program is out of memory, but what can a program do gracefully?

    I assume it could just display an error message, but if it were during a game, how could it handle it gracefully and not crash or give an error message? Would it lower the texture detail or remove unneeded objects on the screen?

Log in

Don't have an account? Sign up now