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, SoundDrvFMod
, 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 /// Width for the Application.
142 /// Height for the Application.
144 /// Bit Per Pixel (only used in Fullscreen mode).
146 /// Monitor Constrast [-1 ~ 1], default 0
148 /// Monitor Luminosity [-1 ~ 1], default 0
150 /// Monitor Gamma [-1 ~ 1], default 0
154 float InterfaceScale
;
155 float InterfaceScale_min
;
156 float InterfaceScale_max
;
157 float InterfaceScale_step
;
161 bool WindowSnapInvert
;
162 uint32 WindowSnapDistance
;
166 std::string VRDisplayDevice
;
167 std::string VRDisplayDeviceId
;
169 /// Client in Local mode or not.
174 bool DisplayAccountButtons
;
175 string CreateAccountURL
;
176 string EditAccountURL
;
177 string ConditionsTermsURL
;
178 string NamingPolicyURL
;
179 string BetaAccountURL
;
182 string LoginSupportURL
;
184 /// User entity Position (in local mode only).
186 /// User entity Heading (in local mode only).
188 /// Height for the eyes.
190 /// Velocity for the Walk.
192 /// Velocity for the Run.
194 /// Velocity for the Walk in DM ing or editing.
196 /// Velocity for the Run in DM ing or editing.
198 /// Velocity for the Fly.
200 /// Acceleration for the Fly.
203 /// Allow debug commands
204 bool AllowDebugCommands
;
208 /// Use a hardware cursor
210 float HardwareCursorScale
; // scale for hardware cursor bitmap (in ]0, 1])
212 uint CursorAcceleration
;
214 uint FreeLookAcceleration
;
215 float FreeLookSmoothingPeriod
;
216 bool FreeLookInverted
;
218 // true if camera is centered when user casts a spell
219 bool AutomaticCamera
;
224 uint ForceDeltaTime
; // 0 to use real delta time
228 /// Landscape Tile Near.
229 float LandscapeTileNear
;
230 /** Landscape Threshold. NB: threshold is inverted ULandscape::setThreshold(), to be more intelligible in client.cfg
231 * MUST USE getActualLandscapeThreshold() to get the real value
233 float LandscapeThreshold
;
238 /// Number poly max for LOD Balancing. Fx and Skin
240 // Is cloud displayed
245 uint NbMaxSkeletonNotCLod
;
246 float CharacterFarClip
;
247 /// ScreenAspectRatio
248 float ScreenAspectRatio
;
249 /// Field of View (FoV)
251 /// Force the DXTC Compression.
253 /// Set the anisotropic filter
254 sint AnisotropicFilter
;
255 /// Divide texture size by 2
256 bool DivideTextureSizeBy2
;
257 /// Disable Hardware Vertex Program.
258 bool DisableVtxProgram
;
259 /// Disable Hardware Vertex AGP.
261 /// Disable Hardware Texture Shader.
262 bool DisableTextureShdr
;
263 /// Enable/Disable MicroVeget.
265 /// Density of microvegetation in %
266 float MicroVegetDensity
;
267 /// Enable/Disable High Def Entity Texture quality. By default its false
268 bool HDEntityTexture
;
269 /// True if the client has HD Texture installed 512*512)
270 bool HDTextureInstalled
;
271 /// Enable/Disable Fog
273 /// Enable/Disable VSync
275 /// Force or auto-detect video memory (in MiB)
278 /// Timer mode. 0 : QueryPerformanceCounter, 1 : timeGetTime.
281 /// Global Wind Setup
282 float GlobalWindPower
;
283 CVector GlobalWindDirection
;
288 // Is bloom effect activated
294 uint MovieShooterMemory
;
295 string MovieShooterPath
;
296 string MovieShooterPrefix
;
297 float MovieShooterFramePeriod
;
298 bool MovieShooterBlend
;
299 uint MovieShooterFrameSkip
;
302 string CameraRecorderPath
;
303 string CameraRecorderPrefix
;
304 bool CameraRecorderBlend
;
307 uint ScreenShotWidth
; // If 0 : normal screen shot, else custom screen shot without interface
308 uint ScreenShotHeight
;
309 bool ScreenShotFullDetail
; // If set to true, then load balancing will be disabled for the duration of the screenshot
310 bool ScreenShotZBuffer
; // If set to true, save also the ZBuffer in a file
312 /////////////////////////
313 // NEW PATCHING SYSTEM //
315 std::string PatchUrl
;
316 std::string PatchletUrl
;
317 std::string PatchVersion
;
319 std::string RingReleaseNotePath
;
320 std::string ReleaseNotePath
;
322 std::string WebIgMainDomain
;
323 std::vector
<string
> WebIgTrustedDomains
;
324 uint WebIgNotifInterval
; // value in minutes for notification thread
326 sint32 CurlMaxConnections
;
331 // With a bigger angle, rotation is animated.
332 double AnimatedAngleThreshold
;
333 uint BlendFrameNumber
;
346 TDriverSound DriverSound
;
348 /// SoundForceSoftwareBuffer
349 bool SoundForceSoftwareBuffer
;
353 string EmptySlotMusic
;
355 string KamiTeleportMusic
;
356 string KaravanTeleportMusic
;
357 string TeleportLoadingMusic
;
360 /// The Sound SFX Volume (0-1) (ie all but music)
361 float SoundSFXVolume
;
362 /// This is volume for "InGame" music. Does not affect the MP3 player volume
363 float SoundGameMusicVolume
;
365 /// Time in ms of sound to be faded in/out when the user is teleported
369 bool EnableBackgroundMusicTimeConstraint
;
371 /// Directory where to generate the sound packed sheets
372 string SoundPackedSheetPath
;
373 /// the directory where the sample banks are stored (.wav)
374 string SampleBankDir
;
375 /// The audio gain for user entity sound
376 float UserEntitySoundLevel
;
377 /// A flag that indicated if we use EAX
379 /// A flag the indicate we whant ADPCM sample (reduce memory by 1/4, but lower quality)
381 /// The max number of track we want to use.
385 string MediaPlayerDirectory
;
386 bool MediaPlayerAutoPlay
;
389 std::vector
<string
> PreDataPath
;
391 std::vector
<string
> DataPath
;
392 /// Data Path no recurse.
393 std::vector
<string
> DataPathNoRecurse
;
395 std::string PreLoadPath
;
396 /// Streamed package path
397 std::string StreamedPackagePath
;
398 /// Streamed package hosts
399 std::vector
<string
> StreamedPackageHosts
; // TODO: From 'domain' SQL table
400 /// Update packed sheet Path.
401 std::vector
<string
> UpdatePackedSheetPath
;
402 /// True if we want the packed sheet to be updated if needed
403 bool UpdatePackedSheet
;
404 /// TIme before exiting the application (in sec).
405 float EndScreenTimeOut
;
406 /// Texture file name for the loading Background.
408 string LoadingFreeTrial_BG
;
409 /// Texture file name for the launch Background.
411 /// Texture file name
412 string TeleportKami_BG
;
413 string TeleportKaravan_BG
;
414 /// Texture file name
416 /// Texture file name
417 string ResurectKami_BG
;
418 string ResurectKaravan_BG
;
419 /// Texture file name for the last Background.
421 string IntroNevrax_BG
;
422 string IntroNVidia_BG
;
423 /// Message screen position
426 /// Name of the scene to play.
428 /// Path for the Id file.
430 // directories where pacs primitive can be found
431 std::vector
<string
> PacsPrimDir
;
433 /// Vector with some entities to spawn at the beginning.
434 std::vector
<string
> StartCommands
;
436 /// Display or not the shadows.
438 /// Shadows are disabled after this distance.
439 float ShadowsClipFar
;
440 /// Shadows draw with just 1 part after this distance.
441 float ShadowsLodDist
;
442 /// ShadowMap Z Direction Clamping when player is on landscape/interior
443 float ShadowZDirClampLandscape
;
444 float ShadowZDirClampInterior
;
445 float ShadowZDirClampSmoothSpeed
;
446 /// ShadowMap Max Depth when player is on landscape/interior
447 float ShadowMaxDepthLandscape
;
448 float ShadowMaxDepthInterior
;
449 float ShadowMaxDepthSmoothSpeed
;
452 /// Prim file to load
453 std::vector
<string
> PrimFiles
;
455 /// Display or not the Names.
457 /// To force the client to sleep a bit (in ms).
459 /// Force process priority
460 sint ProcessPriority
;
463 // To show/hide the entities path
465 /// Draw the Boxes used for the selection.
468 /// The Sheet used by the user.
469 std::string UserSheet
;
470 /// (only use in local mode) User Sex.
471 GSGENDER::EGender Sex
;
473 /// height added to character primitive
474 float PrimitiveHeightAddition
;
476 /// Distance between 2 attackers.
480 /// Day at the beginning (in local mode only)
482 /// Time at the beginning (in local mode only)
486 /// Temp for test : manual setup of the weather function
487 bool ManualWeatherSetup
;
489 float ChaseReactionTime
;
491 /// Time allowed to adjust the camera from 1st to 3rd person view (in ms).
492 double TimeToAdjustCamera
;
493 /// Change the direction once this angle is reached.
494 double ChangeDirAngle
;
495 /// Guild Symbol Size
496 float GuildSymbolSize
;
497 /// Distance Maximum to be able to select an entity.
499 /// For fair selection of entity, relative to center of bbox.
500 float SelectionOutBBoxWeight
;
501 /// Distance Maximum to be able to loot/harvest a corpse.
503 /// Space Selection: Max distance for space selection.
504 float SpaceSelectionDist
;
505 /// Space Selection: max number of entities to cycle through
506 uint32 SpaceSelectionMaxCycle
;
515 float FyrosWaterOffset
;
516 float MatisWaterOffset
;
517 float TrykerWaterOffset
;
518 float ZoraiWaterOffset
;
520 /// Water Offset for creature (mektoubs)
521 float WaterOffsetCreature
;
522 /// Time before removing entities collisions from entities with the user in MS.
523 uint32 TimeToRemoveCol
;
524 /// Time before stoping running to 0.5m to an entity for executing an action
525 uint32 MoveToTimeToStopStall
;
526 /// Third Person View Min Pitch.
528 /// Third Person View Max Pitch.
530 /// Max Head Targeting distance
531 float MaxHeadTargetDist
;
532 /// Name of the FX played when dead
533 std::string DeadFXName
;
534 /// Name of the FX played for each impact.
535 std::string ImpactFXName
;
536 /// Name of the FX played when Skill Up.
537 std::string SkillUpFXName
;
538 /// Factor of the walk animation distance after which the entity will start moving.
539 double MinDistFactor
;
541 /// Scale used to display names.
543 /// Distance between the name and the extended name (this value is multiply with the name scale).
545 /// Name Font Size (above entities).
547 /// Names will be hidden after this Value.
549 /// Before this Value, the name size is constant.
550 float ConstNameSizeDist
;
551 /// If true names won't move all the time over entities
552 bool StaticNameHeight
;
558 double FightAreaSize
;
559 /// Destination Threshold
560 double DestThreshold
;
561 /// Radius of the Position Limiter (Useful to avoid some Noise on Positions).
562 double PositionLimiterRadius
;
563 /// Significant Distance
564 double SignificantDist
;
565 /// ZBias for InScene bubble
567 /// ZBias for InScene Forage Interface
568 float ForageInterfaceZBias
;
577 bool EnableRacialAnimation
;
581 /// Right click select too.
582 bool SelectWithRClick
;
583 /// Walk/Run at the beginning
584 bool RunAtTheBeginning
;
585 /// Rotation Velocity
586 float RotKeySpeedMax
;
587 float RotKeySpeedMin
;
588 /// Rotation Acceleration
590 /// Put Back Items after use
592 /// Display the name of the entity under the cursor.
593 bool ShowNameUnderCursor
;
594 /// Display the name of the entity selected.
595 bool ShowNameSelected
;
596 /// Force display of names under this distance
597 float ShowNameBelowDistanceSqr
;
598 /// Force the FPV when the user is indoor.
604 /// Makes entities transparent if they are under cursor
605 bool TransparentUnderCursor
;
607 /// Allow item group to move from / to guild room
608 bool ItemGroupAllowGuild
;
613 /// First Person View or Not.
615 /// Distance of the camera from the user.
617 float CameraDistance
;
618 float CameraDistStep
;
619 float CameraDistMin
; // Last distance before FirstPersonView
620 float CameraDistMax
; // distance max of the camera for ryzom player and ring tester player
621 float DmCameraDistMax
; // distance max of the camera for ring/dm
623 float CameraSpeedMin
;
624 float CameraSpeedMax
;
625 float CameraResetSpeed
;
627 // Default values for CGroupMap
629 float R2EDMaxMapScale
;
631 // If successfull /tar command should set compass or not
632 bool TargetChangeCompass
;
637 bool VerboseAnimUser
;
638 bool VerboseAnimSelection
;
639 bool VerboseAllTraffic
;
644 std::string LigoPrimitiveClass
;
648 // Display names of missing animation files
649 bool DisplayMissingAnimFile
;
650 // Default creature spawned when the entity do not exist
651 std::string DefaultEntity
;
652 // Restrain the predicted interval
654 // Dump Visual Slot IDs.
656 // Font size for Help infos.
658 // Color for the Help Font.
660 // Line step for Help infos.
662 // Font size for debug infos.
663 uint32 DebugFontSize
;
664 // Color for the Debug Font.
665 CRGBA DebugFontColor
;
666 // Line step for debug infos.
670 // Enable/disable Floating Point Exceptions
672 // Use to launch exceptions when there is something wrong
674 // Use PACS collision for all (Work In Progress).
682 std::string LanguageCode
;
683 bool DebugStringManager
;
685 bool ResetShapeBankOnRetCharSelect
;
687 std::string LastLogin
;
689 uint32 SimulatePacketLossRatio
;
691 // Parameters for colors of messages in system info
692 // Mode is the display settings :
693 // Normal : just display in the system info window
694 // Over : must be displayed at bottom of the screen and in system info window
695 // OverOnly : must be displayed at bottom of the screen
696 // Center ; must be displayed at the center of the screen and in system info window
697 // Around ; must be displayed in the around chat window
698 // CenterAround ; must be displayed at the center of the screen and in around chat window
702 std::string SysInfoFxName
;
703 enum TMode
{ Normal
, Over
, OverOnly
, Center
, Around
, CenterAround
};
711 std::map
<std::string
, SSysInfoParam
> SystemInfoParams
;
714 // printf commands to display localized strings in loading screen
715 struct SPrintfCommand
723 std::vector
<SPrintfCommand
> PrintfCommands
;
725 std::vector
<SPrintfCommand
> PrintfCommandsFreeTrial
;
727 // funny loading messages count
728 uint16 LoadingStringCount
;
732 int CheckMemoryEveryNFrame
; // -1 no check (default) else number frame to skip before a memory checking
733 bool LogMemoryAllocation
; // false no log (default) else log each memory allocation in the file "alloc.memlog"
734 int LogMemoryAllocationSize
; // Size of the block to log (default : 8)
737 float GroundFXMaxDist
; // max dist for ground fxs
738 uint GroundFXMaxNB
; // max number of ground fxs
739 uint GroundFXCacheSize
; // max number of cached ground fxs
743 // Array with the name of all offensive impact FXs.
744 std::vector
<string
> OffImpactFX
;
746 // Pacs prim used for ZC
747 std::string ZCPacsPrim
;
749 // Reload config files, teleport list and sheet_id.bin
750 bool AutoReloadFiles
;
752 // Use new version of the blend shapes (if true) new version with min,max in race_stats
753 bool BlendShapePatched
;
755 // Not secure boolean to disable some commands on client side
756 bool ExtendedCommands
;
759 sint MaxNumberOfTimedFXInstances
;
762 std::string SelectionFX
;
763 std::string MouseOverFX
;
764 float SelectionFXSize
;
766 // Time to update water envmap
767 float WaterEnvMapUpdateTime
;
769 // number of frames to profile (0 for start/stop scheme)
770 uint NumFrameForProfile
;
773 std::string KlientChatPort
;
775 // SimulateServerTick
776 bool SimulateServerTick
;
778 // usage of LCT in _Stages of CCharacterCL
779 TStageLCTUsage StageLCTUsage
;
781 // TMP : for integration of damage shield
782 bool DamageShieldEnabled
;
786 /// Activate R2 login behavior
788 /// Force direct R2 editor jumpstart
790 bool R2EDVerboseParseTime
;
791 bool R2EDDontReparseUnchangedUIFiles
;
792 std::vector
<string
> R2EDReloadFiles
;
793 bool R2EDExtendedDebug
;
794 bool R2EDLightPalette
;
795 uint32 R2EDAutoSaveWait
; // wait between 2 autosave in second
796 uint32 R2EDAutoSaveSlot
; // number of autosave file
797 uint32 R2EDLoadDynamicFeatures
;
798 bool R2EDMustVerifyRingAccessWhileLoadingAnimation
;
799 bool R2EDUseVerboseRingAccess
;
801 float R2EDClippedEntityBlendTime
;
803 //0: direct send packet to DSS <=> for not breaking thing
804 //1: cut packet send to DSS <=> for local or SBS less shard (dev)
805 //2: cut packet, simulate SBS <=> debug
806 //3: cut packet, send to SBS <=> will be the final value
809 uint32 R2EDDssNetwork
;
815 /// Allow Lua commands (commands beginning with Lua)
818 bool LuaDebugInfoGotoButtonEnabled
;
819 std::string LuaDebugInfoGotoButtonTemplate
;
820 std::string LuaDebugInfoGotoButtonCaption
;
821 std::string LuaDebugInfoGotoButtonFunction
;
824 /// Display additional Lua DebugInfo
825 bool DisplayLuaDebugInfo
;
827 bool BeepWhenLaunched
; // beep when the client is launched
830 std::string R2ClientGw
;
832 float FogDistAndDepthLookupBias
;
834 // name of the files for hardware cursors
835 std::set
<std::string
> HardwareCursors
;
837 bool CheckR2ScenarioMD5
;
839 // vector of languages avoidable in Ring scenari
840 std::vector
<string
> ScenarioLanguages
;
842 // vector of types avoidable in Ring scenari
843 std::vector
<string
> ScenarioTypes
;
846 std::string BuildName
;
849 bool DisplayTPReason
;
852 //uint32 TPCancelButtonX;
853 //uint32 TPCancelButtonY;
854 //uint32 TPQuitButtonX;
855 //uint32 TPQuitButtonY;
859 std::string ScenarioSavePath
;
862 // tmp for background downloader integration
863 bool BackgroundDownloader
;
868 virtual ~CClientConfig() {}
870 static void setValues (); // Set the values of the ClientCfg instance
871 static void setValuesOnFileChange (); // called when cfg modified
874 virtual void serial(NLMISC::IStream
&f
);
879 bool readBool (const std::string
&varName
);
880 void writeBool (const std::string
&varName
, bool val
, bool bForce
= false);
881 sint32
readInt (const std::string
&varName
);
882 void writeInt (const std::string
&varName
, sint32 val
, bool bForce
= false);
883 double readDouble (const std::string
&varName
);
884 void writeDouble (const std::string
&varName
, double val
, bool bForce
= false);
885 void writeString (const std::string
&varName
, const std::string
&bVal
, bool bForce
= false);
887 // return 0 / false if not succeed
888 bool readBoolNoWarning (const std::string
&varName
);
889 sint32
readIntNoWarning (const std::string
&varName
);
890 double readDoubleNoWarning (const std::string
&varName
);
891 std::string
readString (const std::string
&varName
);
894 // NB: threshold is inverted ULandscape::setThreshold(), to be more intelligible in client.cfg
895 float getActualLandscapeThreshold() const;
897 // Return LanguageCode but if "wk", then return "en"
898 std::string
getHtmlLanguageCode() const;
900 // return a random loading tip or, if there are not, return the string in argument
901 std::string
buildLoadingString(const std::string
&ucstr
) const;
903 /// get the path to client_default.cfg including the filename itself.
904 bool getDefaultConfigLocation(std::string
& fileLocation
) const;
906 };// CClientConfig //
912 extern CClientConfig LastClientCfg
;
913 extern CClientConfig ClientCfg
;
914 extern const std::string ConfigFileName
;
916 #endif // CL_CLIENT_CFG_H
918 /* End of client_cfg.h */