With a nice, long weekend to concentrate on fixes and features, we managed to get a lot of work done with Project Spaghetti. As usual, when we have a lot of overtime changes, rather than go through them during the show, we’ll go over the details here and mention the post.
Add music to the game
The background music for the game we previewed during the music special was ready to go into the game, so we went ahead and put it in. The music system has been in the game for a long time, just with no data, so it wasn’t too difficult to get the music playing. What did take a little work was balancing the music volume for each song against the others and against the in-game sound effects. Unfortunately, we don’t know of a great way to do this other than playing it by ear.
Picking the statistics to show by level
This is where we left off at the end of last week’s episode. We only had the stats to display chosen for the first town level, so we went through and picked the stats we’d like to show for the other levels as well, based on the types of enemies and bumpers encountered. Also, to give the stats displayed a little variety, we didn’t give them a fixed order, rather we gave them a random range that determines the probability of them being shown before others.
Updating stats through a function
Up until now, we’ve been directly changing the global statistic variables, but this makes any changes to the overall statistics system a huge, bug-prone undertaking, so instead, we now update any in-game statistics through a function. This allowed us to finally tackle lifetime stat tracking.
Lifetime statistic tracking
Incrementing statistics through a function made it trivial to also track lifetime statistics (statistics like how many enemies a player has shot over the course of every playthrough)
Showing a random scattering of stats between levels is fine, but players are going to want to check certain stats, so to do that, they’re going to need a menu to do it from. We added an Extras menu to the main menu and linked stats, achievements, and a credits roll to it. Unfortunately, the Commodore 64 retro interface is not great at displaying a lot of information, so we decided to go with a system where stats are displayed one at a time, one after the other. We used the same effect for achievements and for staff credits.
Add achievement base
In the future, we’re going to want to link up to different platforms’ achievement systems, which means having internal achievements tracking in place. For now, we created a function that takes an achievement ID as a parameter and unlocks it. After we hook up to the various platforms, we can add the necessary code to that function, rather than everywhere achievements are unlocked.
Display achievements when unlocked
When the achievement pops, we created an achievement display object that pops up a text box and adds a treasure chest graphic to it to let the player know they’ve unlocked an achievement. Of course, a lot of achievements are tied to stage clear conditions, so multiple achievements could pop at the same time, and we need to think of a good way to handle that. Queuing them up seems the most appropriate strategy, as long as the achievement conga line doesn’t keep going and going to the irritation of players.
Link achievements to gameplay
We had a huge wish list of achievements, so we went through and added all of the necessary triggers to the game. Obviously, some of these were quite tricky to pull off, but we did go through and test them all to confirm they were working properly.
Staff & Thank You Credits
To thank the people and viewers who stuck with us while we made the game, there were two places where we wanted to show credits: the ending and a menu. To make the data easy to access, we stuffed the data for the credits (name, title, description) into an array. The ending required creating a text display option that accessed the array and displayed text boxes with the information in places that wouldn’t obstruct the ending action. It took quite a bit of adjustment in the timeline to get things appearing right, but it seems good at the moment. For the menu, we took a hint from the way we display statistics and displayed the credits one at a time, one after the other. In the menu version, we were able to fit a little more information about why the people are in the credits, so we added that to the array.
Add secret level access points
These have all been added to the game and are revealed upon meeting certain in-game conditions. Of course, we can’t say what those conditions are, because it wouldn’t be a secret, but they’re spread throughout the game and have been properly tested.
Make the sun go down
This undertaking was completely underestimated. Making the sun go down was actually rather tricky to do from a timeline, but we managed, and to make the ending more dynamic, we timed the sundown to the enemy characters lining up outside the outhouse. To further express the passage of time, we switch day & night, sun & moon back and forth, speeding up the sun rise and fall events.
We added an option triggered by a key or button input to skip the ending and go straight to the ending menu. This was especially necessary for players going through subsequent playthroughs because seeing something once is generally enough for anything a player can’t control.
Display an extra “+” on New Game for every playthrough
Just so players could keep track of how many times they’ve gone through the game in one sitting, we’ve added a “+” to the New Game option in the ending menu for each playthrough.
Remove level select for New Game+ playthroughs
The level select makes sense for the first playthrough, but on subsequent playthroughs (beating the game and choosing New Game+), it meant players could just shortcut to the end and keep stacking up the “+”s to game point multipliers. We fixed this by skipping the outhouse level selection on anything but going from the title menu into a new game.
Open outhouse doors from a distance
The problem with the level select outhouses was that, by the time the player could tell through their actions that the door was unlocked, they would enter the outhouse and warp to a level with it. To give players a choice to back out and choose a different level, we made the outhouse doors open with a wider area than the warp trigger. There were a few issues with the outhouse doors opening and closing and reopening during warping, so we had to add a few extra checks to prevent the problem.
Player ending animation
This task has been low in priority in the list for some time, and we were thinking it unnecessary, but we decided to tackle it and are glad we did, because the addition of the cowboy victory jump after beating all of the enemies sends a clear sign to the player that they’re safe. One problem was that the animation was brief, so if a player was hurt when they won the stage, they’d jump for joy and go back to being hurt, so we made sure to prevent that with a condition check.
Delay laser reflection
This is a game balancing issue we’ve been wanting to address for some time. When an alien laser hits a crystal, it reflects back to the alien as well as spitting out two lasers at 45 degrees clockwise and counterclockwise of the incoming laser, but where these lasers will be going is very difficult to judge for players because laser fire is instant. We implemented a brief delay, where we indicate the direction outgoing beams will travel with a particle coming off the crystal before doing the firing. This definitely helps give players time to duck or react.
Let players skip the map
For the map to make sense, we have to display it for a few seconds, but players might not care about the map (especially after multiple playthroughs), so we introduced an option to skip it by pressing any key or button
When viewer Pandabitz mentioned the points might be a little extreme given all of the multipliers, we agreed. We went through and lowered the base enemy point value to 10, which is still plenty considering an exploding bullet carries a multiplier of x10. We also had to modify the coin code to make sure that the coins felt like a good chunk of change for the lower point values.
Bullets bouncing inside an enemy shield
We finally pinned down the problem when we saw it happen with the alien boss shield. The problem was that the collision event for the bullet was being ignored if the alien was hurt, but after the shield came back (and the alien was no longer “hurt”), if the bullet happened to be inside the shield, it would rattle around, unable to escape, as it was told to bounce off the shield. We had to change a few state conditions to address this. Hopefully the changes didn’t introduce new problems.
Player stays frozen if the game is paused during the move tutorial
This was just a condition check issue. The pause screen was checking for tutorial objects and keeping the player frozen if one was found. As the opening move tutorial included a tutorial object, this meant players couldn’t move when coming back from the pause screen. We added a variable to the tutorial object for the pause manager to check whether or not it should keep players paused.
Gold keys showed up silver / NPCs didn’t speak
These two bugs were actually related to the same thing. The problem was that we were resetting the “current_secret” variable in the secret room, so that the array no longer knew what keys or dialog to access. There was no reason to reset the variable, so we took that line out and everything worked fine.
Music restarts when returning to the title
Every time the player went from the title menu into a sub menu and backed out to the title menu, the main theme started over again. The problem was that the music play function wasn’t properly checking to see if the same music was already playing before trying it again. With that fix, everything worked fine.
Resizing resolution from options causes weirdness
When players chose a different resolution from the Options Menu, the window size would change, but the surface would switch to the base 320 x 240 size, until players left the menu and everything fixed itself. This was obviously not ideal, but anything involving surfaces and resolutions is a pain to fix. Thankfully, the resolution change in the Pause Menu was working, so we changed the Options Menu script to the Pause Menu version, and it worked. To help make issues easier to fix in the future, we pulled out every bit of code that changes resolutions or resizes windows/surfaces and put it into separate scripts to be called from the game. This way, every time we make a change, we don’t have to go into the Menu Manager, Arrow Objects, Menu Objects, Pause Menu, Result Menu, System Object, etc. That being said, there is still an issue where we have to either choose whether we want the window initializations and resizes to go off without a hitch, or we want to apply shaders, but that’s another problem for another time!
That was a lot of fixes, but, especially with the introduction of the music, the game is finally shaping up into a proper game. We’re looking forward to adding the alien boss fight mechanics on the next show!