Wednesday, September 25, 2024

Aftershock Simulator Sprint 2

 The first thing I worked on this sprint was the person occupancy icon, a special UI element that fills up with color to indicate the proportion of people in a building out of its maximum capacity.

All the code for getting the icon to fill up had already been written, the challenge for this task was taking code written for the old deprecated UI system and re-implementing it into Vivian’s improved UI system. I really had to get into the weeds of understanding how Vivian’s UI system worked, but once I did, I was able to add a new sprite element to the UI pop-up, grab a reference to it, and add the code that gets it to display the right amount of color fill. 

This feature was possible to calculate because of my previous work from last sprint calculating how many people were in a building. Ultimately I’m really happy with how much success I had finding parity working within the UI system without having to change it much.


With the next task, however, the lack of a designer really started to impact our team. I was initially given a card to fix the search-and-rescue timer that displays the rescue progress over a building. After investigating it, however, I found out that everything was working as intended, it just wasn’t clear to the player how it was supposed to work—it was a design problem, not a code problem. 

The team threw out a couple suggestions for how to better indicate to the player what was happening, but since these ranged from changing the art assets to working with the AI system, it ended up being passed from person to person. Additionally, we discovered that many of these suggestions were impossible with the way the game’s codebase had been structured, so I eventually just decided to add a text popup to the progress bar to describe what’s happening

The major outcome of this was that we realized we would need a designer, especially with the direction the project was going—the majority of our backlog needed specialist interviews before we could implement them, and even still, they didn’t have specs. Fortunately, our professor decided to step up as the project’s designer, especially since he plans to continue it past our involvement in the project.


This also, however, led to a pivot of our priorities for the project. One of the first tasks I had after this meeting was coming up with some discussion questions so we’ll be ready for a specialist interview in the future. We discussed what we thought would be needed for the project to better focus on its learning objectives, and starting next sprint, we’ll probably start working on more of those major re-designs.

Which is why for my last task of the sprint, I thought it would be worthwhile to try fixing the day/night cycle. It did exist within the project, but was disabled since it wasn’t properly functional.

The first issue to fix was that it wasn’t connected to the game’s in-game clock. After reading through the code on how the various timer and clock functions work, I was able to add another module to the clock that calls the day/night cycle to update with time, passing the current time. From there, the day/night cycle uses a bunch of math to figure out how bright the sun should be and what angle it should be at. I wrote a function that turns the hour/minute time into minutes, divides it by the number of minutes in a day, converts it to radians so i can take the cosine of the function, and then invert that so that the sun gets brighter and brighter, hits its peak at mid-day, and then gets darker.



There’s a similar piece of code with the moon lighting to keep things not too-dark at night, although it probably needs some fine tuning. I went ahead and implemented it to be functional, then I plan to show it to my team, get some feedback, and make a few adjustments—since taking things out is way easier. In particular, I’m worried about the performance tanking due to the dynamic shadows, but because of the way it’s designed it’s super easy for me to disable them if they’re too costly.


This sprint had me doing a surprising amount of problem-solving, but now that it’s over I think the team is in a much better spot having a designated designer and with our collaborations on the plans for the direction of the project. Overall, I think I made some relevant quality-of-life improvements to the game’s UI and visual elements. Looking into the next sprint, we have a much better idea of what we’re trying to make, and I can look forward to being able to implement the changes we’ve decided on.




No comments:

Post a Comment

Featured Post

ProcGen FPS Update -- 8/28/2024

  The level is procedurally generated each time the program is run.