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: improve EnemySpawnSystem #103

Merged
merged 1 commit into from Oct 22, 2020
Merged

Conversation

jdrueckert
Copy link
Member

  • might fix a potential issue with despawning MawGooeys
  • only spawn enemies if there's less than the max number present (instead of always spawning and removing if above max)
  • spawn periodically based on elapsed time rather than game ticks (cpu-dependent)

- might fix a potential issue with despawning MawGooeys
- only spawn enemies if there's less than the max number present (instead of always spawning and removing if above max)
- spawn periodically based on elapsed time rather than game ticks (cpu-dependent)
@jdrueckert jdrueckert added the Type: Improvement Request for or addition/enhancement of a feature label Oct 20, 2020
@jdrueckert jdrueckert self-assigned this Oct 20, 2020
Copy link
Contributor

@skaldarnar skaldarnar left a comment

Choose a reason for hiding this comment

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

This changes the logic a bit - we no longer spawn new enemies in each update period, but only if there is still some space left in our queue. Cleanup of inactive enemy entities still happens, so hopefully moving to different chunks will cause a clean up and new mobs to spawn.

We may want to track more information about the mobs in the future to allow for despawning if "not gameplay relevant", and prevent despawning of "relevant" mobs (e.g., currently in a fight).

@jdrueckert jdrueckert merged commit c2912cc into develop Oct 22, 2020
@jdrueckert jdrueckert deleted the feat/improve-EnemySpawnSystem branch October 22, 2020 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Improvement Request for or addition/enhancement of a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants