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: Moss grows into adjacent cells #33

Merged
merged 1 commit into from
Feb 2, 2025
Merged

Conversation

finger563
Copy link
Member

@finger563 finger563 commented Feb 2, 2025

Description

  • Update grid and grid component to have helper methods for getting neighboring / adjacent cells (optionally including occupied cells)
  • Remove print from growable base
  • Add growable subclass for moss BP_Moss
  • Update item datatable so moss grid item class points to new BP_Moss class
  • Update BP_Moss to disable collision of the mesh on begin play (allowing player to walk through them easily)
  • Refactor BP_Grid to have helper function for spawning a grid item by grid item class into a cell
  • Update BP_Moss to have a GrowNeighbor moss function which gets the unoccupied neighbor cells and spawns a new moss randomly within one of those cells
  • Update BP_Moss to override the OnGrowthCompleted event and to call GrowNeighborMoss after a delay (delay needed to keep growth manager from processing it)

Motivation and Context

Closes #32

⚠️ This changes C++ code so you will need to recompile before loading the project ⚠️

How has this been tested?

PIE in playground level, place one moss and skip forward a few days to watch it spread. Tested to ensure the moss is able to be taken from the grid as normal, and that those cells can be properly filled in with new moss.

Screenshots (if appropriate):

moss-propagation-compressed.mp4

image
image

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 and grid component to have helper methods for getting neighboring / adjacent cells (optionally including occupied cells)
* Remove print from growable base
* Add growable subclass for moss BP_Moss
* Update item datatable so moss grid item class points to new BP_Moss class
* Update BP_Moss to disable collision of the mesh on begin play (allowing player to walk through them easily)
* Refactor BP_Grid to have helper function for spawning a grid item by grid item class into a cell
* Update BP_Moss to have a GrowNeighbor moss function which gets the unoccupied neighbor cells and spawns a new moss randomly within one of those cells
* Update BP_Moss to override the OnGrowthCompleted event and to call GrowNeighborMoss after a delay (delay needed to keep growth manager from processing it)

Closes #32

PIE in playground level, place one moss and skip forward a few days to watch it spread. Tested to ensure the moss is able to be taken from the grid as normal, and that those cells can be properly filled in with new moss.
@finger563 finger563 self-assigned this Feb 2, 2025
@finger563 finger563 merged commit f2ad56e into main Feb 2, 2025
@finger563 finger563 deleted the feat/32-moss-spreading branch February 2, 2025 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update moss to spawn moss in adjacent unoccupied cells at the end of a growth cycle
1 participant