Hello guys, I've been encountering a strange issue while developing a 3D game using AppGameKit and was wondering if anyone else has come across such an issue or if the AppGameKit team could shed some light on what could possible be going wrong. I've checked the forums but it doesn't look like anyone else has experienced a similar issue.
My game generates a lot of assets on the fly, for example bullets, ricochet debris, etc and I've been very careful to free every single resource I create as soon as it's no longer in use. There's never a situation where there are too many assets on screen at the same time, and even when there are I track them all and make sure they're all safely deleted.
Now when I start playing the game, all goes well but after a long while, especially in the heat of a fierce battle where there are bullets flying everywhere and debris all over, AppGameKit refuses to load anymore objects or images. The game doesn't crash, it still works like normal but every call to create a new object or image fails so you get instances of invisible bullets flying around or white HUD sprites with no texture. When I use the GetLastError() command it just returns something along the lines of "failed to load object" or "failed to load image". What I'm interested in is why?
Now I was thinking it could be some kind of memory leak but when I exit the current game session to return to menu, a function is called that frees all resources used for the game session (deletes existing images, objects,sprites, texts etc) before returning to the menu. And even when this is done, and I try to load assets for the menu I get the same issue.
What are the limits of the Images and Objects you can load? If I delete an object and load objects later on will it pick an object ID of objects previously loaded and deleted? Or does it keep incrementing till it reaches some kind of upper limit?
Help!
Here are my System Specs:
AGK Version: v2.0.20 Tier 1
Dev Platform OS: Windows 10
Processor: Intel Celeron Quad Code 1.6GHz
Graphics Card: Intel HD 1GB
RAM: 2GB