I apologize if this is the wrong forum, but I have a somewhat broad question and I wasn’t sure where to put it. If a mod knows of a better place, by all means, send it there.
I’m trying to make a cellular automaton in Unity. To do that, I need to be able to make a grid of variable size (x number of columns, y number of rows) where each box or “cell” within those has things happen to it over increments of time. So I need each cell to act as an independent unit with some function running on that specific cell (that same function is applied to all cells simultaneously).
Additionally, cellular automata involve something called a “neighborhood,” which is the set of cells surrounding a single cell (the size of the neighborhood varies). Therefore, I need a way for each single cell to be able to reference some arbitrarily specified range of cells around it and gather information about them.
In addition to this, in some cellular automata, the things being studied (or, the stuff inside the cells) actually move around. One example is a number of gas molecules with a gravitational force upon them (they will trend down towards the bottom of the grid). Thus I need a way to have the contents of a cell actually move from one cell to another (with the necessity of being able to recognize if a cell is already “filled” or not, at which point that cell is unavailable for movement).
Another concern: this needs to be large. Some cellular automata have thousands and thousands of cells on a grid, each one independently iterating some simple set of rules. I’m currently using one designed for DOS (I have to use DOSBox for it to even run on my Windows 7 PC), and I regularly use a 2500-cell grid. I’d actually prefer to use a 10k-cell grid or larger, but it’s too slow to be very effective for rapid simulations.
I have only just begun looking at the different grid systems people have used in Unity, but I’m not aware of any that allow all of these different things. I know some, for example, simply create a bunch of cubes aligned in a grid, but I don’t know how speedy that would be for 10,000 or more of them.
Does anyone have any suggestions for where to start? Many thanks.