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
;
160 bool InterfaceScaleAuto
;
164 bool WindowSnapInvert
;
165 uint32 WindowSnapDistance
;
169 std::string VRDisplayDevice
;
170 std::string VRDisplayDeviceId
;
172 /// Client in Local mode or not.
177 bool DisplayAccountButtons
;
178 string CreateAccountURL
;
179 string EditAccountURL
;
180 string ConditionsTermsURL
;
181 string NamingPolicyURL
;
182 string BetaAccountURL
;
185 string LoginSupportURL
;
187 /// User entity Position (in local mode only).
189 /// User entity Heading (in local mode only).
191 /// Height for the eyes.
193 /// Velocity for the Walk.
195 /// Velocity for the Run.
197 /// Velocity for the Walk in DM ing or editing.
199 /// Velocity for the Run in DM ing or editing.
201 /// Velocity for the Fly.
203 /// Acceleration for the Fly.
206 /// Allow debug commands
207 bool AllowDebugCommands
;
211 /// Use a hardware cursor
213 float HardwareCursorScale
; // scale for hardware cursor bitmap (in ]0, 1])
215 uint CursorAcceleration
;
217 uint FreeLookAcceleration
;
218 float FreeLookSmoothingPeriod
;
219 bool FreeLookInverted
;
221 // true if camera is centered when user casts a spell
222 bool AutomaticCamera
;
227 uint ForceDeltaTime
; // 0 to use real delta time
231 /// Landscape Tile Near.
232 float LandscapeTileNear
;
233 /** Landscape Threshold. NB: threshold is inverted ULandscape::setThreshold(), to be more intelligible in client.cfg
234 * MUST USE getActualLandscapeThreshold() to get the real value
236 float LandscapeThreshold
;
241 /// Number poly max for LOD Balancing. Fx and Skin
243 // Is cloud displayed
248 uint NbMaxSkeletonNotCLod
;
249 float CharacterFarClip
;
250 /// ScreenAspectRatio
251 float ScreenAspectRatio
;
252 /// Field of View (FoV)
254 /// Force the DXTC Compression.
256 /// Set the anisotropic filter
257 sint AnisotropicFilter
;
258 /// Divide texture size by 2
259 bool DivideTextureSizeBy2
;
260 /// Disable Hardware Vertex Program.
261 bool DisableVtxProgram
;
262 /// Disable Hardware Vertex AGP.
264 /// Disable Hardware Texture Shader.
265 bool DisableTextureShdr
;
266 /// Enable/Disable MicroVeget.
268 /// Density of microvegetation in %
269 float MicroVegetDensity
;
270 /// Enable/Disable High Def Entity Texture quality. By default its false
271 bool HDEntityTexture
;
272 /// True if the client has HD Texture installed 512*512)
273 bool HDTextureInstalled
;
274 /// Enable/Disable Fog
276 /// Enable/Disable VSync
278 /// Force or auto-detect video memory (in MiB)
281 /// Timer mode. 0 : QueryPerformanceCounter, 1 : timeGetTime.
284 /// Global Wind Setup
285 float GlobalWindPower
;
286 CVector GlobalWindDirection
;
291 // Is bloom effect activated
297 uint MovieShooterMemory
;
298 string MovieShooterPath
;
299 string MovieShooterPrefix
;
300 float MovieShooterFramePeriod
;
301 bool MovieShooterBlend
;
302 uint MovieShooterFrameSkip
;
305 string CameraRecorderPath
;
306 string CameraRecorderPrefix
;
307 bool CameraRecorderBlend
;
310 string ScreenShotDirectory
;
311 uint ScreenShotWidth
; // If 0 : normal screen shot, else custom screen shot without interface
312 uint ScreenShotHeight
;
313 bool ScreenShotFullDetail
; // If set to true, then load balancing will be disabled for the duration of the screenshot
314 bool ScreenShotZBuffer
; // If set to true, save also the ZBuffer in a file
316 /////////////////////////
317 // NEW PATCHING SYSTEM //
319 std::string PatchUrl
;
320 std::string PatchletUrl
;
321 std::string PatchVersion
;
323 std::string RingReleaseNotePath
;
324 std::string ReleaseNotePath
;
326 std::string WebIgMainDomain
;
327 std::vector
<string
> WebIgTrustedDomains
;
328 uint WebIgNotifInterval
; // value in minutes for notification thread
330 sint32 CurlMaxConnections
;
335 // With a bigger angle, rotation is animated.
336 double AnimatedAngleThreshold
;
337 uint BlendFrameNumber
;
350 TDriverSound DriverSound
;
352 /// SoundForceSoftwareBuffer
353 bool SoundForceSoftwareBuffer
;
357 string EmptySlotMusic
;
359 string KamiTeleportMusic
;
360 string KaravanTeleportMusic
;
361 string TeleportLoadingMusic
;
364 /// The Sound SFX Volume (0-1) (ie all but music)
365 float SoundSFXVolume
;
366 /// This is volume for "InGame" music. Does not affect the MP3 player volume
367 float SoundGameMusicVolume
;
369 /// Time in ms of sound to be faded in/out when the user is teleported
373 bool EnableBackgroundMusicTimeConstraint
;
375 /// Directory where to generate the sound packed sheets
376 string SoundPackedSheetPath
;
377 /// the directory where the sample banks are stored (.wav)
378 string SampleBankDir
;
379 /// The audio gain for user entity sound
380 float UserEntitySoundLevel
;
381 /// A flag that indicated if we use EAX
383 /// A flag the indicate we whant ADPCM sample (reduce memory by 1/4, but lower quality)
385 /// The max number of track we want to use.
389 string MediaPlayerDirectory
;
390 bool MediaPlayerAutoPlay
;
393 std::vector
<string
> PreDataPath
;
395 std::vector
<string
> DataPath
;
396 /// Data Path no recurse.
397 std::vector
<string
> DataPathNoRecurse
;
399 std::string PreLoadPath
;
400 /// Streamed package path
401 std::string StreamedPackagePath
;
402 /// Streamed package hosts
403 std::vector
<string
> StreamedPackageHosts
; // TODO: From 'domain' SQL table
404 /// Update packed sheet Path.
405 std::vector
<string
> UpdatePackedSheetPath
;
406 /// True if we want the packed sheet to be updated if needed
407 bool UpdatePackedSheet
;
408 /// TIme before exiting the application (in sec).
409 float EndScreenTimeOut
;
410 /// Texture file name for the loading Background.
412 string LoadingFreeTrial_BG
;
413 /// Texture file name for the launch Background.
415 /// Texture file name
416 string TeleportKami_BG
;
417 string TeleportKaravan_BG
;
418 /// Texture file name
420 /// Texture file name
421 string ResurectKami_BG
;
422 string ResurectKaravan_BG
;
423 /// Texture file name for the last Background.
425 string IntroNevrax_BG
;
426 string IntroNVidia_BG
;
427 /// Message screen position
430 /// Name of the scene to play.
432 /// Path for the Id file.
434 // directories where pacs primitive can be found
435 std::vector
<string
> PacsPrimDir
;
437 /// Vector with some entities to spawn at the beginning.
438 std::vector
<string
> StartCommands
;
440 /// Display or not the shadows.
442 /// Shadows are disabled after this distance.
443 float ShadowsClipFar
;
444 /// Shadows draw with just 1 part after this distance.
445 float ShadowsLodDist
;
446 /// ShadowMap Z Direction Clamping when player is on landscape/interior
447 float ShadowZDirClampLandscape
;
448 float ShadowZDirClampInterior
;
449 float ShadowZDirClampSmoothSpeed
;
450 /// ShadowMap Max Depth when player is on landscape/interior
451 float ShadowMaxDepthLandscape
;
452 float ShadowMaxDepthInterior
;
453 float ShadowMaxDepthSmoothSpeed
;
456 /// Prim file to load
457 std::vector
<string
> PrimFiles
;
459 /// Display or not the Names.
461 /// To force the client to sleep a bit (in ms).
463 /// Force process priority
464 sint ProcessPriority
;
467 // To show/hide the entities path
469 /// Draw the Boxes used for the selection.
472 /// The Sheet used by the user.
473 std::string UserSheet
;
474 /// (only use in local mode) User Sex.
475 GSGENDER::EGender Sex
;
477 /// height added to character primitive
478 float PrimitiveHeightAddition
;
480 /// Distance between 2 attackers.
484 /// Day at the beginning (in local mode only)
486 /// Time at the beginning (in local mode only)
490 /// Temp for test : manual setup of the weather function
491 bool ManualWeatherSetup
;
493 float ChaseReactionTime
;
495 /// Time allowed to adjust the camera from 1st to 3rd person view (in ms).
496 double TimeToAdjustCamera
;
497 /// Change the direction once this angle is reached.
498 double ChangeDirAngle
;
499 /// Guild Symbol Size
500 float GuildSymbolSize
;
501 /// Distance Maximum to be able to select an entity.
503 /// For fair selection of entity, relative to center of bbox.
504 float SelectionOutBBoxWeight
;
505 /// Distance Maximum to be able to loot/harvest a corpse.
507 /// Space Selection: Max distance for space selection.
508 float SpaceSelectionDist
;
509 /// Space Selection: max number of entities to cycle through
510 uint32 SpaceSelectionMaxCycle
;
519 float FyrosWaterOffset
;
520 float MatisWaterOffset
;
521 float TrykerWaterOffset
;
522 float ZoraiWaterOffset
;
524 /// Water Offset for creature (mektoubs)
525 float WaterOffsetCreature
;
526 /// Time before removing entities collisions from entities with the user in MS.
527 uint32 TimeToRemoveCol
;
528 /// Time before stoping running to 0.5m to an entity for executing an action
529 uint32 MoveToTimeToStopStall
;
530 /// Third Person View Min Pitch.
532 /// Third Person View Max Pitch.
534 /// Max Head Targeting distance
535 float MaxHeadTargetDist
;
536 /// Name of the FX played when dead
537 std::string DeadFXName
;
538 /// Name of the FX played for each impact.
539 std::string ImpactFXName
;
540 /// Name of the FX played when Skill Up.
541 std::string SkillUpFXName
;
542 /// Factor of the walk animation distance after which the entity will start moving.
543 double MinDistFactor
;
545 /// Scale used to display names.
547 /// Distance between the name and the extended name (this value is multiply with the name scale).
549 /// Name Font Size (above entities).
551 /// Names will be hidden after this Value.
553 /// Before this Value, the name size is constant.
554 float ConstNameSizeDist
;
555 /// If true names won't move all the time over entities
556 bool StaticNameHeight
;
562 double FightAreaSize
;
563 /// Destination Threshold
564 double DestThreshold
;
565 /// Radius of the Position Limiter (Useful to avoid some Noise on Positions).
566 double PositionLimiterRadius
;
567 /// Significant Distance
568 double SignificantDist
;
569 /// ZBias for InScene bubble
571 /// ZBias for InScene Forage Interface
572 float ForageInterfaceZBias
;
581 bool EnableRacialAnimation
;
585 /// Right click select too.
586 bool SelectWithRClick
;
587 /// Walk/Run at the beginning
588 bool RunAtTheBeginning
;
589 /// Rotation Velocity
590 float RotKeySpeedMax
;
591 float RotKeySpeedMin
;
592 /// Rotation Acceleration
594 /// Put Back Items after use
596 /// Display the name of the entity under the cursor.
597 bool ShowNameUnderCursor
;
598 /// Display the name of the entity selected.
599 bool ShowNameSelected
;
600 /// Force display of names under this distance
601 float ShowNameBelowDistanceSqr
;
602 /// Force the FPV when the user is indoor.
608 /// Makes entities transparent if they are under cursor
609 bool TransparentUnderCursor
;
611 /// Allow item group to move from / to guild room
612 bool ItemGroupAllowGuild
;
617 /// First Person View or Not.
619 /// Distance of the camera from the user.
621 float CameraDistance
;
622 float CameraDistStep
;
623 float CameraDistMin
; // Last distance before FirstPersonView
624 float CameraDistMax
; // distance max of the camera for ryzom player and ring tester player
625 float DmCameraDistMax
; // distance max of the camera for ring/dm
627 float CameraSpeedMin
;
628 float CameraSpeedMax
;
629 float CameraResetSpeed
;
631 // Default values for CGroupMap
633 float R2EDMaxMapScale
;
635 // If successfull /tar command should set compass or not
636 bool TargetChangeCompass
;
641 bool VerboseAnimUser
;
642 bool VerboseAnimSelection
;
643 bool VerboseAllTraffic
;
648 std::string LigoPrimitiveClass
;
652 // Display names of missing animation files
653 bool DisplayMissingAnimFile
;
654 // Default creature spawned when the entity do not exist
655 std::string DefaultEntity
;
656 // Restrain the predicted interval
658 // Dump Visual Slot IDs.
660 // Font size for Help infos.
662 // Color for the Help Font.
664 // Line step for Help infos.
666 // Font size for debug infos.
667 uint32 DebugFontSize
;
668 // Color for the Debug Font.
669 CRGBA DebugFontColor
;
670 // Line step for debug infos.
674 // Enable/disable Floating Point Exceptions
676 // Use to launch exceptions when there is something wrong
678 // Use PACS collision for all (Work In Progress).
686 std::string LanguageCode
;
687 bool DebugStringManager
;
689 bool ResetShapeBankOnRetCharSelect
;
691 std::string LastLogin
;
693 uint32 SimulatePacketLossRatio
;
695 // Parameters for colors of messages in system info
696 // Mode is the display settings :
697 // Normal : just display in the system info window
698 // Over : must be displayed at bottom of the screen and in system info window
699 // OverOnly : must be displayed at bottom of the screen
700 // Center ; must be displayed at the center of the screen and in system info window
701 // Around ; must be displayed in the around chat window
702 // CenterAround ; must be displayed at the center of the screen and in around chat window
706 std::string SysInfoFxName
;
707 enum TMode
{ Normal
, Over
, OverOnly
, Center
, Around
, CenterAround
};
715 std::map
<std::string
, SSysInfoParam
> SystemInfoParams
;
718 // printf commands to display localized strings in loading screen
719 struct SPrintfCommand
727 std::vector
<SPrintfCommand
> loadingTexts
;
729 // funny loading messages count
730 uint16 LoadingStringCount
;
734 int CheckMemoryEveryNFrame
; // -1 no check (default) else number frame to skip before a memory checking
735 bool LogMemoryAllocation
; // false no log (default) else log each memory allocation in the file "alloc.memlog"
736 int LogMemoryAllocationSize
; // Size of the block to log (default : 8)
739 float GroundFXMaxDist
; // max dist for ground fxs
740 uint GroundFXMaxNB
; // max number of ground fxs
741 uint GroundFXCacheSize
; // max number of cached ground fxs
745 // Array with the name of all offensive impact FXs.
746 std::vector
<string
> OffImpactFX
;
748 // Pacs prim used for ZC
749 std::string ZCPacsPrim
;
751 // Reload config files, teleport list and sheet_id.bin
752 bool AutoReloadFiles
;
754 // Use new version of the blend shapes (if true) new version with min,max in race_stats
755 bool BlendShapePatched
;
757 // Not secure boolean to disable some commands on client side
758 bool ExtendedCommands
;
761 sint MaxNumberOfTimedFXInstances
;
764 std::string SelectionFX
;
765 std::string MouseOverFX
;
766 float SelectionFXSize
;
768 // Time to update water envmap
769 float WaterEnvMapUpdateTime
;
771 // number of frames to profile (0 for start/stop scheme)
772 uint NumFrameForProfile
;
775 std::string KlientChatPort
;
777 // SimulateServerTick
778 bool SimulateServerTick
;
780 // usage of LCT in _Stages of CCharacterCL
781 TStageLCTUsage StageLCTUsage
;
783 // TMP : for integration of damage shield
784 bool DamageShieldEnabled
;
788 /// Activate R2 login behavior
790 /// Force direct R2 editor jumpstart
792 bool R2EDVerboseParseTime
;
793 bool R2EDDontReparseUnchangedUIFiles
;
794 std::vector
<string
> R2EDReloadFiles
;
795 bool R2EDExtendedDebug
;
796 bool R2EDLightPalette
;
797 uint32 R2EDAutoSaveWait
; // wait between 2 autosave in second
798 uint32 R2EDAutoSaveSlot
; // number of autosave file
799 uint32 R2EDLoadDynamicFeatures
;
800 bool R2EDMustVerifyRingAccessWhileLoadingAnimation
;
801 bool R2EDUseVerboseRingAccess
;
803 float R2EDClippedEntityBlendTime
;
805 //0: direct send packet to DSS <=> for not breaking thing
806 //1: cut packet send to DSS <=> for local or SBS less shard (dev)
807 //2: cut packet, simulate SBS <=> debug
808 //3: cut packet, send to SBS <=> will be the final value
811 uint32 R2EDDssNetwork
;
817 /// Allow Lua commands (commands beginning with Lua)
820 bool LuaDebugInfoGotoButtonEnabled
;
821 std::string LuaDebugInfoGotoButtonTemplate
;
822 std::string LuaDebugInfoGotoButtonCaption
;
823 std::string LuaDebugInfoGotoButtonFunction
;
826 /// Display additional Lua DebugInfo
827 bool DisplayLuaDebugInfo
;
829 bool BeepWhenLaunched
; // beep when the client is launched
832 std::string R2ClientGw
;
834 float FogDistAndDepthLookupBias
;
836 // name of the files for hardware cursors
837 std::set
<std::string
> HardwareCursors
;
839 bool CheckR2ScenarioMD5
;
841 // vector of languages avoidable in Ring scenari
842 std::vector
<string
> ScenarioLanguages
;
844 // vector of types avoidable in Ring scenari
845 std::vector
<string
> ScenarioTypes
;
848 std::string BuildName
;
851 bool DisplayTPReason
;
854 //uint32 TPCancelButtonX;
855 //uint32 TPCancelButtonY;
856 //uint32 TPQuitButtonX;
857 //uint32 TPQuitButtonY;
861 std::string ScenarioSavePath
;
864 // tmp for background downloader integration
865 bool BackgroundDownloader
;
870 virtual ~CClientConfig() {}
872 static void setValues (); // Set the values of the ClientCfg instance
873 static void setValuesOnFileChange (); // called when cfg modified
876 virtual void serial(NLMISC::IStream
&f
);
881 bool readBool (const std::string
&varName
);
882 void writeBool (const std::string
&varName
, bool val
, bool bForce
= false);
883 sint32
readInt (const std::string
&varName
);
884 void writeInt (const std::string
&varName
, sint32 val
, bool bForce
= false);
885 double readDouble (const std::string
&varName
);
886 void writeDouble (const std::string
&varName
, double val
, bool bForce
= false);
887 void writeString (const std::string
&varName
, const std::string
&bVal
, bool bForce
= false);
889 // return 0 / false if not succeed
890 bool readBoolNoWarning (const std::string
&varName
);
891 sint32
readIntNoWarning (const std::string
&varName
);
892 double readDoubleNoWarning (const std::string
&varName
);
893 std::string
readString (const std::string
&varName
);
896 // NB: threshold is inverted ULandscape::setThreshold(), to be more intelligible in client.cfg
897 float getActualLandscapeThreshold() const;
899 // Return LanguageCode but if "wk", then return "en"
900 std::string
getHtmlLanguageCode() const;
902 // return a random loading tip or, if there are not, return the string in argument
903 std::string
buildLoadingString(const std::string
&ucstr
) const;
905 /// get the path to client_default.cfg including the filename itself.
906 bool getDefaultConfigLocation(std::string
& fileLocation
) const;
908 };// CClientConfig //
914 extern CClientConfig LastClientCfg
;
915 extern CClientConfig ClientCfg
;
916 extern const std::string ConfigFileName
;
918 #endif // CL_CLIENT_CFG_H
920 /* End of client_cfg.h */