Wednesday, August 12, 2015

Calculating Jump Arc

"So how do I jump?" It's a common question I hear when I see people play a game with any level of platforming in it -- and often a desire in a game that doesn't.

But lately, while working on Battle High 2 updates, I have been asking myself a particular question related to jumping: "How do I jump so that I reach this height and return to the ground within so many seconds?" It's honestly a mathematical question that would make ninth grade me laugh, but then I'd slap him and tell him that he couldn't comprehend any aspect of 3D modeling, but I digress.

Anyway, I just wanted to write a small post about this situation as it's something that has perplexed me during Battle High 2, and something I hope won't perplex me in future games.

Firstly, I hate using builtin Physics engines, at least for character movement. People don't often move realistically in games, so why should I use an engine that is trying to simulate realistic physics? In conclusion, when working in Unity, I don't want to let the physics engine move my character, but instead use my own velocity, speed, etc.

The most common setup that I've learned since college is simply as follows:

speed += gravity * timeDelta;
position += speed * timeDelta;

Essentially, the player's speed -- assuming we are only focusing on the vertical -- is increased by the gravity and then position is moved by the new speed. This works fine. There's probably a bunch of other ways to calculate these values, but I use this one.

The problem I was having though was, if I'm using this, how do I predict positioning? Whether it would be for networking or basic planning, being able to predict a jump arc is pretty useful.

So, after banging my head against the wall for awhile, I found this was the equation I wanted to use to do said prediction:

position = 0.5 * gravity * time^2 + speed * time

Honestly, it's a basic physics equation that can be found doing some searching or going here: . Here's some more information involving calculus concepts such as integrals and derivatives: . This being said, this still didn't help me if I wanted to know the best speed and gravity to reach a certain height in a given amount of time.

Anyway, the previous equation is a basic quadratic equation where

a = 0.5 * gravity
b = speed
c = 0

c is 0 because I know that I want to start my jump on the ground -- at 0 -- and end it on the ground -- also at 0. Anyway, going to a quadratic equation in standard form:

y = ax^2 + bx + c

I know three of the five variables: x, y, and c. So my issue was, knowing what these values are, how can I solve for a and b, my gravity and speed.

I also knew that I can graph any parabola as long as I know three points, and I did!

(0, 0)
(t, 0)
(t/2, h)

Assuming t is time and h is the desired height or apex, I have these three variables. At the beginning of my graph, I'm at (0, 0). I haven't left the ground yet. Then, when time has elapsed all the way, I'm back to the ground. Finally, at half the time, I'd reach the desired height. Knowing this, I knew I could factor the equation as follows:

y = (x - 0)(x - t) or x(x-t)

In factored form, however, there is a coefficient, which I'll designate a. If I solve for a, I should be able to find my gravity! So what I did, is I substituted t/2 into the equation and solved for a.

h = a * (t/2)*(t/2-t)
a = h / (t/2)*(t/2-t)
a = -h/(t/2)^2

Finally, I knew a. Problem was, a is not equal to gravity. a = 0.5 * gravity. So gravity = a * 2.

Now, knowing my gravity, I can solve for speed, which is equal to -0.5 * gravity * time:

0 = 0.5 * gravity * time^2 + speed * time
-speed * time = 0.5f * gravity * time^2
speed = -0.5 * gravity * time

So, I finally figured out the issue, an issue that someone in a basic physics class learns within the first semester, but I was still happy, and yes, there are probably better, easier ways to figure this out, but that doesn't change the difference that I'm proud of my work!

But, I soon thought, what if I'm not on level ground? Then what?! I was a bit stumped, but I thought about all the variables I know and how they relate.

g = gravity (or acceleration)
v = initial velocity (or speed)
s = starting position
e = ending position
t = time
k = height (I'll explain why I'm using k later)

So at first, I thought the following three sets would work:

(0, s)
(t/2, k)
(t, e)

I know (0,s) and (t,e) are true, but the problem is (t/2,k) isn't necessarily true. By having different starting and ending heights, my jump is essentially ending at a different point, interrupting the full arc jump. So now, I have to find t/2, which I will designate as h so I can use the vertex formula:

y = a(x - h)^2 + k

In the above, a is the same as it was for standard form, so 0.5 * gravity. h and k stand for the vertex of my jump arc. We know k, the height designated earlier, but we have to solve for h now, which was originally t/2.

So now, I have to solve for h. I do, however know two values, which can help for solving h.

s = a(0 - h)^2 + k
e = a(t - h)^2 + k

We are solving for h, but if we solve for a first, we can set the two equations equal to each other.

a = (s - k) / h^2
a = (e - k) / (t-h)^2

Because of this, I know now the following is true:

(s-k) / h^2 = (e-k) / (t-h)^2

Now, I can solve for h! I'll save you the trouble and give you the following. It's the quadratic formula:

In this formula:

x = h
a = sk - ek
b = -2 * sk * t
c = sk * t^2

The only change is that s-k and e-k have been replaced by sk and ek. So first, we should note that if the starting position and ending position are the same, we can't use this method. We'll be dividing by 0 which won't work, BUT this doesn't matter. If the starting height and ending height are the same, we can just use the original method where we know that t/2 is our halfway point. Anyway, now that we know h, we can use this method to solve for a by using the following:

s = a(0-h)^2 + k
s-k = a(-h)^2
a = (s-k)/h^2
g = a * 2

We know now everything we need to know for our equation!

a = (s-k)/h^2
g = a * 2
s = -g * h or -0.5 * g * h * 2

This is really just scratching the surface, so I'm going to end this early. Regardless, using the following equations, we can solve a combination of problems concerning jumps.

p = 0.5gt^2 + st
p = a(t-0)(t-(-2s/g))
p = a(t-h)^2 + k

I can write more later, maybe illustrate some of points. This is a lot more complex than I was expecting when I started writing. Regardless, being able to determine what speed and gravity I need to utilize so that a jump of a certain height can be accomplished within a certain amount of time is very useful.

Sunday, August 2, 2015

Jam Week 2015: TetherBrawl

Last week I participated in Jam Week at work.  Jam Week is a week in which the entire studio gets to work on anything they desire -- within reason.  I, like I tend to do, worked on a solo project that I entitled TetherBrawl.  The following three videos are of the game's progress over time:

In TetherBrawl, the two players hit the ball, trying to get it through their hoop while moving in the correct direction.  Once the ball enters the hoop, a set of gems is generated that the player must collect; the amount of gems generated is proportional to the ball's speed upon entering the goal.  If the player is hit by either the ball or the opponent's attacks, they lose 10 gems that their opponent can then pick up.  After a minute, the winner is determined by whomever has the most gems.
I only did one character, a billiards player with an eyepatch, but my thinking for the theme was to create a cast of characters all based of sports that people don't deem as very athletic:  billards, golf, chess, bowling, esports, etc.  I do think the character proportions for the size of the screen work against it.  That character is probably around 7 heads tall; for a game like this, characters should probably be more cartoonish, around 5 heads tall, maybe even 4.
I thought it was a simple game, but a lot of people didn't quite know what was going on, at least on their first play through.  I think part of this is because I didn't get a chance to tutorialize it enough -- then again, when you have 4 days, maybe 4.5, tutorialization isn't your top priority.  Another is that I sort burned myself out.  I've been stressed lately trying to finish up Battle High 2 A+; finding motivation to work on it has been rather daunting.  So working on something in such a short amount of time burned me out.  Also, I realized about halfway through that most of my Jam Week ideas are extremely similar.  Two times I worked on GumTrix -- which is now available for iOS and Android -- and every other time, I've done some sort of 2-player, competitive game:  Two years were different fighting robot games and now this year was a competitive game.  I guess I sorta felt like a one trick pony.
Also, lately, doing solo work has been a little problematic.  I like working by myself.  There's a lot of good aspects to it, but I've lately found there are some negative aspects as well.  The most positive aspect is that there is a lot of ownership and control over the ideas.  No meetings to brainstorm or discuss or hurt feels when things are rejected or undesired compromises.  On the other hand, I find I have a hard time staying confident in an idea without working with another person, and sometimes, bouncing ideas can be beneficial.  Also, trying to do everything yourself is extremely daunting.
That was one area that working solo affected this jam week.  I tried to do everything myself when I should have cut some things.  For example, I made a character using Fuse and then animated it in 3DS Max.  This took a little longer than expected, the Max to Unity process being a bit clunkier and slower than I imagined.  Also, I thought I knew a lot more about Mecanim than I did.  I was able to get my animations and transitions working, but there were times were triggers always happened or when the game would wait for a transition before going to the next state.
 I think if I had went with a simpler, more minimalist approach to the art, I could have focused on the game's design more, maybe even getting a chance to make a strong tutorial.  Overall, I learned a lot, but I should have narrowed my focus during this year's Jam Week; given the amount of pressure I'm imposing on myself to finish the Xbox One port of Battle High 2 this year, trying to do a whole game in 4 days was a bit imposing, and after 3 days, I sorta stopped caring about the idea, as I just wasn't feeling it.  Next Jam Week, I'd like to avoid the two-player, side view game theme as well, but we'll see.

Thursday, July 2, 2015

Rejection and Finding My Place

So as EVO 2015 approaches, I recently found out that my game, Battle High 2, was rejected from showing in the Indie Games Showcase.  Well I didn't get direct word, but based on some Twitter chatter and the fact that registration for the tournament ended on the June 30th, I can only assume.  There are a several reasons I can guess as to why it probably wasn't picked:
  • Too traditional of a 2D fighting game, not helping really helping the genre or competitive scene grow
  • The game just isn't up to the standard of quality they were looking for
  • I'm too unknown of a developer
Regardless of the reason(s), I have to admit, I'm actually a little relieved it wasn't chosen.  I'm definitely not happy, but trying to get a build ready for the show as well as marketing materials and the like would have been a lot of stress.  And though getting feedback from fighting game players would have been awesome, it would have been like releasing a game through Early Access only to release the game in full a month later.  Would I have been able to meaningfully react to any feedback received?

At the same time, this rejection has sort of made me reflect on my work and my relationship with fighting games as a whole.

Do I Even Like Fighting Games?

It sounds silly, but I probably wouldn't be in the game industry if it weren't for fighting games, or rather, I wouldn't have wanted to go into the industry without them.  I enjoyed playing video games from an early age, but when I accidentally rented Mortal Kombat for the SNES from a Blockbuster Video -- I think my age is showing -- instead of the rage-inducing platformer, Plok, I found a game I really enjoyed.  I honestly don't even remember what it was, but eventually it went into more series:  Street Fighter, Tekken, Power Instinct.  If it was being sold or available to rent at my local Toys R' Us or Microplay, I was trying it.  I even remembering wanting a Sega CD JUST to play the Eternal Champions sequel.  And though my sketchbooks contained designs for Sonic and Lemmings levels, most of it contained character concepts for fighting games, a favorite of which was Slug McDog, a strange dog-slug hybrid with a human foot protruding from its sternum.

Anyway, as I became older, due to online technology improving, the genre changed, and I think I began to realize that I was never playing fighting games in the way they were intended.  They are competitive games, yet I rarely played them this way.  True, I played against the AI, but I rarely had friends over and never entered tournaments.  To be honest, I never even knew things like that existed, and by the time I got my driver's license the only arcades in the Lehigh Valley area were on their way out.  The clearest time in the genre's life that I really noticed this was the differences between Soul Calibur 3 and Soul Calibur 4.  Ignoring the gameplay differences and mechanics, from a single player perspective, in my opinion, there is a lot more to do in Soul Calibur 3 than 4.  Not to mention, there is even less to do in Soul Calibur 5.  Regardless, it now seems most games have abandoned -- or put off -- single player content to focus on developing better online communities, and you know what?  That's fine!  This speaks to how the genre was designed.  It's helping the genre grow in popularity and in ways I never had imagined, but at the same time, I just don't feel a strong connection with it anymore.

As online became more prevalent, companies focused on it more -- as they should have -- and less on single player content.  Fortunately, some series still do a great job such as Tekken, but others, I feel, have dropped the ball such as, again, Soul Calibur and Mortal Kombat X.  The problem I run into now is that, if I'm not going to play the game online or study and go to the lab aka experiment in training mode, for hours, what's really the point?  The rich stories?  Not quite.  In fact, I once mentioned I wanted better stories in fighting games and someone joked that the players are now the stories.  I smirked and then grimaced, because there was some truth in their answer.

Anyway, in the modern fighting game, my first big problem is that I'm not competitive.  That sounds so stupid, I know; the entire genre is built around competition!  I guess, when I first started playing them, I never really thought about it that way.  They were more like puzzle games to me.  They required quick thinking and problem solving but also performance and timing with some discovery -- how do I perform that, who do I unlock if when I beat the game, etc.  When I did try to play with friends, I was met with the all too common "Ugh, you're too good and it's not fun."  It's funny I mention that, because that's how I feel about my time online in most fighting games.  I feel fighting games are most enjoyable when you fight people around your level.  Fighting a beginner isn't enjoyable and getting demolished by an expert isn't either -- even worse when it's an anonymous expert.  Some people use their losses as a learning experience and try to figure out where they went wrong, but after "learning" 20 times in a row, some people probably just feel like dropping out.  Also, I often found myself asking, "Why am I doing this?"  I don't have plans to enter a tournament like EVO, so all this time spent online getting destroyed, I'd ask myself, "What am I working towards?"  This feeling becomes much stronger when it feels like my skills have plateaued.  I know that it's not about the destination, but the journey, but when you reach that skill plateau, it feels like the journey has stopped, and with so many games, there's little incentive to keep me playing.

To summarize, I'm a filthy casual who doesn't want to invest the time to git good!

My Place in the FGC

The Fighting Game Community, or FGC, is really something I didn't know much about until recently -- though I still don't know tons about it -- but when I found out about it I really thought, "Wow, there is a huge following for fighting games and I want to be a part of it!"  There are two problems.  One is I tend to be shy and a bit introverted.  I went to EVO in 2014 with a friend, and didn't really introduce myself to anyone new, but where I excel at is when someone ask me a question or has a reason to approach me, which is why I submitted my game to EVO in the first place.  Also, I've yet to really learn about a fighting game community in Pittsburgh, or even if I did, dedicate any time to it.  Fortunately, with the introduction of Victory Pointe, a new arcade / gaming center in Pittsburgh, I may, but again, I have to find time to go there.
The second problem is by the time I really wanted to be a part of it, I was already working and didn't have the time to become a major player in the community.  That's why I developed a fighting game to begin with.  I thought, "I'll contribute to this community by creating new games for it!"

Though as I started to develop Battle High, I realized that the desires for what players of the genre want is really out of sync with what I can / want to do in the genre.  I know very little network programming for example, so a good, competent online mode of any kind just isn't going to happen quickly.  I get to a crossroad; I could either invest an unknown amount of time to becoming an expert on the subject or just not do it and focus my attention elsewhere.  I've chosen the latter.  At the same time, do players even want new games?  I think the obvious answer is yes, but you have to be so careful, because if the new game isn't good, most will go back to what they know and like more.  For example, there is still a huge following for Smash Bros. Melee, which was released in 2001.  I think it's not so much that they don't want new content, but in a niche genre, being established -- whether it be through the IP or publisher -- really improves your chances of success.
So, with the rejection of Battle High 2 from EVO, I ask myself again, "How can I contribute to this community?"  In addition, I have to ask, "Do I even want to?"  Sure that sounds salty -- and it is to a degree -- but it's not really in a "HOW DARE YOU NOT ACCEPT MY GAME $*&(%&($&(#!!" kind of way, but more in a "Maybe this just isn't for me."

My Place as an Indie Developer

Indie development, in some ways, is similar to fighting games.  It's niche and competitive, and like the FGC, I don't really play a big part in it.  I'm slowly showing off more of my work in various forums, such as this, but as a whole, I just find that I'm way too busy to really contribute, but then I think, similar to playing online, "Why am I doing this?"  Now I know why I make games outside of my full time job, because I really enjoy doing it and if I weren't, I'd probably be bored, but someday I get stressed, I let the ideas of competition and worrying about what player acquisition or marketing get too overwhelming, almost paralyzing, and I just have to stop myself and ask, "Why?"
For one, I don't need to worry about these things.  I develop games on the side as a hobby.  Sure, it'd be nice to make money and have a lot of people like my work, but I don't produce enough of it consistently enough to have a following, but I'm not putting in hundreds of thousands of dollars into my games or have a team of 8 that needs to pay bills, so I don't need to make that much back.  I really consider myself now as an advanced hobbyist; I only add the word "advanced" since I'm trying to get my work on Xbox One, knowing full well I could just settle for platforms with lower barriers of entry.  Now if I were to go full indie, my feeling on this would change.  I no longer could call myself a hobbyist, but at the same time, I would have more time to focus on business and marketing and community -- things I don't have time to focus on or the skill to do well enough yet.

Learning from Rejection

Anyway, I'm using my rejection from EVO as a time to reflect and learn.  Maybe making a fighting game isn't really for me.  Maybe I need to stand back and figure out what aspects of fighting games I enjoy, and what can I take away from them to make a unique, story driven experience like I've been wanting lately.  Also, I'm still going to work on and finish Battle High 2 A+, but I'm going to do it my way.  I'm not going to do online and instead focus on new single player features.  I know this isn't the popular choice, but I think it's the right decision for what I can and what I want to do.  Of course, why even finish the game, right?  Well, that's just because I hate leaving projects unfinished. 
Overall, right now, as an introverted advanced hobbyist -- yes, I know that's a bit eyeroll inducing -- I want to find where I fit into these groups, if at all, but, knowing that both are hobbies, the moment either one begins to stress me out unnecessarily, I just need to step back and seriously ask "Why am I doing this?"

I've also posted this blog on Gamasutra. 

Sunday, June 14, 2015

Showing off Battle High 2, New Games, and More!

I haven't been too active lately.  I've been busy with my work and projects that I haven't had time to really write about Battle High 2's progress, which I think there has been some made.  Anyway, the first is that I've released new builds and Battle High 2's page.  I also submitted a new build to OUYA.
Everytime I work on the game, I fix a variety of small things.  Here is a current to just name a few:
  • Display Reversal and Throw Breaks more clearly (maybe too clearly)
    • If you didn't know these were in the game, it was probably because it's not displayed or taught, something I want to do better in the game as a whol
  • Kazuo's super armor attacks cause him to change color when hit, he can only be hit ones before interrupting it, and proper hit stun still occurs.
  •  Fixed challenge combos
  • Raised Michelle's Jumping Heavy Kick
But the time is approaching to start working on the Xbox One version, which I will do next week.  The first task will be making sure the game runs on the Xbox One console, but I also want to do a major UI overhaul.  I've been learning a lot as I work on my newest project at Schell Games, Orion Trail, and there is so much with the UI I can do to make it look better, work better with button sprites, and make it easier for localization.  Also, I need to improve the AI.  It's still too easy; hopefully with the inclusion of throw breaks and reversals, this will change, but I still need to make the AI intelligent enough to use them.
The hardest aspect of the Xbox One version will be deciding new features I should try and implement.  I've decided awhile ago that online is not one of these features.  I'd rather explore new characters and modes.
In more exciting news, I showed off Battle High 2 at a gathering in Pittsburgh.  It was called CREATEfest -- not sure how they capitalized it -- but it was a gathering of technology entrepreneurs.

Unlike something like EVO or PaxEast though, CREATEfest wasn't quite the proper place to show off Battle High 2 -- which was shown with several other games as part of the Pittsburgh chapter of the International Game Developers Association or PIGDA.  It was still fun though and fortunately everything ran smoothly.  This was probably the most stressful part of the entire conference was just crossing my fingers and hoping it wouldn't crashed when being played.

 It was awesome seeing people, albeit a few of them, play the game and seem to enjoy it, including one guy who had just played Capcom Vs. SNK 2 prior to the event.  Still, every time I see people play, I notice like 100+ things I want to fix.  For example, even with throw breaks, throws are too safe.  And originally the game's playing was made to be 4:3, and after some confusion, I made it 16:9, but I've noticed, this might be too wide and take too long for characters to get in during a match.  I've noticed with new games too, characters are a lot taller than those in Battle High in compared to UI placement and width.


 New Games!

So besides working on Battle High 2, I've had to take a break and work on some new game projects.  I have two in the works.  Actually 3, but I haven't touched the one in awhile.  The first is a one-on-one competitive game, but it's not a fighting game.  My goal with the game was to create something simple and try and get some footing on network programming.  I've decided that I'll work on this game during our company's Jam Week in July.  I'll write more about it when I start working on it.
The second is a strategy RPG similar to Final Fantasy Tactics.

