Journal Entry 1
Date: 21. 4. 2022
Activity
Developed and tested The Explorer game based on One Page Design from Project A. Implemented the individual features incrementally, uploading simplified version and updating it with respect to gameplay experience.
Notes
I got stuck in multiple phases of the development, mainly because I didn’t test all of the required features while creating One Page Design. They seemed pretty straightforward having the experience from Scripting Walkthrough tutorial but once I had to integrate them, it didn’t work out as I imagined. Examples:
1) Door that unlocks after collecting multiple keys
We’ve only worked with basic door that could be open with pressure pads or switches (one time events). To be able to work with the keys, I had to inspect KeyCanvas, player’s inventory with unique key identifiers and map it to Key prefab. I was lucky that I used exactly 3 keys in my 1PD (it wasn’t on purpose) for which I could use the predefined components. Instead of a basic door sprite I wanted to use HubDoor design which is intended to be used for 3 unlock phases (sprites HubDoor0, HubDoor1, HubDoor2, HubDoor3). After some digging, I found a tutorial that explained this setup so I mapped it on my key inventory items but then I got another problem - how should I deal with door unlocking and opening? I wanted to use the DoorOpening animation but I didn’t manage to replicate it for my HubDoor. I decided to switch on a dialogue with ‘Press E to unlock’ message once that all 3 keys are collected and Ellen approaches the HubDoor. When the interact button is pressed, the door unlocks and Ellen can pass in front of them. I decided to omit the door opening animation for now. HubDoor is used in Zone2 where the camera temporarily zooms the door on key pick up. I spent quite a lot of hours trying to implement it in my scene, facing mainly the problem of having 3 keys instead of just 1 key. I wanted to trigger the animation for the first key collected but it could be an arbitrary key out of the 3. In the end, I managed to do it using Composite Collider 2D + Rigidbody 2D on Keys parent object and Circle Collider 2D on the individual keys. With setting parent’s Rigidbody to asleep mode for each key pick up event.
2) Temporary abilities effects
The goal was to create flower objects that could be collected and that would be causing random positive or negative effect on Ellen’s abilities. After some testing, I decided it would be better to reset those abilities to default values once Ellen dies. Otherwise the player would have to wait for 30 seconds for each ability to get back to normal. Which would be pretty annoying in some level sections where nothing can be done before the effect fades out. These temporary effects are implemented using the coroutines on PlayerInstance so I tried to stop these coroutines on Ellen’s death. That didn’t do the trick, WaitForSeconds still continued and the effect was reverted after its original 30 seconds interval. In the end, I decided to go for a solution that stores a unique id for each applied effect. Before the effect is reverted, it is checked whether the id is still in the unprocessed ids list. If so, the effect is reverted. On Ellen’s death, the list of effect ids is cleared and all abilities are set to their default values.
3) Score and abilities canvases
The player should stay informed of his current time score as well as the abilities effects that were applied. For this, I added 2 text panels on the bottom of the screen that I had to map on the current score and abilities changes. We haven’t focused on UI development so I tried to figure it out myself. It took me a while to find a way to adjust panel’s size and position with respect to screen size.
4) Prefabs vs. scene object instances vs. components
Sometimes I couldn’t decide whether I should attach some component to the prefab or to the concrete object in the scene and whether to make some class members static or not. Especially for objects that should appear just once per scene (Ellen, Score…). E.g. I attached AbilitiesEffects component to Ellen’s prefab so that I could refer to it from other prefabs (flowers, acid…). Or I created Score prefab with ScoreController component but then I also added Score instance to the scene which might be redundant when I’m using the functions from prefab’s ScoreController.
Invested hours
30+ hours
Outcome
- Final build uploaded
- Recorded the gameplay and uploaded it to YouTube
Files
Get Project B
Project B
mff-gdintro-2022-b
Status | In development |
Author | lhotanok |
Genre | Platformer |
Tags | 2D, Singleplayer, Unity |
Leave a comment
Log in with itch.io to leave a comment.