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

feat(grid): Improve editor performance #29

Merged
merged 1 commit into from
Feb 1, 2025

Conversation

finger563
Copy link
Member

Description

  • Update grid c++ code to have editor-only function to detect property changes to width/height and reinitialize the grid cells accordingly
  • Update grid cell to not have world position as member, but instead a GetWorldPosition() const method for calculating it from the grid - this ensures the grid cells do not need to be updated if the grid moves
  • Update affected grid code to use new functions
  • Update data stored for grids in the maps
  • Update BP_Grid to not adjust grid in constructor
  • Update BP_Grid to only fill attributes in beginplay

Motivation and Context

  • Fixes a bug where BP_Grid did not properly set attributes for the cells
  • Fixes performance in editor and switching between editor and PIE modes because grid could keep re-creating cells
  • Fixes performance when editing grid class or grid objects (even just moving their positions)

How has this been tested?

PIE and ensuring the various grids in the prototype_blocking and playground maps work as expected w.r.t. grid cell ground type attributes / restrictions and ability to change their actor transforms.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • New Art / Asset
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Art / Asset Update
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed.
  • My code follows the code style of this project.

* Update grid c++ code to have editor-only function to detect property changes to width/height and reinitialize the grid cells accordingly
* Update grid cell to not have world position as member, but instead a GetWorldPosition() const method for calculating it from the grid - this ensures the grid cells do not need to be updated if the grid moves
* Update affected grid code to use new functions
* Update data stored for grids in the maps
* Update BP_Grid to not adjust grid in constructor
* Update BP_Grid to only fill attributes in beginplay

* Fixes a bug where BP_Grid did not properly set attributes for the cells
* Fixes performance in editor and switching between editor and PIE modes because grid could keep re-creating cells
* Fixes performance when editing grid class or grid objects (even just moving their positions)
@finger563 finger563 self-assigned this Feb 1, 2025
@finger563 finger563 merged commit 5e73465 into main Feb 1, 2025
@finger563 finger563 deleted the feat/grid-performance-to-changes branch February 1, 2025 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant