Thursday, October 17, 2019

What I've been up to

Just before the initial public release of Productive Game 2 - Trees my motherboard failed, and I've been using sub standard hardware since, which has significantly slowed development.  Frequent freezing caused by low memory, or slow hard drives, made work slow and frustrating. I still need to do some work on the hard drives, but I was finally able to get that motherboard replaced, and should be in a much better position to make steady progress.

I started this post some time ago, but never released it for one reason or another.  I wanted to explain what I have been doing, since there was a big gap of silence after the release of Productive Game- Trees 0.013.

After I finished 0.013 of the Tree Timer, I started moving in different directions and then eventually burned out.  First I started working on improving the Options UI, so that the UI objects scale correctly and it would be easier to add more in the future.  Due to an issue with the task icon code that I thought I had fixed,  I ended up losing that work.

I was planning on coming back to it, but decided to do something completely different instead.  I started working on Productive Game 3 - Text Adventure.  With PG3 - Text Adventure, you use the points you gain from your daily activities to advance in a text adventure.  In its finished state, users should be able to create their own text adventures, and share them with others.  Basically,  I modified the Yarn Spinner code so that I would be able to determine which text nodes had been visited.  I then added a really rudimentary productivity system where you basically just press a button to add a point, and then when you visit an unvisited node, it would take a point away.  I could also add yarn stories by simply dropping them into a folder, and then when the program started, it would automatically add the story.  Your progress is always saved and you can also switch between stories.



I was planning on releasing that prototype, but I felt like it needed a better productivity system.  However, I learned a lot of things creating the first two Productive Game prototypes, so I decided to take what I learned and make something better.

I decided to start working on what I called the "Productive Game Core".  I wanted to make a Productivity System that I could use as a solid foundation in order to jump start my progress on any future Productive Games.  I wanted PGC to be a modular system that I could build once, and then propagate the updates to all of my Productive Game Prototypes, and any potential fully realized Productive Games in the future.

I also wanted to be able to keep track of work time.  I have sometimes used the Toggl application in order to keep track of work time, so I thought I would see if I could interface with the Toggl API.  I created a successful login application.  Feeling confident that it was possible, and that I roughly knew how to interface with the Toggl API, I then moved on to working on the Productive Game Core.  I streamed some of my work with the Toggl API, but I finished offline.



I wanted to build the Productive Game Core correctly, from the beginning.  One thing I've never done right, is the way that I stored information on the hard drive.  I've mostly been using Unity PlayerPrefs, with or without PlayerPrefsX, but if I was going to store work time information, I needed to potentially store a lot of data, and I needed a robust system in order to do that.  I was able to make some simple storage tests using FileStream, and was able to transfer my own simple data in Productive Game 2 - Trees, to a different computer.  But that's not a very robust system, and I couldn't find a good answer on what kind of system I needed to use.  I researched using SQLite, but it seemed intimidating and with my lack of confidence, that it truly was the best system to use, I didn't pursue it at that time.  I streamed some of my work on Productive Game Core.

I also wanted a Calendar system to be able to visualize progress.  The most basic system will simply show whether or not the program had been used that day.  I wanted to be able to display a whole month, or a whole year.  The year layout might look something like this.  I created a rudimentary implementation that worked perfectly with the data I had, but I needed to clean it up and create better user interface elements for it.  I'm not entirely sure how I want it to work, or where I want to put the button in Productive Game 2 - Trees.  I could wait and add it to Productive Game Core and leave it out of Trees, but who knows when I'll finish Core.  I still need to decide where and how I want to use it.  I streamed some of working on the Calendar.


I also tested out billboard sprites in the tree scene, to see how they would look compared to the fixed row I had previously.  I had been playing Doom and Doom II, and that compelled me to try it. Initially I had decided not to use billboard sprites, because I liked the orchard like appearance of the fixed, straight rows, but after trying it I decided that it did look better.  In the future, I plan to add an option that people can toggle to switch between them.  I streamed working on it, but I think I finished off-stream. 




So, in short,  I started working on revamping the Options UI in PG 2, and then lost the progress.  I then created a prototype for PG3, but decided that I needed to do more work on it before release.  In order to be able to release new prototypes quicker, I decided to a create a unified Productivity System, calling it Productive Game Core.  For PGC I created a successful login test for the Toggl API, with the intention of using it to keep track of work time, in the future.  I created a rudimentary calendar system test that I could either add to PG2, or wait and add it to PGC, but it still needs a better looking User Interface.  I created a test to export and import data from PG2, but it needs some cleanup before I can release it.  And I got completely lost trying to decide how I wanted to store data on the disk for PGC.

After I did all this, I noticed the bug in version 0.013 of PG2, so I created a "fix" and released version 0.14, with the billboard sprites feature.  This was documented in the last post.

I have now begun work on trying to get a working SQLite implementation for Productive Game Core.  I'm still in an early stage, but I'm making progress.  I don't yet know if SQLite is the best method for handling my data in Productive Game Core, but I'm going to try to take it to its logical conclusion so that I may know with certainty.

Friday, August 2, 2019

Version 0.14 of ProductiveGame 2 - Trees released.





Changelog

Removed the minimize to system tray functionality because it caused conflicts with the Unity Game Engine.
Changed the 2.5d tree sprites to billboard sprites
Dropped and extraneous zero from version numbering.
Details

I noticed a bug in version 0.013, where the cpu would increase significantly when program was minimized to system tray, or "hidden".  Apparently the Unity Engine doesn't like being hidden, and cpu usage increases significantly, and there is also an error that is continuously output to a file.  I found a log file that was 19gb!  Every time the program loads, it deletes the old log file and creates a new on, so there should be no need to try to track down and delete the log file manually.



I believe my only option was to remove the minimize to system tray functionality, so I changed it to a regular minimize.  Now the minimize buttons and exit buttons do the same thing.  I did this so that someone (like me, for example), won't click the exit button thinking it will minimize when it actually closes the program.  In the future, I'll add an option to change that functionality.



In addition, I changed the tree sprites to "billboard sprites", so that they are always facing the player.  This is similar to the way sprites work in 2.5d games like Doom, Wolfenstein 3d, Duke Nukem 3d, etc.



I also dropped an extraneous zero from version numbering.

Friday, August 31, 2018

ProductiveGame 2 - Trees Version 0.012 Released - First Person Forest, Continuous Mode, and Bug Fixes


Big update to my Tree Timer.  I can't decide whether to continue posting Development Logs here or just post them on itch.io, or copy and paste logs to both or just link to the log on the other.  I don't know if any reads my development logs, anyway, or I might make them more informative, and more often.

Anyway, until I decide what I'm doing, here is a link to the changelog.


Edit: The latest version 0.012 includes a 3d scene of your forest to give some weight and physicality to the time you've spent working. You can walk with WASD and use mouse to look. Hold shift to run and press space to jump. Right mouse button, and Enter button will toggle mouse/cursor focus(Escape button also works on all but the Web Browser version). There are also very quiet grassy footfall sounds.  You can pick up where you left off when you return from the forest scene.


  

Monday, July 16, 2018

Productive Game 2 - Trees Public release

On June 24th, I made my first public release of Productive Game 2 Trees.  It's a timer / time boxing / Pomodoro app that creates a virtual tree for each completed timer, with optional syncing with Habitica.com.


I have been neglecting to update this website, and instead have been posting my updates to my twitter at https://twitter.com/StewartJMartin .  I probably need to be more diligent in keeping this website up to date,  and should probably improve the layout. I also think cross posting my dev logs to itch.io would be a good idea.

Here's the changelog since the last post

06/01
0.009
Added scrolling to History.
Added a session reminder when program starts.
Added offline functionality:
When connection is lost to the Habitica server, for any reason, upscores are saved and then sent when connection is reestablished.
Added a light that is green when connection is working, and turns red when connection is lost.  The light is also a button, and clicking the button rechecks the habitica connection.
An error message displays when connection is lost, and a different message displays when the connection is reestablished

06/24
0.010
Added tree count to Adjustment config
store uid, token, and bactchcount in player prefs
added a user login UI to the config UI with API and username/email login
with settings to remember or forget login info

06/26
0.011
I removed a message box in the forest screen that had a reference to a joke that contained a curse.  It was brought to my attention that is inappropriate for some audiences, so I removed it.  I may add the message box back later, with the option of creating your own message.  For now I've just removed it.

And here is a sneak preview of what I'm working on next


Friday, May 4, 2018

ProductiveGame 2 Trees Update #1

Making a tooltip implementation has been on my todo list for years, for multiple project.  I finally buckled down and made one for ProducteGame 2 - Trees.

It's not perfect, but it works pretty well.   It took much longer to get working right than I had anticipated.  There were many hurdles I didn't expect.  There is one panel prefab, with a text object, and a content size fitter, and a horizontal layout group.  It also has a script that makes the prefab instance a public static.  Another script attached to the other ui objects, sets the initial position of the tooltip based upon the center of it's parent.  Then it waits for half a second.  If the cursor is still within the parent object,  it enables the tooltip.  If the tooltip edges are within the game window, it stays in the same position.  If the tooltip edges are outside the game window it repositions the tooltip and saves the new position to be reused.  Whenever the cursor leaves the parent UI object, the tooltip disables.

Multiline text is kind of hacky, but it works.  The text is assigned in the inspector, and in the Windows Unity Editor, "\n" for new line doesn't work when it is typed in the editor for some reason.  So instead I use "\\n" with some code that replaces the text in the string, at runtime.  Like this:
tooltipText = tooltipText.Replace("\\n", "\n");

Because the code finds the tooltip position based upon its size, and its size is being driven by the  unity ui(content size fitter and horizontal layout group), the code has to wait until the end of the frame to find the position.  This causes the tooltip to sort of pop in to place, which is noticeable.  However, the code stores the position, so this only happens when the game first starts, or when the window is resized.  There might be a way I could calculate if the tooltip will fall outside the window beforehand, but I don't know how to do that, and the pop-in isn't very noticeable since it only happens once after a resize, or at start.

ChangeLog:
04/21
0.008
Added Hover over text.
Messed around with font sizes for the header, to try to make things a little more compact and a little more uniform

Monday, April 16, 2018

ProductiveGame 2 Trees

I've started working on a new project. I've been using the Forest APP to help me stay focused, and to help me start working when I'm not really feeling it. Mostly it's just a timer, that I use like a pomodoro timer. However, when I'm working on the pc, I'd rather just not mess with my phone at all. Luckily there is a chrome extension. However the chrome extension has no audible alert when it finishes. I also wanted to show people on my steam friends list that I was working in the Unity game engine. However, after adding Unity as non-steam game and starting Unity through steam, steam seemed to think Unity was still open even after it was shut down. It was all a hassle. So I decided to create my own rudimentary version of the forest app with Unity. Thus "ProductiveGame 2 - Trees" was born.

Screenshot of Version 0.001:
 

(A gif of the latest build is at the bottom of this post)

I use it like a Pomodoro tracker.  So for each 25 minute increment, the Trees Planted number increases.  I have also added a tree count for the current session, and I create a new session at the start of each work day.  There is a history of those sessions as well so I can compare how many "trees" I created for each session, and when I created them.  An audio alert sounds when the timer has finished, and a volume slider lets me set the volume of the alert.  The sound I'm using is the "PointScore" sound from Pongball, created by Kyle Wynn.  I added the productive game to my steam, and launch it from steam so all my steam friends can see it.

 I've been developing it organically, with the target audience as myself, and adding features that I felt would be most useful to me.

I plan on releasing it to the public (soon?), but some work needs to be done to get it ready.  Specifically, the current version has very basic syncing with Habitica.com that is hard-coded for my API UID and Token and I need to create a login screen to handles that elegantly.

The current changelog is listed below:
03/23
Version 0.001
Initial version.
Basic clone of Forest App.
Working Timer,  image of tree does nothing,  type in number of minutes and click start to start timer.  Previous time is saved, so typing in time is unnecessary if time is correct.  Sound when timer finishes.  Volume control via Control Panel/Button represented by gear image.  Previous volume is saved.
I had to switch from Unity 2017.4.0f1 LTS to 2018.0b12 because, in Windows 10, there was a bug with the resize icon

03/25
Version 0.002
Added break timer and pause.  Break timer starts automatic 5 minute timer.  Tree count does not increase.  Press start a second time to pause.

03/28
0.003
Added "Current Session" count, Next Session button that resets Current Session, and adds Current Session Count to history of Previous Sessions.
Added History Panel and button to show list of Previous Session counts.  Still need scroll bar for when list gets longer than the panel can show.

04/03
0.004
Added date array to keep track of the date each Session was created, and added that information to History Panel
Added FPS limiter for 30 fps.  Should reduce CPU usage

04/04
0.005
Added simple Habitica.com integration.
Added script that handles scoring a Habitica habit when a tree is completed.
If the habit does not exist, the habit is created.
Attempted to use built-in json and webrequest from unity.  Had some difficulties.
JsonUtility does not handle nested objects, which prevented the processing of some JSON data.  Particularly getting the api user id and token by using the login username and password.
The API uid and token are currently hard coded.
REST POST is working, but it required a workaround use a custom UploadHandler, as UnityWebRequest applies URL encoding to POST message payloads, which mangles the JSON.

04/04
0.006
Added plus and minus buttons to adjust the number of trees.  Added so I could adjust the tree count when I forget to click "next" at the beginning of a new sessions.
adjustment buttons do not UpScore Habitica
Adjusted the inputfield so that it clears at the end of an edit.

