Bugs, Bugs, Bugs, Bugs, Sound, Bugs, Bugs.
Greetings friends! Welcome to the next devlog for Commuter: The Game! This week we, unexpectedly needed to do a bug bash.
Ahh bugs. Can’t have em and boy do they come up when you don’t want them. Coming off the heals of our biggest update to the game last week naturally there was going to be some bugs that came along with it. Some of which were pretty easy to fix and that we anticipated. Others, and one big one, was so rare and unique the Unity dev community was stumped and was a major bug found with this build of Unity.
Thankfully, we managed to fix it. But the funny thing is, we don’t know how it was fixed. The bug was somewhere around our Spawn routine. The game has two types of spawns. “First Spawn” and “Re-spawn”. When a sprite spawns it is given a classification or “Tag”. This tag marks it as a departing or arriving sprite so that it can do the right Pathfinding out of the map.
This bug lived in the re-spawn code. When the player (you) exited a station the view. The game counts the number of players on the platform and their tag and then stores it for when the player goes back to that station. If a train arrives in the station while the player is out of it that number gets added to the train. If the player entered back into the station. Then the number gets thrown into the loading script and spawns the number of sprites that were left there. Simple right?
In the super secret computer build of the game this was working no problems and without any errors. When we pushed the build to mobile. The game would just keep spawning and spawning and spawning in an infinite loop until the game engine cant handle it and crash.
As you can expect this is frustrating when the code is saying one thing and a second build is also saying one thing but the intended destination said another. Then, all the sudden, it was fixed. To this day I don’t know what I did to fix it. I hope it was just an error with the device and not the code, but time will tell.
This update was not all lost. We did manage to get some more sound added to the game. We have ambient background music that is playing during the game as well as door open and close chimes that comes from the very handy database the transit system here in Toronto has. Take a listen below at the sounds that were added!
There were some other minor changes we made for some UI stuff, tweaks to the signals and dispatch features of the game. See the full change long down below.
Finally, as we enter into the month of August and it being my birthday money. The next Devlog for this game will be on August 10, 2019. Taking a week off from this game to clear my head after the bug bash as well as work on a proof of concept for another game. If that proof works out and the pre-development works out, then the devlogs will become bi weekly.
Commuter: The Game Alpha Version 0.5 Bug: Fixed bug where re-spawning was not stopping. Bug: Fixed bug where trains would not enter station if it was full and just delete. Bug: Fixed bug where players would still board train, even when train wasn't there. Bug: Fixed bug where saving/loading was sometimes crashing game. Bug: Fixed bug where empty stations would not spawn sprites. Tweak: Terminal Stations now only dispatch train if frequency time has been hit. Tweak: Animation improvements on trains to match sounds. Tweak: Cleaned up some unnecessary code to speed up game. Tweak: Adjusted economy engine so train depart fees are more realistic and does not cause significant deficit. Tweak: Players will not pay for train departures on track they do no own. Feature: Sound now added to the game. Ambient music and doors open/closing. Feature: Economy Engine now tracks income and expenses