The Pokedex recreation was an exercise to replicate the list-recalling and getting familiar with scriptable objects as a concept.
Role: Solo
Duration: 2 Weeks
Tools Used: Unity
Genre: System Cover
The idea for this project was to understand what it took for the Pokedex system to function correctly. Upon replication through scriptable objects and recreating the infrastructure, I built this with the process of 1. Pokemon are locked (Undiscovered), 2. Discovered Pokemon become unlocked through if it’s seen (Discovered), 3. Pokemon can be caught and once caught give more information (Caught).
The process of deciding which generation to choose didn’t necessarily matter, I personally love the character design in gen 2 so I chose this one.
I then worked on the container known as the scriptable object. This stored the information that I pulled off of (https://bulbapedia.bulbagarden.net/wiki/) was used to populate each scriptable object, making it recall it from a list.
Technical Design:
Firstly, for the Pokedex, the system needed a way to populate the information stored in the scriptable objects; this is where the Awake() and SetUp() method comes into play.
SetUp Function:
This function works in conjunction with another script that is attached to the Pokemon manager object. What its operation is doing is being called when the [Find Pokemon] button is pressed, which loads a Pokemon at random, taking its information and storing its data through the scriptable object into the list. This works by updating the Current Index and overriding that empty object with the scriptable object associated with the random Pokemon called.
The List:
This list handles the PokemonEntries, a game object containing all Pokemon Scriptable Objects, and updates where the Scriptable Object is in what state (discovered, caught, undiscovered) and takes the corresponding state, updating its sprite transparency value and changing the alpha on it.
Next, we have some checks with if and else statements checking pseudo-states of the Pokedex.
UpdateData(): Discovered State
This function takes the PokemonEntries[currentIndex] if the Pokemon is {Discovered} and updates the information straight into the scriptable object, overriding its current information and replacing it with the new data.
UpdateData(): Caught
This function takes the PokemonEntries[currentIndex] if the Pokemon is {Caught} and reveals sprites and text to the scriptable object, overriding its current information and replacing it with the new data.
UpdateData(): Undiscovered.
This function takes the PokemonEntries[currentIndex] if the Pokemon is {Undiscovered} and nulls out all information.
I learned the essence of scriptable objects and how they are used as containers that can be templates.
I also learned how to take a random range in a list and update that specific location index, updating the information depending on which state it corresponds to. This way of building on the information was something I learned how to do more efficiently through debugging processes along each step.
The challenges presented for this game were the following.
1. Understanding the information needed to build this kind of system -> in turn, deciding how to reverse engineer a system such as the Pokedex.
2. I walked away with a better understanding of the power of the “scriptable object” template and how to update information for loops and lists.
3. Setting up the infrastructure was pretty complicated.