Static Sprocket
Registered User
Join date: 10 Feb 2006
Posts: 157
|
05-25-2006 11:26
Having read about some Surina Skallagrimson's work on the forums, I've started some work on my own fishies. Mine have a few differences from the way Surina described hers as working, but I'm running into a few problems...
Background, overview, where I am now...
To begin with, I build separate scripts for each of the simple behaviors, such as "If hungry move towards food", "Try to shoal", "Stay under water" -- each of these used scanners and/or timers and applied gradually larger impulse to make any one particular behavior override the others.
So far so good...
However I ended up with a lot of fish moving backwards, sideways, or otherwise "twitching" because it couldn't decide which way to face (from the various behaviors each trying to modify it's direction of movement.) So I thought about pulling out the LookAt code from the individual behaviors and placing it in yet another behavior "look where I'm actually going", which would test the fishie's current velocity and adjust orient it appropriately.
At the same time I was working on this, I noticed in some cases, the fish would, depending on various circumstances end up moving extremely fast -- for example, when not hungry they might move away from food quite a bit, then when their hunger would bring them back, one or two fish would get stuck -- this would encourage the whole school of fish to fight against moving towards the food, making them hungrier and hungrier. Then if the fishies that were stuck, finally worked themselves around whatever was blocking them, the school of fish would shoot towards the food. Their hungry driving them forwards, compiled on top of their desire to all shoal in that direction. Then they'd all over shoot the food, then whip back in the other direction, over shooting it again. The whole time getting more and more hungry...
Quite a few fishies went sailing off the grid this way...
To try and solve the problem of competing behaviors each applying separate impulses and headings (twitchy fishie) -- and in an attempt to regulate max speed, what I've done is added a "Propulsion Script." Now instead of each behavior directly applying an impulse to the fishie, it instead shoots a link_message to the propulsion script. The propulsion script then averages the impulses and applies a single impulse. It also takes care of correcting the fishie's heading.
P.S. I have never attempted a AI or ALife project before, and I'm more interested in well behaved fish that are fun to look at rather then trying to imitate with any precision a real life animal.
|
Static Sprocket
Registered User
Join date: 10 Feb 2006
Posts: 157
|
My kingdom for a well behaved fishie...
05-25-2006 11:32
At this point I'm still having problems with hyper speed fishies sometimes... Usually one fish, other times the entire group all at once...
Does anyone have any suggestions on how to handle this? I've considered using a reverse impulse based on the fishies current velocity, prior to applying the new impulse. But my initial experiments didn't go so well (fish kept stopping, or became drastically less smooth.)
180 degree whiplash... I tend to still have a lot of fish that will make rather sudden 90 degree, or greater turns (and a lot of 180 degree turns when overshooting food.) Has anyone experimented with smoothing out turns, so that instead of immediately applying impulse in the opposite direction, and flipping the fish around, you instead have them turn in a circle? Say no more then 45 degrees of turn per second, or anything like that?
Any thoughts or suggestions would be greatly appreciated!
P.S. Dead, dying, and generally miss-behaving fishies can be spotted in Christabel
|
Llauren Mandelbrot
Twenty-Four Weeks Old.
Join date: 26 Apr 2006
Posts: 665
|
05-29-2006 05:11
You using "physical" fish? If not, I suggest considering giving it a try. The physical system is designed for many of the issues I have encounterred playing with AL. On the other hand, if your fish ARE physical, many of the problems sound idealy suited for the vehicle system to handle. Yesterday, I assisted a new Friend in adapting Gingham`s brain to a flier, and vehicle status cured several issues. Over all, designating mobile AL forms as physical and/or vehicle would seem [to me] to be more effecient than trying to replicate functionality in LSL. For those who do not know Gingham, she is a physical pet ball with [at least three] independant layered behaviors mediated by a single script. Keep up the good work! Toodle-oo!
|
Static Sprocket
Registered User
Join date: 10 Feb 2006
Posts: 157
|
05-29-2006 09:34
Yup, they're physical. They're starting to get a bit more well behaved, just using better constructed llApplyImpulse() calls.
Having problems finding the right weights for the different behaviors, but I guess that's a "normal" problem.
I've got them dying from hunger, but need to decide what a good life cycle is. How long should one live without food? 5 Minutes, 15 Minutes, an Hour? Right now I'm tending to the smaller end, because I like to see it happen realtime, but that also means I'm generating food a lot more often from my auto-feeders to keep them alive.
In addition to the auto-feeders that chuck food into the water, I've made some water plants that change their name to the name the fish associate with food. Then when a fish touches it, it gets "fed", and the plant changes it's name so it's no longer food for a while -- right now 60 seconds. Then it becomes food again. Seems to work well for pulling the fish around, so they don't tend to stay in one spot/area as much...
As always suggestions and feedback greatly appreciated... Fishies at Christabel 135/65/21
|
Never Rust
Registered User
Join date: 27 Apr 2006
Posts: 15
|
05-31-2006 11:10
Sounds like some fantastic progress on the fish! You should think about joining our Eco-system group (do a Find for Eco-system). Our discussions are here: http://groups.google.com/group/SL-EcoSystem
|