MARCH 11 → MARCH 14 – 2024
Tasks
Technical Developments
- Setting up interaction (see video below)
- We decided to start with scene three as it was most interaction heavy so we wanted to get that out of the way while also having our setup fit a scene like this.
- Added a ‘Trash’ class that is tagged as an Interactable and can be clicked. After which the InputManager handles the further proceedings.
- Added a custom score per ‘Trash’ object. This is to ensure it can be used for the actual implementation later on.
- Implemented dummy objects from a Synty asset pack to function as trash until an artist makes the actual models.
- Starting refactoring process
- Began with the foundation, creating a Scriptable Object pipeline.
- The first scriptable object, GameScene, holds all necessary data per scene. Such as name, index, referenced object and a method for cloning. (code below)
- Figured out I had to clone the scenes as to not change them permanently from code. As they are Scriptable Objects.
- Began with the foundation, creating a Scriptable Object pipeline.
Miscellaneous
- Driving exam (I passed yay)
Double Diamond
During this week I mainly focused on the interaction and started researching and planning the refactoring towards the end of the week.
Discover
Researched good solutions for my scalability problem while still being able to develop for Android and keeping the project clean and transparent.
Define
After gathering all the facts I decided to work with a Scriptable Object solution that would hold all data per scene. This would then be read by the needed scripts (mainly the GameManager) to process its data and work with the scenes as intended. This ensures scalability and ease of use as Scriptable Objects work wonders for setting up a small project like this.
Develop
Created the first working prototype that does as described above, the models are placed according to the images detected. This also works in real life but we don’t have access to a phone capable of AR at this moment in time.
Finished a simple prototype that includes interaction at the beginning of the week and later merged it with Emma’s (artist) work, to have it be more of a forest environment. This prototype implemented an InputManager handling the clicking of Interactable objects by accessing their scripts to call the needed method.
Deliver
This prototype was not posted as a release on Github but was instead sent to our client in video format. After which he provided feedback.
Plan
Next week’s plan is to further lay out the foundation of a scalable and performant framework. Based on Scriptable Objects and script inheritation. This should hopefully not take more than a week and in return, provide me with a solid base on which I can then more easily add features and improvements.
There will also be a Reality Check Festival, which is a festival hosted by our studies which we will all attend.
Research
The research conducted this week mainly revolved around trying to find a good solution for our scalability issues. Everything I found pointed towards using Scriptable Objects and while I do have experience with those already, I still decided to do some more digging into the subject.
- Better Data with Scriptable Objects in Unity! https://www.youtube.com/watch?v=PVOVIxNxxeQ
- SCRIPTABLE OBJECTS in Unity https://www.youtube.com/watch?v=aPXvoWVabPY
Reflection
This fourth week started really well, I managed to implement the interaction quite quickly and it immediately was in a solid state.
Unfortunately I also learned the repercussions of not setting up the project in a scalable manner and found that I now had to work on refactoring and starting (almost) from scratch again to allow the project to remain possible in a clean manner. This was a major learning point for me and in hindsight, I am glad that it happened here.
Media & code
[Serializable]
[CreateAssetMenu(fileName = "New Scene", menuName = "Eden/Scene", order = 1)]
public class GameScene : ScriptableObject
{
public string sceneName;
public int sceneIndex;
public GameObject sceneUIPrefab;
public GameObject sceneEnvironmentPrefab;
public SceneState sceneState;
public List<GameSceneAdditionalObject> additionalObjects;
public GameScene Clone()
{
GameScene clone = ScriptableObject.CreateInstance<GameScene>();
clone.name = sceneName;
clone.sceneName = this.sceneName;
clone.sceneIndex = this.sceneIndex;
clone.sceneUIPrefab = this.sceneUIPrefab;
clone.sceneEnvironmentPrefab = this.sceneEnvironmentPrefab;
clone.sceneState = new SceneState { state = this.sceneState.state };
clone.additionalObjects = this.additionalObjects;
return clone;
}
}
[Serializable]
public class SceneState
{
public State state;
public enum State
{
Active,
Inactive,
Hidden
}
}