04/16
0.007
Added a rudimentary tree scene
clicking the tree on the timer screen will change to it, but the tree can only be clicked when the timer is not active.
If you have paused the timer, your current time will be lost.

Friday, June 2, 2017

Productive Game Beta Release 1.0.6 on the Web, PC and Android!

Version 1.0.6 can now be played in your web browser on itch.io!

In addition to playing in your web browser, you can download the Productive Game for PC(Windows, Linux, and OSX) as well as Android


I also created a new demonstration video.

And, as before, you can also get the Productive Game for Android through Google Play.
Get it on Google Play

1.0.6 Changelog:
- Made some modifications to make the Productive Game work better on PC
- Fixed a bug related to movement speed 
- Consistently renamed Game Points to Build Points.

I might post a devlog with further information later.

Tuesday, April 18, 2017

ProductiveGame Beta Release 1.0.5!

Get it on Google Play
ProductiveGame Beta 1.0.5 Released!
You can download it on Google Play.  Additionally, since it's an open Beta, you don't have to sign up to test it, you can just download it!



Changelog:
-The biggest feature from this new release is a task screen that you can reach by rotating your phone to portrait.  Rotate back to landscape to get back to the gamescreen.
-The second biggest feature, on the task screen, todos have an additional edit button.  In edit mode, you can rename your task, delete your task, or set your task to repeating.  Repeating tasks never get deleted unless you delete them yourself, or change them back to a todo and check them.
-Also, on the task screen is settings button.  So far it only includes an instructions button and a multiplier button, but it may get more buttons later.
-Build Points are no longer used automatically to build the level.  Instead you must tap the Build Game button to use them.
-The sound button now has a checkmark on it to show you if it is on or off, and the sound only plays -when the level has been fully built.
-The exit button has been removed, but the back button on your android device now functions the same way as the exit button did.


I fixed a lot of bugs and added some major new features, as well as some minor ones.  I took pretty extensive notes, but I didn't post them here.  I also made a lot of git commits but they are all private on bitbucket.

I'm currently active in the a community project for Double Fine's Amnesia Fortnight, but once I feel I've made satisfactory progress on what I'm working on for that, I will get some webgl and desktop builds built and place them on itch.io, of the Productive Game.

Thursday, July 21, 2016

Productive Game Alpha Test Released on Google Play

I've been working on the Productive Game Prototype, but have neglected to post here.



My app is now going through Open Alpha testing on the Google Play store!  If you would like to sign up to be a tester, you can find that here:
https://play.google.com/apps/testing/com.ProductiveGaming.PGP_Roguelike


After you have signed up to be a tester, you can get the app by going here:
Get it on Google Play

Here are the changelogs from my Android releases:


-1.0 Fixed newly instantiated tasks.  They weren't sizing properly.

- 1.0.1 Changed Canvas Scaling to Screen Size instead of Physical size in an attempt to make UI look right on Mobile.

-1.0.2 Bug Fixes:
Fixed Blurry Game Panel
Fixed Reset Game Button

Next up:
GUI elements are still too small on some devices.

-1.0.3 Bug Fixes:
Modified GUI elements so they should be the same size across all devices.  I also increased their size and spacing to, hopefully, make them easier to tap.

Let me know if I need to improve the sizing some more, on buttons, checkboxes, text, etc.

Notice:  Apparently Unity 5 no longer supports Tegra 2 devices.  This includes, but is not limited to, some Galaxy s2 devices, the first Galaxy Tab 10.2", and the atrix 4g.  In order to fix this, I would need to switch to Unity 4.6.  blegh.

- 1.0.4 Changelog:
Fixed the Pause Button
Attempts to improve clarity:
Renamed "Unused Todos" to "Build Points"
Renamed "Speed" to "Multiplier", and increased max from 4 to 9, and changed default from 1 to 3.
Scaled up Instructions so they are easier to read, and implemented scrolling for them.
Rewrote instructions somewhat.

More Details about the change log


- 1.0
 I decided to get the mobile app ready for a proper mobile release.  I switched the Canvas Scaling from Constant Pixel Size to Scale with Screen Size, and also tried Constant Physical Size, but with both of them the instantiated objects would not scale correctly.  I tried everything for weeks to try to find a solution, but to no avail.  Then I just happened to stumble on the solution here  Apparently,  I needed to set WorldPositionStays to false when instantiating my object.

so:
newTodo.transform.SetParent(todoPanel);
changed to:
newTodo.transform.SetParent(todoPanel, false);
And that seemed to fix it.  Since that was finally fixed, I decided to release my app for Android on the Google Play Store, because it has the lowest barrier to entry(lowest one time fee to be a developer, easiest to build for, simplest approval).  By doing that, I could get feedback from testers.

-1.0.1  This one's pretty self explanatory, but it still didn't exactly work right.  See release 1.0.3

-1.0.2  For some reason I had to turn mipmaps off for the Sprites in order to make them look clear, instead of blurry.  Previous builds weren't blurry so I'm not sure why it suddenly became necessary.

I created a duplicate of my scene when I started working on Android, so I wouldn't break anything.  The code that resets the game calls on the scene, so I just had the change the scene name in the code to fix the reset game button.

I manually resized many UI elements in order for them to be easier to use on Mobile.

-1.0.3  None of Unity's Canvas Scaling methods created a constant physical size across all devices, there was always some sort of variation, so I turned off the Canvas Scaler and switched to a script made by Tess Snider so that I could use Constant DP Size, or "Device-independent Pixels".  You can find that script here.  I then had to change Reference Pixels Per Unit to 60 in order for all of the UI elements to look correct around the edges.

-1.0.4  For some reason, the Pause Button was disabled.  I have no idea why.  The rest of this is pretty self explanatory in the changelog


What's Next

I'm continually improving it every day.  I haven't had any issues with stability at all, so I could push to Beta test status, but I want to add some more features.  

I plan on adding another page or more to the User Interface to accommodate better managing of todos, such as editing, deleting, and  completed todos;  to accommodate a score page;  and to accommodate settings and configuration.

I would also like to add some sort of "Story Events" to the game.








Thursday, July 7, 2016

Why I'm doing this.

What am I trying to do?


I'm trying to create a Productive Game Industry


Why am I trying to do this?


People motivated by greed and self interest have no lack of self motivation.  I believe this is one reason the world is in the state that it is today.  The good people of the world who care about others and society, see the state of the world and become disillusioned or bitter or escape into the virtual world of music, books, video, or video games because it's a much more comfortable place to live.

So, I'm trying to take the best aspects of video game technology mixed with productivity applications to create a video game that empowers and motivates the good people of the world to do more with their lives, and to be more.  When the good people of the world have the tools they need in order to rise up an make the world a better place, the world will become a better place.

Productive Game Technology has a tremendous potential that has only just barely been tapped.  There's some more information about what can be done in the about section of this website, and I have notebooks filled with other possibilities that I would like to one day compile into a cohesive narrative or design document and publish.

So far, I mostly work alone and take shortcuts where I can, but there's only so much that one person can do.  I'm trying to create a product that shows the potential of Productive Games in such a way that other people will compelled to join me, or build upon my work.  This is what I mean when I say that I'm trying to build an Industry(that currently does not exist), and not just a product.


What's next?


I'm working on getting the Productive Game Prototype ready to publish on the major app and game stores(Steam, Apple store, Android Store, Windows Store).

I don't know yet whether I will use a simple todo list structure or combine the Productive Game Prototype with my work making a Habitica Client(the Habit Engine).  This first product I will release for free to garner interest, and then I will set to work on the next Productive Game.  I already have a lot of the game aspects planned out and details will be forthcoming.





Tuesday, November 17, 2015

ProductivityGame Prototype: Roguelike Released!

PGP Roguelike Released!


This is the first release of the Productivity Game Prototype: Roguelike

In the link below I've provided builds for Windows, Linux, OSX and Android.  The Android build is barely usable on my phone because all of the UI elements need to be resized for the smaller screen size.

Download here

More info about using the Productivity Game can be found in this video:


Rename?

 I'm considering changing the name of the project from Productivity Game to Productive Game, but I'm just not sure which is better.  Please let me know what you think in the comments below or send an email to stewart@productivegaming.com

Also, I moved this blog from fragmentalstew.com to productivegaming.com.  Fragmentalstew.com still redirects here, though.  I thought productivegaming indicates better what I'm trying to create.

Also, I added a page for the Habit Engine, a page for the Productivity Game, and I added a lot more info to the About page, about what I'm trying to accomplish.  I encourage you to click the tabs at the top to read more.  I also changed the Template of the website.

Monday, November 16, 2015

Dev Update #18 Ready for Release, Fixed Slow/Drunken Movement Bug, Found New Bug in Saving/Loading


Fixed Slow/Drunken Movement Bug


I finally fixed the Slow/Drunken movement Bug that has been plaguing me for weeks.  As near as I can tell there wasn't any bugs in my code, but there was some buggy weirdness in the project itself.  So, I created a new project.  Exported all of the assets with dependencies from my old project, copied over the tagmanager.asset from the projectsettings folder, and everything was fixed.  This created a new issue with horizontal lines on the edges of the tiles of the board, but this doesn't seem to show up in builds so it's not really an issue.  With this issue resolved, I should have been ready to release today except I did some more testing and...

Fixed Saving and Loading Bug


During testing for release I noticed that saving and loading was working correctly.  I was pretty certain it had been working right, but after examining the code, I noticed that I had missed some crucial lines of code.  Random.seed was being saved when the program began, but not when a new level was loaded.  When the new level was loaded, Random.seed had a different value, but that value wasn't being saved so restarting the level would give you a different level layout.

I added the needed code, which should have resolved the issue, but it did not.  In order to debug, I decided to use the unmodified version of the Roguelike tutorial.  I made the necessary changes and saving and loading still wasn't working correctly.

Each time a Random value is called, the Random.Seed changes.  As long as all of those calls are in exactly the same order, and you start with the same value for Random.Seed you should get the same Random values every time.  But for some reason, this wasn't happening.

In order to fix it I added this line:
Random.seed = Random.seed;
Let that sink in for a moment...
Yes, I am aware that it makes no sense.  Yes, it really does fix the issue with the Random values being different every time.

So, after making that change in the unmodified project, I made that change in my modified project, and lo and behold it did not work.  I realized that this was being caused by my use of coroutines instead of functions.  In code, the first function has to finish before the rest of the code runs.  With coroutines, the code starts the coroutine and then continues execution.  Each coroutine was making a call to Random.Range at it's beginning.  When the level is loading, those calls to Random.Range are in order, and then the other calls to Random.Range happen when a todo is clicked. Since, when the level is loaded, it skips the while loops that wait for each todo to be checked, that caused the order to be different.

So, I created some bools and added some more while wait loops between the running of the coroutines that setup the level.  After the level is loaded, the finished bool is set to true so that the next coroutine is run and this solved the execution order issue so that levels should finally load exactly the same whether they are being loaded sequentially after each todo or whether they are loading all at once.

Then I realized that I could have just used "yield return StartCoroutine" to call each coroutine, and that would make code execution wait for the coroutine to finish before continuing.

I feel kind of silly for not doing that from the beginning.  Live and learn, I guess.

Ready for Release


And with those last bug fixes, I feel confident in releasing the prototype.   I would like to do a little work on the website and might get a new domain as well.   Stay tuned. 





Monday, November 2, 2015

Dev Update #17 Broken Release

Broken Release

I had the game all finished up.  Then I built and tested the game, and for some reason that I don't understand, all character movement moves very, very slowly.  One move takes about two full seconds, which is far too slow.  I have no idea why this is happening.  Also, there is far too much CPU being used.  It jumped from less than 10% CPU usage to between 40 and 60%.  And it doesn't seem consistent.  Sometimes the build will run with less CPU or it will have lower cpu usage and then jump higher.

Here is a video showing the slow movement in the build:


Even in the editor there seems to be some issues with movement.  The characters move at full speed(as far as I can tell), but the player will weave around and not stay within the tiles.  This seems highly inconsistent, because sometimes the player will move normally with absolutely no changes made.

Here is an example of the weaving when run in the editor:



Again, I don't know why any of this happening.  There doesn't seem to be any bugs in my code that would cause this, and I don't know why movement would be so much slower in the build rather than the editor, or why cpu usage would jump.

This issue with movement and cpu usage is the only thing preventing me from making a release.

If anyone thinks they can help with this issue, or with development of the project, I can give access to the bitbucket project or a link to download an archive.

Tuesday, October 27, 2015

Dev Update #16 Speed, Tweaked UI, Modified Player Pause, P and M Key, Random Pausing, Build Mode

Changed Button Presses So They Don't Interfere With Typing

I set the "M" key press to only work when the game is paused.  This prevents "M" from pausing the music when typing a todo.  I had to entirely disable the "P" key press for pausing the game, because there was no elegant way to change it using the current code. There's probably some way to do it involving the AddTodo field focus, but it's relatively minor and I'm just going to leave it out for now.

Modified The Way Player is Paused During Level Loading

I was disabling the Player object during board setup, and then reenabling when board setup was finished. I have suspected that having the player game object disabled may interfere somewhat with the movement of the enemies.  It gives me no errors, but just to be sure, I decided to disable just the sprite and then set the Player script to paused.  I wasn't able to access the Player.player.paused(player is a reference to the instance) variable from BoardManager, even though I can access it fine from other scripts.  I get a "null reference error" - this gave me a lot of grief in the past.  I suspect it has something to do with the BoardManager being instantiated, whereas the other scripts that are accessing Player.player.paused are not being instantiated.  They just exist within the scene.

So, instead, I used:

        playerObj = GameObject.Find("Player");
        playerScript = playerObj.GetComponent<Player>();
        playerScript.paused = true;

 It's less elegant than "Player.player.paused = true;", but it works.  I'm not sure if it makes any difference.  The enemies do seem a little more responsive in their attacks, but it's hard to tell. They still seem to move in roughly the same pattern.

Tweaked UI elements

I tweaked a lot of the different UI elements - adding padding and slightly modifying shape.  I changed the font on many UI elements to PressStart2P-Regular, that came with the Unity Rogue 2d Tutorial.  I chose to continue using Arial on the Todos, because Arial looks better at a smaller font size, and I didn't want to make the fonts big enough to look good use the PressStart font.  I made the text darker on the todos and the other UI elements with grey backgrounds

Random Pausing Fixed

I fixed the Inputfield from (seemingly randomly) being selected while you're moving the character.  It turns out is wasn't random at all, it was the UI navigating between UI elements until it hit the input field.  I turned the input field navigation to off, which should solve that.

Speed

I added a speed modal.  It sets each todo to complete 1, 2, 3, or 4 tiles when they are checked.  I would go into more detail about how I did this, but the actual creation of the modal was a bit complex.  It's not really a modal as much as a configuration window that pops up on the right panel.  In order to activate and deactivate the  modal, I had to create a separate script that mostly just keeps track of the "speed" variable, that is never deactivated.

Build Mode

I also added an image and text that says "Build Mode" instead of "Paused" when the level is building.


What's Next

I think I'm going to add some kind of instructions.  I'm debating whether or not I want to implement any kind of deleting or editing of todos before release.



Tuesday, October 20, 2015

Dev Update #15 - Almost Done. Exit Game Button. Confirmation Dialog Boxes

Exit Game Button

10/18/2015 I added an Exit game button using Application.Quit(); and also moved the Right Panel Buttons off of a Scrollview that wasn't doing anything and redid the anchors for the buttons so they would scale correctly.

Confirmation Dialog Boxes (Modal Windows)

10/20/2015   I added some Modal windows for 6 Reset Game and Exit Game.  I started by watching the part 1 of 3 of the Unity tutorial/live session UI TOOLS: MAKING A GENERIC MODAL WINDOW, and then decided I didn't need such a complex solution for just 2 modal windows, so I hacked together some panels and buttons, copied them, and then modified my original Exit Game and Reset Game button scripts.

The ExitGame script looks like this:

using UnityEngine;
using System.Collections;
public class ExitButton : MonoBehaviour
{
    public GameObject exitModal;
    public GameObject resetModal;
     public void ExitGamePressed()
        {
            if (resetModal.activeSelf == false)
            exitModal.SetActive(true);
        }
     public void ExitGame()
     {
         Application.Quit();
   
     }
     public void ClosePanel()
     {
         exitModal.SetActive(false);
     }
}

The ResetGame script is mostly the same except with "Reset" in place of "Exit" and instead of Application.Quit, it calls the ResetGame function from BoardManager.  All the code I added to the two scripts is almost the same between both scripts, which seems wasteful and I'm sure there's a better way, but I'm more concerned with getting it functional. I may rewrite later.

The appropriate functions are then assigned to the appropriate button's onClick events and the appropriate GameObjects are assigned to the scripts.  Both exitModal and ResetModal are set to inactive in the editor.

What's Next

I'm pretty much done.  I've made a build and I'm testing it.  Currently the key press "P" will pause/unpause and "M" will pause/unpause the music which is a problem when typing in todos, so I'll fix that.  I'll readjust a few things in the UI to try to make them look a little more professional.  I don't really like the way the text looks. I might try to make that look a little nicer.  Some graphics on the UI elements would be nice, but I don't think I'm going to touch that for the prototype.

There's always more I could do, but as far as I'm concerned, I've accomplished all my goals.  So once, I've polished things up a little, and done a little testing, I'm going to make Windows, Mac OSX, linux, and maybe Android builds and release them all simultaneously on this website.  That should be very soon.
Running in a Build

Saturday, October 17, 2015

Dev Update #14 Reset Button Fixed(Again), Pausing Works, Window Scaling Fixed, Unused Todos Usable

Reset Button Fixed(Again)

In my attempt to get Pause to work today, I discovered in issue with the Reset Button I should have noticed the first time.

I was using a checkedOff variable in my TodosHandler script to pass a variable to the BoardManager script, that manages the game board.  The TodoScript attached to the TodoButton sets the checkedOff variable in the TodosHandler to true.  Update() in BoardManager waits for the checkedOff variable in TodosHandler to be true, and then it sets the "clicked" variable in BoardManager to true.  This signals a while loop to stop, which then loads the next tile in BoardManager.

Originally, I thought this wasn't working when the game was paused because Update() wasn't running when time.TimeScale was set to 0.  This, however was false, but I didn't know that at the time.  To fix this, I gave the TodoScript direct access to the "clicked" variable in the BoardManager script, and let it set "clicked" directly.  This was changing the variable to true, but it did not trigger the while loop to stop.

The reason for this, I eventually discovered, was that I had multiple instances of BoardManager.  I discovered this by using:
Debug.Log("Parent of this BoardManager is " + transform.parent.gameObject);
Debug.Log("Root parent of this BoardManager is " + transform.root.gameObject);

I'm not entirely sure why my previous fix for the ResetButton worked.  I'm guessing that the change I made allowed the ResetButton script to find only one copy of the BoardManager instance instead of two, or maybe it found the correct instance instead of the wrong one.

So I removed the copy of BoardManager from the ResetButton and changed the ResetButton code to:
        BoardManager.boardManager.ResetBoard();
In order to access the variable directly from TodoScript, I had previously added to my list of variables:
    public static BoardManager boardManager = null; 
and then also added, to the "void Awake();" function:

         boardManager = this;
 This allowed me to access the ResetBoard() function directly as well.

However,  after implementing this code, I came to discover that tiles are still not loaded when the game is paused.  Apparently Update() is still called while Time.timeScale is 0, but
while (!clicked)
                {
                    yield return new WaitForSeconds(0.01f);
                                     
                }
never completes, because time has stopped.

Pausing Works

Since setting Time.timeScale to 0 doesn't work with WaitForSeconds, I instead decided to pause the player by making a "paused" variable in the Player script.  I made that variable accessible by other scripts so that those scripts can pause the player.

The player moves through:

            horizontal = (int)Input.GetAxisRaw("Horizontal");
            vertical = (int)Input.GetAxisRaw("Vertical");
and some other scripts in Update() of the Player script, so I added "if (!paused)" before that.

I then added code to the Pause button script to set Player.player.pause to true or false and I added an "Event Trigger" component to the Todo field.  I then added a Select and Deselect even to the event trigger, added a PausePlayer and UnpausePlayer function to the Pause script, and assigned those to Select and Deselect so that the player is paused when the field is selected and unpaused when the field is deselected.  This keeps the player movement from being effected when typing in todo names and keeps todos from being typed in when the player is moving.

I also added a black image, with an alpha, with the word "Paused" overlayed on top of the game as a visual queue.


I also added a gameActive variable to the boardManager so that the pause scripts can check to see if the game is Active.  The game is by default, paused when the level is loading, so this prevents the scripts from trying to unpause the game when the level is still loading.

Currently music doesn't pause with the game, but it can be paused separately by clicking the music button.  I did this intentionally to give players more control over whether the music is, or is not playing.  The music does start by default when the level is finished loading.

Window Scaling Fixed(sort of)

I (sort of) fixed scaling.  I set the aspect ratio to 16:9 and then set the windows to stretch vertically, with their anchors set to the bound of the panel.  This makes the panels scale correctly.  However, the aspect ratio is stuck at 16:9

Unused Todos

Previously, all todos you did while the game was active would not be counted.  I changed this, so that there is now a counter in BoardManager that keeps track of those unused todos.  There is also a panel that tell you how many unused todos you have, and a button you can click that will use those unused todo points as if they were a todo you were clicking on the left panel.  I could give more technical information, but this post is already a bit long.

What's Next

I may add some kind of confirmation popup for the Reset Game button that asks whether you are sure you want to reset the game, and maybe some hover over tooltips if that's possible, but that's the only thing I can think of right now. 

I'll take a little time to think about whether there is anything else I want to add before release.  I'll also do some testing and make some builds.  Then I will release a working build for everyone to download.





Friday, October 16, 2015

Dev Update #13 Fixed Reset Game Bug

Fixed Reset Game Bug

I set out to fix the reset game bug, today, and was successful.

After resetting the game, the tiles would continue to load even after the game had started.  I thought this might be caused by having a second instance of the BoardManager script attached to the ResetButton script.  I did that, because assigning the BoardManager script, that was already in the scenne to the ResetButton script wasn't working.  First, I tried uncommenting my previous code to see why it didn't work and it worked perfectly fine.  I don't have a clue why it didn't work the first time, I'm just glad it's working now.

The code looks like this:
boardScript = FindObjectOfType(typeof(BoardManager)) as BoardManager;

Next up: Bug Fixing Pause 

Next up, I need to get some sort of pausing of the game working.  Currently, pausing the game prevents tiles from being loaded when they're checked off.  Currently, to pause the game, I'm using:
if (Time.timeScale == 1)
             {
                 Time.timeScale = 0;
                 AudioListener.pause = true;
             }
             else
             {
                 Time.timeScale = 1;
                 AudioListener.pause = false;
             }
this prevents all of the Update() events from triggering in the game.  The code that triggers the next tile to be loaded looks like this:

    void Update()
    {
        if (TodosHandler.todosHandler.checkedOff)
            clicked = true;
    }

And this is why tiles are not loaded when the game is paused.  I now have to either rewrite my code so that I am not using Update() to wait for a checkedOff event, or I have to rewrite the pause so that the player is turned off.  I know how to do that latter.  I have a vague idea about how to do the former.  I'm not sure which is best.  I was going to work on that today, but then I had personal matters to attend to.

On the Backburner: Window Scaling (yet again)

As it turns out, though I thought I had fixed the window scaling, in the last post, it turns out I had only fixed the gaps when scaling the game window horizontally.  When scaling vertically they reappeared.  I'm not entirely sure how to fix this.  I think I may need to make an actual build of the game, which I haven't done yet, and then see how scaling the window works in the actual build.  I would like to make the game fully scalable in all directions, with a limit on how small the window can get, however I may have the make the game a fixed aspect ratio.   Hopefully I won't have the make the game a fixed resolution/resolutions.

Tuesday, October 13, 2015

Dev Update # 12: Pausing Audio, UI Elements Correctly Scaling


I've decided to add  more pictures and more technical information into my dev updates.  I've also decided to do a write up on my progress/lack thereof immediately after I've made the progress/lack thereof.  Instead of making a lot of dev updates, I will add to them until I feel like I have enough material before posting.

10/12/2015 I found a way to pause and play the music in the game, using "AudioListener.pause" instead of turning on and off the SoundManager object. One benefit to this, is that the music will begin playing where it left off instead of restarting every time. Also, Unity can't find an object when it's not active, and this is why the sound breaks using my current "reset game" code. One downside the AudioListener pauses all of the audio including the music and sound effects. Apparently can "set the ignoreListenerPause property" to true for sound effects, to prevent this, but I'm not entirely sure how to do this yet. A snippet of my code is below. This is the body of a function I have that runs when the music button is pressed, or the "M" button is pressed.
if (AudioListener.pause == false)
        { AudioListener.pause = true; }
        else
        { AudioListener.pause = false; }

10/13/2015  I readjusted some of the UI elements that weren't scaling with everything else, so they would scale correctly.  I changed the anchors to top horizontal stretch(not sure if the top part is important, but I know that adding vertical stretch will generally break everything. see Image 1).  Anchors and pivots with the new UI system are a bit confusing.  I think maybe I'm starting to understand them a little.

I was having trouble getting the left and right panels to scale with the game board in the middle.  I created a panel that mimics the game board, to make it easier.  The game board is always square, 1x1, so as the window scales the game board gets bigger or smaller in the middle.  Initially, the left and right panels stayed the same width, because there was no width scaling which would create large black areas on the left and right of the game board(see image 2), or the panels would overlap the game board.  Every time I changed the anchors, the panels would scale, but they would scale incorrectly.

To fix this, after a LOT of trial and error, I set the inside anchors to the middle of the screen.  Don't ask me why this works or how I thought of trying it.  I have a very vague idea, but I couldn't explain it.
Success!!! UI Elements scale correctly.

Image 1: vertical scaling breaking UI elements, before I fixed it

Image 2: Gaps between Game Board and Panels

Sunday, October 11, 2015

Tech info: ArrayPrefs2



09/28  I added saving and loading of the todoList array today.
I'm using PlayerPrefs to save and load single variables and ArrayPrefs2 to save and load arrays.  Since I'm using Lists, I have to convert the lists to and from arrays when using ArrayPrefs2, but I plan on creating a more robust system later.  Possibly using XML.  Ideally, I would save individual entries in the todoList, instead of the entire array, but saving the whole array every time a todoList item is removed or added may not be too resource intensive.  I'm really not sure.  Right now I'm mainly focused on getting everything running and released.  I'll focus on optimization later.


Dev Update #11 - Continuing work on Productivity Game - Rogue-Like Prototype

Game in mid-level load

Game on Day 2
What works:
-Adding and completing tasks.
-Completing a task adds a tile to the level.
-The level can then be played once all tiles are complete.
-Todo buttons fit the size of their text.
-The level, the number of tiles added to the level, and the remaining todos are all saved when the game is closed and reopened.
-  The actual game portion works

What doesn't work:
I added those buttons along the right side to test some features.  Currently they're all a little broken.  I'm pretty sure I know how to fix the music button to turn music on and off.  The pause button technically works, but tiles are not added to the level when a todo is completed, when paused, which defeats the purpose of the pause.  The reset game button resets the game, but you also have to immediately turn the game off and back on again or it will break all kinds of things.

So, I'm basically just bug fixing right now.

I thought I made at least one post, if not multiple posts since the last one, but they don't appear to exist :/

Thursday, September 10, 2015

Dev Update #10

2d Roguelike Prototype:
I've completed saving and loading using random.seed, a couple of simple integer variables, and player prefs.  This was actually much easier than I anticipated.

Now I'm back to where I left off with the Habit Engine...The GUI.

I'm not looking forward to this, but I know it's necessary and highly important.  I'm hoping to build the "One GUI to rule them all!" or, in other words, a flexible, customizable GUI I can continue to reuse on all projects.

I may do a more indepth write up of my work so far, eventually, but I wasn't planning on posting until I had the prototype finished.  I basically looked at the GUI once and got a migraine and decided to come back to it.  I plan on starting work on it this week.  Since I have no idea how long the GUI will take me, I decided to post now.   At least the game part is basically finished.

Maybe I'll post a video so I can show its current state.

Tuesday, September 1, 2015

Next Dev Update very soon

I'm planning on posting a new update on the first of every month.  I may make interim posts as well, but new updates should always be posted on the first of the month.

Today's update, however, is late, because it's not finished and I need to leave for work(crappy call center job) at this moment.

I've made some very exciting progress on the 2d rogue prototype and may be able to get it working and published within one to four weeks.  Sequential level loading is working, and I've moved on to saving and loading.

Check back here within the next few days for a more thorough write up.

Thursday, July 30, 2015

Dev Update #9 Productivity Game - Rogue-Like Prototyping

I did a tutorial for Unity for a 2d Roguelike
I decided to modify this Game so that every time you do a task, another tile/part of the level loads and then once all tiles/parts are loaded, you can play the level.

I've made some progress in this.

I used:

while (!clicked)
{
yield return new WaitForSeconds(0.01f);
}
clicked = false;

To make each piece of the level wait for a click until loading the next piece.


