-
Notifications
You must be signed in to change notification settings - Fork 2
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
CsvSpawner - fix spawning when the terrain is included #102
Open
w-czerski
wants to merge
35
commits into
main
Choose a base branch
from
wc/terrain_notify_update
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
…ick call | general clean up Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
…rrains available Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
…nning simulation Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
496fa39
to
3871fac
Compare
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
…ibility of the button based on is terrain available Signed-off-by: Wojciech Czerski <[email protected]>
… is active for both (with terrain and without) Signed-off-by: Wojciech Czerski <[email protected]>
…avted button Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Also please note, that solution in editor Reflcet of Enums TerrainChangedDataMask is a dirty hack. I couldnt manage o3de to work with |
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
Signed-off-by: Wojciech Czerski <[email protected]>
patrykantosz
approved these changes
Jan 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few minor comments.
Gems/CsvSpawner/Code/Source/CsvSpawner/CsvSpawnerEditorComponent.cpp
Outdated
Show resolved
Hide resolved
Gems/CsvSpawner/Code/Source/CsvSpawner/CsvSpawnerEditorComponent.h
Outdated
Show resolved
Hide resolved
...pawner/Code/Source/CsvSpawner/EditorConfigurations/CsvSpawnerEditorTerrainSettingsConfig.cpp
Outdated
Show resolved
Hide resolved
...vSpawner/Code/Source/CsvSpawner/EditorConfigurations/CsvSpawnerEditorTerrainSettingsConfig.h
Outdated
Show resolved
Hide resolved
Signed-off-by: Wojciech Czerski <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
About:
This PR introduces improvement to the
CsvSpawner
.❌ Removed frame skipping and counting
✅ Rely on built in Bus Notifies in
AzFramework::Terrain
Entities are spawned based on Terrain availability.
If not available- call
SpawnEntities()
in first available frame (like it was done before).OnTerrainCreateEnd()
,otherwise queue spawn on activation.
OnTerrainDataChanged()
, otherwise queue spawn on activation.Editor has dedicated masks to filter important updates, that indicate is terrain created properly - so call happens only once.
Why use different events?
OnTerrainCreateEnd()
- notifies when Terrain is Activated, launched at finish.OnTerrainDataChanged
- notifies every time when Terrain Data has changed inside Tick.Terrain is being initiated not only in
Activate()
, butOnTick()
. This generates some problems while being in Editor.Since physics don't work the same way as in game mode, editor needs another approach. It is possible to filter every Terrain updates with masks (flags), and
SpawnEntities()
when Terrain is ready.Features (in Editor)
SpawnOnTerrainUpdate
enabled and specify which updates should trigger entity spawning.Example