HomePortalFAQSearchMemberlistUsergroupsRegisterLog in
Making threads to link to banned members content grants an automatic ban
Meet the new KITO admins & hear their plans here.
You can use google search to find threads and posts here now. Example

Share | 
 

 How tamable is my critter?

View previous topic View next topic Go down 
AuthorMessage
RedEye
Retired
avatar

Game username : -redeye-
Server : KITO
Male Posts : 2575
Join date : 2011-07-24
Age : 30

PostSubject: How tamable is my critter?   Mon Nov 14, 2011 3:15 pm

tags to ease searching: taming, tame'able, tamable.
English knowledge of "then" and "than" difference is required to understand this! Otherwise is confusion guaranteed.

If you're reading this then you want to know how hard or easy it is to tame your critter.
To succeed in taming a critter then the critters max HP, current HP and the ratio between the max and the current HP are used. As well as some random numbers. And isUncustomizable in cd1.dat

The ratio between max and current HP example:
Consider a critter (Mutant Hare for example) with the max HP of 3500.
You beat this poor thing around and its HP is now 1400
Code:
HP/maxHP = 1400/3500 = 0.4
This means the ration between its max and current HP is 0.4. You can always use this here. Might make a calculator later, but for now... Onwards!


The source code calculating this is:
Code:
const bool tSuccess = ((tC->getMaxHP()!=0?Math::UnitRandom()<(10.0f/tC->getMaxHP()):true)
                  && Math::UnitRandom()>(float)tC->getHP()*0.01f
                  && Math::UnitRandom()>tC->getHPRatio()
                  && (!tCritter.isUncustomizable||Math::UnitRandom()<0.001));
Coders tips:
&& means AND. This means you must have this in the end:
Code:
const bool tSuccess = (true
                  && true
                  && true
                  && true);
If any of them is false, then the tame failed.
|| means OR

The function
Code:
Math::UnitRandom()
returns a random number between 0 and 1.

So to make this more readable by section:
Code:
(tC->getMaxHP()!=0?Math::UnitRandom()<(10.0f/tC->getMaxHP()):true)
Into:
Code:
if maxHP does not equal 0 (protip: it never does) then
   if a RandomNumber (between 0 and 1) is smaller than 10/maxHP then this is true
if maxHP does equal 0 then
   this is always true
I know it can be hard to understand this, but this part of the code is basically telling "The higher a maxHP a critter has, the harder it is to tame it". This is because of:
Code:
   if a RandomNumber (between 0 and 1) is smaller than 10/maxHP then this is true
As an example of this let's use Hare (maxHP = 65) and Mutant Hare (maxHP = 3500). If we only consider the condition above to tame the critter:
For the Hare
Code:
10/65 = 0.15385
   if a RandomNumber (between 0 and 1) is smaller than 0.15385 then this is true
For the Mutant Hare
Code:
10/3500 = 0.00286
   if a RandomNumber (between 0 and 1) is smaller than 0.00286 then this is true
So you hopefully tell that a RandomNumber below 0.15385 is more likely than a RandomNumber below 0.00286.
Just for fun, consider Haunted Tower. With a maxHP of 10000. That's 0.001.

Next part of the code:
This should be straightforward:
Code:
Math::UnitRandom()>(float)tC->getHP()*0.01f
Reads as:
Code:
if a RandomNumber (between 0 and 1) is bigger than HP*0.01
Again a critter Mutant Hare, you beat it around and its HP is now at 300
Code:
if a RandomNumber (between 0 and 1) is bigger than 300*0.01=3 then this is true
You're now thinking "Aha! But that will never be possible to tame then?", but wait! There's moar!
To tame then, the HP of the critter must be below 100 (100*0.01=1). So beat the critter some moar! To 20
Code:
if a RandomNumber (between 0 and 1) is bigger than 20*0.01=0.2 then this is true
This means that any tames used on critters above 100 HP ARE WASTED!

Anyways, onwards! Next part of the code:
Code:
Math::UnitRandom()>tC->getHPRatio()
Reads as:
Code:
if a RandomNumber (between 0 and 1) is bigger than the HP Ratio then this is true
Look further up in this post for HP ratio explained.
Using the same example as up there:
Code:
if a RandomNumber (between 0 and 1) is bigger than 0.4 then this is true
Basically means: THE MOAR YOU BEAT THAT CRITTER THE EASIER IT IS TO BECOME YOUR FRIEND/SLAVE. Note: This does not hold true in real life.


Last part of the code:
Code:
(!tCritter.isUncustomizable||Math::UnitRandom()<0.001)
tCritter.isUncustomizable is taken from cd1.dat and reads as
Code:
isUncustomizable=true
If isUncustomizable is true, then it depends on RandomNumber to be smaller than 0.001.
isUncustomizable is default false, so in that case, then the RandomNumber doesn't matter.


Let's sum up with some examples
Code:
const bool tSuccess = ((tC->getMaxHP()!=0?Math::UnitRandom()<(10.0f/tC->getMaxHP()):true)
                  && Math::UnitRandom()>(float)tC->getHP()*0.01f
                  && Math::UnitRandom()>tC->getHPRatio()
                  && (!tCritter.isUncustomizable||Math::UnitRandom()<0.001));
Code:
Success = (RandomNumber < (10/maxHP)
                  AND RandomNumber > (HP*0.01)
                  AND RandomNumber > HP_Ratio
                  AND (!isUncustomizable OR RandomNumber < 0.001));
Hare
Untouched by player
maxHP=65
HP=65
(isUncustomizable is default false, and !false becomes true)
Code:
Success = (RandomNumber < 0.1538
                  AND RandomNumber > 0.65
                  AND RandomNumber > 1
                  AND true);
It would never be possible to tame this because the player hasn't smacked it once first and the HP Ratio is left at 1 (line 3 in the code).

Smacked by player
maxHP=65
HP=35
(isUncustomizable is default false, and !false becomes true)
Code:
Success = (RandomNumber < 0.1538
                  && RandomNumber > 0.35
                  && RandomNumber > 0.5385
                  && true);
It would be possible to tame this Hare.

Dire Hare
maxHP=150
HP=120
Code:
Success = (RandomNumber < 0.0666
                  AND RandomNumber > 1.2
                  AND RandomNumber > 0.8
                  AND true);
It would be impossible to tame this since its HP is not below 100 (100*0.01=1 and 120*0.01=1.2)

Mutant Hare
maxHP=3500
HP=20
isUncustomizable=true
Since isUncustomizable is true, then the last statement isn't automatically true, but instead depends on a RandomNumber to be less than 0.001.
Code:
Success = (RandomNumber < 0.00286
                  AND RandomNumber > 0.2
                  AND RandomNumber > 0.0057
                  AND RandomNumber < 0.001);
It would be possible to tame this critter.


Hope it helps you all to understand how taming works.


Last edited by RedEye on Mon Nov 14, 2011 3:25 pm; edited 2 times in total (Reason for editing : cleanup)
Back to top Go down
Draak
Texture Artist
Texture Artist
avatar

Game username : Draak
Female Posts : 681
Join date : 2011-07-28

PostSubject: Re: How tamable is my critter?   Mon Nov 14, 2011 7:58 pm

....do you mind doing an example of what it'd take/what the chances are and such for a Zombie Dragon?

I suck at math D:

And I want to see how insane I'm trying to be by attempting to tame one XD
Back to top Go down
RedEye
Retired
avatar

Game username : -redeye-
Server : KITO
Male Posts : 2575
Join date : 2011-07-24
Age : 30

PostSubject: Re: How tamable is my critter?   Mon Nov 14, 2011 8:42 pm

Zombie Dragon
maxHP=8000
isUncustomizable=true
HP=??
(Replace ?? in the formula with the HP you want)

Code:
Success = (RandomNumber < 0.00125
                  AND RandomNumber > (??*0.01)
                  AND RandomNumber > (??/8000)
                  AND RandomNumber < 0.001);

if HP=20
Code:
Success = (RandomNumber < 0.00125
                  AND RandomNumber > 0.2
                  AND RandomNumber > 0.0025
                  AND RandomNumber < 0.001);

________________________________
Retired
Back to top Go down
Draak
Texture Artist
Texture Artist
avatar

Game username : Draak
Female Posts : 681
Join date : 2011-07-28

PostSubject: Re: How tamable is my critter?   Tue Nov 15, 2011 7:02 am

Ooh thanks Very Happy

So...if I'm reading this right (inwhich I'm probably not, I can never get my head around stuff like this lol) the Dragon's HP would have to be less than 20 in order for tames not to be wasted?
Back to top Go down
RedEye
Retired
avatar

Game username : -redeye-
Server : KITO
Male Posts : 2575
Join date : 2011-07-24
Age : 30

PostSubject: Re: How tamable is my critter?   Tue Nov 15, 2011 7:11 am

All critters must be beaten to a HP less than 100

________________________________
Retired
Back to top Go down
RedEye
Retired
avatar

Game username : -redeye-
Server : KITO
Male Posts : 2575
Join date : 2011-07-24
Age : 30

PostSubject: Re: How tamable is my critter?   Tue Nov 15, 2011 8:04 am

Again HP=20, Zombie Dragon
Code:
Success = (RandomNumber < 0.00125
                  AND RandomNumber > 0.2
                  AND RandomNumber > 0.0025
                  AND RandomNumber < 0.001);
If you want to use percentages instead:
line 1: 0.125% chance of happening
line 2: 80% chance of happening
line 3: 99.75% chance of happening
line 4: 0.1% chance of happening.
In total: 0,00009975% chance to tame it

________________________________
Retired


Last edited by RedEye on Thu Jul 24, 2014 9:01 pm; edited 1 time in total
Back to top Go down
Nesbael
Texture Artist
Texture Artist
avatar

Game username : Nesbael
Server : LastMoon
Posts : 55
Join date : 2011-08-11
Age : 27
Location : California

PostSubject: Re: How tamable is my critter?   Tue Nov 15, 2011 10:08 am

OW. My brain...>.o

Very helpful though, RedEye! Once my brain stops twitching I'm sure this will be a huge help. XD
Back to top Go down
Dinnieh

avatar

Game username : DinWolfie // Dinnieh
Server : Server ghost
Female Posts : 39
Join date : 2011-07-29
Age : 22
Location : Nottinghamshire, England.

PostSubject: Re: How tamable is my critter?   Tue Nov 15, 2011 2:18 pm

I totally understand this, But I'm need of actually changing this to become not a random number, But to change it to a value of roughly 1.0 ? So It would be pretty much tameable first time? If you get my drift. Razz
Back to top Go down
http://www.dinnieh.deviantart.com/
RedEye
Retired
avatar

Game username : -redeye-
Server : KITO
Male Posts : 2575
Join date : 2011-07-24
Age : 30

PostSubject: Re: How tamable is my critter?   Tue Nov 15, 2011 4:01 pm

That should be straight forward =^.^=

Code:
Success = (RandomNumber < 0.01);

^--- 1% chance

________________________________
Retired
Back to top Go down
Dinnieh

avatar

Game username : DinWolfie // Dinnieh
Server : Server ghost
Female Posts : 39
Join date : 2011-07-29
Age : 22
Location : Nottinghamshire, England.

PostSubject: Re: How tamable is my critter?   Thu Nov 17, 2011 11:35 am

aha! Where can I find where the coding is? :3
Is it in a .dat? the source? Razz
Back to top Go down
http://www.dinnieh.deviantart.com/
RedEye
Retired
avatar

Game username : -redeye-
Server : KITO
Male Posts : 2575
Join date : 2011-07-24
Age : 30

PostSubject: Re: How tamable is my critter?   Thu Nov 17, 2011 6:26 pm

in MagixUnitManager.h @ lines 382-385

________________________________
Retired
Back to top Go down
Dinnieh

avatar

Game username : DinWolfie // Dinnieh
Server : Server ghost
Female Posts : 39
Join date : 2011-07-29
Age : 22
Location : Nottinghamshire, England.

PostSubject: Re: How tamable is my critter?   Thu Nov 17, 2011 8:33 pm

thankyouu <3
Back to top Go down
http://www.dinnieh.deviantart.com/
Lily The Alphess

avatar

Game username : LilyTheAlphess
Server : Dragon's Den <3
Female Posts : 82
Join date : 2011-11-07
Location : 4 billion years after the appocalypse, planet Earth.

PostSubject: Re: How tamable is my critter?   Sun Nov 20, 2011 10:58 pm

Ohh how many tames would it take to tame a Monster Ray that has only 10 HP left? (Or the percent... whatever xD)
Back to top Go down
Dinnieh

avatar

Game username : DinWolfie // Dinnieh
Server : Server ghost
Female Posts : 39
Join date : 2011-07-29
Age : 22
Location : Nottinghamshire, England.

PostSubject: Re: How tamable is my critter?   Wed Nov 23, 2011 6:17 pm

hm; I tamed a ZD with 700 tames.
Really it's chance; But im sure red can find the sucsess rate.
Back to top Go down
http://www.dinnieh.deviantart.com/
RedEye
Retired
avatar

Game username : -redeye-
Server : KITO
Male Posts : 2575
Join date : 2011-07-24
Age : 30

PostSubject: Re: How tamable is my critter?   Wed Nov 23, 2011 6:30 pm

That fits pretty well with the 0.5% success rate of the ZD Wolfie.
A Monster Ray has a maxHP of 5500. So it's easier to tame than a ZD.
Hit it until at 20 hp

Code:
Success = (RandomNumber < (10/maxHP)
                  AND RandomNumber > (HP*0.01)
                  AND RandomNumber > HP_Ratio
                  AND RandomNumber < 0.001);

Code:
Success = (RandomNumber < 0.001818
                  AND RandomNumber > 0.2
                  AND RandomNumber > 0.003636
                  AND RandomNumber < 0.001);

If you want to use percentages instead:
line 1: 0.1818% chance of happening
line 2: 80% chance of happening
line 3: 99.6364% chance of happening
line 4: 0.1% chance of happening.
In total: 0,0001449% chance to tame it.

The chance is lower because of the HP Ratio

________________________________
Retired


Last edited by RedEye on Thu Jul 24, 2014 9:02 pm; edited 1 time in total
Back to top Go down
Draak
Texture Artist
Texture Artist
avatar

Game username : Draak
Female Posts : 681
Join date : 2011-07-28

PostSubject: Re: How tamable is my critter?   Wed Nov 23, 2011 8:34 pm

Quote :
hm; I tamed a ZD with 700 tames.
Really it's chance; But im sure red can find the sucsess rate.

That's lucky XD I've exceeded the 3000 tames mark and is still trying x_X
Back to top Go down
Lily The Alphess

avatar

Game username : LilyTheAlphess
Server : Dragon's Den <3
Female Posts : 82
Join date : 2011-11-07
Location : 4 billion years after the appocalypse, planet Earth.

PostSubject: Re: How tamable is my critter?   Thu Nov 24, 2011 12:11 am

Ohh yay! When I get a Monster Ray, I'm gonna name it "Riptide" cause Monster Rays are good at sneeking up xD.
Edit: My friend would like to know how easily you can tame a Skyshroud.
Back to top Go down
Moonlight~{Wildcat26}

avatar

Game username : Wildcat26 (All IT servers & FH)
Server : Explorer Core
Female Posts : 45
Join date : 2011-09-20
Age : 27
Location : Stalker :U

PostSubject: Re: How tamable is my critter?   Fri Dec 02, 2011 9:09 pm

So by this I'm gathering that infact any critter is tamable if you have enough tame + get the health low enough and get lucky? lol[i]
Back to top Go down
http://wildcat-26.deviantart.com/
RedEye
Retired
avatar

Game username : -redeye-
Server : KITO
Male Posts : 2575
Join date : 2011-07-24
Age : 30

PostSubject: Re: How tamable is my critter?   Fri Dec 02, 2011 9:16 pm

Yup

________________________________
Retired
Back to top Go down
Moonlight~{Wildcat26}

avatar

Game username : Wildcat26 (All IT servers & FH)
Server : Explorer Core
Female Posts : 45
Join date : 2011-09-20
Age : 27
Location : Stalker :U

PostSubject: Re: How tamable is my critter?   Sat Dec 03, 2011 5:32 am

^^^Thanks!
Welllll guess it's time to hunt eles to the ends of the IW earth and try for those boss pets I've always wanted Razz
Back to top Go down
http://wildcat-26.deviantart.com/
RedEye
Retired
avatar

Game username : -redeye-
Server : KITO
Male Posts : 2575
Join date : 2011-07-24
Age : 30

PostSubject: Re: How tamable is my critter?   Thu Jul 24, 2014 9:03 pm

Fixed the example calculations I did *cough* very wrong totals *cough* not 0.49% total *cough* but more like 0,0001449%

________________________________
Retired
Back to top Go down
Greywolf8888

avatar

Game username : Darkstorm99398
Server : Primordious (owner), Impressive Shadows (mod), and many more IT servers
Female Posts : 112
Join date : 2016-12-08
Age : 14
Location : Under your bed.

PostSubject: Re: How tamable is my critter?   Thu Dec 08, 2016 10:37 pm

on Last moon , Ive been trying to tame a Dire cat , are they tamable?
Back to top Go down
http://Primordious.freeforums.net
 
How tamable is my critter?
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Keeping I.T. Open :: START HERE :: KITO's IT Source Code :: Guides & FAQs-
Jump to: