meisei4 / yakuzaishi

1 stars 0 forks source link

State Transitions: its more than just Startup and Update scheduling #3

Open meisei4 opened 2 weeks ago

meisei4 commented 2 weeks ago

You need to introduce the following states:

#[derive(States, Debug, Clone, PartialEq, Eq, Hash)]
pub enum GameState {
    Load,
    Run,
    Pause,
}

but they must integrate with Plugins (https://bevy-cheatbook.github.io/programming/plugins.html)

So the idea is introduce these states as a way to properly structure the states of the game.

This will hopefully fix the issue of Resource loading during "Startup" schedule of system adding.

Where there will be much more concrete state transitions between each Startup System. Including WAIT/Yield flags that allow for asset_server to FINISH loading the god damn contents of an asset (BEYOND JUST THE HANDLE/POINTER), before the next system tries to access it.

meisei4 commented 2 weeks ago

god i suck at programming. will keep reference to the following discord threads that have the same issue, as a way to figure out why so many people run into this issue like i have.

https://discord.com/channels/691052431525675048/1165973447659245648/1165973447659245648 https://discord.com/channels/691052431525675048/1165973447659245648 https://discord.com/channels/691052431525675048/1146060361657757767 https://discord.com/channels/691052431525675048/1096450974438146118 https://discord.com/channels/691052431525675048/1087865793150193756

Its definitely a design flaw... When someone starts writing multi-system game that doesn't even have States (https://bevy-cheatbook.github.io/programming/states.html) yet and just relies on the main-scheduler: https://bevy-cheatbook.github.io/programming/schedules.html#the-main-schedule

i.e. i am dumb or ECS also needs some more god damn letters in its acronym (State and Resource specifically E(r)CS(s) or some shit)

meisei4 commented 2 weeks ago

feeling good about https://github.com/meisei4/yakuzaishi/commit/7d78e25a80fcdcc7d8730e6fb98533f1e863b107 progress on basic State introduction.

Will update this ticket when I feel the need to add anything to State fundamentals.

P.S. from now on ECS to me is ECRSS...

ECRSS being: Entity. Component. Resource. System. State. <--- The actual core fundamental concepts.

From my understanding you cannot reduce Resources into Entities. Nor can you reduce State into a System (infact i would argue that System should be reduced into just a "Running State". but its all semantics, so i cant really argue i guess