大量のイベントフラグをレベルを跨いで管理・保持する方法

タイトルの通り、大量のイベントフラグをレベルを跨いで管理・保持する方法について質問させていただきます。

この質問をするに至った経緯といたしましては、

1.条件によって発生するイベントをゲーム中で大量に用意したい
2.変数の値によって特定のイベントの発生をさせるかさせないか、もしくは既にイベントを終えているか
判定したい
3.レベル遷移をしてもフラグの状態を保持したいので、イベントの発生を管理する変数をGame Instance で管理すればいい
4.しかしながら、下の画像の調子で何の捻りもなくそれぞれのイベントを管理する変数を追加していくと、数十個ものイベントを管理するとなった時に明らかに不便すぎる。

GIS_Novel 2024_04_30 23_59_54

このような流れで考えていきましたが、自分ではいい方法が思い浮かばなかったので今に至ります。
大量の値を管理する方法としてデータテーブルなども考えましたが、データテーブル内の値を外から
セットできないとのことなので断念しました。

その上で私が知りたいこととしては、こういったレベル間を跨いで大量の変数を管理する際のより良い方法、もしくは全く違うアプローチで大量のイベントのフラグを上手く管理する方法です。

どうぞよろしくお願い致します。

This is what I think the user above is saying (with my rudimentary knowledge of japanese):

Title: A way to manage/store/retain a large amount of Event Flag spanning across levels.

As the title says, I would like to ask a question about managing/storing/retaining a large amount of Event Flags spanning across levels.

The sequence of events that led to this question is the following:

  1. During the game I would like to have a large amount of events triggered by certain conditions
  2. I would like to decide if a specific event is triggered or not based on the value of some variable, or to use them to check if the event is already over
  3. Since I want to preserve the state of these variables across the changing of levels, I think it would be appropriate to manage said variables using a Game Instance
  4. However, if I do it just by keeping adding those variables as you see in the attached image below, when it reach several dozens of events it becomes apparent it’s an awful way to manage it.

That was my thought process, but since I couldn’t find a nice solution to this I’m asking to you guys.
I had also thought about using a Data Table to manage the large amount of variables, but since you can’t change the data value from the outside, I gave up on that approach.

Therefore what I would like to ask is if there is a better way to handle a large amount of variables spanning across levels, or if there is a completely different approach to properly manage a large amount of Event Flags.

Thank you for your help.

1 Like

@manakamanaka 上の動画が答えになるのかどうか分からないけど調べてみる値があるかもと思います
I don’t know if the video above answers the question, but it might be worth checking it out.