I thought about this game after last year's EVO.  I wanted to make a game that used fighting game mechanics in its gameplay, but wouldn't be considered a fighting game.  Right now, the strategy portion doesn't have much to do with a fighting game, but hopefully as I continue to develop it, while trying to juggle my job and Battle High 2 work, I can start getting something more concrete.
Anyway, the next couple of weeks and months are going to be rather hectic, working on Orion Trail at Schell Games and Battle High 2 at home.  I haven't heard back yet about showing Battle High 2 at EVO, and a part of me almost doesn't want to anymore -- I'm lying, I'd still love to, but I won't be as crushed if I don't hear back or get a refusal.

Finally, if you haven't noticed, I am doing the social medias.  Besides updating my actual website -- -- I now have the following:
  • Twitter:   @mattrifiedgames -- I'll try to keep it to game-related posts, but deviate from time to time
  • Instagram:  @mattrified -- this one is not very game related and is mostly food related
  • Tumblr:  @mattrified -- this tumblr page will be kept mostly to game related content for my work when I want to post something longer than a tweet
  • FaceBook: .  Not as active as the rest.  The Battle High 2 Facebook Page is much more active but with posts mostly related to Battle High 2.
Thanks for reading and I'll be sure to update you with more soon!

Saturday, May 2, 2015

Unity Analytics

Recently I was asked to investigate integrating analytics into a game I'm working on, and I decided to write a little post about it and my experience with analytics as a whole.


Does anyone actually use analytics?

The obvious answer is yes, people use analytics; otherwise, it wouldn't be a topic of discussion at GDC or this post.  But my question really pertains to, does everyone use analytics?  Sure, people integrate analytics into their game, but do they actually understand how to interpret the data they are tracking?  That's my issue really.  I feel like sometime the desire for analytics data is like "We need to integrate analytics!  For the love of all things sacred, if they aren't being recorded, the game will most surely fail!"
But then those who request the analytics get them and it's like, "What do we do with all this data?!  I'm drowning in piles and graphs and pie charts of data!"  So that's my first...disclaimer?  Sure, disclaimer.  If you're going to integrate analytics, make sure you have a plan on how the data will be read and used.  I contemplated on integrating analytics into Battle High 2, and if I were to do so, I would probably try and use it to analyze the following:
  • Which characters are the most popular.  If a character is neglected, maybe it needs some buffing; if a character is overused, maybe it needs some nerfing.  Also track their win / loss percentages.
  • Maybe track the highest combo per character per match.  If a recorded combo seems ridiculously high, maybe there is a problem with that character.
  • Are the journal entries / challenges / achievements actually being finished
That's really it for now.  I usually undershoot what to track; I know some designers who could probably fill a list of 100 items to track on Battle High 2 alone, but again, would I take / have the time to analyze all those results properly.  As someone said to me, "Tracking the data is easy; analyzing the data is the hard part."

Unity Analytics

Anyway, the game I've been working on was made with Unity, so I decided to try Unity's new analytics plugin, aptly named Unity Analytics.  It's in beta, but what I liked about it was that it was extremely easy to integrate.


Creating a Project

So if you're interested in trying Unity Analytics for your project, you should go here first: .  You'll have to be logged into your account, and for now, it's available for all users during this beta.
When creating a project, you'll be asked a few questions such as the project name and organization and version of Unity.  There is then a question about whether or not your game is directed at minors, since due to some laws, the type of data collected is limited when creating a game for minors.
The only thing that was a little confusing for me was the question about the Google API Key.  I wasn't sure if this was Google Analytics or some other key, but it's the key used by Google if your game has IAP purchases and is integrated into the Google Play Store: 

It's an example, but that long string is an example key used for the Google API Key.

Once this is done, your project is ready to start integration.

Integrating Unity Analytics

Another thing I liked about this process is that there is a built-in integration tutorial into the website, and even better it allows you to test if your integration is working.  The initial integration involves a few steps:
  • Downloading the Unity Analytics SDK, which can be found in the Unity Asset Store
  • Creating an object that calls UnityAnalytics.StartSDK (projectId)

Project ID is supplied in the integration steps. You can then test it through the website, almost immediately, to see if your game, even in the editor, is sending these calls properly. There are then steps to try and do monetization analytics, custom events, and player definitions.
Our game doesn't really require monetization analytics -- which I believe is why you are asked for the Google API key -- and player definition yet, but the custom event integration is pretty painless.
All you do is call UnityAnalytics.CustomEvent. It takes two arguments, a string -- the name of the event -- and then a Dictionary, whose keys are strings and values are objects -- extra parameters about the custom event.
The interesting thing though is that Unity analyzes and processes the data, so the way you send custom events is unique.

Analysis Points

Disclaimer: I am still new to Unity Analytics and my interpretation of Analysis Points could be inaccurate.

Every project you make uses what is known as Analysis Points. These points can be better understood by using this post. From my understanding, they are depending on the different types of custom events you can track. The evaluation is a little interesting, but all-in-all, it forces you to be very careful about how you track said events.

For example, let's say I have an event that results in true or false. "Accepted Mission". So, to call it, I would call:

UnityAnalytics.CustomEvent("Mission Status", 
     new Dictionary());

Now what if I wanted a custom event that is simply mission failed or passed.

UnityAnalytics.CustomEvent("Mission Status", 
     new Dictionary()
          {"Success", true}

Now the problem here is that my custom parameter, Success, will actually cost 10 analysis points -- you start with 1,000 per project -- because it'll be converted to a string as opposed to an integer. Now, I could try doing something like 0 for false and 1 for true, but the problem is Unity Analytics will average these values so reading them will become difficult. A smarter approach would probably be to do two different CustomEvents with no custom parameters such as

UnityAnalytics.CustomEvent("Mission Failed", 
     new Dictionary());

UnityAnalytics.CustomEvent("Mission Success", 
     new Dictionary());

Using two simple Custom Events will only cost 2 analysis points, 1 each. Also, as a heads-up, I have found that using an enum in the dictionary, will not work or register. Sending a separate Custom Event based for each enum would probably be more efficient.



So that's all I really have notes on, the integration. Unfortunately, the game I'm referring to hasn't been updated with the new analytics yet, so there hasn't been a need to try and analyze any data. There seems to be a lot of advance tools provided by Unity for funneling data, testing, defining the users -- male, female, age, etc.
Unity Analytics really comes down to another reason why I like Unity as a whole. The Unity Engine isn't the most powerful, but it's approachable and with the addition of new features such as this, Unity Ads, and UNET, Unity continues to provide a lot of new features for their user base so they can utilize features that a lot of other successful games utilize.
Now, unfortunately, I'm not sure what the future plans of Unity Analytics will be. Will they charge for more analysis points? Will they give users less then 1,000 once out of beta? I'm not sure, but if you do what to integrate analytics in your Unity game, it's a great place to start!

Wednesday, April 22, 2015

Battle High 2 Future...Plans?

It's humorous -- maybe not the best word, a trend you'll notice a lot in this post -- that my previous post was about future Battle High 2 plans as this post is also about them and how I'm probably going to cut a majority of those previously mentioned.  It's also why I promise nothing!
Last weekend I essentially had a nervous breakdown; actually, calling it that is an insult to anyone who has had an actual nervous breakdown.  What I had was mostly just a strong, stress-induced, table-flipping realization that I, after working on the game on-and-off for over 4 years, just wasn't enjoying working on Battle High 2 anymore.

Okay, it was more like monitor-punching -- which I didn't do! -- but similar in idea
I was trying to update a feature, to create a training dummy, because all the great fighting games have advanced training dummies -- which, in reality, are probably more for the programmers, designers, and testers than players -- but it was taking me forever and wasn't working and creating a lot of frustration.  It was one of those features, like a games' tutorials, that if you start thinking about it early, it's a lot easier to implement, but I didn't at first and it was becoming nightmarish.  When I started writing Battle High's code, I was just excited to be getting these systems working, not trying to think about the long-term integration of new features.

I was, and let's face it, still am, a little like this dog.
I felt like I was on this tight schedule, trying to get these changes in for the Xbox One version, and the worst part is that I felt like nobody cared and was losing the little motivation I had left.  The original Battle High team pretty much disbanded, so I've been working mostly by myself.  There wasn't a KickStarter or a heavy demand from a large fanbase yelling at me to finish.  And the potential I saw in the game was quickly diminishing.  I still see potential in the franchise, characters, and game's systems but using the base I had just felt more problematic to try and fit new features in than to just start over.
But at the same time I tried starting over with Battle High, two times actually, and each time failed.  I think this failure came due to another realization that Battle High isn't mine.  I hate this word because it feels so selfish, but Battle High is actually much older, about 7 years apparently, 3 of which I wasn't involved, and I just feel guilty, like I stole it.  I think stole isn't the correct word; if I stole it, I'd probably be in a litigation nightmare, but that's not the case -- and hopefully becomes it.  I guess the fact that Battle High isn't truly my IP, I feel dirty making certain narrative and design decisions without input from the original team, a team that's moved on to other things.  Also, when asked things about Battle High like "what was your reasoning for this," I have a hard time answering them, especially if they concern a character's narrative.  I guess I was just excited about making the game for XBLIG and the same with the sequel when the team was still really involved, but after it disbanded, the only motivation left really is just that it exists.  The systems, art, etc., are done; they just need "polish" which is so dangerous because you can polish and roll a turd in glitter forever but you still have a turd.

This is actually a chocolate covered banana...but it looks a bit like a turn with sprinkles...

I don't think Battle High is a turd, but when it comes to the Xbox One, I feel like I can already hear people moan about the pixel art and how they don't feel its worthy to be on such a powerful, next-gen console or how the netcode (or lack thereof) is substandard.
Feeling saturated with a lot of negativity and doubt, I was contemplating on just killing the project, forgetting it and moving onto something completely new, but then I thought:

It's a silly quote -- from my secret muse, Amy Poehler -- and I don't mean it in a disrespectful way to players or anything.  And obviously, I do care otherwise I wouldn't write this.  I think I'm mostly saying this to myself.  Not everyone is going to like my game no matter what I do.  I need to face this fact.  So I say this to them, but also to my inner negativity and fear about those individuals.  I can't let that stop me from something I want to finish, something that would be a shame to abandon now.
Though, this being said, I'm probably going to cut a lot of stuff that I previously mentioned; this might upset some people who I do care about liking it.  For example, I would LOVE to get new characters in the game, but I thought of it this way:
  • I have 13 characters already that need some balancing love, focus on them first
  • Who knows how long getting voiceover, new music, new sound, artwork, etc., would take, and I would hate to delay release because of these unknown variables
  • Modern gaming and DLC make integrating new characters later much easier
  • Finally, if the game is an utter flop, I can just say "Screw it, no new characters!" saving both money and time.
So these are my current goals.
  • Improve artificial input.  The idea behind this is that by doing this I can in turn create more intelligent AI.  This is the feature that was stressing me out but mostly because I was trying to rush it.  I'll need to gut some of my code, but it'll probably take about two to three weeks to do properly and knowing that will make me stress about it less when I face inevitable setbacks
  • Balancing.  I started some of this by making attacks frame-based and not strange multiplier based but more work needs to be done.
  • Improve UI -- EVERYWHERE.  I don't think the current UI is bad but I hate how it doesn't tie into the school theme at all.  I have an idea of how to do this, but it does go into that dangerous polish realm so I need to be careful.  In fact, I want to polish the art to make it more "worthy" of Xbox One, but polish is such a dangerous area to get lost in.
  • ONLINE.  I don't want to do online; it's not a secret.  I'm sick of buzzwords like netcode and GGPO (which I think when most people say, they just mean rollback netcode, not the specific framework which apparently doesn't integrate into Unity), but I ultimately know I need it.  I know doing online at this point is going to be painful and not good, but it will be a learning experience.  I need to try and get it working so that my FUTURE games can have it and have it done properly (or at least better).  The only thing I'm struggling with is should I use UNet, Unity's new networking solution, available only to beta users currently, or Photon.  The risk I have doing Photon is that it may not work properly on Xbox One, but I'm not even sure this is entirely true.
