Welcome Guest [Log In] [Register]
Welcome to Northernskies,

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
How to Code Animals Like Aurora Designs
Topic Started: Aug 27 2012, 11:40 AM (7,844 Views)
Ghost
Member Avatar
Administrator

Title: How to Code Animals Like Aurora Designs
Author: Otterlord

Want to learn how to code animals like Aurora Designs? This tutorial goes over some of the changes that Aurora Designs makes for coding animals, which includes all Radical Remake, bonus download, and solo projects. What this hopes to do is to provide a standard for user-made content and keep animals coded in relation to one another. That way prairie dogs aren't made with 4 star ratings and Grant's gazelle do not have a higher view bonus value than pandas. This tutorial also hopes to give designers more options to create unique animals by altering values such as star rating, cost, and space requirements so animals are not just coded copies of one another. Also there are some alterations that Aurora Designs is making to all the Zoo Tycoon 2 animals that designers may want to follow to when making user-made animals.

This will be a rather short and easy tutorial, but it takes some understanding about coding to follow it. If you would like to learn about coding animals, try looking at some of the tutorials around here or other sites.

What Aurora Designs is doing for all animals
The following are changes that we are doing for all animals, even the Radical Remakes ones. If you want the lifespans, space requirements, etc. to be realistic, it would be best to follow these if you plan to use Radical Remake.

Longer Lifespans
Lifespans are made to be about 1/5 of their real time. If an animal lives for 10 years in real life, it will live for 2 years in the game. We decided on the 1:5 ratio because in game there is an award for zoos reaching 20 years of age, and in real life 100 years for a real zoo is a similar milestone. We also wanted to encourage people to invest in their zoos and play longer, which would build a stronger connection between the builder and their animals or zoo.

Editing lifespan is in the tsk file of your animal. Now we are also going to edit the time an animal reaches adulthood and dies. Search for the Puberty and Old task templates and look for the tags <Qualifier> and you will see a value for lifespan=" GE x" (x is any number, bolded in the example code). This number designates time within game where the certain actions of reaching adulthood or dying occurs, and you need to edit the numbers to make the changes. But, to this it will take a bit of math.

First look up the age of maturity and lifespan of your animal in years. If you have it in months, divide it by 12 to convert it into years. When you have the years, divide that number by 5 to get 1/5 of the real value. Now you cannot just place number under lifespan and be done, you have to multiply it by a constant because the number under lifespan is not equal to years in game. The numbers under there are 23.27 units for every year in game, so you need to multiply 1/5 of your animals age by 23.27 then put that number.

For more advanced coders:
If you have juvenile stage for you animal, set maturity to your second puberty event. Set the first puberty value to be some where between adulthood of your animal to be where your animal goes from young to juveniles. Juveniles cannot breed so do not make the first value the age your animal reaches maturity.

Here's an example.

Quote:
 
<BFAITaskTemplate Name="Puberty" TaskDelayMin="60" TaskDelayMax="60" UniqueID="pandagiant:Puberty">
<BFAICreateData>
<Subjects>
<PandaGiant_Young/>
<Qualifiers_AND inWater_OR_onLand="true" lifespan="GE 6.26"/>
</Subjects>
<Targets>
<self/>
</Targets>
<Objects/>
</BFAICreateData>
<BFAIEvalData fixedScore="2000"/>
<BFBehExecTask>
<BFBehSendToken>
<BFAITokenList>
<BFAIToken Name="t_Age" GiveTo="subject" Timeout="59" Chance="50" Reconsider="true"/>
</BFAITokenList>
</BFBehSendToken>
</BFBehExecTask>
<BFAICompletionData/>
</BFAITaskTemplate>
<BFAITaskTemplate Name="Old" TaskDelayMin="60" TaskDelayMax="60" UniqueID="pandagiant:Old">
<BFAICreateData>
<Subjects>
<PandaGiant/>
<Qualifiers lifespan="GE 26.83"/>
</Subjects>
<Targets>
<self/>
</Targets>
<Objects/>
</BFAICreateData>
<BFAIEvalData>
<BFAIAttributeFloatMap lifespan="-100"/>
</BFAIEvalData>
<BFBehExecTask>
<BFBehPlaySet behSet="Sleep"/>
<BFBehSendToken>
<BFAITokenList>
<BFAIToken Name="t_Die" GiveTo="subject" Timeout="59" Chance="25" Reconsider="true"/>
</BFAITokenList>
</BFBehSendToken>
</BFBehExecTask>
<BFAICompletionData/>
</BFAITaskTemplate>


