WienerWiener
  • Introduction
  • Comparison
  • Pricing
  • FAQ
  • Use Cases
  • License
  • Unity Asset vs Standalone
  • Obfuscation & Tamper Detection
  • Mismatch Detection & Debug
  • Localization
  • Versioning
  • Google Sheets Input
  • Excel
  • YAML
  • Settings
  • Data Format
  • Convert
  • ValueOnly Format
  • Startup
  • Samples
  • Converter
  • YAML Editor
  • Setting Editor
  • 日本語
  • English
  • Introduction
  • Comparison
  • Pricing
  • FAQ
  • Use Cases
  • License
  • Unity Asset vs Standalone
  • Obfuscation & Tamper Detection
  • Mismatch Detection & Debug
  • Localization
  • Versioning
  • Google Sheets Input
  • Excel
  • YAML
  • Settings
  • Data Format
  • Convert
  • ValueOnly Format
  • Startup
  • Samples
  • Converter
  • YAML Editor
  • Setting Editor
  • 日本語
  • English
  • Samples

    • Samples
    • Convert the 2.2-Million-Cell Sample Data
    • Create the Item Master
    • Experience Hot Reload
    • Create the Unit Master
    • Create the Reward Master
    • Create the Equipment Master
    • Try Localization
    • Add Keys to Existing YAML

Create the Unit Master

Preparation Before Starting the Sample

  • Unity Startup is complete
  • Create the Item Master is complete

Overview

This sample covers the following:

  • Check IDs with Validate.KeyExist
  • Create DictionaryList-format Static Game Data

Unit Master Format

  • id(int) ID
  • name(string) Name
  • hp(int) HP
  • attack(int) Attack
  • defense(int) Defense
  • magic(int) Magic
  • growth_pattern_id(int) Growth pattern ID

Unit Growth Master Format

  • growth_pattern_id(int) Growth pattern ID
  • level(byte) Level
  • hp_ratio(int) HP ratio
  • attack_ratio(int) Attack ratio
  • defense_ratio(int) Defense ratio
  • magic_ratio(int) Magic ratio

Steps:

  1. Create the Excel data files
  2. Create YAML
  3. Convert
  4. Runtime check
  5. Check an ID mismatch error

Create the Excel Data Files

Assets/Wiener/Data/excel/Unit/Unit.xlsx
Assets/Wiener/Data/excel/Unit/UnitGrowth.xlsx

Assets
+-- Wiener
    +-- Data
        +-- client
        +-- excel
            +-- Const
            +-- Item
            +-- Unit
            |   +-- Unit.xlsx
            |   +-- UnitGrowth.xlsx
            +-- EnumBase.xlsx

Unit.xlsx

Image from alias

int	string	int	int	int	int	int
id	name	hp	attack	defense	magic	growth_pattern_id
1000000001	Hero	1000	800	800	600	1200000001
1000000002	Skilled Warrior	800	600	600	400	1200000001
1000000003	Heroine	500	200	400	800	1200000002
1000000004	Villager A	400	300	200	50	1200000002
1000000005	Soldier King	900	800	700	100	1200000001

UnitGrowth.xlsx

Image from alias

int	int	int	int	int	int
growth_pattern_id	level	hp_ratio	attack_ratio	defense_ratio	magic_ratio
1200000001	1	1000	1000	1000	1000
1200000001	2	2000	2000	2000	2000
1200000001	3	3000	3000	3000	3000
1200000001	4	4000	4000	4000	4000
1200000001	5	5000	5000	5000	5000
1200000001	6	6000	6000	6000	6000
1200000001	7	7000	7000	7000	7000
1200000001	8	8000	8000	8000	8000
1200000001	9	9000	9000	9000	9000
1200000001	10	10000	10000	10000	10000
1200000002	1	1000	1000	1000	1000
1200000002	2	1700	1700	1700	1700
1200000002	3	2400	2400	2400	2400
1200000002	4	3100	3100	3100	3100
1200000002	5	3800	3800	3800	3800
1200000002	6	5000	5000	5000	5000
1200000002	7	6200	6200	6200	6200
1200000002	8	7400	7400	7400	7400
1200000002	9	8600	8600	8600	8600
1200000002	10	10000	10000	10000	10000

Create YAML

Create YAML files with YamlEditor.

Open YamlEditor

Select Tools > Wiener > Open Yaml Editor to open YamlEditor.

Image from alias

Create the unit Folder

Right-click the yaml folder in the left tree and select Create Folder, then create the unit folder.

Image from alias

Create unit.yaml

Right-click the unit folder in the left tree and select Create From Input, then load it from Excel or Google Sheets in the same way as the item master.

Image from alias

Confirm unit.yaml Was Created

Image from alias

Create unit_growth.yaml

Create unit_growth.yaml from UnitGrowth.xlsx using the same steps as unit.yaml.

Image from alias

Edit YAML

unit.yaml

Change header.container_type to WienerDictionary.

Image from alias

Enable fields.validate.key_exist to check that growth_pattern_id exists in unit_growth.yaml.
Because 0 is treated as an invalid value, add it to ignores and press the Save button.

Image from alias

unit_growth.yaml

Because growth_pattern_id is a group ID, change container_type to WienerDictionaryList and press the Save button.

Image from alias

Convert

Open Converter

Select Tools > Wiener > Open Converter to open Converter.

Image from alias

Run Conversion

Press Run Develop to run conversion and confirm that no errors occur.

Image from alias

Runtime Check

Create the following Sample.cs script, attach it to the scene, and confirm that logs are output correctly.

Sample.cs

using System.Linq;
using UnityEngine;
using Wiener;

public class Sample : MonoBehaviour
{
    void Start()
    {
        var wm = new WienerManager();
        var textAsset = Resources.Load("basic") as TextAsset;
        var result = wm.LoadBasicPack(textAsset.bytes);
        if (result != Result.Success)
        {
            Debug.LogError($"Failed to load basic pack: {result}");
            return;
        }

        OutputUnit(wm, 4);
    }

    void OutputUnit(WienerManager wm, int level)
    {
        foreach (var unit in wm.Unit.Values)
        {
            if (!wm.UnitGrowth.TryGetValue(unit.GrowthPatternId, out var growths))
                continue;

            var growth = growths.FirstOrDefault(x => x.Level == level);
            if (growth == null)
                continue;

            var attack = unit.Attack * growth.AttackRatio / 10000;
            var defense = unit.Defense * growth.DefenseRatio / 10000;
            Debug.Log($"Id: {unit.Id}, Name: {unit.Name}, Attack: {attack}, Defense: {defense}");
        }
    }
}

Result

Image from alias

Check an ID Mismatch Error

Excel Setting

Set growth_pattern_id in Unit.xlsx to an ID that does not exist.

Image from alias

Detect the Error During Conversion

Run conversion and confirm that the target Excel file, sheet, cell, and data are output in the error message.

Image from alias

Last Updated:: 6/14/26, 1:03 PM
Contributors: artisan-sawasaka
Prev
Experience Hot Reload
Next
Create the Reward Master