WEEKLY NARRATIVE
This week I worked on pausing the game. And it was the simplest task ever to implement, but researching about it turned out to be a pain. All internet forums seem to suggest turning Time.timeScale to 0 will pause the game, but we had the concern of losing some control as timeScale is used by so many systems inside Unity. We came across the solution of writing our own PausableMonoBehaviour script that would derive from MonoBehaviour, but will have the added functionality of pausing the game. This, however, meant that all our scripts were to be modified to implement PausableMonoBehaviour instead of MonoBehaviour. We also thought of using a script that would keep track of the paused status of the game, and have a static public bool value accessible by all other scripts. This also meant modifying each and every script that used Update(), FixedUpdate(), LateUpdate(), or any collision checks. For simplicity, we just stuck with setting the timeScale to 0, and it worked just fine.
I also worked on making the UI prompts context sensitive. Whenever a UI prompt is displayed, it checks to see what device was used to provide the last input (mouse & keyboard or controller), and changes the prompt accordingly (Press Shift vs Press Circle). This method does not differentiate between multiple controllers, so an Xbox controller or a PS4 controller is still a controller, and both will yield the same UI prompt - not helpful. This is something that I've been researching on, since we're now using ReWired, and checking which device was used to provide input kind of nullifies the point of using ReWired in the first place.
I also worked on making the UI prompts context sensitive. Whenever a UI prompt is displayed, it checks to see what device was used to provide the last input (mouse & keyboard or controller), and changes the prompt accordingly (Press Shift vs Press Circle). This method does not differentiate between multiple controllers, so an Xbox controller or a PS4 controller is still a controller, and both will yield the same UI prompt - not helpful. This is something that I've been researching on, since we're now using ReWired, and checking which device was used to provide input kind of nullifies the point of using ReWired in the first place.
CONTENT WITH HOURS
- Pausing Research (1.5 hr)
- Pause implementation (0.5 hr)
- Game meeting (1.5 hr)
- Context Sensitive UI prompts (1.5 hr)
- Pause menu fixes (1 hr)
WORKFLOW EXAMPLES
POSITIVE OUTCOMES
- The game seems to pause just fine with timeScale without any bugs.
- Context sensitive UI prompts! So now if you're using a controller you won't see things such as "Press spacebar"
NEGATIVE OUTCOMES
- Pause research turned out to be not very helpful.
- All controllers will show the same UI prompt - so the UI prompts are not completely context sensitive.

No comments:
Post a Comment