(I'm finding it difficult to properly format the code on blogger.)

Then I tried to make the Sound and Player Object wait to load until after the level was loaded, but I've had some difficulty.

First, I thought I would just turn them off in the inspector and then turn them on with a script.  It turns out, accessing a deactivated object is difficult in Unity, because most of the easy ways to access an object require the object to be active.

Second, I thought I would try to create a script that had a reference to the Object, and then I could access the reference from the script.  I spent a long time trying, but could never get it to work.  It might not be possible.

Then I decided to leave the Player Object active and simply toggle the Player Script and and Player SpriteRenderer.  This worked on the first level, but after the next level loaded, there was some code that was trying to use the Play Script, but couldn't because it was deactivated.

I'm not yet sure how I will solve this.

Dev Update #8 UnityUI Tests

I've been streaming some of my work on http://www.twitch.tv/fragmentalstew. Unfortunately the stream is too low quality to see what's going on. Mostly it's me trying things and then them not working. I do make a little progress, though. Also I don't have a webcam or mic hooked up currently so my only means of communication is through wordpad.

 I made a simple mockup of the UI with a prefab of a toggle. I tried to dynamically instantiate a list of those prefabs but I had trouble making the new instantiated toggles children of the canvas. I found a video about it on https://www.youtube.com/watch?v=TRLsmuYMs8Q and downloaded the video using firefox's video downloadhelper addon so I could control playback speed. I used the code that was linked to this video, with a slight modification to use SetParent instead of Parent, to display a list of toggles that are children of the canvas. They scroll correctly and everything. Now I just have to apply this to my own project and I should be able to create a mockup for the new UI. I'm still not entirely sure what everything in the code does, but I'll figure it out.


 Update: I made a draft of this post a while ago but never posted it. After this post, I created 4 separate lists of toggles and connected them to the same scrollbar. They don't scroll evenly. Each list is centered instead of starting at the top and the longer the list, the faster it scrolls, but I moved on to something else which I'll describe in my next post.  I also added rudimentary health/xp/mana bars.

 

Thursday, June 25, 2015

Dev Update #7 And we're back!

Lost the domain for a little while, because the registrar wanted to renew it for a much heftier price that I was willing to pay.  I wanted to switch do a different registrar but never got around to it.

Luckily, this domain was available for registration with google domains for a reasonable price, with free identity protection and email forwarding.

I put off work on the HabitEngine for a while, but I've started back.

I transferred the project to Unity 5.  In the process, I didn't transfer all the folders, so what I thought was a bug was really only a problem I created.  However, in the process of trying to fix the bug I created, I found the solution for the scroll bar not being clickable, so I fixed that.  I also cleaned up my HabitRPG avatar code so it's not clogging up the console with warnings.

I'm working on recreating the GUI using Unity's new UI tools.  There should be many advantages to this.  Hopefully I will be able to create a more dynamic, customizable, efficient UI that runs well on all devices.

Learning the new unity UI is a chore, and I'm working 40 hours a week, so it will probably take me a while.

Here's a picture of The Habit Engine, with old GUI, running in Unity 5, with working scroll bar, and minus the console clogging avatar code.









So, I thought I might get a habitengine domain if it was available, but apparently a Finnish guy named Janne Haonperä, Chief Marketing Officer for http://www.cloudriven.fi/, has bought up all the domains.  I might try to contact him about it.  Janne, if you're reading this, can haz?

Fell free to suggest name changes, in case it has to come to that one day.

Wednesday, October 8, 2014

Dev Update #6 New Builds! (And Flying Voxel Pigs)

Go to the link below and download the executable for your desktop operating system.  There are builds for Linux, Windows, and Mac OSX
https://drive.google.com/folderview?id=0B6yn-RDuOpqhSTdoNkhCdFZXRTA&usp=sharing

This is the first build with the bug fix that makes it work with habitrpg.com(again).  I also added Jennifer Phillips' Voxelated pigs, from the concept art competition, to the login screen.



Notes:

-Functionality-
-You can login with either username or api.  Click the buttons on the login screen to switch between them.
-You can add habits,dailies, todos, and rewards.
-You can view and check tasks and checklist items.
-Checklist items appear as other tasks except with numbers in front of them (1,1) for example.
-There is no edit functionality, or reorder.
-Todos that have been done still display.

-Sprites-
-I haven't added pets.
-Only your costume currently displays.  If you're not using a costume your character won't display.
-Adding sprites is a very manual process.  If the sprite/gear you're using was added after the date that I added the sprites, it cannot display.

Monday, September 22, 2014

Wednesday, September 3, 2014

Dev Update #4 First of the Month

I planned to update on the first of every month and I'm late this month. My apologies.

UnityHTTP is working, and I'm working towards an open source release.  If all goes as planned, I should be able to release on github within the week.  Possibly Sunday. Sunday is usually my dev day.

Wednesday, August 20, 2014

Dev Update #3 - It works again!!!

Good news!  The release that contained my bug fix came out on the 12th.  I could have updated then, but I waited until now to post about it.  With this bug fix, the Habit Engine finally works with habitrpg.com again.

I've been trying to update at roughly the same time every month, but I kind of dropped the ball this time.  I'll probably start updating at the beginning of the month, just to make it easier to check.

Since the last update, I have been trying to get unityhttp to work.  Uniweb works great, and it's a steal at $25, but if I'm going to open source Habit Engine, I can't expect everyone to buy it.  In fact, if I decide to use a gpl license, which I am leaning towards, I think that sort of breaks the license.  For that reason I have posted a simple test project at https://github.com/fragmental/HE_Rest_Test in order to test unityhttp.

If you are a programmer, interested in helping, you can clone this repo, and then clone unityhttp into the assets folder, and help me find out what the problem is.

In other good news, Unity 2.6 open beta is out!  This contains the new GUI elements, which means that my workload went from a few things to a hundred.  I'm not ready :/

Stay tuned for more info, and if you're interested in helping in this endeavor, please don't be shy about messaging me.


Tuesday, July 15, 2014

Dev Update #2: And we're still waiting; Waiting on the code to change

https://github.com/Unity-Technologies/mono/pull/141

Update X509Certificate.cs is my commit to Unity's Mono, that fixes the SSL bug I mentioned in the last post.  It was finally merged 4 days ago, and it's only a matter of time before the release that features the bug fix.

I'm not sure when it will come.  I get excited, and then subsequently disappointed after every minor release.  If I was feeling adventurous, I could probably compile the code myself, but I'm just not sure it's worth the effort.  I mean, I could spend hours getting the code to compile just to find that it won't work, and I still have to wait.  I just don't have that kind of time to waste.

Once the bug fix finally drops, there will probably still be a relatively long wait for Unity 4.6, which contains the new Unity GUI.  In that time, I plan on using the Habit Engine myself with my habitRPG.com account, and then progressively adding the features that I find most useful.  I will probably stick with the current gui code, even though performance may suffer as I add more gui elements;  then I will rewrite the gui after 4.6.

Code Updates:
I recently added HabitRPG sprites.  It still need some polishing up, but it's otherwise fully implemented.  Ignore the lack of data;  I turned that off while working on the GUI.




Friday, June 13, 2014

Development update #1

I decided to rename the project from "Habit Media Engine" to just "Habit Engine".

Development has had its ups and downs.  



First, the good news:

1.On the near horizon, the next release of Unity includes a new GUI system, which I should be able to leverage to really improve the UI.
2. Entry on Enter is working.
3. Task colors partially work.
4. Checklists work, though adding and editing them has not be implemented, and their ui could use some work(see #1).
5.  I tested builds for Android and Iphone using "Good ol' Sockets" and they both worked, though the UI would need to be changed for mobile(see #1) and the performance needs to be improved.
6.  I added a 3d character with animations that trigger during certain events.  When a positive habit is clicked, or a daily or todo is checked, the character smiles.  When a negative habit is clicked, or a daily or todo is unchecked, the character frowns.  When you reach a new level, the character jumps.(For more information, see the end of this post)



Next, the bad news:

Currently, there is a bug in Unity's mono ssl runtime that prevents  Habit Engine from communicating with the HabitRPG server.  HabitRPG's certification used a different algorithm until they updated it.  The bug does not exist in Unity 5, but Unity 5 probably won't be released until sometime in 2015.  I'm currently not sure what to do to resolve this in the meantime.  I've created a bug report, and even a pull request, and I'm not sure if there is much else I can do.  This bug is the only thing that prevents me from making a second release.  It also breaks the first release.


More on Character Animations


I spent a lot of time working on importing 3d animations into Unity.  I used a character I had previously made called "Piggly", because I thought that would make the process much simpler and quicker.  Piggly is not a biped.  He's more like a blob with eyes, ears, nose, and mouth.  Supposedly, bipeds are much easier to work with in Unity.

 I created him at a Skills USA National competition, for a short film.
Bad Piggies Director's Cut from Stewart Martin on Vimeo.


I imported Piggly, with a morpher(3dsMax equivalent of blend shapes) and a stretch deformer from 3dsMax.  I then found out that Unity doesn't support deformers.  Additionally something about the morpher was causing the skin to be affected by light differently.

So, I abandoned 3dsMax, imported my meshes into a single Maya scene, made new textures, and tried again.  All of the blendshapes and the main character shape in Maya were simple low poly with a quick smooth applied.  Turbosmooth  with a morpher, from 3dsMax, imports properly into Unity(except for the problem above) but quick smooth from Maya does not.  In Maya, you can use a smooth mesh on the main shape, and it will properly apply the vertex changes to all of the blend shapes, but in Unity, this causes terrible distortions in the skin.

Because of this,  in Maya, I had to apply a smooth mesh, and then remake the blend shapes from scratch using the higher poly meshes.  I did this quickly, and the results were not as good as the previous blend shapes.

After doing a little research, I read that the best way to do squash and stretch on a character in Maya, for use in Unity, was to create a squash and stretch rig like the one outlined in the tutorial here.  So, I spent hours following the first 6 tutorials, and then followed them a second time, applying those steps to my own character.  After creating a jump animation and importing it into Unity, there was a(nother) terrible distortion in the skin, because Unity doesn't support scale compensation.


At this point, I had spent many hours, and the majority of that time was spent trying to import a simple squash and stretch into Unity.  It was then that I realized that, all along, I could have just animated the scaling by hand, and baked the animation.  The scaling is not mathematically accurate for squash and stretch, but it does the job.

After that, I worked on triggering the animations in Unity.  Eventually I was successful using the "legacy" rig type.  I posted an explanation of the process to Unity Answers here.  However, when I first finished the animation didn't work.  It wasn't until I realized I needed to assign my script, that was calling the animations, to the object that owned the animations that it finally worked.

I live streamed some of this process on twitch.  I made a highlight video of the moment I figured it out.  The epiphany happens at 1:15.  I still had to fix a few bugs, but I got it all working.  The pig finally jumps at 4:19.

I would like to create new animations involving bipeds, but I haven't found or created a biped that I want to use.  I'm working on that.

Bonus picture:  I imported the maya piggly rig into 3dsMax, and it looks funny.
Dat Chin Tho