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.