Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

아레나 시뮬레이션 개선 #6621

Merged
merged 4 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 51 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ Example:
- Set notifications to **Suggestion** level.

#### Code Body
- Prefer block body over expression body for functions.
- Prefer block body over expression body for functions.
- Recommend expression body for properties, indexers, and events.

```csharp
Expand All @@ -253,7 +253,7 @@ private int Add(int a, int b)
```

#### Attributes
- Separate each attribute with its own square brackets.
- Separate each attribute with its own square brackets.

### Braces Layout
- Use BSD style (default setting).
Expand All @@ -269,4 +269,52 @@ private int Add(int a, int b)
- Place field or property/indexer/event attribute on the same line

### Spaces
- Use default settings except for **Between attribute sections**, which is set to `false`.
- Use default settings except for **Between attribute sections**, which is set to `false`.

Arena simulation
---
You can simulate an ArenaBattle using the Assets/_Scenes/BattleSimulation scene in the editor.
you can config avatar spec with `Assets/StreamingAssets/avatar.json`, `Assets/StreamingAssets/avatar-enemy.json`

### avatar.json format
```json5
{
"Level": 1, // Represents the level of the avatar in the simulation
"collectionIds": [
1, // Corresponds to a specific collection ID in the CollectionSheet. Refers to collections to activate.
8 // Refer to the CollectionSheet for more details.
],
"RuneItems": [
{
"Id": 30001, // ID of the rune, as defined in the RuneListSheet
"Level": 2, // The level of the rune
"SlotIndex": 0 // Slot where the rune is equipped (0-6). If empty, only level bonuses are applied.
}
],
"CostumeIds": [
49900024 // ID of the costume to equip. Refer to the CostumeItemSheet.
],
"EquipmentItems": [
{
"Id": 10120000, // ID of the equipment item, as defined in the EquipmentItemSheet
"Level": 17, // The level of the equipment
"StatOptions": [
{
"StatType": "HP", // The type of stat (e.g., HP, ATK, etc.) from StatType Enum
"Value": 100 // The value of the stat to be applied
}
],
"SkillOptions": [
{
"Id": 800072, // ID of the skill option
"Power": 100, // The power of the skill
"Chance": 100, // The probability of skill activation (percentage)
"StatPowerRatio": 1, // Skill power ratio based on stats
"StatType": "HP" // The type of stat influencing the skill (from StatType Enum)
}
]
}
]
}

```
38 changes: 38 additions & 0 deletions nekoyume/Assets/StreamingAssets/avatar-enemy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"Level": 1,
"collectionIds": [
1,
8
],
"RuneItems": [
{
"Id": 30001,
"Level": 2,
"SlotIndex": 0
}
],
"CostumeIds": [
49900024
],
"EquipmentItems": [
{
"Id": 10120000,
"Level": 17,
"StatOptions": [
{
"StatType": "ATK",
"Value": 100
}
],
"SkillOptions": [
{
"Id": 800072,
"Power": 100,
"Chance": 100,
"StatPowerRatio": 1,
"StatType": "HP"
}
]
}
]
}
3 changes: 3 additions & 0 deletions nekoyume/Assets/StreamingAssets/avatar-enemy.json.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions nekoyume/Assets/StreamingAssets/avatar.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"Level": 1,
"collectionIds": [
1,
8
],
"RuneItems": [
{
"Id": 30001,
"Level": 2,
"SlotIndex": 0
}
],
"CostumeIds": [
49900024
],
"EquipmentItems": [
{
"Id": 10120000,
"Level": 17,
"StatOptions": [
{
"StatType": "HP",
"Value": 100
}
],
"SkillOptions": [
{
"Id": 800072,
"Power": 100,
"Chance": 100,
"StatPowerRatio": 1,
"StatType": "HP"
}
]
}
]
}
3 changes: 3 additions & 0 deletions nekoyume/Assets/StreamingAssets/avatar.json.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion nekoyume/Assets/StreamingAssets/serialized_allrune1.txt

This file was deleted.

3 changes: 0 additions & 3 deletions nekoyume/Assets/StreamingAssets/serialized_allrune1.txt.meta

This file was deleted.

1 change: 0 additions & 1 deletion nekoyume/Assets/StreamingAssets/serialized_allrune2.txt

This file was deleted.

3 changes: 0 additions & 3 deletions nekoyume/Assets/StreamingAssets/serialized_allrune2.txt.meta

This file was deleted.

1 change: 0 additions & 1 deletion nekoyume/Assets/StreamingAssets/serialized_avatar1.txt

This file was deleted.

3 changes: 0 additions & 3 deletions nekoyume/Assets/StreamingAssets/serialized_avatar1.txt.meta

This file was deleted.

1 change: 0 additions & 1 deletion nekoyume/Assets/StreamingAssets/serialized_avatar2.txt

This file was deleted.

3 changes: 0 additions & 3 deletions nekoyume/Assets/StreamingAssets/serialized_avatar2.txt.meta

This file was deleted.

1 change: 0 additions & 1 deletion nekoyume/Assets/StreamingAssets/serialized_collection1.txt

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion nekoyume/Assets/StreamingAssets/serialized_collection2.txt

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion nekoyume/Assets/StreamingAssets/serialized_inventory1.txt

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion nekoyume/Assets/StreamingAssets/serialized_inventory2.txt

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion nekoyume/Assets/StreamingAssets/serialized_runeslot1.txt

This file was deleted.

3 changes: 0 additions & 3 deletions nekoyume/Assets/StreamingAssets/serialized_runeslot1.txt.meta

This file was deleted.

1 change: 0 additions & 1 deletion nekoyume/Assets/StreamingAssets/serialized_runeslot2.txt

This file was deleted.

3 changes: 0 additions & 3 deletions nekoyume/Assets/StreamingAssets/serialized_runeslot2.txt.meta

This file was deleted.

6 changes: 0 additions & 6 deletions nekoyume/Assets/_Scripts/Editor/TestArena.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,16 @@
using Cysharp.Threading.Tasks;
using Libplanet.Crypto;
using Nekoyume;
using Nekoyume.Blockchain;
using Nekoyume.Editor;
using Nekoyume.Game;
using Nekoyume.Game.Battle;
using Nekoyume.Game.Character;
using Nekoyume.Game.Controller;
using Nekoyume.Game.Util;
using Nekoyume.Game.VFX.Skill;
using Nekoyume.Helper;
using Nekoyume.L10n;
using Nekoyume.Model;
using Nekoyume.Model.BattleStatus.Arena;
using Nekoyume.Model.Item;
using Nekoyume.Model.Skill;
using Nekoyume.UI;
using UniRx;
using UnityEngine;
using ArenaCharacter = Nekoyume.Model.ArenaCharacter;
Expand Down Expand Up @@ -418,4 +413,3 @@ public IEnumerator CoShatterStrike(ArenaCharacter caster, IEnumerable<ArenaSkill
}
}
}

8 changes: 3 additions & 5 deletions nekoyume/Assets/_Scripts/Editor/TestArenaCharacter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@
using Nekoyume.Game;
using Nekoyume.Game.Character;
using Nekoyume.Game.Controller;
using Nekoyume.Game.VFX;
using Nekoyume.Model.BattleStatus.Arena;
using Nekoyume.UI;
using UnityEngine;
using Nekoyume.Model.Skill;
using Nekoyume.Model.Elemental;
using Nekoyume.Model.Item;
using UnityEngine.Serialization;

namespace Nekoyume.Editor
{
Expand Down Expand Up @@ -103,7 +101,7 @@ public void Init(
_equipments.Clear();
_equipments.AddRange(digest.Equipments);
_target = target;
appearance.Set(digest, avatarAddress, Animator, _hudContainer);
appearance.Set(digest, avatarAddress, Animator, _hudContainer, TestArena.Instance.TableSheets);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TestArena.Instance.TableSheets
라는 프로퍼티를 갖는게 의미있는 상태인지 모르겠습니다. 테스트 씬에서만 아래 필드의 객체를 갈아끼울 순 없을까요?
Game.instance.TableSheets;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Game.Instance.TableSheets를 갈아끼도록 처리하려면 내부에서 심볼을 다시 사용해야할것 같은데 좋은 방법이 아닌것 같습니다. 혹시 다른 좋은 생각이 있으실까요?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 씬관리하는 객체가 존재함
  • 해당 객체에서 테스트씬인지 체크가 가능하다면 인자 추가를 안하고 처리 가능할듯
  • 가능하면 테이블 시트 자체를 별도 싱글톤으로 처리하는게 베스트

}

public void Spawn(Model.ArenaCharacter model)
Expand All @@ -128,7 +126,7 @@ public void Spawn(Model.ArenaCharacter model)
public void UpdateStatusUI()
{
_hudContainer.UpdatePosition(ActionCamera.instance.Cam, gameObject, HUDOffset);
arenaBattle.UpdateStatus(CharacterModel.IsEnemy, _currentHp, CharacterModel.HP, CharacterModel.Buffs);
arenaBattle.UpdateStatus(CharacterModel.IsEnemy, _currentHp, CharacterModel.HP, CharacterModel.Buffs, TestArena.Instance.TableSheets, false);
UpdateBuffVfx();
}

Expand Down Expand Up @@ -256,7 +254,7 @@ private IEnumerator CoExecuteAction()
}
}

yield return new WaitForSeconds(StageConfig.instance.actionDelay);
yield return new WaitForSeconds(0.5f);
if (_runningAction != null)
{
yield return StartCoroutine(TestArena.Instance.CoSkill(_runningAction));
Expand Down
Loading