You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes, fish should prefer to swim near other fish.
Make a git branch for the school algorithm, in case it stinks.
Include original algorithm as an option for how to generate some tweets. There will be multiple algorithms, with one of the algorithms chosen randomly for each tweet.
Two variables to experiment with artistically:
Ratio of cell height to cell width.
Power to which you raise the inverse distance.
Ratio of cell height to cell width.
When calculating distances with Pythagorean Theorem, treat cells as if they're taller than they are wide. Experiment with ratios like 1.5:1, 2:1, 3:1, 4:1. That should make the proximity placement algorithm more likely to make fish clump into short wide ovals instead of circles. Real schools of fish are short wide ovals.
Power to which you raise the inverse distance.
The inverse of the distance between candidate cell and occupied cell is the base score for the candidate cell. Raise that score to a power of 2 or 3 or 4, or maybe even 2.75, to change how drastically different the probabilities are for close vs far cells. The variable is the exponent to which you raise the inverse of the distance.
d = distance
n = exponent
s = score
s = 1/(d^n)
Cells with higher scores are more likely to receive the next fish placement.
How to make actual schools of fish algorithmically. Fish prefer to be close to other fish. That's why they form schools. Imitate that behavior, but with enough randomness to be unpredictable and interesting.
Start with an XY coordinate system for sprite placement (visually tweak with occasional random small spaces at the end of the process).
Randomly choose a number of fish to be in the school, all of the same type.
Randomly place the first fish.
Iterate through the remaining fish, placing each one.
To place the next fish in the school:
Iterate through all empty cells. These are the candidate cells for the next fish placement. For each candidate cell:
Iterate through all fish already placed in the school. For each fish, calculate the distance between the fish and the candidate cell. Raise the distance to the variable power (see above) and invert it (1/x) and add that result to the candidate cell's score. The lesser the distance, the greater the proximity score.
When the proximity scores for all candidate cells are calculated, choose a random candidate cell in a way that gives weight for each cell equal to that cell's score.
Place a fish in the weighted-randomly-selected cell.
The text was updated successfully, but these errors were encountered:
Sometimes, fish should prefer to swim near other fish.
Make a git branch for the school algorithm, in case it stinks.
Include original algorithm as an option for how to generate some tweets. There will be multiple algorithms, with one of the algorithms chosen randomly for each tweet.
Two variables to experiment with artistically:
Ratio of cell height to cell width.
When calculating distances with Pythagorean Theorem, treat cells as if they're taller than they are wide. Experiment with ratios like 1.5:1, 2:1, 3:1, 4:1. That should make the proximity placement algorithm more likely to make fish clump into short wide ovals instead of circles. Real schools of fish are short wide ovals.
Power to which you raise the inverse distance.
The inverse of the distance between candidate cell and occupied cell is the base score for the candidate cell. Raise that score to a power of 2 or 3 or 4, or maybe even 2.75, to change how drastically different the probabilities are for close vs far cells. The variable is the exponent to which you raise the inverse of the distance.
d = distance
n = exponent
s = score
s = 1/(d^n)
Cells with higher scores are more likely to receive the next fish placement.
How to make actual schools of fish algorithmically. Fish prefer to be close to other fish. That's why they form schools. Imitate that behavior, but with enough randomness to be unpredictable and interesting.
The text was updated successfully, but these errors were encountered: