Friday, October 14, 2016

Introducing the "Mini Games Project" - or the one where Joe becomes a dad

Summer "vacation" ends, an announcement, and a baby...

Sub-Zero Squirrel Games
October 11, 2016 - Little Rock, Arkansas, USA

Well that  was refreshing. While an unintended break seemed to put the halt on some game development, there were definitely other things being developed in the SZS family. First and foremost, please welcome Evelyn Rose Hassell to the world (pic at the bottom). As you might imagine, Joe has had his hands full for a couple months. Congratulations are in order to Katie and him.


So, I'm going somewhat solo for a couple of small projects in the meantime. I sometimes need to vary projects for a while, and come back to older ones or I get bored. One of my favorite concepts we've worked on in the past is "The Lost Office," which you can read more about on our IndieDB page for the project. It's the kind of game that would contain a lot of mini games within: mostly as types of puzzles. So I've tasked myself with building a bunch of them over the coming months in between updates to Teratrons From OuterSpace 



I'm going to call him "Game a weekish."

He came to me a dream, and I forgot him in another. Actually, I was just bored and decided to see if I could make a complete game in just a couple of days. My goal was no more than 40 hours from start to finish. My first attempt came out okay. Here is the finished product: 


Here are the rules as I've made them up along the way. 

1. No project should take more than a week to build. 
2. The game must have a start, a mechanic, and a win condition. 
3. The game must have enough randomness to be infinitely(ish) playable
4. The idea doesn't have to be wholly original. practice is practice 
5. Share the process of discovery with the community. 
6. Pay a bill or two?

Anyway, I decided to attack the slide puzzle first. What I failed to think of early in the process is that I would create rule number 5, which means that when I'm finished, I have something to share about how the process evolved. So I don't have really good documentary materials to draw upon this first time around. I promise to do better next time. 

There WILL be a next time, I've already brewed up the next concept. But back to the business at hand.

The road to Slidesville has a few turns and corners before it brings you into downtown where the streets are all square and everything tries to move into the one empty space (I was going to park there!). The traffic is a nightmare until you're through, but I found a few guideposts along the way. 

If you want to download the Unity project I used to do this including all the code, but not the art, you can find it here: http://subzerosquirrel.com/UnityProjects/SlidersTutorialPackage.zip

The idea is simple enough, create some tiles, make them move when you click. You need to constrain them, and move them within a grid. The math geek in me loved this part. Declare  yourself a 2D array of GameObjects and get to work:

for (int i = 0; i < GridSize; i++){
    for (int j = 0; j < GridSize; j++){
         GridTiles[i,j]= Instantiate(Tile);
         GridTiles[i,j].GetComponent<TileScript>().var = somevar;
         etc...
    }
}


Don't forget that when you position your tiles, that you are positioning them left to right, top to bottom, so y positions will be negative from the top down. Otherwise, you get some very confusing responses from you tiles.

Don't forget to add some randomness. Check out this nifty bit of code that follows. It's called the Fisher-Yates shuffle, and it looks something like this for an array of string[]:

  1. for (int i = 0; i < alpha.Count; i++) {
  2. string temp = alpha[i];
  3. int randomIndex = Random.Range(i, alpha.Count);
  4. alpha[i] = alpha[randomIndex];
  5. alpha[randomIndex] = temp;
  6. }
source: http://answers.unity3d.com/questions/486626/how-can-i-shuffle-alist.html


Which just shuffles all the tiles into a fairly random order. I used this concept to create an int[] which held the index order for my actual tiles. Excellent! But there's a problem I didn't know about at first. As I was testing my project out, I couldn't solve one of the puzzles... 

I just couldn't solve it. There was no set of moves that could possibly result in a correct solution. NOT ALL RANDOM ORDERS HAVE SOLUTIONS!

I had no idea. It turns out that if there are an odd number of value inversions  in a list, then the puzzle cannot be solved (citation needed).

Here's a simple example:

You cannot solve this puzzle, ever:


   Two is greater than one, so 1 inversion.
   Two is less than three, so 0 inversion
+ One is less than three, so 0 inversions
                                              1 total inversions (odd)



nor this one:








which I'll let you figure out on your own. (the answer is:

             int InversionCount = 0;

            for (int i = 0; i < TileCount; i++)
            {
                for (int j = i + 1; j < TileCount; j++)
                {
                    if (GridTiles[i].value > GridTiles[j].value)
                    {
                        InversionCount++;
                    }
                }
            }

: which comes out to 15).

We have a winner.

So we have a mechanic (sliding tiles), a startup scenario (shuffled tiles), and a win condition (get all the tiles in the right places).
The simplest way to check the win condition is to iterate through the grid, and make sure everything's in the right order. Do this at the end of every move and you can't miss. We're dealing with four bit numbers here. There's no real math to do.

But what about some feedback along the way. Games are more enjoyable, no matter how simple, when you give the player an audio-visual response to their actions. For example, if a move results in a tile moving to its home square. But the tiles can be in any configuration after any move. So tell them where home is from the very start.

 There are a couple different ways to do this. You could build them all then shuffle them (which now that I look back is a better way) or you could figure it out from their value;

Given the following grid:

X → 0 1 2 3
Y = 0 0 1 2 3
1 4 5 6 7
2 8 9 10 11
3 12 13 14

A quick empirical study reveals that the value of the tile is related to its position such that (with zero bases indices)

Z = x + y*GridWidth   (GridWidth is a non zero number!)

For Example: 14 = (2) + (3)(4), so you know 14's home position is (2,3).

BTW, that works for any rectangular grid, not just squares.

or to reverse the process:

                int Ypasses = 0;

        while (SolutionIndex > GridSize)
        {
            Ypasses++;
            SolutionIndex -= GridSize;

        }

        HomeCoords Result = new HomeCoords(); //struct { int, int }
        Result._X = SolutionIndex;
        Result._Y = Ypasses;


now, we can simply check the tiles home position against its current position, and do something nice for the player when the tile gets home. 

I chose to flash the tile and play one of 4 random, pleasing, and tonal sounds in the same key as the music. Tiles will often reach home several times before the puzzle is finished, it's important that the sound be musical in some way. The music was (mostly) in C major, so I went with four high pitched triads from the major scale  I, IV, V, vi. The reason for the high pitching is so that 

1 - It will stand out from the musical background
2 - The triad will sound pleasing regardless of the root below it at the time from the music.


I should probably stop babbling on about music theory. I could do a whole series on game music and sound design theory. That's for another day. Here's a quick video




By the way, I removed all the music and sound from the project, as well as a portion of the art. You can't have everything for free.  

There's really a lot more that I could do with this. The simplicity of the platform allows for all kinds of permutations. Perhaps, you draw pictures (i.e. dickbutts) or take photographs (most likely shower selfies) or any kind of order-able set of related numbers, equations, so on and so forth.  

Passing the test:

Let's check our rules again: 

1. No project should take more than a week to build. 
2. The game must have a start, a mechanic, and a win condition. 
3. The game must have enough randomness to be infinitely(ish) playable
4. The idea doesn't have to be wholly original. practice is practice 
5. Share the process of discovery with the community. 
6. Pay a bill or two?

How did we do? The build time was actually less than 48 hours or so, including art and music. The game can be started, played, and won. With over 60,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 possible start up puzzles, it's damned near infinitely playable. Not an original idea, but it definitely has my take all over it. I wrote a blog about it.

The last one remains to be seen. 

What did I learn? Aside from the hurdles already mentioned above and the lessons learned there, I learned I can't do one of these in just a week. If I didn't include the tutorial/social aspect, then sure, I could grind them out; but that defeats the purpose of discovery and sharing. In fact, I'm making sure to document what I do as I get into the next project. I'm hoping for a video out of this one.

What's Next?

My next project is going to be called ICBM. You get to launch missiles and destroy other civilizations, and take their loot, so you can build bigger missiles to destroy bigger civilizations to take their loot so you can build bigger missiles to destroy bigger civilizations to take their loot so you can build bigger missiles to destroy bigger civilizations to take their loot so you can build bigger missiles to destroy bigger civilizations to take their loot so you can...
(how much of that did you really read?)



The trick to this game is you can only control your rocket as long as you have fuel to burn. I foresee some issues arising with touch controls. I'm going to need to create some virtual touch-zones to control the game. We're going to need multiple controls, and on top of that we'll need to create an economy, store, and up-gradable rockets. This should be fun!

Until then, Stay Frosty!
~Sub Zero Chuck



Thursday, April 28, 2016

We've got some news - Or Episode XI, A New Hope


Wait! That's not our logo. What's it doing on the top of this blog? Let me fix that:

Sub-Zero Squirrel Games
April 28, 2016 - Little Rock, Arkansas, USA

Let me backtrack a moment. I know why that logo is at the top of the page. We're going to ComicCon! We're not going as visitors, mind you, but as exhibitors. We got our booth yesterday, right in under the wire. We had almost forgotten it was coming up, as this time last year, we were no where near ready to show anyone anything that we had dreamed up yet. We did manage to go spread some propaganda: Little cards with our branded logo printed on one side. We left them all over the place, hoping people would pick them up and look us up as a result. It wasn't very successful as far as we could tell. There might have been a slight uptick on website stats over the next couple of days. It's hard to tell when numbers are so small to begin with.

The upside is that now, 11 months later, we have a game to actually show people. We're so close to producing the final product right now that we're sure we can be ready. To that end, we want to thank all of you who have helped us find and squash the various bugs we intentionally wrote into the code so you could find them and think that we're merely human after all and not actually game code gods, which we are, of course. Why would you think otherwise?

If you're in the Central Arkansas region and would like to bask in the glory of our greatness, please come see us the weekend of June 11 and 12. There will be snacks. We will not provide said snacks. We're pretty sure that's up to the food vendors. 

New Deadline, Production Release - June 1

We feel this is completely reasonable, given the state of the game at this very moment. On that topic, if you're not already playing our Early Access Beta, stop reading this, and go download it now:



For those of you already testing, we'll be dropping a couple more updates in the next few weeks as we expand a few things, finalize a accounts for Facebook, add some more music, etc. 

One last thing...

We heard you like videos. Here's one of the opening story:


Until next time, Stay Frosty,
~Sub-Zero Chuck


Wednesday, April 13, 2016

Too Much Clutter - or how I finally decided to make a dialog box

Sub-Zero Squirrel Games
Wednesday, April 14, 2016 - Little Rock, Arkansas, USA

Man this canvas is getting a little cluttered. The hardest thing we're working on right now is the Graphical User Interface, which I will just call GUI like a good nerd from here on out. With all the various settings, options, requests, information, feedback, and other stuff we the games needs to let you know what's going on and what's next and how you prefer the experience, the various parts are starting to get a little crazy. There's a bunch of stuff you don't see sitting off screen waiting for it's moment of glory. Check out this comparison:


On the left you see the exploded canvas waiting to be brought onscreen, which you see in the right. The canvas is an overlay on the screen, separate of the camera, which is why you don't see the game objects (ship. moon, etc. ) on the left. There's a lot of stuff hanging over the edges. But wait, you can't even see all the various layers beneath stuff. Believe me, it's a lot of stuff.

You don't believe me? Well, let's just prove it, here's a picture of the animation tree...



It's only going to get worse as I go. I need a better solution.

My AHA moment

In my years of writing software for people to use, I've learned that you have to be careful about when you let people click buttons in your application. In general, users will find amazingly unique ways to mess up your carefully crafted logical program. So, you have to ask them if they really mean to do what they just asked your program to do. Now, in any .Net situation, I'd simply just pop open a dialog box, and ask them a question, "ARE YOU SURE YOU'RE NOT AN IDIOT?" (Yes, I've actually used that question before in  program at work.) 

But, in Unity, there's no such easy call just built in, and besides, anything we put on the screen should reflect the design on the rest of the game, and not be some generic OS provided message box. 

I know I'm not the first one to stumble across this simple solution, but I'm going to share mine anyway. It's short. sweet, to-the-point, and could save someone else a lot of work. 

The rest of this post is all geek speak, if you're interested in that part, keep reading. Otherwise, play the game already:





I created this dialog box starting with an Image on the main canvas, which has been tagged "MainCanvas" and is a prefab which is used in every gameplay scene. It has an invisible full screen image behind it, so that it becomes modal. I attached a script to it, made a new prefab, dropped the whole group of canvas objects into it, then deleted it from the scene. 

Here's the code attached to this new prefab: 

using UnityEngine;

using System.Collections;
using UnityEngine.UI;

public class DialogBox : MonoBehaviour {

//this is a modal doalog box for TFOS
    //this string right here is the name of the function to call when the
    //player has responded:
    public string CallBack;
    
    //a list of character images to choose from, and a way to set that choice
    public Sprite[] Characters;
    public int CharaterIndex;

    //options for the dialog
    public string Message;
    public int Alignment;
    public string ChoiceOne;
    public string ChoiceTwo;
    
    //references to the parts of the dialog that need to change
    public Text ButtonOneText;
    public Text ButtonTwoText;
    public Text MessageText;
    public Image CharacterImage;

    void Start()
    {

        CharacterImage.sprite = Characters[CharaterIndex];
        MessageText.text = Message;

        switch (Alignment)
        {
            case -1:
                MessageText.alignment = TextAnchor.UpperLeft;
                break;
            case 0:
                MessageText.alignment = TextAnchor.UpperCenter;
                break;
            case 1:
                MessageText.alignment = TextAnchor.UpperRight;
                break;
        }


        ButtonOneText.text = ChoiceOne;
        ButtonTwoText.text = ChoiceTwo;

    }

    public void OnButtonOne()
    {
        Debug.Log("Sending Choice: " + ChoiceOne);
        GameObject.FindGameObjectWithTag("MainCanvas").SendMessage(CallBack, (int)1);
        Destroy(gameObject);
    }

    public void OnButtonTwo() 
    {
        GetComponentInParent<CanvasManager>().SendMessage(CallBack, (int)2);
        GameObject.FindGameObjectWithTag("MainCanvas").SendMessage(CallBack, (int)1);
        Destroy(gameObject);
    }


}

Now I just need to add a reference to this new prefab into my main canvas manager script, and instantiate a new one whenever I need to ask the player a question. It could be any question, but let's ask them about Facebook:

//the prefab is a UI Image, with attached components
public Image PrefabDialogBox;

public void OnFBInteract()
    {
        if (FB.IsLoggedIn)
        {
            Image _DialogBox = Instantiate(PrefabDialogBox);
            _DialogBox.transform.parent = transform;
            _DialogBox.transform.position = new Vector3(Screen.width / 2f, Screen.height / 2f, 0);


            DialogBox ThisDialog = _DialogBox.GetComponent<DialogBox>();
            ThisDialog.Message = "Do you want to log out of Facebook and remove the information?";
            ThisDialog.ChoiceOne = "yes";
            ThisDialog.ChoiceTwo = "no";
            ThisDialog.CharaterIndex = 3;
            ThisDialog.Alignment = 1;
            ThisDialog.CallBack = "FaceBookLogoutreply";


        }
        else
        {
            Image _DialogBox = Instantiate(PrefabDialogBox);
            _DialogBox.transform.parent = transform;
            _DialogBox.transform.position = new Vector3(Screen.width / 2f, Screen.height / 2f, 0);


            DialogBox ThisDialog = _DialogBox.GetComponent<DialogBox>();
            ThisDialog.Message = "Can we access your public Facebook profile? We need to be able to notify your next of kin.";
            ThisDialog.ChoiceOne = "yes";
            ThisDialog.ChoiceTwo = "no";
            ThisDialog.CharaterIndex = 2;
            ThisDialog.Alignment = -1;
            ThisDialog.CallBack = "FacebookLoginReply";


        }


    }

    public void FaceBookLogoutreply(int Choice)
    {
        if (Choice == 1)
        {
            FB.LogOut();
            //TODO: clear any FB data we've requested
        }
        else
        {
            //player chose not to log out, or something else
            //Do.Nothing();
        }

    }

    public void FacebookLoginReply(int Choice)
    {
        if (Choice == 1)
        {
            //TODO: log into facebook

        }


    }

So there you have it. No more creating permanent instances and cluttering up EVEN MORE of my canvas with simple yes/no questions. I still need to leave in those parts which will be animated in and out, but that's just what it is, and I'm not going to complain.

Until next time, Stay Frosty,
~Sub-Zero Chuck

Friday, April 1, 2016

Crossing the Finish Line - or where we get ready for the next hurdle.

Crossing The Finish Line

Sub-Zero Squirrel Games
April 1, 2016 - Little Rock, Arkansas, USA

It's Friday night, and officially since it's still before midnight in the time-zone in which our studio is located, we managed to get out a fully playable game, from start to finish. That's not to say that everything is worked out, and that the game is everything we want it to be, but

Early access is live, and we want you to join us

Get a very sneak peak into Teratrons From Outer Space today, and when we release the final version, you'll get free of charge, the premium no-ad game. Not only that but you'll also get to see first hand the progression of the game as we take it from a fully playable (if yet a little buggy) creation to the fully progressive game it will become in the next several weeks. Hopefully you'll give us feedback as we try to balance the difficulty settings tweak the game play until the fun is turned up all the way to 11. 

At this point, we don't have too much to say. This last week has been grueling, but we feel like it has been worth it, and that you'll enjoy this early release of Teratrons From Outer Space. The best part is that it only gets better from here. 

Head on over to the Early Access portal, you'll need to log in to the google play store to access the game. Here's a link:




Stay Frosty,
Sub-Zero Chuck

Friday, March 25, 2016

Crunch Week Begins - Or the one where we become bald over a period of seven days.

Crunch Week Begins

Sub-Zero Squirrel Games

March 25, 2016 - Little Rock, Arkansas, USA

We promised you a game.

When we started we figured we would have this thing down in a couple of weeks. I mean, how hard could it be? It's such a simple mechanic, and we already have a working prototype that people genuinely enjoy. After realizing that the projects we are seriously passionate about, and really want to make into really awesome games, Huey the Hamster  and The Lost Office, would take entirely too long to bring to fruition, and would probably not make for a suitable first game for us.

We promised you Bouncy Adventures.

It was the very first concept we came up with, because a bouncing ball was a very easy mechanic to set up, and to be truthful, it was really more just the two of us figuring out how all this stuff worked. By the way, we're still trying to figure it out, we've just gotten a lot better at it then when we started. Bouncy Adventures has it's merits: the prototype was showed some very promising designs. My personal favorite out of that was the "Night Cannons" designs.


You can play this prototype if you like. It's available FOR FREE for PC and Android on our IndieDB page. We tried to force it into some type of world tour of ancient and modern sites via pinball. It felt forced, and eventually, forced us to quit the project. It's not a bad game idea, we just lost interest. So, no Bouncy Adventures for you.

Then we promised you:


And we told ourselves we should be finished by the end of the year when we started in Nov. 2015. By January we thought we had it all figured out and that we could put this thing together in no time. "We should be done sometime in January," we told ourselves. 

We were wrong.

Yeah, the initial work didn't take too long. But, we wanted the game to have some real game play, and not just another simple color match game. We also wanted it to have some personality, as we continued to develop new tactics, and advancing the difficulty over time without just speeding things up, we also began to envision characters and story line to go along with the game play, and give some depth to what you're actually doing when you play the game. 

YOU ARE DEFENDING THE VERY EXISTENCE OF LIFE OF EARTH!

As you will soon see for yourselves, it's going to be worth delaying release on this until we're done with it. When March 1, our officially published release date on SlideDB, starting creeping around the corner, neither of us gave it much thought. But that day, we set our sights on next Friday. And we're staring down the barrel the whole time. 

We're aiming for a complete game, with all the levels in place, as well as all the options, We're aiming to have all the characters in place, and the story line complete. We're aiming to have all the bugs worked out, but we're not aiming for production release just yet. 

Next week's release is supposed to be our full length Beta Test. We have an offer to make you: 
Beta Test our full game FOR FREE and when we go production release, we'll give you the AD FREE premium version at no cost. How can you turn that down? I must admit, there's a catch, we just need feedback from you. 

You also get a chance to influence any changes we make as a result. Then the game becomes a part of you, and you it. We would also like to publicly thank our testers in game.

So, we promised you a game. And (insert your choice of expletive here) you're going to get that game. Things are looking good, and we're super excited. 

BTW, I also promised you some character introductions, here's one: Dr. Allen Astronamor, penned by Matt Barnette and inked by SZ Joe. Here he is looking a little bit intrigued about something:


Stay Frosty
~Sub-Zero Chuck


Tuesday, February 16, 2016

An older perspective, or The One Where Rachael Realizes Her Mistake

The first person look for this game is awesome, if you're on a large screen. 


Sub-Zero Squirrel Games, LLC
February 16, 2016 - Little Rock, AR, USA

After spending the last couple weeks working on bringing you a first person version of this game, which we love (see our previous blogs), after trying it out on a couple of mobile devices, we realized that we were heading down the wrong road.

Do you need glasses?

I do. I've needed them for years, and do wear them. But that's beside the point which is that in this perspective view, that the TFOS get smaller the further away you are from them. Of course, that is the very nature of perspective. However, when you couple that with the small screen of the mobile devices, you might as well hand the player a microscope to use along with their phones. Aside from a few professional labs, and high-school science classrooms across the nation, there aren't microscopes readily available, and I doubt people are going to bring one with them while sitting on the train going to work, although I very much would like to see that happen. I imagine it goes something like this:

"Excuse me, Mam, are you playing Teratrons From Outer Space on this train today?"

"No, I'm researching a cure for cancer, why do you ask?"

"Because I'm trying to play TFOS, and can barely make out what I'm looking at, can I interrupt your research?"

"By all means, please. I'm just wasting time; you're the real hero here!"

So what do we do now?

Rest assured, mobile gamer. This game is for you and that is our target. While we don't want to throw away the work we've done here, we want to make this a enjoyable experience (sans microscope). Luckily, we've been using version control, and can go back to an earlier iteration. Joe's going to refine the 2D layout to allow us to use more of the screen. Meanwhile, I'll diff the code to see what I've changed since we took off on this foray into perspective.

And all the work we've done in the last couple weeks? That's not time lost, per se. Of course, it does move us back a little, but not that much. March 1st may be out of reach, but not completely. I've managed to quash a couple bugs in the meantime, and we do want to branch this project off in the future, so the work Joe's done with the 3D modeling isn't going to go to waste.

That future project? XBox/PS/PC, of course. During early development, we added controller input. This game is actually a lot of fun with a controller or keyboard and/or mouse. The 1st Person perspective also plays really well on the larger screen space, and we also get a lot more freedom with textures, particle systems. and other performance concerns. Also, that gives us a chance to explore some new mechanics as well! You can get some of the early Prototypes from our website:
under the Deep Acorns Tab. There's a forum called Untitled Space Game. For Windows only.

Next Up: Meet the Characters in Teratrons From Outer Space 

Until then, Stay Frosty,
~Sub-Zero Chuck


Monday, February 1, 2016

Cockpits (Nothing Dirty)



     As you all know, from our social media prolific lead developer Chuck, we have decided to take the Teretrons into the 3rd dimension.  Now, we decided to do this for several reasons which I won't go into here (If you want to know read his article: http://subzerosquirrel.blogspot.com/2016/01/a-new-perspective.html .) So, the questions I asked myself as I started transitioning from a top-down 2d game to a first person 3d layout, were "What shouldn't I see?" & "What should I see?"

What I shouldn't see:

     A frame.  Meaning that in a first person view there would be no frame, no screen that you look down on your world like a god ( I don't know if your god has a frame he or she looks though, but mine does with a score, extra lives... you know the works.) No, I have to see through the eyes of man, and that means I can't just be hangin' out in space.




What I should see:

     A cockpit, and glass, and controls, and displays, and PRETTY LIGHTS!  Almost all of these were sorely missing in our first attempt. Our current look, while pleasing in it's own way... is also sterile and flat.  There is also a lot of screen space wasted.  Waste not, want not right?  The only control that seemed to fit on the screen was the fire button.  The rest were just placeholders, and none of the other options I tried were much better.

My first attempt at a cockpit:


It was really just and chair and a control panel.  Here I was just working with space.  I played for a while with adding and subtracting different components, trying to figure out what was actually necessary.  I didn't like my first chair, so that went.  Chuck and I both thought the control panel got in the way too much, so... gone. I finally added everything to the ship design, and condensed down to a more minimalistic design:



This is the state of it as it stands now. I think I will add yoke controls to the left and right sides of the screen, and move most if not all of the UI elements to look like they are projected on the glass, on the sides of your cockpit glass.  Tune in for future installments of me rambling. :)