Skip to content

Game slow down #186

@higles

Description

@higles

I'm creating this as a bug report so we can be sure it gets fixed for certain. Currently the game slows down gradually with each generation as originally pointed out by @BIOEvolveTD. There's a number of theories around this, some of which has been debunked.

1.) Data collection storing up too much data DEBUNKED
- I've disabled data collection, and ran. Same issue occurs so this is not the issue

2.) Bullets flying off the screen maybe never getting deleted DEBUNKED
- All instances of projectiles are killed. This is done throughout the round and there is a massive wipe of them at the end of the round.
- There is no way forgotten projectiles are adding up over time.
- Slow down only occurs as the turret is firing.

3.) Dead creatures keep spewing out gametes every update. DEBUNKED
- 2 gametes are spawned just before kill body is called and after alive has been set to false.
- the update function is only ran on creatures that have alive set to true.

4.) Turret sound threads might not be properly disposed of. _PROBLEM_
- I believe someone stated that the turret sounds are now threaded processes so that we can have overlapping sound.
- We should double check and be sure that these sound threads are being deleted properly and not becoming zombie processes.
* To solve this I added 2 lines in the sounds run function.
- After play() I added a delay(2000) to allow for a max sound file of 2 seconds. (This will be changed to account for the file's length as soon as I figure out how.)
- After the delay I added the .close function call for the audio player. This actually stops the audio player and the thread can sense that it is done and delete itself.

__/* New Related Issue __/*
5.) According to some awesome inspecting by @andschwa it appears that there is still a memory leak in our midst. A brief overview of the problem is as follows.
- The leak appears to be related to the floatList.
- The largest floatList items we have are genome's/gametes but these appear to be deleted properly as at the end of each generation there is a drop in the memory used.
- The drop is never quite as much as the rise from the previous wave, hence the buildup.
- We believe this to also be some sort of render issue since the amount of extra floats isn't big enough to seem like gametes.
- It is not the data collection. This has already been tested.
For more detailed information please refer to the comments below. @andschwa has supplied plenty of documenting of his findings on this.

I think this issue would be a great place for us to collaborate and think of possible reasons this may be occuring as well as a way to communicate what we've attempted in fixing this issue. So please contribute.

Another thing to keep in mind is that this problem actually existed in master previous to the mass master merging of tuesday apr 7th. and in the 2 days previous there had been a lot of other merges to master. So looking at changes made there might be a good start to figuring out this problem.

Also making sure that the game runs for at least 15 generations without slowing down before merging to master would be a good practice from here on out.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions