๊ฐ•์˜

๋ฉ˜ํ† ๋ง

๋กœ๋“œ๋งต

Latter part unfinished (no plans for completion) [Unity] How to make a turn-based tactics game + How to create a unique, easy, and cool game architecture. Currently demonstrating scalability and reusability while adding content features.

This is an incomplete course where the latter parts of the curriculum have not been covered. However, the core content for prototyping and advanced sections is included. (Please refer to the announcement for further details.) ---------------------------------------- How to Implement a Turn-Based Tactics Game Part 1, 2 -> Basic features, basic combat loop (the core framework) As the assets available to me increased and the list of things I wanted to update grew, you can think of this as a guide for rapid prototyping. Based on the content covered in these two parts, you can infer how the updated (and future) features will be implemented. ---------------------------------------------------------- Updates -> Deepening and enriching the content built in Parts 1 and 2 cf -> Useful content for game development in this genre + alpha

(5.0) 1 reviews

41 learners

Level Intermediate

Course period Unlimited

C#
C#
Unity
Unity
Architecture
Architecture
C#
C#
Unity
Unity
Architecture
Architecture
nyangzzalholder๋‹˜์˜ ํ”„๋กœํ•„ ์ด๋ฏธ์ง€

๏ฝฅ

Edited

Finally, even advanced items are starting to appear.

Design and implementation for reactive states are starting. (We will also cover common common contents in between #Advanced# <- Only those that are attached to this)

It uses the IEnumerator event, which allows you to perform operations in a set order no matter when you subscribe to it.

(In fact, it's the same as what we did in previous classes) It's a method of using additional IEnumerators by grouping them by priority and category and sorting them in a Consecutive and Parallel manner.

However, it may take some time to get used to the event subscription cancellation pattern at first.

Don't you want to try those states? If they are implemented, you can add a lot of strategy to the tactics game you make.

Those + you will now be able to implement and add similar things enough,

System change? It's added after development (I think it's a consistent context).

+After following all of that, you can now apply the IEnumerator event to most other projects with great excitement.

I think it might be possible.

Part 1,2 also perfectly controls the timing of events by IEnumeratorizing the events (in the order of subscription) <- This is also really good. And it's easy.

But this is one level higher, not depending on the subscription order, but automatically proceeding in a predetermined order + same categories at the same time!

๐ŸŽฏ Func A true innovation in the priority system

๐Ÿ“Š Legacy System vs. Improved System

๐Ÿ’ก Structure and limitations of existing systems

Existing: Subscription order dependent method

csharp

 public event Func OnDamageEvent; // ๊ตฌ๋…ํ•˜๋Š” ์ˆœ์„œ๊ฐ€ ์‹คํ–‰ ์ˆœ์„œ๋ฅผ ๊ฒฐ์ • OnDamageEvent += ProcessDamage; // 1๋ฒˆ์งธ ์‹คํ–‰ OnDamageEvent += PlayAnimation; // 2๋ฒˆ์งธ ์‹คํ–‰ OnDamageEvent += CheckDeath; // 3๋ฒˆ์งธ ์‹คํ–‰ // ์‹คํ–‰ yield return this.ConsecutiveAll(OnDamageEvent.GetInvocationList() .Cast  >() .Select(handler => handler()));

Problem:

  • Determine execution order based on subscription order

  • Depends on code location or initialization order

  • Difficulty controlling order in complex interactions

  • Unpredictable execution order in dynamic subscriptions

๐Ÿš€ Innovation of the improved system

๐Ÿ’Ž Custom attribute-based priority control

Innovation: Declarative Priority Management

csharp

 public event Func OnDamageEvent; // ๊ตฌ๋… ์ˆœ์„œ์™€ ๋ฌด๊ด€ํ•˜๊ฒŒ ์šฐ์„ ์ˆœ์œ„๋กœ ์‹คํ–‰ [EventPriority(1, "Damage")] IEnumerator ProcessDamage() { } [EventPriority(3, "Death")] IEnumerator CheckDeath() { } [EventPriority(2, "Animation")] IEnumerator PlayAnimation() { } // ๊ตฌ๋… ์ˆœ์„œ๊ฐ€ ๋ฐ”๋€Œ์–ด๋„ ์‹คํ–‰ ์ˆœ์„œ๋Š” ํ•ญ์ƒ ๋™์ผ OnDamageEvent += CheckDeath; // ๋Šฆ๊ฒŒ ๊ตฌ๋…ํ•ด๋„ OnDamageEvent += ProcessDamage; // 1๋ฒˆ์งธ ์‹คํ–‰ OnDamageEvent += PlayAnimation; // 2๋ฒˆ์งธ ์‹คํ–‰ // 3๋ฒˆ์งธ ์‹คํ–‰

๐ŸŒŸ The Real Value of This Innovation

๐ŸŽฎ Power in complex game scenarios

Scenario: Combat with Chain Reaction

csharp

 // ๊ธฐ์กด ๋ฐฉ์‹: ๊ตฌ๋… ์ˆœ์„œ์— ๋ฏผ๊ฐ OnAttackEvent += ProcessDamage; // ๋จผ์ € ๊ตฌ๋…ํ•˜๋ฉด ๋จผ์ € ์‹คํ–‰ OnAttackEvent += TriggerCounter; // ๋ฐ˜๊ฒฉ์ด ํ”ผํ•ด๋ณด๋‹ค ๋Šฆ๊ฒŒ ์ฒ˜๋ฆฌ OnAttackEvent += CheckDeath; // ์ฃฝ์Œ ์ฒดํฌ OnAttackEvent += PlayAnimation; // ์• ๋‹ˆ๋ฉ”์ด์…˜ // ๋ฌธ์ œ: ์ดˆ๊ธฐํ™” ์ˆœ์„œ๋‚˜ ๋™์  ๊ตฌ๋…์— ๋”ฐ๋ผ ์‹คํ–‰ ์ˆœ์„œ ๋ณ€๊ฒฝ ๊ฐ€๋Šฅ

Improved approach: Ensuring clear ordering with attributes

csharp

 [EventPriority(1, "PreProcess")] IEnumerator CalculateDamage() { } [EventPriority(2, "Damage")] IEnumerator ApplyDamage() { } [EventPriority(2, "Counter")] // ํ”ผํ•ด์™€ ๋™์‹œ์— ๋ฐ˜๊ฒฉ IEnumerator TriggerCounter() { } [EventPriority(3, "PostProcess")] IEnumerator CheckDeath() { } [EventPriority(4, "Visual")] IEnumerator PlayAnimation() { } // ์–ธ์ œ ๊ตฌ๋…ํ•˜๋“ , ์–ด๋–ค ์ˆœ์„œ๋กœ ๊ตฌ๋…ํ•˜๋“  ์‹คํ–‰ ์ˆœ์„œ ๋™์ผ

๐Ÿ’ก Innovation in category-based parallel processing

Same priority, different categories = parallel execution

Comment