Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
Now that our game is in pretty good shape
Visually and gameplay wise
There is one final mechanic that I want to add into the game
And that is meta progression
Most games in this genre
Have some way
Tuchel
Permanent upgrades
Based on
What you're accomplishing in the game in those permanent upgrades
Can
Affect
Every subsequent run
So I'm going to walk you through the process of building out a framework that you can use
To implement however many
Upgrade you want and also how to save and load that data from the disk
So that
Persists in between gameplay sessions
So the first thing that were going to want to do is let's just
Set up
Code
For supporting
Metre upgrade
So the best place to put this is going to be in a
Sing
And that means that weekend reference that data from anywhere
The code
But also it's going to allow us to save and load the files at any point
Subtitled by online-courses.club We compress knowledge for you!
During a game weather in the game or in the options menu at the moment
Whenever is necessary
Someone who
Golden place will go through the process of saving the data
And loading it from the disc and then we'll build a UI
So that the player can actually put points into that progress
What's going on in create a new node
And we're going to create
Our route now
Of type no
And then let's call it m
Manager
Or let's can't medipro
Progress
Like
I was describing
Anna let's do scenes
And then I delayed will save it
What's going on at a script of this metal press
What is Our Data going to look like well
I think we're going to pretty much use the same
Strategy as what we have for our ability upgrades
So I'm going to
Create a new folder on a resources
And then I'm going to call this medical grade
Meta underscore
Upgrades
And before we doing the code in the meta progress
Let's create a script under mega upgrade
So Michael
New
Script and call it
Meta underscore upgrade
GD
OK then let's go ahead and open up that matter upgrade
And this needs two extends resource same as what we're doing with our
Ability upgrades here
And that we're gonna do is we're going to add an export variable
I'm going to give this an idea again so this is going to be ID string
Then let's export
Another variable called Max quantity and that will be an Int
21 by The Fall
Anna let's give it a
Tidal
Bar title
String and then
Unless do export underscore multi line
Via
Description
String
Ok so what are some
What is one upgrades that we can add
For the player
Because our game is not full of content
There's not really anything to creative
Can do yet
I think one obvious thing that we can do is increase the drop rate of
Experience rate so that the player can get upgrades fast
I'm not really paying attention to match two balancing this game
Balancing is a hoarder can of worms that
Alarm time to get through
I'm just trying to show you throughout this course how you can approach adding new things that doesn't necessarily mean that they
You think you're going to be balanced or good for the
So
Let's go ahead and create a new resource under the minute upgrades or right-click that folder
New resource
And then let's go ahead and add a base type resource here
And let's call
What's experienced underscore game
Double-click that experience game
And then drag the mirror upgrade into the
And you should see all of the ideas here
Navigate to Wright experience gain in the ID here
Max quantity can stay at
1
Let's call the title increase experience
And then
Let's do increases
Experience
Drop
Chance by
Ten percent
A very basic upgrade that we
So you've got R1 upgrade setup
Let's go back to the meta progression script and let's do a little bit of planning about how our
Save data is going to
I'm going to create a new variable called
M upgrades
Then this is going to
A type of dictionary
And the weather I'm going to set this as I'm going to set it equal to an empty dictionary
But just for demonstration purposes
I think what's going to happen is we're going to have
The ID here so it's going to look like something like experienced game just like that
And then there's going to be a sub dictionary here
And there's going to be a quantity
Which is going to be 1 or something similar
And the reason why I like to do nested dictionaries as because imagine your building this as a fool
And you have some other data that you want to associate with the experience
If you just had what city experienced game said to one right there
You would have a hard time associated more data with
Whereas
If you had just a sub dictionary you can add any number of additional properties under here
So you want Sofia insta
Let's say that I wanted to tell the player
When
They picked up
There's a billy I can say
Acquired
Time step
Right and then this could be some kind of numb
What kind of what I'm going to set it up as so the currency that's going to be used for these upgrades is going to be the total amount
Experience that you
So in addition to experience levelling you up and the game that's going to get added to a number
In the mirror upgrade
So
Actually what we're going to
How to do if something like
What's it called is currency
Upgrade currency
Like so
And this will be something like cereal
And then I'm going to have another key
Underneath the car
Upgrades
And in this upgrades Dictionary that's where you're going to see things
Experience game
So it's really important to plan out
What you want your data
Look like
And so now we've got a top lever
Which can tell us
Things about the play
Progress
And we might be
Even able to store more data in here like we could say
Win count rate
And then last count
And then we can also store the upgrade currency and the current
Let's call this m upgrades and M upgrade
Currency to be very
Southway
Initialise a dictionary like this
Now the data is becoming very clear right we can add more top level on related stats to the
As part of the same file
And then we have a very specific key that keeps track of all of the
Solicit the beauty of dictionaries as that you can store
Arbitrary nested data very sensibly
But I'm going to get rid of this Wincanton last count and just keep it like that
And then I'm probably going to get a let's just remove the experience game here
And so this is my stepdad
Are we actually leave it like this as well
ASDA
Initialised version of the digger
So we got a metre upgrades now
Let's go ahead and increment this metal upgrade currency
Whenever
The experience is increased now fortunately we have in our game events we have
This
Experience vile collect
Right and we can actually listen to that in our Meadow progress
Project project settings auto load
One thing that we need to do before we can do that is we need to
Dad dad
Meta-regression to r
So let's go ahead and click this load button
Go to seems autoload
And go ahead and put in the meta progression tscl
Click
And then close
So now
Dad's Ian the
Fintry this meta progression we can in are ready method so let's too far
Ready
We're going to
Say game events
Dart
Experienced by all collected dad can I
And they're on Xperia
Collected is the
Function
Anna let's go down
Do the same thing so fun
On Experian
Collected
Alright
So in here
What we want to do is we want to first of all the number comes in as an argument here so let
Specify that
And then we can say
Mirror upgrades
And then
The index which is made
Currency
Plus equals
Number
So now you're just constantly keeping track of the experience that was killed
OK now it's about another function
Admiral upgrade
And we're going to pass in the upgrade which is of type in let's go ahead and give
H m upgrade Script so go ahead and open up Meadow upgrades
GD
Give It A Class name of meta up
So class name
Mirror
Excel
CD go back to your meta progression
And let's make this type in here
Type of metre upgrade
So now or going to do
Is we are going to The Fall
We're going to say
Mela upgrades
Metre upgrade
Let's let's change this so this may upgrade radio this variable which change it to save underscore
Potato
Cos that's a little bit more descriptive of what we're doing with this
Subtitled by online-courses.club We compress knowledge for you!
And then let's change it here save
Data
Exchange
In his own experience collected as
So if save data met upgrades so that's this key right here
Has
And then in here we want to say
Upgrade
And that's actually invert this also
Not what you can use the word or you can use exclamation mark
If not save data has upgrade ID
Then what we're going to do is we're going to say save data
Index metre upgrades
And then index
Upgrade.ie is equal to
And then let's go ahead and set a default quantity
Of
So what is this
What is the saying is that if we don't yet have an entry for the upgrade that were passing in
Then what we're going to do is we're going to set
That entry
To have a default value of quantities
So that means that essentially after we had the experience upgrade
Or experience gain
Upgrade
It's gonna look like
Experience game
And then it's going to have
An object like cell
That's what we're creating
If it doesn't exist
I never we can do it since we are now guaranteed that this
Save data has that upgrade with in the middle of grid
We can say say
Underscore dealer
Mirror upgrades
And then upgrade on ID
And then quantity
What's equals 1
Did you see what we're doing now
We are now referencing that quantity
And increasing and I might be so why don't we just say it do it here because
This will work every single time it is that conditional
Inherited condition
So if we said
12th day one then we have to return at the function
It just makes more sense to set up the initial empty object the initial object structure
And then always add 1 to it rather than deal with the other conditions
So after we are the upgrade I'm going to go ahead
And I'm going to print that save data just for
Just for debugging purposes and then in the ready method let's go and tell
Let's do admin upgrade
And then we're going to do a
What's a load
Res
Experience game
So
Well loading this pathway
Resource
Meta upgrades experience game
And so soon as we Run the game
What we should see
We should see
H dictionary printed and you can see that's exactly as we expect it right we have no upgrade currency
We have no
We have one metre upgrade with a
The other one
So that's all working so I'm going to remove that code
Because we don't need that now remove the printer as well because we verify that is were
So that's our data set
In the next lesson were going to set up saving and loading that data
From the door
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.