Summer 2022 Repeat Journal
Planned work
This week, I have to work on
- Research procedural terrain generation (est. 4h)
- Implement procedural terrain generation (est. 4h)
- Research and implement a blizzard effect when a fight starts (est. 4h)
- Research Poisson Disc Sampling (est. 2h)
- Research Poisson Disc Sampling (est. 2h)
Update 1 : 27/06
I watched Sebastian Lague's introduction video to Procedural Terrain Generation (link) and updated the portfolio to talk about the failed attempt at layout generation and explain how terrain generation works (4h).
Update 2 : 28/06
I started implementing Sebastian Lague's Procedural Terrain Generation (4h). Somehow, I hadn't taken into account the duration of the video tutorials whilst estimating the time each task would take, meaning this would have to span over multiple days. Other than that, I haven't encountered any issues.
Update 3 : 29/06
I continued the Procedural Terrain Generation implementation (6h). This took longer than expected as the tutorials were using the Standard Render Pipeline, meaning the shader code using Cg didn't work with the Universal Render Pipeline. To remedy this, I had to spend time recreating the shaders in ShaderGraph. Fortunately, I found a thread on the Unity Forum started by someone who followed this exact tutorial and encountered the same issue. I also added triplanar mapping on a separate shader. Later during refactoring, the generation stopped working for me. I lost a lot of time trying to fix it before realizing one of the values was set to zero. Once that was set to a positive value, it worked fine again.
Update 4 : 30/06
I finished implementing Procedural Terrain Generation, cleaned up the code, re-enabled the possibility to use a falloff map and added a shader which uses multiple textures and tints to paint the terrain based on the height of the various layers (6h). I didn't encounter any major issues.
Update 5 : 01/07
I researched and implemented Poisson Disc Sampling based on a tutorial by Sebastian Lague (4h). I also implemented a scriptable object to store sampling settings. After doing a bit of research, I couldn't find a way to create a blizzard effect, so I'll put this task off for later.
Planned work
This week, I have to work on
- Research how to tell a story through the decor and find appropriate props (est. 6h)
- Implement said props in the first level (est. 6h)
- Research Hotline Miami-inspired procedural level generation (est. 4h)
- Implement Hotline Miami-inspired procedural level generation (est. 4h)
From here on, I'll use the following format to convey :
- Green represents narrative-related tasks
- Olive represents technical tasks
- Estimated and actual spent time are in bold
Update 1 : 20/06
I watched a pair of videos by Game Maker's Toolkit and Extra Credits on storytelling, which gave me the insight I needed to figure out the theory of telling a story through its decor (4h), relying on environmental storytelling to help build the lore and the characters.
Update 2 : 21/06
I decided to take the points of interest (POI) which were already implemented in the first level by other team members and inject plot relevance in them. In that optic, I took each POI and wrote new dialogues spoken by Erik when interacting with them (4h). I have also contacted Erik's voice actor so that he could record voice lines for those new reactions. This will also help make the game more uniform by having all lines of dialogue spoken instead of having some just being displayed lines of text.
Once I'll have enough time to do so, I also plan to add a Credits button in the menu to actually give credit to the three voice actors of Erik, Heimdall and Loki. While the latter two's dialogues still aren't used in the game, this is something which I intend to remedy if I find the time to do so.
Circling back to the environmental storytelling, once the current POIs are all repurposed, I'll have some family and friends play the level and collect their feedback. Based on that, I'll decided whether to include more POIs or not.
Update 3 : 22/06
I carried on with yesterday's work and replaced the old POI dialogues with the new ones (1h). From here on, this task will have to be put on stand-by until I can get the voice lines recorded and feedback from ensuing play-testing.
That's why I moved on to the next task, procedural level generation. The first step was research, so I studied a paper by J. A. Brown et al. about Procedural Content Generation of Level Layouts for Hotline Miami (3h). Procedural level generation being a dropped feature, I have already read through this paper a handful of times, so technical concepts relating to evolutionary computing are not foreign and I was able to extract the information I needed relatively easily. I have good hopes that I'll be able to wrap up the procedural level generation by tomorrow, although I might need to tweak the generator to fit the following features I intend to add.
Update 4 : 23/06
I continued studying the paper and established a general data structure which I will use to create the level layout generator (4h). It took longer than expected because of fatigue, but I'm still on track with my planning.
Update 5 : 24/06
I started turning the data structure I established into usable code for the generator (4h). Before moving on to the evolutionary computing part, I wanted to make sure the mesh generation worked as intended first. Creating a grid mesh from a room five-tuple was easy enough, even if I had to rely on code by Catlike Coding to help me get it working. Turning a chromosome into many meshes that are cut to remove the overlap, however, proved to be a more difficult task.
Removing the unnecessary vertices is the easy part, you only have to look out for those on the edge of the "mask" which need to stay even if they are shared.
Removing the unnecessary triangles, however, is another can of worms, as it relies in indices, which change the moment you alter the number of vertices. My solution was to rely on "squares" (basically, two adjacent triangles which form a square) to identify which can stay and which should go.
As of today, I have encountered two problems :
- The mesh cutting doesn't work properly for rooms with a placement type of U ;
- The function which is supposed to calculate a room's surface area doesn't return the proper value.
I have no idea so far how to fix this, but I'll come back to it tomorrow and will hopefully find a solution.
Update 6 : 26/06 - Weekend work and reflection
I decided to work on the project this weekend as I don't want to fall back too much on my work planning. I continued working on procedural level layout generation on Saturday (6h) and Sunday (8h). I encountered even more issues as I was working with non-rectangular meshes, which was a struggle to generate. Even once I managed to generate those, the evolutionary computing part decided to put up a fight and refused to cooperate. If I can't manage to get it working by tonight, I'll move on and find another way to create a non-rectangular level layout.
As this week concludes, it's now time to reflect on what I've accomplished.
What I had to do | Research how to tell a story through the decor and find appropriate props |
Implement said props in the first level | Research Hotline Miami-inspired procedural level generation | Implement Hotline Miami-inspired procedural level generation |
Estimated time | 6 hours | 6 hours | 4 hours | 4 hours |
What I did | Learnt about environmental storytelling and the importance of using the decor to tell the player about the lore |
Replaced all written dialogues with newer, more pertinent ones Commissioned Eric's voice actor to record more voice lines |
Reread the paper Took notes and wrote the bases for the code |
Implemented the system as explained in the paper Added a system to display the layout as a mesh |
Time spent | 4 hours | 5 hours | 7 hours | 18 hours |
Why I had to do it | As it stands, the narrative isn't palpable at all within the game, which needs to be fixed | The game only has one level, I want to add a procedural level generator, step-by-step | ||
Problems encountered | None |
I hadn't planned new voice lines, so this task will have to continue in parallel until I can complete it for good
|
Fatigue |
The mesh generator didn't work properly The function to calculate a room's surface didn't work The mesh cutting didn't work properly The evolutionary computing didn't work properly |
Reflection | This was really educative | I should plan a bit further ahead from now on, to avoid being taken aback | I should be a tad less overconfident about my ability to make something work. At least I am certain to have tried everything before moving on |
- Research how to tell a story through the decor and find appropriate props (est. 6h)
As it stands, the narrative isn't conveyed in the game, which needs to be fixed. To solve this, I watched videos and learnt about environmental storytelling and the importance of using the decor to let the player know about the lore. This took me 4h, and I encountered no major roadblocks for this.
- Implement said props in the first level (est. 6h)
As it stands, the narrative isn't conveyed in the game, which needs to be fixed. To remedy this, I have replaced most written dialogues with more pertinent ones, and I also contacted Erik's voice actor to record more voice lines. This took me roughly 5h, and it posed no major problem. However, as I hadn't planned for new voice lines, it added more tasks to do, which means I'll have to continue working on this task in parallel to the rest until it's finished (wait for the new voice lines to be recorded, implement them, get the level play-tested to see if the narrative is conveyed better and react accordingly).
- Research Hotline Miami-inspired procedural level generation (est. 4h)
The game only has one level, so I want to add a procedural level generator, doing so step-by-step. For starters, I reread the paper I found earlier this year about procedural level layout generation and established the bases for the code. This took me 7h, mostly due to fatigue, but the time I saved on the narrative tasks meant it didn't lose me any time for this week.
- Implement Hotline Miami-inspired procedural level generation (est. 4h)
The game only has one level, so I want to add a procedural level generator, doing so step-by-step. To get the level layout generator working, I implemented the system as explained in the paper, as well as another generator to turn the layout into a usable mesh. This took me a staggering 18h, as I encountered issues every single step of the way : The mesh cutter didn't work properly, the area calculating function returned incorrect values, it took me a day and a half to get the more complex mesh generator working, and the evolutionary computing part doesn't seem to work with the mesh generator. This made me feel a tad less overconfident in my ability to make something work, and it took me most of my weekend for nothing, but at least I know I have tried everything before abandoning the feature and moving on.
All in all, I had planned to work 20h this week, but ended up working 34h, mostly due to the implementation of a complex feature for which I couldn't find any pre-made solution on the Internet.