an_toni.a
10/08/2024, 5:47 AMcsharp
private static GoogleSheetBuildSource[] _sheetSources =
{
new GoogleSheetBuildSource("Master sheet", "1wXKv4SPD7BZBwTRc7YfAU7oVjuWFDZZFbHZ8PKyCatM"),
};
public override IEnumerable<GameConfigBuildSource> GetAvailableGameConfigBuildSources(string sourceProperty)
{
if (sourceProperty is nameof(IdlerGameConfigBuildParameters.DefaultSource) or nameof(IdlerGameConfigBuildParameters.LiveOpsSource))
{
return _sheetSources;
}
Maybe I should just modify that to use two sources somehow normally but don't really know how yet, only started to study the builder stuff.Jurjen
10/08/2024, 5:56 AMGameConfigBuildParameters
2. Change the GameConfigEntryAttributes in your SharedGameConfig to set the optional configBuildSource parameter to the name of source that you want to use, if you don't pass anything then it will use the default one
3. Add more sheet sources to GetAvailableGameConfigBuildSources
And I think that should already workan_toni.a
10/08/2024, 6:18 AMan_toni.a
10/08/2024, 6:28 AMGetAvailableGameConfigBuildSources always return the list of all sources?
or maybe the implementation in Idler is weird with the synthesize stuff and I should switch to a normal template ..
i don't have the menu option "Metaplay/Enable Default Game Config Build Window", I guess because I already had the config builder from before, but I guess I can copy it from the SDK somewhereJurjen
10/08/2024, 6:28 AMJurjen
10/08/2024, 6:29 AMan_toni.a
10/08/2024, 6:29 AMan_toni.a
10/08/2024, 6:30 AMcsharp
public override IEnumerable<GameConfigBuildSource> GetAvailableGameConfigBuildSources(string sourceProperty)
{
if (sourceProperty is nameof(DecorsocietyGameConfigBuildParameters.DefaultSource) or nameof(DecorsocietyGameConfigBuildParameters.LiveOpsSource))
{
return _sheetSources;
}an_toni.a
10/08/2024, 6:31 AMan_toni.a
10/08/2024, 6:32 AMJurjen
10/08/2024, 6:32 AMan_toni.a
10/08/2024, 6:33 AMan_toni.a
10/08/2024, 6:34 AMhttps://pasteboard.co/ozAx6SF7VQAe.png▾
Jurjen
10/08/2024, 6:35 AMJurjen
10/08/2024, 6:36 AMmajor: 29 right?an_toni.a
10/08/2024, 6:38 AMpublic static DeploymentVersion CurrentMetaplayVersion => new DeploymentVersion(29, 2, 0, null); // add "pre" label in develop when between releases, "null" otherwisean_toni.a
10/08/2024, 6:38 AMan_toni.a
10/08/2024, 6:39 AMJurjen
10/08/2024, 6:39 AMGameConfigBuildWindow.cs exists in the unity project (should be in the metaplay unity sdk package)?an_toni.a
10/08/2024, 6:41 AMMetaplaySDK/Client/Unity/Editor/GameConfigBuildWindow.cs is there
i'm also building configs all the timeJurjen
10/08/2024, 6:41 AMan_toni.a
10/08/2024, 6:42 AMcsharp
[MenuItem("Metaplay/Game Config Build Window", false, 3)]
static void CreateWindow()
{
Type inspectorType = Type.GetType("UnityEditor.InspectorWindow,UnityEditor.dll");
GameConfigBuildWindow window = GetWindow<GameConfigBuildWindow>("GameConfig Build", desiredDockNextTo: new Type[] {inspectorType});
window.Show();
}Jurjen
10/08/2024, 6:42 AMJurjen
10/08/2024, 6:43 AMan_toni.a
10/08/2024, 6:43 AMan_toni.a
10/08/2024, 6:44 AMJurjen
10/08/2024, 6:44 AMan_toni.a
10/08/2024, 6:45 AMhttps://pasteboard.co/IZE6k2CdH4BM.png▾
Jurjen
10/08/2024, 6:46 AMGameConfigEntry.configBuildSource == LiveOpsSource?an_toni.a
10/08/2024, 6:47 AMan_toni.a
10/08/2024, 6:47 AMcsharp
[GameConfigEntry("ItalianDream", configBuildSource: nameof(DecorsocietyGameConfigBuildParameters.LiveOpsSource))]
public GameConfigLibrary<HotspotKind, HotspotInfo> Hotspots { get; set; }
`Jurjen
10/08/2024, 6:47 AMan_toni.a
10/08/2024, 6:48 AMan_toni.a
10/08/2024, 6:49 AMJurjen
10/08/2024, 6:50 AMan_toni.a
10/08/2024, 6:50 AMan_toni.a
10/08/2024, 6:50 AMan_toni.a
10/08/2024, 6:51 AMJurjen
10/08/2024, 6:51 AM[MetaSerializableDerived(1)]
public class CustomGameConfigBuildParameters : GameConfigBuildParameters
{
[MetaMember(2), MetaFormLayoutOrderHint(0), MetaValidateRequired]
public GameConfigBuildSource LiveOpsSource;
public override bool IsIncremental => false;
}
Is likely all you needan_toni.a
10/08/2024, 6:52 AMJurjen
10/08/2024, 6:52 AMIdlerGameConfigBuildJurjen
10/08/2024, 6:52 AMIdlerGameConfigBuildIntegration is the only thing you'll needJurjen
10/08/2024, 6:53 AMan_toni.a
10/08/2024, 6:55 AMJurjen
10/08/2024, 6:56 AMan_toni.a
10/08/2024, 6:57 AMan_toni.a
10/08/2024, 6:57 AMJurjen
10/08/2024, 6:58 AMJurjen
10/08/2024, 6:59 AMan_toni.a
10/08/2024, 6:59 AMan_toni.a
10/08/2024, 7:00 AMan_toni.a
10/08/2024, 7:22 AMJurjen
10/08/2024, 7:28 AMan_toni.a
10/08/2024, 7:33 AMan_toni.a
10/08/2024, 7:35 AMcsharp
[GameConfigEntry("ItalianDream", configBuildSource: nameof(DecorsocietyGameConfigBuildParameters.RoomStylerSource))]
public GameConfigLibrary<HotspotKind, HotspotInfo> Hotspots { get; set; }
for each level, i'd need to create such entries for each level that's listed in the first sheet
as the whole idea is that we can add new contests just via config
but it's nice to author the per-level data so that it's in a dedicated sheetan_toni.a
10/08/2024, 7:36 AMan_toni.a
10/08/2024, 7:37 AMJurjen
10/08/2024, 7:46 AMGameConfigLibrary<ContestKind, AggregatedDetails>. Not 100% sure off-hand what the easiest way to achieve this is, can potentially take a look later.an_toni.a
10/08/2024, 7:48 AMan_toni.a
10/08/2024, 7:53 AMan_toni.a
10/08/2024, 11:16 AMan_toni.a
10/08/2024, 11:16 AMan_toni.a
10/08/2024, 11:16 AMan_toni.a
10/09/2024, 2:08 PMan_toni.a
10/09/2024, 2:09 PMan_toni.a
10/09/2024, 2:10 PMJurjen
10/10/2024, 5:32 AMcs
public class GameConfigBuild : GameConfigBuildTemplate<SharedGameConfig>
{
protected override async Task BuildAsync(IGameConfigBuilder<SharedGameConfig> shared, IGameConfigBuilder<ServerGameConfigBase> server)
{
await base.BuildAsync(shared, server);
// modify game config here...
// shared.RawOutput
}
}Jurjen
10/10/2024, 5:34 AMSharedGameConfigBase.OnLoaded, but that's also called at runtime.Jurjen
10/10/2024, 5:38 AMcs
SpreadsheetContent MergeItems<TKey, TInfo>(VariantConfigItem<TKey, TInfo> a, VariantConfigItem<TKey, TInfo> b)
{
// left as exercise to the reader
return null;
}
ConfigEntryBuilder ItemMergeEntryBuilder<TKey, TInfo>(string entryName, string sourceName1, string sourceName2) where TInfo : class, IGameConfigData<TKey>, new()
{
IGameConfigSourceData source1 = null;
IGameConfigSourceData source2 = null;
return new ConfigEntryBuilder()
{
FetchDataAsync = () =>
{
source1 = FetchSourceData(sourceName1, BuildParametersBase.DefaultSource);
source2 = FetchSourceData(sourceName2, BuildParametersBase.DefaultSource);
return Task.CompletedTask;
},
BuildAsync = async (builder) =>
{
List<VariantConfigItem<TKey, TInfo>> items = new List<VariantConfigItem<TKey, TInfo>>();
items.AddRange(builder.ParseLibrarySheetItems<TKey, TInfo>(entryName, (SpreadsheetContent)await source1.Get()));
items.AddRange(builder.ParseLibrarySheetItems<TKey, TInfo>(entryName, (SpreadsheetContent)await source2.Get()));
builder.AssignLibraryBuildResult(entryName, MergeItems(items), null);
}
};
}
protected override ConfigEntryBuilder? GetEntryBuilder(Type configType, string entryName)
{
if (configType == typeof(SharedGameConfig) && entryName == "MyLibrary")
return ItemMergeEntryBuilder<TKey, TInfo>(entryName, "MyLibrarySheet1", "MyLibrarySheet2");
return base.GetEntryBuilder(configType, entryName);
}Jurjen
10/10/2024, 5:38 AM