That's really about it.  That doesn't sound like much, but I'm at a point where I want to finish the game, get it on Xbox One, and evaluate its popularity from there.  Like I said, if people like it and there's a following -- doesn't even need to be a giant one -- sure, I'll look into adding new characters, rewards, modes, etc., but for now, it's not necessary to the core.
Worry about the CORE features of the game -- something I hear a lot.

I want to do one more OUYA / PC build -- with the improved AI and balancing -- then maybe one more with very early online and then it's onto the Xbox One work and getting the game published there if I want to try and make my 2015 deadline -- a deadline I realize is really only in place because I want to move onto something new in 2016.

Finally, to those who have been following the game and enjoy it, I really appreciate you even though this may sound like I don't.  I even mention if there were more fans I'd have more motivation, and it's a little true, but who knows?  Maybe more fans would make the pressure and doubt even worse.  I think my some of my doubts and issues come from not wanting to disappoint fans of the game, and sometimes my ideas of starting over are more to serve them with a new idea that I'm ultimately more confident in.  Anyway, hopefully I can give a new update that isn't just about my feelings soon, a fun, visual updates with images and gifs and videos!

Sunday, March 29, 2015

Future Battle High 2 Plans!

So a few Fridays ago, I tweeted this:

And it's true, but for now, that's all I'm going to say. I'm working on it, but even before an Xbox One version, there are changes I want to make to the versions that are currently live on Desura and OUYA -- which I can also say now exists in Chinese!

Improved AI and Training Mode

So in a previous post, I wrote about a talk Mike Z gave at UFGTX. In his talk, he put a lot of emphasis on the importance of having a deep training mode. Personally, I don't go into training mode for hours, so an in-depth training mode never felt important to me, but the more I thought about it, the more I realized that it's a really useful tool not only for players but also the developer. I can make an AI do and see if the AI is corresponding to my requests and recorded inputs accurately. I think another reason I strayed away from it was that it'd be a rather large amount of UI work. Seeing that I could use this as a great way to improve AI as well, this will probably be one of the first tasks I tackle.

I WANT MY AI TO BE ADVANCED!  Okay, maybe not this advance

From Time to Frames

In the XNA version, I was using time-based system for animation and frame counting. Now, I do have a system that consistently increases times so animations are accurate, but due to floating-point error on different systems, this can still be a problem, so I want to change to a frame-based system. For example, if Jiro's light punch is 10 frames, it would be 0.6 seconds to complete (10 Frames / 60 FPS). If I wanted to change this and make the animation a little bit longer on start-up, in the current system, I'd have to change some hard-coded multiplier, but with this new system, I can just add a duplicate frame to the animation. This is a pretty big fix, but it's one that'll make updates and changes much easier to make. Also, if people were to ask for frame data, I can actually give them something that's readable and make sense. The biggest challenge is how to handle when the player has gotten hit since this varies. Hit while standing I think is about 6 frames now. If it's less I can just stop the animation before that, but if it's more, figuring out how to distribute the hit frames is a bit challenging.
Okay, I wanted an illustration for time versus frames; this is not the best.

Updated Audio

So I enjoy the music in Battle High 2 and won't be making any changes to it; however, a review did mention that the sound effects are a little on the weak side. Personally, I don't have the best ear for sound design. Audio is important, but for me, it's personally not the most important thing I look for when playing a game, so in my own work, audio can be lacking at times. Fortunately, I am planning to update the sound effects as well as work on some leveling issues between them and the voice-overs but with someone's help.

