ConfigManager.txt

(36 KB) Pobierz
#############################################################################
# Configuration rules and options for SimCity
#
# This script both defines what the various game options
# do, and sets defaults for them based on the video
# card, sound card, CPU, and other factors.
#
# It also sets some properties determining what the
# hardware will support.
#


#############################################################################
# Constants
#

set Off 0
set On  1

set Min    0
set Low    1
set Medium 2
set High   3
set Ultra  4

set ModernFail -1
set ProbablyFail -2
set DefinitelyFail -3

# Shader paths -- must match with Material/config.mtl
seti shaderPathMin         0 # Not well supported
seti shaderPathLow         1
seti shaderPathRecommended 2
seti shaderPathMax         3

#############################################################################
# Set up
#

setVariables

setb isMac   false
setb isWin7  false
setb isXP    false
setb isVista false

if (match("${platform}", "OSX*"))
   # Running on the Mac wrapper. Set mac-specific options here
   output "Running on OSX"
   setb isMac true
   boolProp RenderTargetCorrection false
else

    setb isWin7 (match("${OSVersion}", "6.1.*"))

    if ($isWin7 and $os64Bit and (not $has64BitExceptionFix)) 
       alert "To get proper crash handling it is recommended you install this hotfix:\n    http://support.microsoft.com/default.aspx/kb/976038\n\nIt is available from:\n    \\maxislocalbuild\Builds\Install\n\n" 2004 -warning
    endif

    setb isVista false
    if (match("${OSName}", "*Windows Vista*"))
        setb isVista true
    endif

    setb isXP false
    if (match("${OSName}", "*Windows XP*"))
        setb isXP true
    endif

    if ($isVista and $vistaKB940105Required) 
       alert "The game may run out of address space with some configurations\nand video cards, resulting in stability problems.\n\nIt is recommended that you install the latest Windows Vista Service Pack\nand check for updated video drivers.\n\nFor details see the Microsoft Knowledge Base article\n\n    http://support.microsoft.com/default.aspx/kb/940105\n\n" 2003 -warning
    endif

endif



#############################################################################
# Initial defaults.
#
# These may be overridden below according to CPU or card.

setOption OptionShadows             $High
setOption OptionTextureDetail       $Medium
setOption OptionEffects             $High
setOption OptionLighting            $High
setOption OptionGameQuality         $High
setOption OptionPeopleQuality       $High
setOption OptionSignQuality         $High
setOption OptionCityImpostorQuality $High
setOption OptionAudioPerformance    $Medium
setOption OptionGeometryDetail      $High
setOption OptionAnimationDetail     $High
setOption OptionFXAA				$Off
setOption OptionPictureFilter       $Off

setOption OptionPhotoRes            $Medium
setOption OptionVideoRes            $High

setOption OptionSkipLOD0            $Off
setOption OptionDropMips            $Off

#############################################################################
# Identify graphics adapter
#


# set some config variables based on a card table and vendor specific rules
# sets isCardFound, cardVendor, and cardName
setb isCardFound false
set cardVendor Unknown
set cardName Unknown
include "VideoCards.txt"

# Fallback on the card name text supplied by the card itself.
# Assumes that at least the cardVendor has been matched, since
# vendor name is not contained in some vendor card names.
# Note that specific vendors are overridden to a default card.
#  For AMD    -> Radeon 9800 Pro
#  For NVIDIA -> NVIDIA GeForceFX 5200 SE

if (not $isCardFound)
   set cardName "${graphicsCard}"
endif


#############################################################################
#
# Testing Code
#

# For testing
setb doTestCPU 0
setb doTestGPU 0

if ($doTestCPU)
    seti pentium4 0
    seti cpuCount 1

    seti cpuSpeed 2000
    set cpuBrand "AMD Athlon64"
endif

if ($doTestGPU)
    # test some 2.0/3.0 cards
    #set cardVendor "AMD"
    #set cardName "FirePro W5000"

    #set cardVendor "Intel"
    #set cardName "Series 4"

    set cardVendor "NVIDIA"
    set cardName "Quadro FX 5800"

    #seti testShaderModel 3
    #seti maxVertexProgramVersionHW ($testShaderModel*256)
    #seti maxPixelProgramVersion    ($testShaderModel*256)

    # have to set this, since some overrides fallback on graphicsCard string
    set graphicsCard "$cardName"
endif

#############################################################################
#
# Option Levels
#

seti cpuLevelHigh          3
seti cpuLevelMedium        2
seti cpuLevelLow           1

seti gpuLevelHigh          3
seti gpuLevelMedium        2
seti gpuLevelLow           1
seti gpuLevelMin           0

#############################################################################
#
# CPU Assessment
#

seti adjustedCPU $cpuSpeed

setb cpuAMD false
if (match("${cpuBrand}", "*AMD*"))
    setb cpuAMD true
