suriyun-production / mmorpg-kit-docs

This is document for MMORPG KIT project (https://www.assetstore.unity3d.com/#!/content/110188?aid=1100lGeN)
https://suriyun-production.github.io/mmorpg-kit-docs
49 stars 11 forks source link

[Question] What takes priority between serverConfig SpawnMaps, GameDatabase MapInfos and Unity BuildSetting Scenes #2339

Closed shubhank008 closed 8 months ago

shubhank008 commented 8 months ago

Hi Suriyun,

I have many maps made and set in my GameDatabase.MapInfos Screenshot 2023-12-16 at 3 47 00 PM

but I had only a few of them/their scenes added to my build settings scene list Screenshot 2023-12-16 at 3 47 54 PM

And I had even lesser maps configured in my server's Config/serverConfig.json file

Screenshot 2023-12-16 at 3 48 35 PM

Out of these, which configuration would take priority and would not having all the maps/scenes in my build settings, that I have configured in my GameDatabase cause problem ? I always thought serverConfig's SpawnMaps take precedence even regardless of Scenes in Build Settings

insthync commented 8 months ago

Scenes in builds settings won't be modified by anything, so if you add map info to database, you still have to put the scene into scenes in builds by yourself.

Maps which being spawned by map-spawn server, can be configured in server configs, list of maps which will be spawned will be replaced by config in server configs, server config prioritized like this Command Line -> Config files -> Component data info

List of maps which will be spawn will be set in MMOServerInstance.cs (try find if (ConfigReader.ReadArgs(args, ProcessArguments.ARG_SPAWN_MAPS, out spawnMaps, defaultSpawnMaps))

shubhank008 commented 8 months ago

Scenes in builds settings won't be modified by anything, so if you add map info to database, you still have to put the scene into scenes in builds by yourself.

Maps which being spawned by map-spawn server, can be configured in server configs, list of maps which will be spawned will be replaced by config in server configs, server config prioritized like this Command Line -> Config files -> Component data info

List of maps which will be spawn will be set in MMOServerInstance.cs (try find if (ConfigReader.ReadArgs(args, ProcessArguments.ARG_SPAWN_MAPS, out spawnMaps, defaultSpawnMaps))

Got it, but just to reconfirm my exact doubt/question. Regardless of whatever scenes we have or have not in build settings or GameDatabase.MapInfos, whatever is set in serverConfig will take effect, am I right ? And only whatever is present in serverConfig.SpawnMaps need to exist in GameDatabase.MapInfos and BuildSettings and not vice versa ?

Just trying to understand for scenarios where we might have 10's of maps in our GameDatabase, but only need to keep whatever we are actively using in Build Settings (Scenes) and in serverConfig (SpawnMaps)

insthync commented 8 months ago

If you have 10 map infos in game database, 10 scenes from those map infos in scenes in build, and you set only 3 maps to spawn then it will spawns only 3 maps.

insthync commented 8 months ago

If you have 3 map infos in game database, 3 scenes from those map inofos in scenes in build, and you set 10 maps to spawn then it will spawns 10 map seevers, but 7 of them win't be able to load data and run properly .

shubhank008 commented 8 months ago

If you have 10 map infos in game database, 10 scenes from those map infos in scenes in build, and you set only 3 maps to spawn then it will spawns only 3 maps.

Thanks, this is what I wanted to confirm, together with what you said in last comment.