-
Notifications
You must be signed in to change notification settings - Fork 12
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
Event structure #20
Comments
So each Event would contain an array of Events? I think it makes more sense to store that array in the Room, since the Room knows about the light level. Other than that this looks good to me. I think Event can extend from Resource, then each child Event could do whatever logic it wants. I imagine each Event type will load a unique type of scene with some data passed in from the Event (like Scene_Encounter, Scene_Shop, Scene_Heal, etc) |
No, only the base Each event will indeed have a unique type of scene (or multiple type of scene if we want different backgrounds depending on where we are in the tree, having different background at the bottom and at the top). |
Sorry, I'm still not really understanding. So the structure looks like this Then Event looks like this: extends Resource
class_name Event
var events: Array[Event] = [] Then the events: Array[Event] = [Event_Mob, Event_Shop, Event_Heal] Then the event is chosen based on the light level in the associated Room? What do you mean by "Each event would only be one event in itself"? |
Correct
Nope, it would be: extends Resource
class_name Event
const EVENTS_CLASSIFICATION: Array[Event] = [Event_Mob, Event_Random, Event_Shop, Event_Heal] Then at the When the game starts, the start node has a light, so the light level rises by 1 for the rooms of level 1. We check If the light was risen by 1 level again, it would become The
It was to answer your previous question "So each Event would contain an array of Events?" -> No each event would only be an event, it would not contain an array of events. Only the parent class has an array of events to tell us how to change based on the level of light. |
Okay I see what you mean now |
If it's clear enough for you, put a confirmed tag. Otherwise ask me other questions if you have them, or if you want to change something. |
Need some clarification here about the
The way we want this defined is essentially Index 0 being Light Level 1 and Index 3 being the max Level of Light? |
This array is not meant as a direct translation to light level. The way we might change depending on light level is more complex than a linear progression (because of the example I gave, where something pretty challenging like The Array in itself is in one line "IF we decide to make a change, HOW do we make this change". So to answer the question, no index 0 is not light level 1 and index 3 is not max level of light. Note that this list I gave above is not exhaustive and more events might be added in the future. You might want to read #20 (comment) again because I think that's the most detailed explanation I gave. If you want me to explain again after then i'll try to do so in a different way (like a drawing for example, it might help) |
If I'm understanding correctly that array will be subject to change once we hash out the details for light better then. I'll leave it as that array for now, feel free to light it up in the PR. A drawing would help as well! Thanks in advance. |
I will see if I have some time after reviewing PR and finishing code on my side. If not today, then tomorrow. |
Created a Draft PR with some suggested changes! Feedback is 10000% welcomed, wasn't too sure if I was picking up what Turtyo was throwing down 😅 |
Feature Description
An
Event
is a description of the content in eachRoom
. It tells us what the encounter is (mystery encounter, mob, boss, shop etc...). Depending on the type of the encounter, it gives more information, for example for mobs it gives the mobs that are in the room. For a random encounter, it gives the chosen encounter.Motivation
This would be useful to have a place to hold the data of the different encounters. We could put it directly in the room in itself, but i think it's better to have separated, since it will probably be easier to test and debug that way.
Acceptance Criteria
Event
can be modified at runtime (due to dependence to the light level)Proposed Solution
The
Event
class in itself is the parent of possible events. So we would haveEvent_mob
,Event_shop
,Event_heal
etc... as extending from theEvent
class.The event is only chosen when it enters player view (because they used a torch or just that they are next to it). The
Event
holds an array of the level depending on light value.For example if at light 0 we have a mob, at light 1 we have a random event and at light 2 we have a shop, it looks like this
[Event_mob, Event_random, Event_shop]
.Note that this doesn't mean we will necessarily have a mob at light level 0, it just explains which event you go to when light increases/decreases. We could have a random event at light 0, thus when we get to light level 1 we get a shop (because it's the next one in the list).
The choice of the event will probably be handled at map level, because it will have a global vision and can distribute events better.
Additional Context
In link with #6 and #10
The text was updated successfully, but these errors were encountered: