Tuesday, February 11, 2014

Dev Blog 22 - Double Blog!

We're back in business! Hackbeanpot was fun, but now I'm back on Chromacore. Forgot to do a blog yesterday, so here's a double whammy blog today:

I worked on another music track, one that's more mellow and slow. I spoke with Korbin about the timestamp issues I was having, and from what I described to him he thinks I'm time-stamping the song properly. I sent him the .FLP files for the song I created so he can take a look for himself.

In the meantime I've looked through /r/GameDevClassifieds for any musicians that want their work in games. There I found a cool guy with some great music tracks willing to give his songs away for free so long as I share the wealth if I make any money off of Chromacore. I'm now working with /u/ioncehadsexinapool to select some his tracks I think are suitable for Chromacore and get the stem files so I can chop them up (properly).

Ronny and I have a working session tomorrow (Wednesday) so we can jointly work on an mp3 analyses algorithm in Unity. He has one working in Java so (hopefully) this will mostly involve C# to Java translation.
I wrote some code to setup a skeleton for tomorrow's work session. The way I envision this working is LoadingScreen.cs will handle importing the mp3 file, and then invoke another script AudioAnalysis.cs that will handle all of the information gathering. Once that is done, AudioAnalysis will invoke another script LevelGeneration.cs that will handle the creation of the level based on the information passed to it by AudioAnalysis. Once completed, it will call back to LoadingScreen.cs to tell it the level is ready, and then the game will proceed to the generated level.

Saturday, February 8, 2014

Hackbeanpot!

Hacking away on a new project over the weekend, will return to Chromacore on Sunday.


Friday, February 7, 2014

Dev Blog 21 - Level Up!

Met with my professor, academic adviser, and the dean of my college to finalize the details of my independent study! Soon the credits will be officially on the books.

Today I continued working on Level 2 - I realized that the automatic note placement wasn't working properly, and discovered that the Notes List and Notes Array wasn't being sorted correctly. It was being sorted quasi-alphabetically (since that's what the built-in List.Sort() does) instead of naturally numerically.
So elements in the list were incorrectly sorted as "0, 1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 21, 22, 23, 24, 3, 4, 5, 6, 7" instead of simply "0, 1, 2, 3, 4, 5....etc"

After fixing this sorting issue, the Notes still sounded "off" by a little over 1 second, I think due to improper timestamp labeling. Sent a message to Korbin for some insight - he timestamped mp3 files that worked perfectly fine with my auto-placement algorithm, will see if there's a specific way of doing this (I simply timestamped based on the time shown in FL studio).

I very much like the song I created and think it lends itself to designing an interesting level, can't wait to have it working! I'm off to Hackbeanpot in an hour or so, hopefully the timestamp problem will be clarified over the weekend.

Thursday, February 6, 2014

Dev Blog 20 - Debugging

Today I once again combed through the Unity Answers and forum threads about mp3 importing for Android hoping to find something I missed or some new insight - no such luck. I added some more debugging code that might be able to tell me some more information about what isn't working properly, waiting on results.

In the meantime, I don't have any other issues to work on, but I do have the milestone goal of 5 stock levels due in 10 days, so I've begun work on additional levels for the time being.

Update: Good(ish) news! The debugging code I added actually gave me an error that helped! It threw a FileNotFoundException and listed the filename as "/ /sdcard/Downloads/burn.mp3" when it should be "file: //sdcard/Download/burn.mp3". This is quite peculiar since I had the filepath output to the debug text this entire time - this means that somewhere between when the filepath is recorded and given to WWW, it's modified or messed up in someway.

Update 2 @ 6pm: Spent all day creating a new music track and building a 2nd level. I intermittently played bug detective too, not much progress on the file path front though.

Wednesday, February 5, 2014

Dev Blog 19 - Snow Day!

Snow day! Boston is getting 6-8 inches, and it's the perfect kind for making snowballs~~~!!!! I helped introduce my friend's kitty "Frozone" to snow for the 1st time - he was very confused and cold!

Anyway, back to business - today I became suspicious of the extra forward slash that had been added in front of the file paths on Android. I had applied a fix for this earlier (by removing one of the forward slashes if on Android) and now I'm thinking that could be causing an issue related to the mp3 import problem. I'm removing my earlier fix and seeing if that changes any results or debug output.

In the meantime I'm also knocking out some more low priority issues (updating end of level credits, and increasing the file browser text another 10% or so).

Update: No visible changes from removing forward slash fix, re-applied it

Update 2 @ 11:20PM: Using wwwData.bytes.Length.ToString(); I was able to discover that when normally imported a song would have something like 500,000 bytes, but when run on the Android has zero. This means that the song isn't even downloading properly, which could be the real source of the mp3 import issues. It may have something to do with the forward slashes, but I don't think that's the root issue. Working on discovering the real source of the problem on Android.

Tuesday, February 4, 2014

Dev Blog 18

Today I implemented a potential solution to the mp3 import problem for Android.

So the issue isn't with static vs. non-static IEnumerators, the issue is that StartCoroutine cannot be called from static functions without a script instance. The solution is to implement a Singleton Instance, which I had already implemented somewhat. I refactored the code a little bit to look more like the solution in this UA thread: http://answers.unity3d.com/questions/47513/ienumerator-solution.html

This still imports and plays mp3's on PC, waiting to test on Android now.

Update: The Singleton Instance refactoring didn't work, got same results on Android. In the meantime I increased the button size for the file browser and the text of files/folders/navigation menus on mobile platforms only, to improve usability for touch screen users. Looking for a alternate solution to the mp3 issue, but this might force us to have the 2nd gameplay mode as a PC-only feature for now.

Monday, February 3, 2014

Dev Blog 17

Had a Google Hangout call with Ronny & Sean on Saturday to discuss progress and chart a course of action. Ronny used a blog post to guide a Java implementation of a program that takes a WAV file, analyzes it, and creates a visualizer style graph, which is essentially what we need to do. This week, they'll jointly be working on a similar Unity implementation.

Today I worked on the issue with mp3 not importing properly on Android all day to no avail. It's a little difficult to debug on the Android devices since I can't simply use Unity's Debug.Log, but I have a handle on what the problem is, just not what I can do to fix it quite yet.

Just to get something completed today (and ease a little frustration) I knocked out one of the easy low priority issues - increasing font size of all GUI buttons across the board with GUI Styles.

Update 11PM: After some quick Googling I think that the issue of PlayAudioFile() not being called is related to the fact that: it's an IEnumator function being called via a static StartCoroutine() function. It seems that is a no-no. This doesn't quite explain why everything works perfectly on PC but starts to go awry on Android. Will take a closer look tomorrow and start refactoring.