Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)

 MunnyMike 05-02-2010 09:46 PM

Final Project

Hello alice community.

I'm not sure how to go about doing this so i'll start by first describing my final project.

I want to make a fishtank scene with several fish, rocks, plants, misc. objects in it. Clicking on each of these will cause an action to happen.

That's all simple enough right?

The hard part is that I want the fish to be in constant motion. An infinite loop would be best right?

Also how would I cause bubbles to rise from the fishs' mouths as they are all moving around?

So yeah that's about it. Fish will spin, wink, change to another path when clicked on. Rocks will rise to reveal hidden objects.
I just really want to make this feel like a tank with animals rather than little robots.

Edit*
What would be the best way to mimic the look of a fishtank?

 x2495iiii 05-02-2010 10:52 PM

There's an ocean floor object which you could shrink and put inside a semi-transparent cyan cube or box to simulate a fish tank.

You could use the random function coupled with the sine mathematical function to create wavy, but slightly erratic motions of the fishes, along with semi-transparent spheres which would be invisible at first and vehicled to the fishes, then would become visible, rise, then orient themselves back to the fishes and become invisible again in zero seconds at random intervals to simulate bubbles.

Do you know how to do all this?

 jediaction 05-03-2010 07:25 AM

I would keep it simple and do what he said to do X

 MunnyMike 05-03-2010 10:24 AM

[QUOTE=x2495iiii;20679]There's an ocean floor object which you could shrink and put inside a semi-transparent cyan cube or box to simulate a fish tank.

You could use the random function coupled with the sine mathematical function to create wavy, but slightly erratic motions of the fishes, along with semi-transparent spheres which would be invisible at first and vehicled to the fishes, then would become visible, rise, then orient themselves back to the fishes and become invisible again in zero seconds at random intervals to simulate bubbles.

Do you know how to do all this?[/QUOTE]

I know how to add the bubbles and vehicle them to the fish. I've done something similar before. Thanks for that idea.
I had no idea there was anything like the "ocean floor" as a model (thats what I get for only ever using "search"). I had just been using a combination of squares (with their opacity lowered and color changed to dark blue) as the walls of the tank.

Can you give me a little more information on the sine random function and sine mathematic?

 x2495iiii 05-03-2010 11:22 PM

If you click the sky on your world, the world itself will be selected. While the world is selected, click the functions tab to see the nice selection of functions included with Alice. Two of those are random number and sin [a]. My idea was to have the fish move back and forth, while at the same time moving up and down in a sin curve to simulate a wavy pattern (this is actually one of the assignments in the textbook, see if you can find it for more info), then adding a random number in there somewhere to make it look less mechanical (where you add it depends on your taste, you could add it in the duration to make him move faster or slower randomly, you could add it in the back and forth motion to make it look less like he's just swimming the same bounding path over and over, etc.)

 MunnyMike 05-04-2010 07:21 PM

1 Attachment(s)
[QUOTE=x2495iiii;20730]If you click the sky on your world, the world itself will be selected. While the world is selected, click the functions tab to see the nice selection of functions included with Alice. Two of those are random number and sin [a]. My idea was to have the fish move back and forth, while at the same time moving up and down in a sin curve to simulate a wavy pattern (this is actually one of the assignments in the textbook, see if you can find it for more info), then adding a random number in there somewhere to make it look less mechanical (where you add it depends on your taste, you could add it in the duration to make him move faster or slower randomly, you could add it in the back and forth motion to make it look less like he's just swimming the same bounding path over and over, etc.)[/QUOTE]

thanks again.

I've hit a speed bump in all this.
I put several invisible squares around the "seafloor" and used the squares as collision models (so if the fish get within X distance of them they will turn around)
They aren't really doing that, several of them end up going through both the seafloor wall and the invisible squares.

 x2495iiii 05-04-2010 10:51 PM

You need to put the "If fish is within..." statements in a big do together, then put that in an infinity loop. Where they are now, they're only called once, so if the fish isn't that close when they're called that one time, the scene continues thinking everything's alright.

Very common mistake, everyone makes it at some point (I still do occasionally).

 MunnyMike 05-04-2010 11:10 PM

1 Attachment(s)
[QUOTE=x2495iiii;20810]You need to put the "If fish is within..." statements in a big do together, then put that in an infinity loop. Where they are now, they're only called once, so if the fish isn't that close when they're called that one time, the scene continues thinking everything's alright.

Very common mistake, everyone makes it at some point (I still do occasionally).[/QUOTE]

It must have not come out in the picture well but they are in a big "do together" and that is in an infinite loop.
I know you've helped a lot as it is but would you mind seeing what went wrong?
I've unhid the boxes.
Two methods are under "goldfish"

Edit
I ended up turning in this simple project for my final. A few animals that had buttons near them. They performed different actions depending on what you clicked (buttons/animals/nearby objects)
The teacher is very easily impressed so I think I got an A
I still want to finish this though, so any help is appreciated.

 All times are GMT -5. The time now is 10:17 AM.