Original Post
I'm working on some research for a professor and am trying to solve a problem (more a limitation) that we've come across. I've got a world that exists as a 2 dimensional array. I've populated it with 8000 moth objects that "fly" about for a fixed time. The limitation is, as would be expected, that you can only have one object per cell in an array. If a moth decided to enter a cell that was alreay occupied (unless I prevented them from doing so) the object would overwrite the other object. What I'd like to do is keep the 2 dimensional array fixed, so it is always, say, 5000 by 5000. But I want the Z-axis to be dynamic. Is it possible to occupy each cell of the 2 dimensional array with a linked list? Is that the best way to go about it? I don't think it would be very efficient to use a 3 dimensional array as that still has limitations. Thanks for the help.