Zoo Tycoon Community Download Directory
March 24, 2019, 10:39:45 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome
   Home   Help Search Login Register  
Pages: [1]   Go Down
Author Topic: Behaviorsets and animation speeds  (Read 2412 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline

Posts: 64

« on: October 13, 2014, 11:56:06 AM »

I know cSlowRate etc, I also noticed that the tiger (tiger.ai) has specific animation speed lines (just to slow down or just make the animation faster), but I'm looking into *movement*.

How do you make the tiger swim faster than he regularly does, without changing anything else?
Offline Offline

Posts: 5846

« Reply #1 on: October 13, 2014, 04:27:36 PM »

I do not know how ZT uses the various AnimSpeed settings, since the animations themselves already have animation speeds in them.

As for changing swimming speed, there are 2 different general types of activities an animal can do. The first type of activity is those with a specific purpose. For example, ZT might decide it is time for the tiger to go to a shelter. As far as I know, ZT always uses the cSlowRate setting for the animal speed to get it to a shelter, whether the animal is on land, on water terrain, or in a tank. The animation ZT uses for that purpose is "walk" when on land, "swim" when on water terrain, "surfswim" when at the water surface in a tank, and "subswim" when underwater in a tank. The second type of activity is those without a specific purpose. When the tiger is on water terrain, that is the [m\BehaviorSet\bWaterActive] section in tiger.ai, which looks like this:
f = fMove(0,0,swim,26)

That "0,0," has the tiger swimming randomly around. That "swim" is the animation that is used while it is swimming. That "26" is the speed it will move around while swimming, which happens to be faster than the cSlowRate setting, which is set to 20 for the tiger. If you change "26" to a higher number, it will move faster. It is also possible to have the tiger just swim faster part of the time. For example, maybe you want it to swim faster 10% of the time when it is swimming without a specific purpose. In that case, you would leave the [m\BehaviorSet\bWaterActive] section as it is and make other changes. The tiger.ai file has the following section:
f = fPlaySetProb(bWaterActive,100)

That section says to do the bWaterActive behavior set 100% of the time that the tiger is on water terrain and not doing something for a specific purpose. That could be changed to:
f = fPlaySetProb(bWaterActive,90,bWaterActiveFast,10)

That will do the usual swimming behavior 90% of the time and a different swimming behavior 10% of the time. You would then add a section similar to this to have it swim faster that 10% of the time:
f = fMove(0,0,swim,40)

It is also possible to have young tigers swim slower on water terrain than the adults by adding something similar to the following:
f = fMove(0,0,swim,15)

f = fMove(0,0,swim,30)

The "y" says these are for young animals. When a specific behavior set is not there for the young, then it uses the adult's behavior set instead, though still using young graphics.

The above is for water terrain. There are other behavior set sections for when the tiger swims on the surface of the water in a tank:
f = fWalk(surface, 0)

The above will use the surfswim animation and the cSlowRate setting. That could be changed to something similar to the following:
f = fMove(surface,0,surfswim,40)

That says to keep the tiger at the surface of the water, move randomly around, use the surfswim animation, and use a movement speed of 40. If you want to have the tiger swim faster in a tank only 10% of the time, you would leave the [m\BehaviorSet\bSurface] section as it is and make other changes instead. You would have to change all "f = fPlaySetProb(bSurface,80,bSurfidle,20)" lines to:
f = fPlaySetProb(bSurface,70,bSurfaceFast,10,bSurfidle,20)

Then you would add:
f = fMove(surface,0,surfswim,40)

If you want young tigers to always swim in a tank slower than adults, you can add something similar to the following sections:
f = fMove(surface,0,surfswim,15)

f = fMove(surface,0,surfswim,30)
Offline Offline

Posts: 64

« Reply #2 on: October 14, 2014, 11:49:19 AM »

Thanks, very informative Jay!

Seems I was messing around with the wrong behavior set, I'll try the right one soon :)
Pages: [1]   Go Up
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.029 seconds with 20 queries.