Remote Config
Remote Config allows you to manage various game settings on the server in real time. It enables immediate adjustments to game balance, event management, and system configurations without requiring app updates.
Key Features
- Real-time modification and application of settings
- Automatic synchronization across all clients
- Real-time game balance adjustments
- Management of events and system settings
- Support for various data types
Setup Instructions
1. Add Component
When you add the NetworkManager to the scene, the RemoteConfig component is automatically included.
2. Configure in Inspector
In the Inspector window, you can utilize the following features.
- Load: Import the current settings from the server.
- Save: Save the modified settings to the server.
- Add New Value: Add a new configuration value.
- X: Delete the selected configuration value.
Data Types
Basic Types
bool // true/false
int // 32-bit integer
uint // Unsigned 32-bit integer
int64 // 64-bit integer
uint64 // Unsigned 64-bit integer
float // Floating-point number
string // String
DateTime // Date/Time
JSON (Custom Classes)
For complex data, you can create custom classes and store them in JSON format.
Use Examples
1. Use of Basic Configuration Values
public class GameManager : MonoBehaviour
{
private void Start()
{
var config = NetworkManager.Instance.RemoteConfig;
// System configuration
bool maintenance = config.GetValue<bool>("maintenanceMode");
int maxUsers = config.GetValue<int>("maxConcurrentUsers");
float dropRate = config.GetValue<float>("rareItemDropRate");
// Player configuration
float moveSpeed = config.GetValue<float>("playerMoveSpeed");
int startHealth = config.GetValue<int>("playerStartHealth");
// Event configuration
DateTime eventEnd = config.GetValue<DateTime>("eventEndTime");
string eventMessage = config.GetValue<string>("eventMessage");
}
}
2. Use of JSON Configuration Values
// Class for spawn location info
[System.Serializable]
public class SpawnLocation
{
public float x;
public float y;
public float z;
}
// Class for monster settings
[System.Serializable]
public class MonsterSettings
{
public int health;
public float damage;
public float respawnTime;
public SpawnLocation[] spawnPoints;
}
public class MonsterManager : MonoBehaviour
{
private void Start()
{
var config = NetworkManager.Instance.RemoteConfig;
// Import single location info
var playerSpawn = config.GetValue<SpawnLocation>("defaultSpawnLocation");
transform.position = new Vector3(playerSpawn.x, playerSpawn.y, playerSpawn.z);
// Import complicated settings info
var bossSettings = config.GetValue<MonsterSettings>("bossMonsterSettings");
SetupBossMonster(bossSettings);
}
}
3. Event Time Management
public class EventManager : MonoBehaviour
{
private void Start()
{
var config = NetworkManager.Instance.RemoteConfig;
DateTime eventStart = config.GetValue<DateTime>("eventStartTime");
DateTime eventEnd = config.GetValue<DateTime>("eventEndTime");
// Check event period
bool isEventPeriod = DateTime.Now >= eventStart && DateTime.Now <= eventEnd;
// Calculate remaning time
if (isEventPeriod)
{
TimeSpan remaining = eventEnd - DateTime.Now;
Debug.Log($"Until event ends {remaining.Days}D {remaining.Hours}Hr");
}
}
}
Example of Actual Use
Game Balance Adjustments
public class BalanceManager : MonoBehaviour
{
// Manage balance values with Remote Config
private void UpdateBalance()
{
var config = NetworkManager.Instance.RemoteConfig;
GameBalance.DamageMultiplier = config.GetValue<float>("damageMultiplier");
GameBalance.ExpMultiplier = config.GetValue<float>("expMultiplier");
GameBalance.DropRateMultiplier = config.GetValue<float>("dropRateMultiplier");
GameBalance.GoldMultiplier = config.GetValue<float>("goldMultiplier");
}
}
System Status Management
public class SystemManager : MonoBehaviour
{
private void CheckSystemStatus()
{
var config = NetworkManager.Instance.RemoteConfig;
// Check server status
bool maintenance = config.GetValue<bool>("maintenanceMode");
int maxUsers = config.GetValue<int>("maxConcurrentUsers");
int latencyLimit = config.GetValue<int>("regionLatencyLimit");
if (maintenance)
{
string notice = config.GetValue<string>("maintenanceNotice");
ShowMaintenancePopup(notice);
}
}
}
Use Tips
Game Balancing
- Weapon damage, experience points, drop rates, and other balance factors
- Difficulty adjustment values
- Reward multipliers
Event Management
- Event start/end times
- Event rewards and probabilities
- Event messages
System management
- Server maintenance mode
- Concurrent user limits
- Regional settings
Content management
- NPC dialogues
- Announcements
- Tutorial settings :::
- Always use the correct data type when importing values.
- Ensure JSON data is serialized by applying the [System.Serializable] attribute.
- Do not store sensitive security information in Remote Config.
- Design your game so that core logic does not rely on Remote Config. :::