Skip to main content
GameDev.net gamedev.net
🔒 Locked

Amoeba physics

Started by ChesStrategy Dec 29, 2008 at 9:36 PM 1 replies 2.6k views
Original Post
ChesStrategy
ChesStrategy
Hi all, Im currently trying to create a game related to biology, and Im having a hard time grasping both the concepts and a way of implementing the movement of an amoeba. The more I think about it, the more I believe I'm going to have to teach myself some fluid dynamics, if I want a fairly accurate portrayal of amoeba movement. But I just wanted to see (as a last hope) if I can get by with some cheap trick or acceptable approximation and imitation. To set the stage (and if its pertinent), I'm planning on using C/C++ with OpenGL; The game will be 2D as this reduces some of the complexity of the implementation and coding. However, feel free to give advice relating to 2D or 3D amoeba/blob movement as I might consider 3D later in the future (plus, its good to know, right?) So far my understanding is around this point: In the simplest case: 1D, an amoeba is like the ole' simple snake game. If we keep its fluid volume constant and represent its fluid with pixels or "blocks", when it moves, we simply add one block in the direction it moves, and subtract one from its conceptual "end/back". However, as soon as we introduce another dimension, it becomes much more complicated. Ideally, when it moves in a certain direction, we want to subtract/drain fluid from a point inside the amoeba where the point is in the opposite direction from the amoeba's movement and where the point is the farthest away. However, in situations where the amoeba's orientation and state is complex (think of a paint splat)... we take fluid "away" from the farthest appendage, right? (which might not be a point directly opposite from the direction of travel) (as you can see my understanding of fluid dynamics is close to nil). here is a video similar to what Im trying to achieve:
leiavoia
leiavoia
Just thinking in ASCII -

Perhaps represent the amoeba as a collection of circles that expand and contract and change position a bit ("jossle" or "shimy" more like it). When it moves, you move a small (deflated) circle in the general direction you want to move into, then "inflate" it while equally deflating one of the "rear" circles. Having a small handfull of circles would give the general idea of a "moving blob". You only draw the perimiter of the circle collection, of course. You would also need a way to blend the edges together using some kind of "rubber band" outline that wraps the collection.

Another (more realistic) way is to use a closed spline curve. All you need to do then is keep the points that define the curve somewhat equally spaced to give the general impression of amoebaness. When the points move, the curve wobbles visually.

Going even further with the spline idea, i'd give a shot at this [lookey! i make you a picture!]:



Here there's a main circle and smaller circles. I'd put the small circles equally spaced around the main circle. Then put spline points anywhere inside the little circles. Then spline the points.

You could deform the main circle to imply general direction and then circulate the points inside the little circles. In fact, i'll bet simply rotating the spline points inside the smaller circles at a regular speed would give a pretty convincing blob movement. You're giving me ideas; stop that!

it would obviously be up to you to write the math to keep the internal area the same. But unless you are writing a simulator, you shouldn't be doing that.
h4tt3n
h4tt3n
Quote:
Original post by ChesStrategy
... Ideally, when it moves in a certain direction, we want to subtract/drain fluid from a point inside the amoeba where the point is in the opposite direction from the amoeba's movement and where the point is the farthest away.


Is this how amoeba moves around? In the video it appears to move due to small vibrating hairs.

Anyway, Ive done lots of experiments with "blob" sims along the line leiavoia suggests and I wouldn't mind giving you a hand implementing something similar.

Regarding the microscopic life theme, check out:

http://intihuatani.usc.edu/cloud/flowing/

Cheers,
Mike

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.