Month: July 2019

Commuter

Devlog #7 – July 27, 2019

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.

Before we jump into it, be sure to check out our Discord, Subreddit, Twitter and Instagram to follow along more with the game. Now, with all the plugs being done. Lets get into the changes shall we?

Bugs.

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.

Photo of endless spawning…

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.

Sound

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!

Door Closing Chime
Door Opening Chime
Background Music

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.

Discord | Subreddit | Twitter | Instagram

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 

Commuter

Devlog #6 – July 20, 2019

The next station is Midland

Note: The images, features and info in this devlog may change on the final version of the game.

Hello friends and followers and happy Saturday to you all. This week we have a massive update for you! This is the biggest one we have done yet.

Before we jump into everything on this update. You may have seen last Sunday we did a live stream for about and hour. This was a fun little thing we did for you all. We put a time-lapse up on your Youtube channel if you wanted to check it out. Aiming to to more streams when time permits so be sure to subscribe to the channel as that’s where ill be going live.

Also, as always, be sure to check out our Discord, Subreddit, Twitter and Instagram to follow along more with the game. Now, with all the plugs being done. Lets get into the changes shall we?

Midland Station

Early morning at Midland Station

It wouldn’t be a transit system or a game for that matter if there is only one station to play! We have to build almost 50+ stations for the game so this expansion to our second playable station was important step for the game to see how the process will go to build another station in the code.

I wanted to design the game in a way that would be quick for us to add a station on the back end. Adding it wouldn’t require extensive work or changing 100’s of lines of code or worse, building a whole new script. This was a test of that.

While it’s done we did create some bugs that we were able to iron out so now when we push and create Fairview it should go much smoother now. The creation of this station also really makes the game start to feel like a game. You can switch between the stations no problem and the game just runs!

Signal System Enhancements

A visual example of what we needed to create.

In order for users to play the game and deal with the incidents, expand their network and change economy items to be profitable. The back-end system that runs the game just needs to work perfectly.

As stated in a previous devlog we created signal blocks. Signal blocks in this game are working just like real life. A train entered the block and tells the blocks around it not to accept any trains. This was created by creating fictional distances between the stations then telling the game to move the trains through that distance at a certain speed.

Do you remember in school when your math teacher asked how long it would take to go 3km at 45km/h? Well, that math I reluctantly learned in Grade 8 came in handy in this case and this case only.

We still have tons of work to do on the signal system and wont be able to create it in it’s full capacity until we complete all stations. But for now, the signals from Windermere to Midland and Midland to Fairview are complete and working.

The game now even only spawns arriving trains to the stations if there is actually a train coming. Super cool!

Stability Enhancements

As hinted above, with the expansion of the game into Midland this exposed several bugs that were fun to crack and fix. One of the bugs that we had was that when a train animation starts and the train appears to be entering the station. If the player hit the main menu button and then went back into the station the game would crash. Through a long long Sunday night of trying to fix this bug and consulting several developer discords. We were left with a bug that was unfixable based of the design of the game.

You see, when the animation for the train runs. There is a bunch of code that is running in the background that is calculating how many people to spit out the train, how many people need to stay on the train, and most importantly telling the signal system that there is now a train in the station.

If this process gets cancelled by going back to the main menu then the whole game crashes. It crashes the signal controller script and the game is done. It almost looks post apocalyptic. Trains not running, no one spawning, just an empty transit system. Cool look, but not the game we want.

To fix this we needed to do some things with the UI to stop the game from breaking. The first thing we did was created a loading screen when you enter the station. This gives the game enough time to process everything it needs to process.

The second thing we did was disable to UI temporary when a train enters the station (or better way to put it. When that function to calculate everything) is called. This adds sort of a cinematic approach to the game and in my opinion looks kinda neat!

Conclusion

There was tons of other little things that were done in this update. Please take a look at the change log below! Again, follow us on all our socials to stay in touch with the progress of the game. Talk to you all next week.

Discord | Subreddit | Twitter | Instagram

Changelog

Commuter: The Game
Alpha v0.4

Feature: Midland Station now created. 
Feature: Non-Hub stations (Midland) now talks to signal blocks vs set code. 
Feature: Signals from Windermere to Midland created. 
Feature: Signals from Midland to Fairview created. 
Feature: Trains now have a running cost calculated at departure

Tweak: Removed money awarded for arriving customers. Now, users will not get double paid for one person. 
Tweak: Adjusted train capacity to be more realistic. 
Tweak: Signal block update with departing trains vs set values. 
Tweak: Smoothed departing and arriving train animations. 
Tweak: Players now spawn @ hub stations (Windermere) on the side where    the train currently is, or will be next. 
Tweak: Canvas UI disabled during arrival animation to prevent crashing if the players goes back to the main menu during animation.  
Tweak: Adjustment to signal spawn times. 
Tweak: Player speed adjusted to be more realistic. Now have fast walkers and slow walkers. 

UI: Loading screen added on levels. 
UI: Social buttons and branding added to splash screen & main menu.

Design: Changed colours for Midland station. 

Bug: Design bug fixes. 
Bug: Fixed spawning location bug. 
Bug: Fixed game crash where if spawned while train was in station. Game would crash. 
Bug: Fixed bug where sprites wouldn't load on first launch of game. 
Bug: Fixed bug where capacity bar was broken.

Commuter

Devlog #5 – July 13, 2019

UI & Signal Blocking!

Well, here it is! Our first video devlog is out! Here is a first look at the gameplay and some of the changes we made this week! Check it out!

Changelog
Alpha Version 0.3

BUG: Offline Tickets now charge when the hour changes. No longer crashes
BUG: Fixed an Animation bug that, while rare, would cause the animations to fail.

UI: New top panel for game controls created.
UI: Colour scheme changed to be easier to see.
UI: Filled in Station Names and Map for Line 1

Feature: Frequency can now be changed by user by tapping frequency in the top.
Feature: Second station (Midland) is now unlocked by default.
Feature: Signal blocks now created to provide realism to arriving and departing trains. 
Feature: Arriving trains now generate players accurately. 
Commuter

Devlog #4 – July 7, 2019

Economy Enhancements & Loading State

Twitter | Instagram | Subreddit | Discord

Reminder: What you see in this devlog may be changed by final release of the game.

Hello fellow Commuters and for our North American friends I hope you had a great Canada Day/Fourth of July long weekend!

This week we wanted to do a lot more but was faced with a game breaking error that took a good chunk of my time to fix it. But, were cleaned up and ready to start going through our changes for the week.

Time Change

In Devlog #3 we created our time engine and at the time, it was to ensure that the dispatch of trains was working with our Signal Controller. We started to develop more and drew out the plans for next task to work on and found that using real time was not going to work for the type of game we would want to do.

I’m sure you are all are aware that typical tycoon style games work on their own time. So, when you end the game, the game pauses and then resumes when you restart the game. With that in mind, we changed the time engine to work on a local time system. Because of that we are able to speed up the game and run at a faster state allowing you to play the game a little faster.

Economy Enhancements

Now that we have a more usable Time system we are now able to run things “offline”. What we mean by that is that when you leave one station and go to another, the income you gather from the first station will get calculated and counted so that when your working in another station, you are still gathering income.

Also, we are now able to spawn sprites based of the time of day just like in real life. So, 1am is not going to be as busy as 5pm on a Friday. Before, we just had it spawning every few seconds. But now, we can control it with the data we have put in.

Example of calculations.

This adds to the realistic effect that the time of day tests your system for its efficiency.

Loading Script

So, as I mentioned we found a game breaking bug that took WAY to long to fix. Well, longer then I wanted. It came down to the saving and loading. The game upon getting killed would save all the necessary things it needs to save. Then when it reloads, it well, reloads everything.

This was working fine, then it game to me loading it on to my device for some testing and noticed that when the game launched, it crashed. No mater what I did, it would crash. Turns out when the game loaded and it did not have a save state it freaked out and crashed. So, after many hours trying to fix it we figured out the solution. Now when the game launches for the first time it will create a save state and then call it later. Then upon close, it does the normal working behaviors.

This was honestly like 3 lines of code. Funny how that works eh?

Thanks for reading this weeks devlog. This was intended to be a video devlog but ran into some tech issues when editing. Hopefully the next one will be a video for you all to really see the game.

As always please follow us on all our socials!

Twitter | Instagram | Subreddit | Discord

Changelog
Version Alpha 0.2

- Changed TimeEngine.cs to be local vs live time.
- Created speed code for fast forward feature.
- Created LoadingScript.cs to increase loading speed and prevent crashing.
- Changed GameController.cs to match spawn requests from EconomyController.cs
- Set out of station code to calculate income while not in station.
- Added players per minute to UI
- Trains now tally how many sprites board train for future features.