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

Gamestate Loop #1515

Merged
merged 253 commits into from
Jul 9, 2023
Merged

Gamestate Loop #1515

merged 253 commits into from
Jul 9, 2023

Conversation

heinezen
Copy link
Member

@heinezen heinezen commented Jun 12, 2023

Implement the core components of the gamestate loop

  • Game entity
    • Create game entity from nyan GameEntity
    • Create components from nyan Ability
    • Initialize internal components in spawner
      • Position
      • Ownership
      • Command Queue
    • Pass animations to render entity
      • Pass std::string instead of util::Path
      • Differentiate between absolute and relative paths (see file referencing)
      • Move current animation path outside of GameEntity
  • Basic nyan API interface
    • Ability
      • Fetch properties
        • Animations
        • Sounds
        • Diplo Stances
    • Player Setup (civs)
  • Components
    • Idle
    • Live
    • Move
    • Turn
  • Activity system (New Gamestate: Drafts #1377 (comment))
    • Node graph
    • Systems
      • Idle
      • Move
    • Activity Component
    • Event Canceling

@heinezen heinezen added nice new thing ☺ A new feature that was not there before area: simulation Involved in the game mechanics and simulation big stuff High-impact changes, mainly foundation work labels Jun 12, 2023
@heinezen heinezen force-pushed the gamestate-loop branch 2 times, most recently from e5eecfd to 8ead5c1 Compare June 18, 2023 12:54
@heinezen heinezen mentioned this pull request Jun 24, 2023
13 tasks

auto test_pos = std::make_shared<component::Position>(this->loop, pos, time);

if (entity->has_component(component::component_t::MOVE)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about this code?

if (entity->has_component(component::component_t::MOVE)) {
    std::vector<coord::phys3_delta> positions = {
        {0, 1, 0},
        {1, 2, 0},
        {2, 2, 0},
        {3, 1, 0},
        {3, 0, 0},
        {2, -1, 0},
        {1, -1, 0},
        {0, 0, 0} // Assuming this is equivalent to pos
    };

    std::vector<int> angles = {
        279,
        225,
        180,
        135,
        90,
        45,
        0,
        315
    };

    for (int i = 0; i < positions.size(); i++) {
        entity_pos->set_position(time + i + 1, pos + positions[i]);
        entity_pos->set_angle(time + i + 1, coord::phys_angle_t::from_int(angles[i]));
    }
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh hey, thanks for checking out the code :D

Given that the current code is just test code and soon to be removed, it probably doesn't really matter how it looks. Your solution looks more maintainable though, so if this were an engine demo, it would be the better solution.

@heinezen heinezen added the kevin-rebuild-pl0x instruct kevin to rebuild this pull request label Jun 30, 2023
@SFTbot SFTbot removed the kevin-rebuild-pl0x instruct kevin to rebuild this pull request label Jun 30, 2023
@heinezen heinezen added the kevin-rebuild-pl0x instruct kevin to rebuild this pull request label Jul 3, 2023
@SFTbot SFTbot removed the kevin-rebuild-pl0x instruct kevin to rebuild this pull request label Jul 3, 2023
@heinezen heinezen marked this pull request as ready for review July 9, 2023 00:54
@heinezen heinezen requested a review from TheJJ July 9, 2023 00:54
@TheJJ TheJJ merged commit 526e0e6 into SFTtech:master Jul 9, 2023
12 of 13 checks passed
@heinezen heinezen mentioned this pull request Sep 8, 2023
@heinezen heinezen deleted the gamestate-loop branch October 15, 2023 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: simulation Involved in the game mechanics and simulation big stuff High-impact changes, mainly foundation work nice new thing ☺ A new feature that was not there before
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants