All language subtitles for 12. FSM Retreat (GOOD)

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

Let's find out about the retreat functionality.

One of the three states of our agent.

The retreat feature consists of a state machine definition and the state code to make it work.

It gets triggered when the agent's HP drops below a certain value that can be customized for different

behaviors.

Let's start by looking at our state machine.

So this is the first level.

We need to double click into retreat and here to find the following three states.

First, when entered the retreat, functionality will try to find a valid cover.

If a cover was found, then it will go there to that cover and then it will wait for a certain period

in the cover if the cover is invalidated for some reason.

For example, the player moves and has a direct line of sight to the enemy.

Then the cover will get invalidated.

It will try to find a new cover.

If it is false, then this means that this state is no longer available and the air can move to attack

or patrol state.

Let's look now at the code and how everything is put together.

After the initialization step of various objects, we also need to connect the tank mover so that we

have unfinished moving.

But we also have two important timers search for new cover timer and validate cover timer.

So what do they do?

If you checked the patrol state, you probably are aware that when the patrolling gets called on entry,

the new patrol position is picked and the mover is set to go there.

Their own entry happens only once when the state machine initially transitions to this for cover.

It's a little different since the patrol will always get the position no matter what.

Well, this system might return zero covers and then the air will enter in a locked state, waiting

indefinitely to prevent this as much as possible.

We will use the callback from the timer search new cover and this will ask the cover system from time

to time to get the new cover.

And when found we will transition to move to cover.

If not, we will restart the timer and call again and again because there is one special case when this

situation won't change, if the enemy and also the player don't move at all, nothing will change.

But usually in real life scenarios, the player will most likely move around and the situation on the

battleground will change.

So this means that even if the first time we didn't get the cover, chances are we will be getting one,

the second or the third time when go to cover state is reached.

We know for sure where to go so we can choose an entry to set this to work.

Once the position has been reached, the way state will get triggered.

And lastly here, we need another timer called validate timer.

So how does the timer search for new cover work?

Well, initially on entry happens, we will enter the find cover state and of course the tank mover

needs to stop.

And then we actually call the callback function for the timer to just get it started initially.

And here in our search for new cover timeout, we will try to get a new cover point from the cover system.

If it's different from now, then we set the final state machine to true so that it advances to move

to cover.

If not, then we call the timer search for a new cover again in hopes that in a couple of seconds the

situation will be different.

Right now it's positioned at 1.5 seconds.

So it will try to search for new cover every 1.5 seconds.

Once we get the cover, we can properly transition to the go to cover state.

And here first we need to set up the final state machine, should wait behind cover to false and then

generate the new move path that will give to the tank.

Moving eventually from the current tank position to the cover point.

Once this trigger on finished moving is called, then it means that it should wait behind cover.

And basically this is how it enters the final state.

Wait.

And then the way state on entry is starts the validate cover timer.

What does the validate cover timer do is once it reaches its timeout and then it will get all the targets

in range.

And if one target has a direct line of sight to this particular instance, then this means that we need

a new cover.

And of course we want the cover points to null and then stop the execution of this here.

If not, then will be still running in this state and we will restart the timer to validate the cover

again and again until something happens.

Either it's invalidated or the air enters a completely different state.

And of course when this state is left, so only if it was in the retreat.

Wait, then the timer validate.

Cover needs to stop.

So this is more for the initializing purposes.

And this is the retreat system.

First we search for a cover.

If we don't find one, we keep continuing searching for one.

Once we do find we will go to that cover.

Then we will wait if the cover either is invalidated.

Then we will try to find another one.

Or if the state is no longer necessary, we will exit and go to either patrol or attack.

I hope you like this system.

Leave a comment down below and let me know.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.