1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010-2020 Winch Gate Property Limited
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2010 Robert TIMM (rti) <mail@rtti.de>
6 // Copyright (C) 2010-2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
7 // Copyright (C) 2011-2012 Matt RAYKOWSKI (sfb) <matt.raykowski@gmail.com>
9 // This program is free software: you can redistribute it and/or modify
10 // it under the terms of the GNU Affero General Public License as
11 // published by the Free Software Foundation, either version 3 of the
12 // License, or (at your option) any later version.
14 // This program is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU Affero General Public License for more details.
19 // You should have received a copy of the GNU Affero General Public License
20 // along with this program. If not, see <http://www.gnu.org/licenses/>.
24 #ifndef CL_CLIENT_CFG_H
25 #define CL_CLIENT_CFG_H
32 #include "nel/misc/types_nl.h"
33 #include "nel/misc/vector.h"
34 #include "nel/misc/rgba.h"
35 #include "nel/misc/config_file.h"
37 #include "nel/sound/sound_anim_manager.h"
43 #include "game_share/gender.h"
44 #include "game_share/character_title.h"
50 using NLMISC::CVector
;
54 //---------------------------------------------------
56 // Struct to manage a config file for the client.
57 //---------------------------------------------------
60 enum TDriver3D
{ DrvAuto
= 0, OpenGL
, Direct3D
, OpenGLES
};
61 enum TDriverSound
{ SoundDrvAuto
= 0, SoundDrvOpenAL
, SoundDrvDirectSound
, SoundDrvXAudio2
};
62 enum TStageLCTUsage
{ StageUseNoLCT
= 0, StageUseAllLCT
, StageUsePosOnlyLCT
};
64 // the config file must be always be available
65 NLMISC::CConfigFile ConfigFile
;
67 void init (const string
&configFileName
);
69 /// Save the cfg file when exit the client ?
72 /// Window position in windowed mode
79 /// Skip introdution to ryzom (before the outgame select character
81 /// Select character automatically (dont go to create perso) (-1 if no auto select)
83 /// Selected slot in select char interface
86 /// Textures for interface login
87 std::vector
<string
> TexturesLoginInterface
;
88 std::vector
<string
> TexturesLoginInterfaceDXTC
;
90 /// Textures for interface outgame
91 std::vector
<string
> TexturesOutGameInterface
;
92 std::vector
<string
> TexturesOutGameInterfaceDXTC
;
94 /// Textures for ingame interface and r2 interface
95 std::vector
<string
> TexturesInterface
;
96 std::vector
<string
> TexturesInterfaceDXTC
;
98 /// vector of XML file names that describe the interfaces config for login
99 std::vector
<string
> XMLLoginInterfaceFiles
;
101 /// vector of XML file names that describe the interfaces config for outgame menus
102 std::vector
<string
> XMLOutGameInterfaceFiles
;
104 /// vector of XML file names that describe the interfaces config
105 std::vector
<string
> XMLInterfaceFiles
;
107 /// vector of XML file names that describe R2 editor
108 std::vector
<string
> XMLR2EDInterfaceFiles
;
110 /// logo that are displayed
111 std::vector
<string
> Logos
;
113 /// vector of XML file names that describe input config
114 std::string XMLInputFile
;
116 /// Application start and just start the outgame web browser
118 /// Start URL for testing the browser
119 std::string TestBrowserUrl
;
120 /// Application start with only the interfaces
122 /// Is the landscape enabled ?
123 bool LandscapeEnabled
;
124 /// Is the microlife enabled
125 bool MicroLifeEnabled
;
126 /// are villages enabled
127 bool VillagesEnabled
;
130 /// is level design mode enabled
131 bool LevelDesignEnabled
;
132 // Cache result of interface parsing
134 /// Skip display of EULA (for test purposes)
138 /// Application start in a window or in fullscreen.
140 /// Monitor to use for fullscreen
141 std::string MonitorName
;
142 /// Width for the Application.
144 /// Height for the Application.
146 /// Bit Per Pixel (only used in Fullscreen mode).
148 /// Monitor Constrast [-1 ~ 1], default 0
150 /// Monitor Luminosity [-1 ~ 1], default 0
152 /// Monitor Gamma [-1 ~ 1], default 0
156 float InterfaceScale
;
157 float InterfaceScale_min
;
158 float InterfaceScale_max
;
159 float InterfaceScale_step
;
163 bool WindowSnapInvert
;
164 uint32 WindowSnapDistance
;
168 std::string VRDisplayDevice
;
169 std::string VRDisplayDeviceId
;
171 /// Client in Local mode or not.
176 bool DisplayAccountButtons
;
177 string CreateAccountURL
;
178 string EditAccountURL
;
179 string ConditionsTermsURL
;
180 string NamingPolicyURL
;
181 string BetaAccountURL
;
184 string LoginSupportURL
;
186 /// User entity Position (in local mode only).
188 /// User entity Heading (in local mode only).
190 /// Height for the eyes.
192 /// Velocity for the Walk.
194 /// Velocity for the Run.
196 /// Velocity for the Walk in DM ing or editing.
198 /// Velocity for the Run in DM ing or editing.
200 /// Velocity for the Fly.
202 /// Acceleration for the Fly.
205 /// Allow debug commands
206 bool AllowDebugCommands
;
210 /// Use a hardware cursor
212 float HardwareCursorScale
; // scale for hardware cursor bitmap (in ]0, 1])
214 uint CursorAcceleration
;
216 uint FreeLookAcceleration
;
217 float FreeLookSmoothingPeriod
;
218 bool FreeLookInverted
;
220 // true if camera is centered when user casts a spell
221 bool AutomaticCamera
;
226 uint ForceDeltaTime
; // 0 to use real delta time
230 /// Landscape Tile Near.
231 float LandscapeTileNear
;
232 /** Landscape Threshold. NB: threshold is inverted ULandscape::setThreshold(), to be more intelligible in client.cfg
233 * MUST USE getActualLandscapeThreshold() to get the real value
235 float LandscapeThreshold
;
240 /// Number poly max for LOD Balancing. Fx and Skin
242 // Is cloud displayed
247 uint NbMaxSkeletonNotCLod
;
248 float CharacterFarClip
;
249 /// ScreenAspectRatio
250 float ScreenAspectRatio
;
251 /// Field of View (FoV)
253 /// Force the DXTC Compression.
255 /// Set the anisotropic filter
256 sint AnisotropicFilter
;
257 /// Divide texture size by 2
258 bool DivideTextureSizeBy2
;
259 /// Disable Hardware Vertex Program.
260 bool DisableVtxProgram
;
261 /// Disable Hardware Vertex AGP.
263 /// Disable Hardware Texture Shader.
264 bool DisableTextureShdr
;
265 /// Enable/Disable MicroVeget.
267 /// Density of microvegetation in %
268 float MicroVegetDensity
;
269 /// Enable/Disable High Def Entity Texture quality. By default its false
270 bool HDEntityTexture
;
271 /// True if the client has HD Texture installed 512*512)
272 bool HDTextureInstalled
;
273 /// Enable/Disable Fog
275 /// Enable/Disable VSync
277 /// Force or auto-detect video memory (in MiB)
280 /// Timer mode. 0 : QueryPerformanceCounter, 1 : timeGetTime.
283 /// Global Wind Setup
284 float GlobalWindPower
;
285 CVector GlobalWindDirection
;
290 // Is bloom effect activated
296 uint MovieShooterMemory
;
297 string MovieShooterPath
;
298 string MovieShooterPrefix
;
299 float MovieShooterFramePeriod
;
300 bool MovieShooterBlend
;
301 uint MovieShooterFrameSkip
;
304 string CameraRecorderPath
;
305 string CameraRecorderPrefix
;
306 bool CameraRecorderBlend
;
309 string ScreenShotDirectory
;
310 uint ScreenShotWidth
; // If 0 : normal screen shot, else custom screen shot without interface
311 uint ScreenShotHeight
;
312 bool ScreenShotFullDetail
; // If set to true, then load balancing will be disabled for the duration of the screenshot
313 bool ScreenShotZBuffer
; // If set to true, save also the ZBuffer in a file
315 /////////////////////////
316 // NEW PATCHING SYSTEM //
318 std::string PatchUrl
;
319 std::string PatchletUrl
;
320 std::string PatchVersion
;
322 std::string RingReleaseNotePath
;
323 std::string ReleaseNotePath
;
325 std::string WebIgMainDomain
;
326 std::vector
<string
> WebIgTrustedDomains
;
327 uint WebIgNotifInterval
; // value in minutes for notification thread
329 sint32 CurlMaxConnections
;
334 // With a bigger angle, rotation is animated.
335 double AnimatedAngleThreshold
;
336 uint BlendFrameNumber
;
349 TDriverSound DriverSound
;
351 /// SoundForceSoftwareBuffer
352 bool SoundForceSoftwareBuffer
;
356 string EmptySlotMusic
;
358 string KamiTeleportMusic
;
359 string KaravanTeleportMusic
;
360 string TeleportLoadingMusic
;
363 /// The Sound SFX Volume (0-1) (ie all but music)
364 float SoundSFXVolume
;
365 /// This is volume for "InGame" music. Does not affect the MP3 player volume
366 float SoundGameMusicVolume
;
368 /// Time in ms of sound to be faded in/out when the user is teleported
372 bool EnableBackgroundMusicTimeConstraint
;
374 /// Directory where to generate the sound packed sheets
375 string SoundPackedSheetPath
;
376 /// the directory where the sample banks are stored (.wav)
377 string SampleBankDir
;
378 /// The audio gain for user entity sound
379 float UserEntitySoundLevel
;
380 /// A flag that indicated if we use EAX
382 /// A flag the indicate we whant ADPCM sample (reduce memory by 1/4, but lower quality)
384 /// The max number of track we want to use.
388 string MediaPlayerDirectory
;
389 bool MediaPlayerAutoPlay
;
392 std::vector
<string
> PreDataPath
;
394 std::vector
<string
> DataPath
;
395 /// Data Path no recurse.
396 std::vector
<string
> DataPathNoRecurse
;
398 std::string PreLoadPath
;
399 /// Streamed package path
400 std::string StreamedPackagePath
;
401 /// Streamed package hosts
402 std::vector
<string
> StreamedPackageHosts
; // TODO: From 'domain' SQL table
403 /// Update packed sheet Path.
404 std::vector
<string
> UpdatePackedSheetPath
;
405 /// True if we want the packed sheet to be updated if needed
406 bool UpdatePackedSheet
;
407 /// TIme before exiting the application (in sec).
408 float EndScreenTimeOut
;
409 /// Texture file name for the loading Background.
411 string LoadingFreeTrial_BG
;
412 /// Texture file name for the launch Background.
414 /// Texture file name
415 string TeleportKami_BG
;
416 string TeleportKaravan_BG
;
417 /// Texture file name
419 /// Texture file name
420 string ResurectKami_BG
;
421 string ResurectKaravan_BG
;
422 /// Texture file name for the last Background.
424 string IntroNevrax_BG
;
425 string IntroNVidia_BG
;
426 /// Message screen position
429 /// Name of the scene to play.
431 /// Path for the Id file.
433 // directories where pacs primitive can be found
434 std::vector
<string
> PacsPrimDir
;
436 /// Vector with some entities to spawn at the beginning.
437 std::vector
<string
> StartCommands
;
439 /// Display or not the shadows.
441 /// Shadows are disabled after this distance.
442 float ShadowsClipFar
;
443 /// Shadows draw with just 1 part after this distance.
444 float ShadowsLodDist
;
445 /// ShadowMap Z Direction Clamping when player is on landscape/interior
446 float ShadowZDirClampLandscape
;
447 float ShadowZDirClampInterior
;
448 float ShadowZDirClampSmoothSpeed
;
449 /// ShadowMap Max Depth when player is on landscape/interior
450 float ShadowMaxDepthLandscape
;
451 float ShadowMaxDepthInterior
;
452 float ShadowMaxDepthSmoothSpeed
;
455 /// Prim file to load
456 std::vector
<string
> PrimFiles
;
458 /// Display or not the Names.
460 /// To force the client to sleep a bit (in ms).
462 /// Force process priority
463 sint ProcessPriority
;
466 // To show/hide the entities path
468 /// Draw the Boxes used for the selection.
471 /// The Sheet used by the user.
472 std::string UserSheet
;
473 /// (only use in local mode) User Sex.
474 GSGENDER::EGender Sex
;
476 /// height added to character primitive
477 float PrimitiveHeightAddition
;
479 /// Distance between 2 attackers.
483 /// Day at the beginning (in local mode only)
485 /// Time at the beginning (in local mode only)
489 /// Temp for test : manual setup of the weather function
490 bool ManualWeatherSetup
;
492 float ChaseReactionTime
;
494 /// Time allowed to adjust the camera from 1st to 3rd person view (in ms).
495 double TimeToAdjustCamera
;
496 /// Change the direction once this angle is reached.
497 double ChangeDirAngle
;
498 /// Guild Symbol Size
499 float GuildSymbolSize
;
500 /// Distance Maximum to be able to select an entity.
502 /// For fair selection of entity, relative to center of bbox.
503 float SelectionOutBBoxWeight
;
504 /// Distance Maximum to be able to loot/harvest a corpse.
506 /// Space Selection: Max distance for space selection.
507 float SpaceSelectionDist
;
508 /// Space Selection: max number of entities to cycle through
509 uint32 SpaceSelectionMaxCycle
;
518 float FyrosWaterOffset
;
519 float MatisWaterOffset
;
520 float TrykerWaterOffset
;
521 float ZoraiWaterOffset
;
523 /// Water Offset for creature (mektoubs)
524 float WaterOffsetCreature
;
525 /// Time before removing entities collisions from entities with the user in MS.
526 uint32 TimeToRemoveCol
;
527 /// Time before stoping running to 0.5m to an entity for executing an action
528 uint32 MoveToTimeToStopStall
;
529 /// Third Person View Min Pitch.
531 /// Third Person View Max Pitch.
533 /// Max Head Targeting distance
534 float MaxHeadTargetDist
;
535 /// Name of the FX played when dead
536 std::string DeadFXName
;
537 /// Name of the FX played for each impact.
538 std::string ImpactFXName
;
539 /// Name of the FX played when Skill Up.
540 std::string SkillUpFXName
;
541 /// Factor of the walk animation distance after which the entity will start moving.
542 double MinDistFactor
;
544 /// Scale used to display names.
546 /// Distance between the name and the extended name (this value is multiply with the name scale).
548 /// Name Font Size (above entities).
550 /// Names will be hidden after this Value.
552 /// Before this Value, the name size is constant.
553 float ConstNameSizeDist
;
554 /// If true names won't move all the time over entities
555 bool StaticNameHeight
;
561 double FightAreaSize
;
562 /// Destination Threshold
563 double DestThreshold
;
564 /// Radius of the Position Limiter (Useful to avoid some Noise on Positions).
565 double PositionLimiterRadius
;
566 /// Significant Distance
567 double SignificantDist
;
568 /// ZBias for InScene bubble
570 /// ZBias for InScene Forage Interface
571 float ForageInterfaceZBias
;
580 bool EnableRacialAnimation
;
584 /// Right click select too.
585 bool SelectWithRClick
;
586 /// Walk/Run at the beginning
587 bool RunAtTheBeginning
;
588 /// Rotation Velocity
589 float RotKeySpeedMax
;
590 float RotKeySpeedMin
;
591 /// Rotation Acceleration
593 /// Put Back Items after use
595 /// Display the name of the entity under the cursor.
596 bool ShowNameUnderCursor
;
597 /// Display the name of the entity selected.
598 bool ShowNameSelected
;
599 /// Force display of names under this distance
600 float ShowNameBelowDistanceSqr
;
601 /// Force the FPV when the user is indoor.
607 /// Makes entities transparent if they are under cursor
608 bool TransparentUnderCursor
;
610 /// Allow item group to move from / to guild room
611 bool ItemGroupAllowGuild
;
616 /// First Person View or Not.
618 /// Distance of the camera from the user.
620 float CameraDistance
;
621 float CameraDistStep
;
622 float CameraDistMin
; // Last distance before FirstPersonView
623 float CameraDistMax
; // distance max of the camera for ryzom player and ring tester player
624 float DmCameraDistMax
; // distance max of the camera for ring/dm
626 float CameraSpeedMin
;
627 float CameraSpeedMax
;
628 float CameraResetSpeed
;
630 // Default values for CGroupMap
632 float R2EDMaxMapScale
;
634 // If successfull /tar command should set compass or not
635 bool TargetChangeCompass
;
640 bool VerboseAnimUser
;
641 bool VerboseAnimSelection
;
642 bool VerboseAllTraffic
;
647 std::string LigoPrimitiveClass
;
651 // Display names of missing animation files
652 bool DisplayMissingAnimFile
;
653 // Default creature spawned when the entity do not exist
654 std::string DefaultEntity
;
655 // Restrain the predicted interval
657 // Dump Visual Slot IDs.
659 // Font size for Help infos.
661 // Color for the Help Font.
663 // Line step for Help infos.
665 // Font size for debug infos.
666 uint32 DebugFontSize
;
667 // Color for the Debug Font.
668 CRGBA DebugFontColor
;
669 // Line step for debug infos.
673 // Enable/disable Floating Point Exceptions
675 // Use to launch exceptions when there is something wrong
677 // Use PACS collision for all (Work In Progress).
685 std::string LanguageCode
;
686 bool DebugStringManager
;
688 bool ResetShapeBankOnRetCharSelect
;
690 std::string LastLogin
;
692 uint32 SimulatePacketLossRatio
;
694 // Parameters for colors of messages in system info
695 // Mode is the display settings :
696 // Normal : just display in the system info window
697 // Over : must be displayed at bottom of the screen and in system info window
698 // OverOnly : must be displayed at bottom of the screen
699 // Center ; must be displayed at the center of the screen and in system info window
700 // Around ; must be displayed in the around chat window
701 // CenterAround ; must be displayed at the center of the screen and in around chat window
705 std::string SysInfoFxName
;
706 enum TMode
{ Normal
, Over
, OverOnly
, Center
, Around
, CenterAround
};
714 std::map
<std::string
, SSysInfoParam
> SystemInfoParams
;
717 // printf commands to display localized strings in loading screen
718 struct SPrintfCommand
726 std::vector
<SPrintfCommand
> loadingTexts
;
728 // funny loading messages count
729 uint16 LoadingStringCount
;
733 int CheckMemoryEveryNFrame
; // -1 no check (default) else number frame to skip before a memory checking
734 bool LogMemoryAllocation
; // false no log (default) else log each memory allocation in the file "alloc.memlog"
735 int LogMemoryAllocationSize
; // Size of the block to log (default : 8)
738 float GroundFXMaxDist
; // max dist for ground fxs
739 uint GroundFXMaxNB
; // max number of ground fxs
740 uint GroundFXCacheSize
; // max number of cached ground fxs
744 // Array with the name of all offensive impact FXs.
745 std::vector
<string
> OffImpactFX
;
747 // Pacs prim used for ZC
748 std::string ZCPacsPrim
;
750 // Reload config files, teleport list and sheet_id.bin
751 bool AutoReloadFiles
;
753 // Use new version of the blend shapes (if true) new version with min,max in race_stats
754 bool BlendShapePatched
;
756 // Not secure boolean to disable some commands on client side
757 bool ExtendedCommands
;
760 sint MaxNumberOfTimedFXInstances
;
763 std::string SelectionFX
;
764 std::string MouseOverFX
;
765 float SelectionFXSize
;
767 // Time to update water envmap
768 float WaterEnvMapUpdateTime
;
770 // number of frames to profile (0 for start/stop scheme)
771 uint NumFrameForProfile
;
774 std::string KlientChatPort
;
776 // SimulateServerTick
777 bool SimulateServerTick
;
779 // usage of LCT in _Stages of CCharacterCL
780 TStageLCTUsage StageLCTUsage
;
782 // TMP : for integration of damage shield
783 bool DamageShieldEnabled
;
787 /// Activate R2 login behavior
789 /// Force direct R2 editor jumpstart
791 bool R2EDVerboseParseTime
;
792 bool R2EDDontReparseUnchangedUIFiles
;
793 std::vector
<string
> R2EDReloadFiles
;
794 bool R2EDExtendedDebug
;
795 bool R2EDLightPalette
;
796 uint32 R2EDAutoSaveWait
; // wait between 2 autosave in second
797 uint32 R2EDAutoSaveSlot
; // number of autosave file
798 uint32 R2EDLoadDynamicFeatures
;
799 bool R2EDMustVerifyRingAccessWhileLoadingAnimation
;
800 bool R2EDUseVerboseRingAccess
;
802 float R2EDClippedEntityBlendTime
;
804 //0: direct send packet to DSS <=> for not breaking thing
805 //1: cut packet send to DSS <=> for local or SBS less shard (dev)
806 //2: cut packet, simulate SBS <=> debug
807 //3: cut packet, send to SBS <=> will be the final value
810 uint32 R2EDDssNetwork
;
816 /// Allow Lua commands (commands beginning with Lua)
819 bool LuaDebugInfoGotoButtonEnabled
;
820 std::string LuaDebugInfoGotoButtonTemplate
;
821 std::string LuaDebugInfoGotoButtonCaption
;
822 std::string LuaDebugInfoGotoButtonFunction
;
825 /// Display additional Lua DebugInfo
826 bool DisplayLuaDebugInfo
;
828 bool BeepWhenLaunched
; // beep when the client is launched
831 std::string R2ClientGw
;
833 float FogDistAndDepthLookupBias
;
835 // name of the files for hardware cursors
836 std::set
<std::string
> HardwareCursors
;
838 bool CheckR2ScenarioMD5
;
840 // vector of languages avoidable in Ring scenari
841 std::vector
<string
> ScenarioLanguages
;
843 // vector of types avoidable in Ring scenari
844 std::vector
<string
> ScenarioTypes
;
847 std::string BuildName
;
850 bool DisplayTPReason
;
853 //uint32 TPCancelButtonX;
854 //uint32 TPCancelButtonY;
855 //uint32 TPQuitButtonX;
856 //uint32 TPQuitButtonY;
860 std::string ScenarioSavePath
;
863 // tmp for background downloader integration
864 bool BackgroundDownloader
;
869 virtual ~CClientConfig() {}
871 static void setValues (); // Set the values of the ClientCfg instance
872 static void setValuesOnFileChange (); // called when cfg modified
875 virtual void serial(NLMISC::IStream
&f
);
880 bool readBool (const std::string
&varName
);
881 void writeBool (const std::string
&varName
, bool val
, bool bForce
= false);
882 sint32
readInt (const std::string
&varName
);
883 void writeInt (const std::string
&varName
, sint32 val
, bool bForce
= false);
884 double readDouble (const std::string
&varName
);
885 void writeDouble (const std::string
&varName
, double val
, bool bForce
= false);
886 void writeString (const std::string
&varName
, const std::string
&bVal
, bool bForce
= false);
888 // return 0 / false if not succeed
889 bool readBoolNoWarning (const std::string
&varName
);
890 sint32
readIntNoWarning (const std::string
&varName
);
891 double readDoubleNoWarning (const std::string
&varName
);
892 std::string
readString (const std::string
&varName
);
895 // NB: threshold is inverted ULandscape::setThreshold(), to be more intelligible in client.cfg
896 float getActualLandscapeThreshold() const;
898 // Return LanguageCode but if "wk", then return "en"
899 std::string
getHtmlLanguageCode() const;
901 // return a random loading tip or, if there are not, return the string in argument
902 std::string
buildLoadingString(const std::string
&ucstr
) const;
904 /// get the path to client_default.cfg including the filename itself.
905 bool getDefaultConfigLocation(std::string
& fileLocation
) const;
907 };// CClientConfig //
913 extern CClientConfig LastClientCfg
;
914 extern CClientConfig ClientCfg
;
915 extern const std::string ConfigFileName
;
917 #endif // CL_CLIENT_CFG_H
919 /* End of client_cfg.h */