Just add "game" to the end, and it's pretty accurate.


This one has been, and will continue to be, something I struggle with. Again, people have suggested I inquire about GGPO, and I did a little more research, only to sadly discover that it's very unlikely it'll work with Unity. At the same time, I think I'd rather try and see if I can do some sort of online mode myself. It'll no way be better than GGPO in any way shape or form, but I'd like to make something that players think is at least tolerable and playable. I have some ideas how I'll do it, and the OUYA and PC versions will definitely be my guinea pigs. I think getting the frame stuff to work will definitely be an important factor in getting this online mode to work as well.

No Promises

There are many other updates I'd like to make -- new characters, new stages, new modes, etc. -- but I refuse to promise anything. As a solo dev., it's very hard to promise things. Heck, even on a large team, promises can be risky. There is a lot I want to do to make Battle High 2 the best it can be, especially once it's on Xbox One, but it's a lot of work, and unexpected things can happen; therefore, I refuse to really promise anything, even in regards to what's listed above.

Like this Shayne Ward guy, I make no promises!

DLC and KickStarter

So another thing I've been thinking about is how am I going to monetize this game in the future. Should I take a more modern approach to it with things like DLC or In-App Purchases? I do really like the approach Tekken Revolution took, making it feel similar to the days of the arcade; however, it's a free game, and it's not free to make. Player and multiplayer servers have to be maintained as well as new content pushed from time to time is expensive. Also, IAP sometimes have a play-to-win feel to them if they aren't balanced properly and turn off most players.
Another thing I've been thinking about is, "Should I do a KickStarter?" As of right now, I don't really need to do one from a financial standpoint; sure, more money would help, but it's not needed. I can still get updates and the Xbox One version done. A lot of people though mention that KickStarters are a way to get the word out, a sort of marketing trick. There are two caveats to KickStarter though. One, they are a ton of work. You just don't make the KickStarter and let it go while you develop. It's a living, breathing project at this point. You have to answer questions, emails, prepare physical rewards, etc. At the same time, if the KickStarter fails, it would probably be a huge blow to my ego, making me want to cancel the project altogether. Saying this, as of right now, I will not be doing a Battle High 2 A+ KickStarter any time soon, if ever.

Plus, I'd have to add this tacky image to the game, :-P

Rewards (and a mini-rant)

So one thing I want to make eventually is an deeper single player mode similar to Mortal Kombat 9's challenge tower. The problem is you want rewards for the players then. As of right now, the best rewards I can offer are more color palettes, concept art / imagery, and more bio information. These are okay, but not amazing. Again, more characters, stages, access to the original music, would all be great, but it's tough to get that functioning properly. I still need to think how I'm going to manage this, but there is one thing I know. I will NOT do my unlocking like Resident Evil Revelations 2. I'm fine with the game as a whole, but the reward system is irritating. You first do a difficult task and then a new item becomes available to purchase in a store using in-game currency. I hate this approach! If I can't do that task requested, then I'll just never get the reward, and if I finally am able to do a difficult task, sometimes the reward is so expensive I have to earn in-game currency before I can buy it. It's really frustrating.

I couldn't find an image of the store, so here's Barry kicking something!

I'm fine with either having to earn in-game currency to buy stuff OR do difficult tasks to unlock something, but both is so annoying. I'm also surprised more developers haven't tried doing in-app purchases for this. I think Revelations 2 would be a great example. For example, say I can't get S on all missions for whatever reason: lack of skill, time, patience, new games, etc., but I really want the rocket launcher you get with it. Now, I can get Revelations 2's strategy here. If the player doesn't know, the mystery reward might make them want to try harder, but if they know and don't care, they'll never try. I would be fine with this. Regardless, I'm surprised they haven't just said, "Give us a dollar for that and then you don't have to worry about it." You won't get the achievement, sure, but now you have access to a reward you'd really want. It'd be like a cheap, single-code GameShark or GameGenie without the awkward boot discs or devices! "You want infinite ammo?! Sure! Just give us $3 OR beat the game on nightmare mode." Also, imagine the player who beats the game on nightmare mode, "Wow, not only am I awesome and got infinite ammo now, I saved $3 I don't need to spend now!" Regardless, as of right now, Battle High 2 doesn't even have rewards like this, so I won't be doing it, but I also won't create a in-game currency.

Sad there really aren't any GameShark and similar things for next gen.  THANKS, OBAMA!


Finally, I tweeted, while inebriated at GDC, that I want to be more transparent about Battle High 2:

Ignoring the GDC is bad for me part, I mentioned I wanted to be more transparent, and what I mean is that I want fans of the game to know what I'm doing more often and try and involve them more in the process of making this game. I've taken a few small strides towards this, for example, I created this survey so I can get more insight on what players want in future updates:
At the same time, I want to use this blog as a development log more often and update it when I make small changes and show more progress. I'm not sure I'm going to go as far as dev streaming; if I were a full-time indie, sure, but with a full-time job already and the amount of time required to set these up, it just doesn't seem feasible. Also, I'm not sure how many fans of the game would even be interested in that.

Good quote, DL!  A good summary of why I want to be more transparent.

Anyway, this is the exciting start of a journey. True, Battle High is pretty old in terms of a franchise, but this is the start of me taking it more seriously and trying to put it out there and make it the best game it can be!