endif

seti cpuCutoffLow 2000
seti cpuCutoffMed 2400

if ($pentium4 > 0)
    # intel p4 hyperthread or multiprocessor
    if ($hyperthreading > 0)
        # only count real cpus
        seti cpuCount (floor(${cpuCount} / 2))
    endif

    if ($cpuCount > 1)
        seti adjustedCPU (round($adjustedCPU * 1.3334))
    endif

    seti cpuCutoffLow 2400
    seti cpuCutoffMed 2800

elseif ($cpuCount == 1)
    if ($cpuAMD)
        # amd single core (xp, 64)
        seti cpuCutoffLow 1800
        seti cpuCutoffMed 2000
    else
        # pentium m, celeron, etc
        seti cpuCutoffLow 2000
        seti cpuCutoffMed 2200
    endif
else
    if ($cpuAMD)
        # amd multicore (athlon 64x2)
        seti cpuCutoffLow 1600
        seti cpuCutoffMed 1900
    else
        # intel multicore (core duo, core2 duo)
        seti cpuCutoffLow 1800
        seti cpuCutoffMed 2100
    endif
endif

# rate the cpu
if ($adjustedCPU < $cpuCutoffLow)
    seti cpuLevel $cpuLevelLow
elseif ($adjustedCPU < $cpuCutoffMed)
    seti cpuLevel $cpuLevelMedium
else
    seti cpuLevel $cpuLevelHigh
endif


#############################################################################
#
# GPU Assessment
#

# track specific vendors
setb isNvidia           false
#setb isNvidiaIntegrated false

setb isAMD              false
#setb isAMDIntegrated    false

setb isIntel            false
setb isIntelIntegrated  false

setb isS3               false
setb isVendorUnknown    false

setb isLimitedVideoMemory false

# convert to major version
if (not $isMac)
    seti vsVersion (floor($maxVertexProgramVersionHW / 256))
    seti psVersion (floor($maxPixelProgramVersion / 256))
else
    seti vsVersion (floor($maxVertexProgramVersionHW / 1))
    seti psVersion (floor($maxPixelProgramVersion / 1))
endif

# if not in database, assume any new card is "high"
seti gpuLevel $gpuLevelHigh

if (match("${cardVendor}", "AMD") or match("${cardVendor}", "ATI"))
    setb isAMD true
elseif (match("${cardVendor}", "NVIDIA"))
    setb isNvidia true
elseif (match("${cardVendor}", "INTEL"))
    setb isIntel true
elseif (match("${cardVendor}", "S3"))
    setb isS3 true
else
    setb isVendorUnknown true
endif

# old driver build detection/warning
setb oldDriver false                # Triggers a warning the first time the game is run
setb isOldDriverBuildExit false     # Set this if we know the game won't function with the current drivers

setb isMultiGpu false
if ($gpuCount > 1)
    setb isMultiGpu true
endif

seti oldDriverBuild 0   # Spurious setting necessary because variables are still expanded in skipped clauses =(

if (not $doTestGPU)
    # test each vendor against specific known driver builds
    if ($isNvidia)

        seti oldDriverBuild 13069

        if ($isMultiGpu)
            seti oldDriverBuild 130697
            #setb isOldDriverBuildExit true
        endif

        if ($driverBuild < $oldDriverBuild)
            setb oldDriver true
        endif
        
    elseif ($isIntel)
        seti oldDriverBuild 102875  # this numbering scheme is not continuous with the old drivers for series 4 cards

        if ($driverBuild < $oldDriverBuild)
            setb oldDriver true
        endif

    elseif ($isAMD)
        if (not $isXP)
            seti oldDriverBuild   101140  # Cat 13.1    TODO: update

            if ($isMultiGpu)
                seti oldDriverBuild 101140 # Cat 13.1    TODO: update
            endif
        else
            seti oldDriverBuild 101140  # Cat 13.1     TODO: update

            if ($isMultiGpu)
                seti oldDriverBuild 101140  # Cat 13.1   TODO: update
                #setb isOldDriverBuildExit true
            endif
        endif

        if ($driverBuild < $oldDriverBuild)
            setb oldDriver true
        endif
    endif

    # this alert is only displayed the first time the game is launched, or when the preferences are deleted
    if ($oldDriver)
       if ($isOldDriverBuildExit)
           if ($isMultiGpu)
               alert "An older video driver is detected.\n\nTo ensure correct visuals and gameplay with multiple gpus,\ninstalling the latest video driver is required,\nor multiple gpu mode must be disabled.\nThe game will not run.\nPlease see the README for details.\n\n" 1012
           else
               alert "An older video driver is detected.\n\nTo ensure correct visuals and gameplay,\ninstalling the latest video driver is required.\nThe game will not run.  Please see the README for details...
Zgłoś jeśli naruszono regulamin