The Eleventh Week

Having returned to Winchester, I went to the studio on Monday morning and continued my work from the prior week, thinking of and adding variables to the main script of the piano mechanic prototype. I was feeling quite unhappy, however, and was having a bit of a hard time thinking straight. I spoke to Sid and to James about how things were going, but while I was periodically returning to thinking about and adding variables, I proceeded to spent some time feeling generally tired and incapable of doing anything. I did get around to slowly programming some code for calculating the values of the piano mechanic’s core counter and the radial position of the Piano Man’s line, but I didn’t get a lot done, and didn’t really feel like staying in the studio for long. After I had my dinner, I spent the evening relaxing at a friend’s house, and thus didn’t get any more work done.

On Tuesday morning, I went to the studio again and spent a short while editing some of Adam’s writing for a blog post he’d been working on. Adam came in, and I briefly spoke to him about it to clarify some ideas, before I watched a portion of one of the talks I’d missed at EGX Rezzed (about the technology behind an online deathmatch that supported thousands of simultaneous players). At this point, I started to feel very unhappy, and left to go home soon after. At home, I read a booklet that I was recommended during my previous First Support appointment, and then I spent a pretty long time being generally incapable of doing anything, feeling tired and very unhappy. As I wasn’t able to work, I took up a friend on the offer of spending the evening at his.

On Wednesday morning, I went to the studio and read through Jason Schreier’s article on the development of the upcoming Dragon Age 4 (which I’d recommend reading), but then spent a while feeling generally unhappy and unable to get anything done. When Sid arrived, I joined him in the other studio for some company, and looking at old scripts as a reference, I eventually started thinking about and programming the Piano Man’s movement after the role reversal in the piano mechanic. Once I was done with this, I programmed the player’s movement for the piano mechanic, accelerating towards a target radial velocity based on the horizontal movement of the analogue stick. Then, after trying to help Sid with some programming, I separated the code to loop the counter value (during the middle section) from the subroutine that increases the counter value, so that the looping could happen after the Boolean it relies upon has been set. I also programmed the calculation of the vertical displacement value for the player and Piano Man, so that they could have a synchronised bouncing motion. After helping Sid with some movement programming and speaking to Adam for a while, I programmed the changing of the synchronisation values (opting to have separate sync values for the player and the Piano Man to properly allow for the two values to have different effects), as well as the setting of Booleans to determine the current state of the interaction. After this, I headed home, and after having dinner, I briefly programmed a line of code to calculate the current vertical offsets of the rings of piano keys, and called all of the subroutines I’d coded in the frame update. Then, feeling tired and unhappy, I went to bed.

When I went to the studio on Thursday morning, I was still tired and unhappy, and I got nothing done there for a good while. Eventually, I got to work, and made it so that the synchronisation value can only be increased after the initial landing bounce (from the second bounce onwards). I then thought of and implemented a way to make sure the Piano Man always aims to bounce in the middle of each key, by calculating the distance between his line and the middle of the key he landed on upon each bounce and adding this distance to the amount by which he’s moving (since his movement is determined in terms of how many keys he’s covering between bounces). At midday, I went to my First Support session, and after returning, switched studios (for company) and started thinking about and programming the script to draw the rings of piano keys. I first programmed the logic for when to update the key rings (so that new ones weren’t being drawn each frame, so save on performance), and then the loop for creating a gradient of alternating blacks and whites to set their colours (based on how many keys there are). I then programmed a loop to draw the lines (based on the number of keys, the number of points per key and other factors determining size and position), as well as a short subroutine to clear them when necessary, and updated the logic to determine whether to draw or clear them.

After this, I programmed the code for setting the vertical positions of the lines (by moving the objects the lines are locally attached to, rather than having to redraw them), called the vertical position subroutine in the logic subroutine and called the logic subroutine in the frame update. At this point, I attached the scripts to the necessary objects in the scene, set some test values and tested that the rings were being drawn. They weren’t, so I tried to amend the errors that were being detected, first adding the different analogue stick inputs to the project’s input settings (with separate right analogue stick inputs for Windows and Mac OS). I also noticed that I was only defining the size of the Piano Man’s keys’ colour gradient, so I set that of the player’s, too. After these changes, I found out that a gradient can only have a maximum of eight colour keys, which would only cover four piano keys at a time. For the time being, I changed the number of keys from sixty-four to four, and felt that the best thing I could do would be to instantiate and destroy objects with four keys attached to each, covering different arcs of the ring, based on the number of total keys (which would have to be a multiple of four). Since the resulting lines were pretty hideous, I disabled their casting and receiving of shadows, decreased their width and increased the number of points per key (so that they’d adhere more closely to the shape of the cylinder they were wrapped around). I also tried changing the lines to align to face consistently forwards, but this meant that they were only visible from one side, so I reverted them to being aligned to the camera’s perspective. The lines now looked decent enough, but there were still only four keys on each.

After helping Sid out with some programming, I headed home. After I’d had dinner, I thought of how to go about segmenting the rings of keys, and decided to add a Boolean that would signify when to destroy old line segments (so that I wouldn’t be infinitely instantiating them). I added the setting of this Boolean to the script, and programmed a short script that would be attached to each segment object to destroy them when necessary. I then thought about how to make sure the segments weren’t being destroyed immediately after they were instantiated (due to how I’d have to reset the necessary Boolean), and decided to check that at least a frame has passed since they were instantiated before they can be destroyed. After a trip to Tesco, I adapted some values and calculations to support having multiple segments per ring with four keys each, created a prefab for the segments (with a line renderer and the destroying script attached), and programmed the line drawing subroutine to use two loops instead of one, with one for setting individual line point positions inside one for determining the current segment. I tweaked the gradient setting loop to support having only four keys, and upon testing, the code was working as intended. Feeling quite tired, I then proceeded to head to bed.

On Friday morning, I headed to the studio and showed Sid Hotline Miami 2: Wrong Number (since it’s a good game and he’d only played the first one), until Ella showed up and the three of us spoke for a while. After we’d grabbed lunch, I spent some time speaking to Ella and helped Sid with some Unity and programming issues, but I started to feel very unhappy and was incapable of working. Eventually, I went home, having got nothing done. I continued to feel unhappy and useless after dinner, and the unhappiness proceeded to get worse, leaving me incredibly depressed for much of the evening. Eventually, I went to bed in quite a sorry state. Saturday wasn’t any better, either, as the unhappiness and numbness that I was feeling in the morning grew into a complete breakdown by the afternoon, and I won’t go into details as to how rough I was. By the evening, I was extremely unhappy, very numb and completely incapable of doing anything productive, and I eventually headed to bed in such a state. For future reference, I don’t recommend being alone and as hopelessly depressed as I was.

This brings me to Sunday, which I’ve spent writing this blog and feeling numb and very unhappy. I’m not really pleased with the amount of work that I got done this week, especially considering how little I managed to do the week prior, but I’m hoping that I can pull myself together this time. I know that I’ll need to finish off the piano mechanic this week, and I’ll hopefully be able to make some progress with the brass mechanic, as I’d already (to some degree) planned a way of implementing it. I also have a video call scheduled for Tuesday afternoon, though I won’t go into any details right now in case nothing comes of it. I’ll see how all of that goes, though, as well as how mentally stable I’m able to remain throughout the week, and I’ll let you know in next week’s post.

Advertisement