Angel Lameth
Registered User
Join date: 19 Oct 2005
Posts: 2
|
12-02-2005 12:57
Can anyone create a script that makes fish in fish tanks swim on a random chosen set course at random set speeds? Meaning swim on the course but choose the spots randomly, and choose speed they swim randomly? cCan this be done? Or if it has been done can someone please tell me where to find it? Thanks!
|
Rickard Roentgen
Renaissance Punk
Join date: 4 Apr 2004
Posts: 1,869
|
12-02-2005 13:48
It can be done. The hard part is how do you want to specify those fixed positions? relative to where the fish starts? global coordinates so they have to be updated if you move the tank? in a notecard? in a script? as waypoint prims you actually put down for the fish to go to?
|
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
|
12-02-2005 14:54
From: Angel Lameth Can anyone create a script that makes fish in fish tanks swim on a random chosen set course at random set speeds? Meaning swim on the course but choose the spots randomly, and choose speed they swim randomly? cCan this be done? Or if it has been done can someone please tell me where to find it? Thanks! relatively easily. my A-life fish do as you're asking, and even have a schooling AI (a little buggy at the moment) among other things I'm working on with them. mainly what you're relying on is defining the water level hard-coded in the fish (so they don't swim into the air), and letting some fuzzy logic with navigation and schooling determine where it wants to go (ex, if it's the only fish around it will swim randomly with random speeds, but if there's the same kind of fish it will swim towards it forming a "school" that moves relative to the center of all the fishes). I also have my fish naturally "sink" towards the ground but try to swim up if they com within .25m of the ground level (can be redifined to within the base of an aquarium if you'd like). this seems to give them more life-like movement within the school for some reason. [edit] and it'd be fairly easy to have them swim on a set course and choose each path of the course in random fashing using a list function for all the course coordinates, and then having it randomly select a waypoint. you can create the waypoints on either a notecard, a "server" that will broadcast the coordinates (so you can change between set paths), or just hardcode them into the fish themselves.
|
Rickard Roentgen
Renaissance Punk
Join date: 4 Apr 2004
Posts: 1,869
|
12-02-2005 19:06
sounds pretty cool, I have one (maybe two) questions... how do you keep them from escaping since this is a tank rather than an sl body of water, and sort of related, if you use physical collisions what happens when it's a small tank maybe with a few nice twisted obstacles in it?
|
Senuka Harbinger
A-Life, one bit at a time
Join date: 24 Oct 2005
Posts: 491
|
12-02-2005 22:49
From: Rickard Roentgen sounds pretty cool, I have one (maybe two) questions... how do you keep them from escaping since this is a tank rather than an sl body of water, and sort of related, if you use physical collisions what happens when it's a small tank maybe with a few nice twisted obstacles in it? right now my A-life fish rely on two parameters for the most basic of movement (non-schooling AI): colliding with other prims, and water level. in every movement script, if the fish decides it wants to move above the water level, it will instead move to the level of the water, and if it collides (or will collide) with another prim, it will seek out out a position other than one in which it collides with something else. So no matter what is in it's way, if it thinks it will collide with something, it will choose another path to go along. There are some bugs when this movement AI is applied in conjunction with the schooling AI I have implemented, but for individual fishes, this works fine. [edit] The bugs I'm currently encountering are that the SChooling AI seems to override the basic movement AI in a few select cases, such that if the center of the school is in the middle of an obstacle, the fish will tend to run into the obstacle rather than swim around it. similar circumstances occur when the center of the school of fish is near the surface of the water; the fish will tend to "jump" out of the water in trying to keep up with the center of the school, rather than the entire school of fish recenter someplace just beneath the surface.
|