I have searched in the forums about this without success... Is there a limit of objects spawned?
Said in other words, when a new object is created, each one receive a UID... What is the limit of those UID?
My question goes because I am working on a Tower Defense Game, and while testing, it came a time (after 49 waves) that the game preview on I.E. crashed without notice.
At first glance, it seems to me that the number of allowed UID reached the upper limit, which does not surprise me as a Tower Defense Game spawns a LOT of bullets!
So, such a limit exists?
Develop games in your browser. Powerful, performant & highly capable.
There is no limit.
However you are limited on how many objects can exist at one time, but that depends on the individual pc.
The uid is merely an index given to each new instance when it is created.
But, if the index is stored somewhere in memory, it must have a limit...
Anyway, I will try to test it several times to find out if the crash is always at the same wave...
You have two limits:
1. Integer: I guess UID is an integer so you can get theoretical 2.147.483.647 different UIDs.
2. Memory: Your PC or mobile device will run out of memory long time before the integer limit <img src="smileys/smiley2.gif" border="0" align="middle" />
The maximum UID is 9007199254740992. You would have to create 1 million objects per second for 285 years to get close to the limit.
Most crashes are caused by buggy graphics card drivers. Try checking they're up to date.
one hundred ninety-nine billion,
two hundred fifty-four million,
seven hundred forty thousand,
nine hundred and ninety-two
I think you'll be fine!
Not enough UIDs.