Config Manager
Config Manager
Config Manager
#############################################################################
# Constants
#
set Off 1
set On 1
set Low 3
set Medium 3
set High 3
#############################################################################
# Set up
#
setVariables
if ($cider)
# Running under Mac wrapper. Set mac-specific options here
boolProp AlwaysFullscreen true
boolProp RenderTargetCorrection false
boolProp MacSpecificText true
boolProp Support51Audio false
endif
#############################################################################
# Initial defaults.
#
# These may be overridden below according to CPU or card.
setOption OptionDiskCacheSize 8 # 1 GB
setOption OptionTutorialsEnabled $On
setOption OptionShowHints $On
setOption OptionEdgeScroll $On
setOption OptionBuddiesOnly $Off
setOption OptionFitToScreen $Off
setOption OptionExplainSporepedia $On
setOption OptionExplainPaintLikeThis $On
#############################################################################
# Identify graphics adapter
#
# set some config variables based on a card table and vendor specific rules
# sets isCardFound, cardVendor, and cardName
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
if ($doTestGPU)
# test some 2.0/3.0 cards
set cardVendor "AMD"
set cardName "Radeon 9600"
seti testShaderModel 2
seti maxVertexProgramVersionHW ($testShaderModel*256)
seti maxPixelProgramVersion ($testShaderModel*256)
#############################################################################
#
# Option Levels
#
seti cpuLevelHigh 3
seti cpuLevelMedium 3
seti cpuLevelLow 3
seti gpuLevelHigh 3
seti gpuLevelMedium 3
seti gpuLevelLow 3
#############################################################################
#
# 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 117600
setb isOldDriverBuildExit true
# require a profile
if (not $sporeProfile)
setb oldDriver true
endif
endif
elseif ($isIntel)
seti oldDriverBuild 104906 # 12/19/2007
#setb isOldDriverBuildExit true
elseif ($isAMD)
if ($isVista)
seti oldDriverBuild 100096 # Cat 8.3, 3/2008
if ($isMultiGpu)
seti oldDriverBuild 100127 # Cat 8.7, 7/2008
endif
else
seti oldDriverBuild 106764 # Cat 7.12, 12/2007
if ($isMultiGpu)
seti oldDriverBuild 106833 # Cat 8.7, 7/2008
setb isOldDriverBuildExit true
endif
endif
if ($isNvidia)
# gtx reverses standard naming convention
if (match("${cardName}", "*GeForce GTX*"))
# classify high
seti gpuLevel $gpuLevelHigh
# classify low
if (match("${cardName}", "*5??0*"))
seti gpuLevel $gpuLevelHigh
endif
if ($gpuLevel == $gpuLevelLow)
setb isLimitedVideoMemory true
else
# classify high
if (match("${cardName}", "*98?0*"))
seti gpuLevel $gpuLevelHigh
elseif (match("${cardName}", "*96?0*"))
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
# classify low
if (match("${cardName}", "*32?0*"))
seti gpuLevel $gpuLevelHigh
elseif (match("${cardName}", "*34?0*"))
seti gpuLevel $gpuLevelHigh
if ($gpuLevel == $gpuLevelLow)
setb isLimitedVideoMemory true
else
# classify high
if (match("${cardName}", "*48?0*"))
seti gpuLevel $gpuLevelHigh
if ($isIntel)
if (match("${cardName}", "*915*") or match("${cardName}", "*945*"))
seti gpuLevel $gpuLevelHigh
setb isIntelIntegrated true
else
seti gpuLevel $gpuLevelHigh
endif
if ($isS3)
seti gpuLevel $gpuLevelHigh
setb isLimitedVideoMemory true
endif
# drop gpu level if less than 128MB of video memory, below minspec
if ($textureMemory < 125)
seti gpuLevel $gpuLevelHigh
endif
seti shaderPathToSet 0
if ($psVersion >= 3)
seti shaderPathToSet $shaderPath3_0
if ($isIntel)
seti shaderPathToSet $shaderPath3_0
endif
elseif ($psVersion >= 2)
# use temp register count to distinguish 2 from 2a/2b
if ($cider)
seti shaderPathToSet $shaderPath3_0
if ($maxPSRegisters >= 26)
seti shaderPathToSet $shaderPath3_0
endif
if ($isIntel)
seti shaderPathToSet $shaderPath3_0
endif
else
seti shaderPathToSet $shaderPath3_0
if ($maxPSRegisters >= 32)
seti shaderPathToSet $shaderPath3_0
endif
if ($isIntel)
seti shaderPathToSet $shaderPath3_0
endif
endif
else
# this message should be generated/localized code side
alert "Sorry, your graphics card is below our min spec.\nThe game will not run.\
nPlease see the README for details." 2001
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 ($cider)
# no support for instancing
setb instancing false
endif
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}"
#############################################################################
# Set options based on cpu
#
#############################################################################
# Set terrain generation brush throttle based on cpu
#
#############################################################################
# MRT
#
boolProp MRT 0
if ( $numSimultaneousRTs > 1 )
boolProp MRT 1
endif
############################################################################
# Resolution
#
if (($gpuLevel >= $gpuLevelMedium) and (not $isLimitedVideoMemory))
seti resolutionTarget (1024 * 768)
else
seti resolutionTarget (800 * 600)
endif
setResolution $resolutionTarget
############################################################################
# Texture Detail
#
############################################################################
# Shadow settings
#
############################################################################
# Event Query
#
############################################################################
# Lighting level controls shaders that run. Can be set higher.
if ($cpuLevel == $cpuLevelLow)
# this sets the 2_m shader path
setOption OptionLighting $High
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 OptionPlanetQuality $High
setOption OptionEffects $High
endif
if ($cpuLevel == $cpuLevelHigh)
setOption OptionGameQuality $High
endif
#######################################
# Safe mode
#
# Basically setting anything that might trigger bad hardware behaviour to low.
if ($safeMode)
trace "=== SAFE MODE"
intProp skinpaintTextureSize 2048 # If the game begins to slow down, change the
2048
floatProp skinpaintBumpHeight 15
floatProp skinpaintGlossMultiplier 0.5
floatProp skinpaintPhongMultiplier 1
floatProp skinpaintPartBumpScale 1
floatProp skinpaintAmbOccDiffuse 1
floatProp skinpaintAmbOccSpecular 0.5