Lowering Exhibit Size Requirements
I realize people are now setting animals with no space requirements, but we are just lowering these a bit to maintain realism.

Look in the main xml file of your animal and search for f_RequiredInitialSpace and f_RequireAdditionalSpace. Initial space is the amount of space your animal first needs for itself and additional space is for every new animal of its species in the same exhibit. For Radical Remake and all other animals, we are lowering these values slightly so lower them while keeping in mind that one square is about 4. The addax in this example needs 70 square for itself and 10 more for every extra animal. I would change that to about 40 squares of initial space and 5 squares of extra space.

Quote:
 
<BFAIEntityDataShared f_BaseDonationAmount="60" s_DonateToken="t_DonateAddax" p_NurseNode=".20 -.5 90" p_PreyOffset="0 1 0" s_Endangerment="Critical" s_Species="Addax" b_Elite="true" b_Granivore="true" b_Graminivore="true" s_KeeperEatType="Terrain_Grass" b_SmallAnimal="true" s_KeeperDrinkType="Terrain_Grass" b_Browser="true" b_Grazer="true" f_adoptCount="rand(1,2)" f_adoptRarity="40" s_Zoopedia="zoopedia:zoopedia_addax:entry" f_RequiredInitialSpace="280" f_RequiredAdditionalSpace="40" p_FenceJumpNode="0 -5 180" b_SaltLickUser="true" s_Product="Downloads" f_MaxTourValue="40">
<BFAINeedAdjusts privacy="0.25" thirst="0.05" />
</BFAIEntityDataShared>


Raising the Max Slope
Max slope is the highest slope that animals can travel over. For many animals in Zoo Tycoon 2, this value is set to low to where elevation interrupts the space within the exhibit. You may notice that any elevation in your aardvark or Baird's tapir exhibits drastically cuts the size of the exhibit and these animals cannot climb any slopes.

Search for max slope in your Adult and Young xml files (or Juvenile xml file if you have one). Set this value to 0.9 for a regular animal, this will make it so it can climb over every slope that doesn't have a flat cliff face. If you have an animal that lives in the mountains or climbs cliffs well (i.e: Ibex, Barbary Sheep), set this value to 1.0. This will make it so your animal climbs over every surface no matter of the height. You will have to use fences to enclose this animal, but the game is so bugged that its best to do this for all animals. If you think your animal is an animal that has trouble with high terrain (ie: Giraffe, Elephant), set this value from 0.7-0.9.

Quote:
 
<instance>
<BFGCollisionTester escapeBuffer="0.25" radius=".5" motionClass="tallMover" waterScore="10" maxSlope=".70" wadeDepth="2" />
</instance>


Cost and Stars
You have have not noticed this but cost and star value are related in Zoo Tycoon 2. The later the animal becomes available in challenge or campaign mode, the more it costs.

For the next values, we will be dealing with two different areas of code in the main xml file of your animal. Search for f_adoptRarity, this is the number of stars your animal will be available in challenge or campaign mode. Take into fact the popularity, rarity, and difficulty to acquire for this animal when choosing this. The values for certain star amounts goes as follows:

1 = 1/2 star
20 = 1 star
30 = 1 1/2 stars
40 = 2 stars
50 = 2 1/2 stars
60 = 3 stars
70= 3 1/2 stars
80 = 4 stars
90 = 4 1/2 stars
100 = 5 stars

Quote:
 
<BFAIEntityDataShared f_BaseDonationAmount="60" s_DonateToken="t_DonateAddax" p_NurseNode=".20 -.5 90" p_PreyOffset="0 1 0" s_Endangerment="Critical" s_Species="Addax" b_Elite="true" b_Granivore="true" b_Graminivore="true" s_KeeperEatType="Terrain_Grass" b_SmallAnimal="true" s_KeeperDrinkType="Terrain_Grass" b_Browser="true" b_Grazer="true" f_adoptCount="rand(1,2)" f_adoptRarity="40" s_Zoopedia="zoopedia:zoopedia_addax:entry" f_RequiredInitialSpace="280" f_RequiredAdditionalSpace="40" p_FenceJumpNode="0 -5 180" b_SaltLickUser="true" s_Product="Downloads" f_MaxTourValue="40">
<BFAINeedAdjusts privacy="0.25" thirst="0.05" />
</BFAIEntityDataShared>


Now the cost of your animal corresponds with its star value. Don't just make up a price for your animal, but you have to choose the price given to each star count. This is because when your animal shows up in campaign or challenge mode, it has to be affordable. The table for the values of zoo animals are as follows (the cost for marine and extinct animals are different, those require separate charts) :

1/2 star = 1,250
1 star = 2,000
1 1/2 stars = 3,000
2 stars = 5,500
2 1/2 stars = 7,500
3 stars = 10,000
3 1/2 stars = 15,000
4 stars = 20,000
4 1/2 stars = 35,000
5 stars = 45,000 or 50,000

Quote:
 
<BFBinder>
<instance>
<ZTEconomyComponent cost="5500">
<ZTTransaction name="build" costType="parent" type="debit" category="animal" />
</ZTEconomyComponent>
</instance>
</BFBinder>

Values you can Edit for you Animal
The following serves as a reference for coding your animals, and gives you ideas on what you can change. If you designed for Zoo Tycoon 1, there was the Animal Project Editor, which let gave you options to select and generated the animal. With Zoo Tycoon 2, we have to search for the values that we want to edit, which many people do not take the effort to do. Changing these values will make sure your animal does not end up as a coded copy of its original.

Needs Adjustments
The following are values that depict how fast your animal's needs go up. If your animal is a playful animal, you may want to edit the enrichment level to be higher. If you animal is a shy animal, you may want to increase the value for privacy, and if you animal can survive in the desert without water, you may want to lower the thirst values.

Search in the main xml files and you may find BFAINeedsAdjust. You can edit these values specifically for ever females, males, young, young females, etc. of your animal. To add them make sure they are between <BFAIEntityDataShared >. 0.33 is the normal value for all of these, except reproduction which is 0.25 instead. So if you want needs to go up faster, set the value to higher than 0.33, or lower if you want the needs to go up slowly. For example, hunger is 0.75 for Panda because pandas eat a lot. Also, thirst is 0.05 for addax because they are a desert animal that doesn't drink as much.

Quote:
 

<BFAIEntityDataShared >
<BFAINeedAdjusts health="0.1" stimulation="0.25" exercise="0.25" reproduction="0.1" hunger="0.75" thirst="0.33" social="0.33" privacy="0.1" rest="0.1"/>
</BFAIEntityDataShared>


View Bonus
This value is basically how popular the animal is with guests. When guests see Giant Pandas, they are entirely amazed and thrilled, but if they are in front of Thomson's Gazelle, its a different story. Course this takes some knowledge of the popular opinion, you may think gazelles are cooler than pandas, but a large majority consider giant pandas to be the animal that draws the largest crowds in the real world.

Search for viewBonus in your Adult and Young xml file (you can add this for Juveniles too). Set this number to a reasonable number while checking other animals to make sure Giant Panda doesn't have a lower view bonus number than, for example, your White-tailed Deer. Your animal may even have no view bonus number (ex: Alpine Ibex), but babies do get up to 3 to 5 more points of View Bonus on their parents. For Nile crocodile, I had the old crocodiles have a higher view bonus because their size will draw crowds, while adults and juveniles had lower values. Juveniles had the lowest values because they are small, and the babies had the cuteness factor going for them which put them above adults. Remember that young animals are more popular than adults and take in the rarity, cuteness, or common knowledge factors of your animal. Common knowledge meaning, guests may not be as interested in Saiga because they have never heard of it, but they will be semi-interested because it is rare and interesting.

Quote:
 
<BFAIEntityDataShared f_viewBonus="15" b_Old="true" b_Male="0" s_MorphMessage="zoomessages:AnimalGrow"/>


Reproduction Chance
This is the chance that your animals will mate and how content the animal needs to be in order to mate.

Search for InviteReproduction in the tsk file of your animal. Where it says needPointsGood="x" is how difficult it is for the animal to breed. The higher the number the harder it is, as you can see the Giant Panda has the most difficult chance of breeding. You can gauge what this number should be based off the number it was set to before.

Quote:
 
<BFAITaskTemplate Name="InviteReproduction" TaskDelayMin="60" TaskDelayMax="180" UniqueID="pandagiant:InviteReproduction">
<BFAICreateData>
<Subjects>
<PandaGiant_Adult_F/>
<Qualifiers b_Pregnant="E false"/>
</Subjects>
<Targets>
<PandaGiant_Adult_M/>
<Qualifiers_AND inHabitat="true" canMate="true"/>
</Targets>
<Objects>
<t_Childless/>
</Objects>
</BFAICreateData>
<BFAIEvalData needPointsGood="100">
<BFAIAttributeFloatMap reproduction="-40"/>
</BFAIEvalData>
<BFBehExecTask>
<BFBehHeadLook/>
<BFBehFaceTarget/>
<BFBehSendToken>
<BFAITokenList>
<BFAIToken Name="t_Reproduce" GiveTo="target" Payload="subject" Timeout="30" Reconsider="true"/>
</BFAITokenList>
</BFBehSendToken>
<BFBehPlaySet behSet="MatingCall_F"/>
<ZTBehFeedback>
<ZTFeedbackData>
<ZTActionInfo locID="animalactions:WaitMate" useTargetName="true"/>
</ZTFeedbackData>
</ZTBehFeedback>
<BFBehHeadLook disengage="true"/>
<BFBehAnimate targetAnim="Lie_Idle" playTime="35"/>
</BFBehExecTask>
<BFAICompletionData/>
<BFAIFailureData>
<BFBehExecTask>
<BFBehPlaySet behSet="FailureSet"/>
</BFBehExecTask>
</BFAIFailureData>
</BFAITaskTemplate>


Pregnancy Chance
Pregnancy chance is the odds that your animal's mating will be result in a pregnancy.

Search for t_Pregnant1 in the animal's tsk file and look for Chance="x" in the same row. Alter the number so that it is out of a percentage of 100. This value is set to about 55 for most animals, 75 for animals that do not have difficultly breeding. 45 for rare animals and the lowest is the giant panda at 25.


Quote:
 
<BFAITaskTemplate Name="RespondReproduction" reserveTag="General" UniqueID="pandagiant:RespondReproduction">
<BFAICreateData>
<Subjects>
<PandaGiant_Adult_M/>
</Subjects>
<Targets>
<fromToken/>
<Qualifiers inHabitat="true"/>
</Targets>
<Objects>
<t_Reproduce/>
</Objects>
</BFAICreateData>
<BFAIEvalData fixedScore="100"/>
<BFBehExecTask>
<ZTBehViewEvent viewKey="Pos_5"/>
<BFBehHeadLook/>
<BFBehFaceTarget/>
<BFBehPlaySet behSet="MatingCall_M"/>
<ZTBehFeedback>
<ZTFeedbackData>
<ZTActionInfo locID="animalactions:GoingToMate" useTargetName="true"/>
</ZTFeedbackData>
</ZTBehFeedback>
<BFBehDockRadial subjectNode="Floor" targetRadius="3" rotError="180"/>
<BFBehHeadLook disengage="true"/>
<BFBehSyncSet subjectBehSet="Mate" targetBehSet="Mate"/>
<BFBehSendToken>
<BFAITokenList>
<BFAIToken Name="t_Pregnant1" GiveTo="target" Timeout="-1" Chance="25" ModifyChance="true"/>
</BFAITokenList>
</BFBehSendToken>
</BFBehExecTask>
<BFAICompletionData>
<BFAIAttributeFloatMap reproduction="-50" rest="-10"/>
<BFAITargetData rest="-10"/>
<BFBehExecTask>
<BFBehScript context="behavior" file="scripts/setmates.lua" function="setmates"/>
<ZTBehFeedback>
<ZTFeedbackData>
<ZTEmoticonInfo emoticonName="EmoteAnimalReproductionVeryGood"/>
</ZTFeedbackData>
</ZTBehFeedback>
</BFBehExecTask>
</BFAICompletionData>
<BFAIFailureData>
<BFBehExecTask>
<BFBehPlaySet behSet="FailureSet"/>
</BFBehExecTask>
</BFAIFailureData>
</BFAITaskTemplate>
Edited by Ghost, Aug 27 2012, 11:43 AM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
ZetaBoards - Free Forum Hosting
Fully Featured & Customizable Free Forums
« Previous Topic · Coding Tutorials · Next Topic »
Locked Topic