Professional Documents
Culture Documents
#############################################################################
# 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
#############################################################################
# Set up
#
setVariables
if (match("${platform}", "OSX*"))
# Set mac-specific options here
output "Running on OSX"
setb isMac true
boolProp RenderTargetCorrection false
endif
#############################################################################
# Initial defaults.
#
# These may be overridden below according to CPU or card.
# 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"
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
if ($doTestGPU)
# test some 2.0/3.0 cards
#set cardVendor "AMD"
#set cardName "FirePro W5000"
#seti testShaderModel 3
#seti maxVertexProgramVersionHW ($testShaderModel*256)
#seti maxPixelProgramVersion ($testShaderModel*256)
seti cpuLevelHigh 3
seti cpuLevelMedium 2
seti cpuLevelLow 1
seti gpuLevelHigh 3
seti gpuLevelMedium 2
seti gpuLevelLow 1
seti gpuLevelMin 0
#############################################################################
#
# CPU Assessment
#
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
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
#############################################################################
#
# GPU Assessment
#
if ($isMultiGpu)
seti oldDriverBuild 130697
#setb isOldDriverBuildExit true
endif
elseif ($isIntel)
seti oldDriverBuild 102875 # this numbering scheme is not continuous with
the old drivers for series 4 cards
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
# 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.\n\n" 1011
endif
else
alert "An older video driver is detected.\n\nTo ensure correct visuals
and gameplay,\ninstalling the latest video driver is recommended.\n\n" 1010 -info
endif
endif
endif
# OSX check
endif
if ($isNvidia)
# rules don't apply to Quadro numbering, if not renamed in db assume medium
if (not match("${cardName}", "*Quadro*"))
# default to medium
seti gpuLevel $gpuLevelMedium
# classify failure
if (match("${cardName}", "*5??0*"))
seti gpuLevel $ProbablyFail
elseif (match("${cardName}", "*6??0*"))
seti gpuLevel $ProbablyFail
#7xxx series
elseif (match("${cardName}", "*7??0*"))
if (match("${cardName}", "*79?0*"))
seti gpuLevel $gpuLevelMin
elseif (match("${cardName}", "*78?0*"))
seti gpuLevel $gpuLevelMin
else
seti gpuLevel $ProbablyFail
endif
#8xxx series
elseif (match("${cardName}", "*8??0*"))
if (match("${cardName}", "*81?0*"))
seti gpuLevel $ProbablyFail
elseif (match("${cardName}", "*82?0*"))
seti gpuLevel $ProbablyFail
elseif (match("${cardName}", "*83?0*"))
seti gpuLevel $ProbablyFail
elseif (match("${cardName}", "*84?0*"))
seti gpuLevel $ModernFail
elseif (match("${cardName}", "*85?0*"))
seti gpuLevel $ModernFail
elseif (match("${cardName}", "*86?0*"))
seti gpuLevel $gpuLevelMin
elseif (match("${cardName}", "*88?0*"))
seti gpuLevel $gpuLevelLow
endif
#9xxx series
elseif (match("${cardName}", "*9??0*"))
if (match("${cardName}", "*91?0*"))
seti gpuLevel $ProbablyFail
elseif (match("${cardName}", "*92?0*"))
seti gpuLevel $ProbablyFail
elseif (match("${cardName}", "*93?0*"))
seti gpuLevel $ProbablyFail
elseif (match("${cardName}", "*94?0*"))
seti gpuLevel $ModernFail
elseif (match("${cardName}", "*95?0*"))
seti gpuLevel $ModernFail
elseif (match("${cardName}", "*96?0*"))
seti gpuLevel $gpuLevelMin
elseif (match("${cardName}", "*98?0*"))
seti gpuLevel $gpuLevelLow
endif
#2xx series
elseif (match("${cardName}", "*2?0*") or match("${cardName}", "*2?5*"))
if (match("${cardName}", "*205*"))
seti gpuLevel $ProbablyFail
elseif (match("${cardName}", "*210*"))
seti gpuLevel $ModernFail
elseif (match("${cardName}", "*220*"))
seti gpuLevel $ModernFail
elseif (match("${cardName}", "*230*"))
seti gpuLevel $ModernFail
elseif (match("${cardName}", "*240*"))
if (match("${cardName}", "*GTS*"))
seti gpuLevel $gpuLevelLow
else
seti gpuLevel $gpuLevelMin
endif
elseif (match("${cardName}", "*250*"))
seti gpuLevel $gpuLevelLow
elseif (match("${cardName}", "*260*"))
seti gpuLevel $gpuLevelMedium
elseif (match("${cardName}", "*27?*"))
seti gpuLevel $gpuLevelMedium
elseif (match("${cardName}", "*28?*"))
seti gpuLevel $gpuLevelMedium
elseif (match("${cardName}", "*29?*"))
seti gpuLevel $gpuLevelHigh
endif
#4xx series!
elseif (match("${cardName}", "*4?0*") or match("${cardName}", "*4?5*"))
if (match("${cardName}", "*405*"))
seti gpuLevel $ModernFail
elseif (match("${cardName}", "*420*"))
seti gpuLevel $ModernFail
elseif (match("${cardName}", "*430*"))
seti gpuLevel $gpuLevelMin
elseif (match("${cardName}", "*440*"))
seti gpuLevel $gpuLevelLow
elseif (match("${cardName}", "*450*"))
seti gpuLevel $gpuLevelMedium
elseif (match("${cardName}", "*46?*"))
seti gpuLevel $gpuLevelMedium
elseif (match("${cardName}", "*470*"))
seti gpuLevel $gpuLevelMedium
elseif (match("${cardName}", "*480*"))
seti gpuLevel $gpuLevelHigh
endif
#5xx series!
elseif (match("${cardName}", "*5?0*") or match("${cardName}", "*5?5*"))
if (match("${cardName}", "*510*"))
seti gpuLevel $ModernFail
elseif (match("${cardName}", "*520*"))
seti gpuLevel $ModernFail
elseif (match("${cardName}", "*525*"))
seti gpuLevel $gpuLevelLow
elseif (match("${cardName}", "*530*"))
seti gpuLevel $gpuLevelMin
elseif (match("${cardName}", "*540*")) #this is actually only for the
540M
seti gpuLevel $gpuLevelLow
elseif (match("${cardName}", "*545*"))
seti gpuLevel $gpuLevelLow
elseif (match("${cardName}", "*55?*"))
seti gpuLevel $gpuLevelMedium
elseif (match("${cardName}", "*560*"))
seti gpuLevel $gpuLevelMedium
elseif (match("${cardName}", "*570*"))
seti gpuLevel $gpuLevelMedium
elseif (match("${cardName}", "*580*"))
seti gpuLevel $gpuLevelHigh
elseif (match("${cardName}", "*590*"))
seti gpuLevel $gpuLevelHigh
endif
if ( match("${cardName}", "*FX*") )
if (match("${cardName}", "*3500*"))
seti gpuLevel $gpuLevelLow
elseif (match("${cardName}", "*3700*"))
seti gpuLevel $gpuLevelLow
elseif (match("${cardName}", "*3800*"))
seti gpuLevel $gpuLevelLow
elseif (match("${cardName}", "*4600*"))
seti gpuLevel $gpuLevelLow
elseif (match("${cardName}", "*4800*"))
seti gpuLevel $gpuLevelLow
elseif (match("${cardName}", "*5500*"))
seti gpuLevel $gpuLevelMin
elseif (match("${cardName}", "*5600*"))
seti gpuLevel $gpuLevelMedium
elseif (match("${cardName}", "*5800*"))
seti gpuLevel $gpuLevelHigh
else
seti gpuLevel $ProbablyFail
endif
else
if (match("${cardName}", "*2000*"))
seti gpuLevel $gpuLevelLow
elseif (match("${cardName}", "*4000*"))
seti gpuLevel $gpuLevelMedium
elseif (match("${cardName}", "*5000K*"))
seti gpuLevel $gpuLevelHigh
elseif (match("${cardName}", "*5000*"))
seti gpuLevel $gpuLevelMedium
elseif (match("${cardName}", "*6000*"))
seti gpuLevel $gpuLevelHigh
endif
endif
if ($isAMD)
# rules don't apply to FireGL/FireMV numbering, if not renamed in db assume
medium
if (not match("${cardName}", "*Fire*")) # FireGL/MV
if (match("${cardName}", "*V4800*"))
seti gpuLevel $gpuLevelLow
elseif (match("${cardName}", "*V4900*"))
seti gpuLevel $gpuLevelLow
elseif (match("${cardName}", "*V5700*"))
seti gpuLevel $gpuLevelMin
elseif (match("${cardName}", "*V5800*"))
seti gpuLevel $gpuLevelLow
elseif (match("${cardName}", "*V5900*"))
seti gpuLevel $gpuLevelLow
elseif (match("${cardName}", "*V7800*"))
seti gpuLevel $gpuLevelMedium
elseif (match("${cardName}", "*V7900*"))
seti gpuLevel $gpuLevelMedium
elseif (match("${cardName}", "*V87?0*"))
seti gpuLevel $gpuLevelLow
elseif (match("${cardName}", "*V8800*"))
seti gpuLevel $gpuLevelMedium
elseif (match("${cardName}", "*V9800*"))
seti gpuLevel $gpuLevelMedium
elseif (match("${cardName}", "*W600*"))
seti gpuLevel $gpuLevelLow
elseif (match("${cardName}", "*W5000*"))
seti gpuLevel $gpuLevelLow
elseif (match("${cardName}", "*S7000*"))
seti gpuLevel $gpuLevelMedium
elseif (match("${cardName}", "*W7000*"))
seti gpuLevel $gpuLevelMedium
elseif (match("${cardName}", "*W8000*"))
seti gpuLevel $gpuLevelHigh
elseif (match("${cardName}", "*S9000*"))
seti gpuLevel $gpuLevelHigh
elseif (match("${cardName}", "*W9000*"))
seti gpuLevel $gpuLevelHigh
elseif (match("${cardName}", "*S10000*"))
seti gpuLevel $gpuLevelHigh
elseif (match("${cardName}", "*RG5000*"))
seti gpuLevel $gpuLevelHigh
endif
#if it's a mobile card, kick it down a notch
if ((match("${cardName}", "*Mobility*") or match("${cardName}", "*M*")) and
($gpuLevel >= $gpuLevelMin))
seti gpuLevel ($gpuLevel-1)
endif
endif
endif
if ($isIntel)
if (match("${cardName}", "*915*") or match("${cardName}", "*945*"))
seti gpuLevel $ProbablyFail
setb isIntelIntegrated true
boolProp IsIntelIntegratedGPU true
elseif (match("${cardName}", "*HD Graphics*") or match("${cardName}",
"*Iris*"))
seti gpuLevel $gpuLevelMin
setb isIntelIntegrated true
boolProp IsIntelIntegratedGPU true
if (match("${cardName}", "*5???*"))
seti gpuLevel $gpuLevelLow
endif
endif
if ($isS3)
seti gpuLevel $ProbablyFail
setb isLimitedVideoMemory true
endif
# drop gpu level if less than 256MB of video memory, below minspec
if (not $isMac)
if ($textureMemory < 250)
seti gpuLevel $ProbablyFail
endif
endif
############################################################################
# Handle bad video cards
#
if ($gpuLevel == $ModernFail)
alert "While your graphics card is newer than our minimum specified graphics
card, it might actually be pretty slow. We've set the game to low settings, but
you may still encounter less than optimal performance.~br~Please see the README for
details." 2004 -info
seti gpuLevel $gpuLevelMin
elseif ($gpuLevel == $ProbablyFail)
alert "Sorry, your graphics card is below our min spec.~br~The game will
attempt to run but may fail or perform poorly.~br~Please see the README for
details." 2002 -info
seti gpuLevel $gpuLevelMin
elseif ($gpuLevel == $DefinitelyFail)
alert "Sorry, your graphics card is below our min spec.~br~The game will not
run.~br~Please see the README for details." 2001
seti gpuLevel $gpuLevelMin
endif
############################################################################
# Set base shader path
#
if (not $isMac)
if ($psVersion >= 3)
seti shaderPathToSet $shaderPathMax
else
alert "Sorry, your graphics card is below our min spec.~br~The game will not
run.~br~Please see the README for details.\n\n" 2001
endif
else
if ($psVersion >= 1)
seti shaderPathToSet $shaderPathMax
endif
endif
# NOTE: do not override this for special cases, unless the card will
# actually crash or has bugs. Instead setOption OptionLighting to
# reduce the path by default to what we recommend.
intProp shaderPath $shaderPathToSet
#############################################################################
# Instancing support
if ($instancing)
trace "=== Instancing can be enabled"
boolProp effectsInstancing true
# Report classification
trace "==="
trace "=== GPU level ${gpuLevel}"
trace "=== Card ${cardName}, Vendor ${cardVendor}, Driver ${driverBuild}, $
{instancing}"
trace "==="
trace "=== CPU level ${cpuLevel}"
trace "=== CPU ${cpuCount}, Speed ${adjustedCPU}, HT ${hyperthreading}, P4 $
{pentium4}"
trace "=== GPU Texture Memory ${textureMemory}"
#############################################################################
# Set options based on cpu / gpu
#
if ($gpuLevel <= 1)
setOption OptionGeometryDetail 1
else
setOption OptionGeometryDetail $gpuLevel
endif
if ($gpuLevel <= 1)
setOption OptionTextureDetail 1
else
setOption OptionTextureDetail $gpuLevel
endif
if ($gpuLevel <= 1)
setOption OptionAnimationDetail 1
else
setOption OptionAnimationDetail $gpuLevel
endif
#############################################################################
# MRT
#
boolProp MRT 0
if ( $numSimultaneousRTs > 1 )
boolProp MRT 1
endif
############################################################################
# Resolution
#
seti resolutionTarget (1024 * 768) # 4x3
if ($isMac )
if ($gpuLevel > $gpuLevelHigh)
seti resolutionTarget (3840 * 2400) # 16x10
elseif ($gpuLevel > $gpuLevelMedium)
seti resolutionTarget (1920 * 1200) # 16x10
elseif ($gpuLevel >= $gpuLevelLow)
seti resolutionTarget (1280 * 800) # 16x10
endif
else
if ($gpuLevel >= $gpuLevelHigh)
seti resolutionTarget (3840 * 2160) # 16x9
elseif ($gpuLevel >= $gpuLevelMedium)
seti resolutionTarget (1920 * 1080) # 16x9
elseif ($gpuLevel >= $gpuLevelLow)
seti resolutionTarget (1280 * 720) # 16x9
endif
endif
setResolution $resolutionTarget
############################################################################
# Shadow settings
#
#seti shadowOption $cpuLevel
#if ($gpuLevel < $cpuLevel)
#seti shadowOption $gpuLevel
#endif
############################################################################
# Event Query
#
# Note: Vista and now Windows 7 exhibits hangs when using D3DQUERYTYPE_EVENT.
# Clearly this is not something they'll fix, so now we only enable on XP.
############################################################################
# Lighting level controls shaders that run. Can be set higher.
if ($cpuLevel == $cpuLevelLow)
# this sets the minspec shader path
setOption OptionLighting $Min
endif
############################################################################
# Drop CPU Settings By GPU
#
if ($gpuLevel == $gpuLevelMedium)
# prevent high cpu level from pushing too many batches to medium gpu
# this helps medium gpu classification apply to more cards
if ($cpuLevel == $cpuLevelHigh)
setOption OptionEffects $Medium
setOption OptionGameQuality $Medium
endif
#######################################
# Misc
#
#Mac fails to parse the below freeVirtualMemory conditional, so we are turning this
off for Mac 04/11/2013
if (not $isMac)
if ($freeVirtualMemory <= 2500)
intProp modelMeshLODOffsetOverride 1 -list @SimCityNonSim_ecoUnit!
TemplateBuilding
intProp rasterMipOffset 1
#bump this up for 'low' otherwise they get knocked down two levels
if ($gpuLevel >= $gpuLevelLow)
setOption OptionTextureDetail $Medium
endif
else
intProp modelMeshLODOffsetOverride 0 -list @SimCityNonSim_ecoUnit!
TemplateBuilding
intProp rasterMipOffset 0
endif
endif
#######################################
# Specific OSX settings
if ($isMac)
if ($isNvidia)
if (match("${cardName}", "*650*"))
setOption OptionLighting $Medium
setOption OptionTextureDetail $Medium
endif
endif
endif
#######################################
# Safe mode
#
# Basically setting anything that might trigger bad hardware behaviour to low.
if ($safeMode)
trace "=== SAFE MODE"
endif