Tuesday, May 17, 2011

Calculating XP

There are thousands of games that have some form of experience bar in them. You level your items/cards/monsters/abilities/players/characters... but what's amusing is that when you go to create your own leveling system, something as simple as calculating XP is a little harder than I had expected.

My first attempt at it was some simple thing that I drafted in excel. It scaled very poorly. Then I thought maybe it was exponential growth. HA! I realized very quickly that leveling to higher levels would take astronomical amounts of time.

But surely I don't need to recreate the wheel. That's when I hit up google. I was sure SOMEWHERE someone would have a formula for this. Sure enough, they're out there, and they're not nearly so simple as I had expected.

But for a game, you're going to need two formulas... one to convert from level to XP value, and another to convert from XP value to level.

I settled on the following using Excel formula notation (since that's where I drafted it):  The original I believe comes from dungeons and dragons, but this is slightly modified.

To convert from level to XP :
 =100*(B8+FACT(B8)/(FACT($C$4)*FACT(B8-$C$4))) where B8 is the level-1 and C4 is a constant (in this case 2)

To convert from XP value to level:
=(1+SQRT(H7/125+1))/2 where H7 is the amount of experience
In Corona (lua) it's relatively trivial to turn these into functions, with the exception of calculating factorial where you'll have to roll your own since it's not part of math.lua. And to convert XP to level, you'll have to use math.floor to round down to the nearest level unless you want your player to be level 5.2349542.

So many little things you take for granted when you're on the game-playing side of the fence that when you have to make it yourself... you sit there scratching your head wondering... HOW did they do that?  Thank goodness for google.  I really don't know how programmers did it back in the day... low processing power, insanely little memory, no object oriented programming, no libraries, no google.  Mad props to them.



Friday, May 13, 2011

I'm not good at video games

As I demo my game to every person on the planet I come in contact with (shameless I know), I come across this comment quite frequently.

"I'm not good at video games"

It's a sad state of affairs when people think they're not good at video games.  That's almost like saying "I'm not good at watching tv."  I think we can blame the '80s on this phenomenon when games were insanely difficult due to their coin-op roots and the industry tried to only appeal to the young male demographic, alienating older generations and females.

The fact of the matter is that it simply isn't true for the vast majority of people.  And they're starting to discover that thanks to things like apps and facebook/internet games.  Video games span such a massive array of different types that it's hard to make the blanket statement that you're not good at ANY of them.

Do you like crosswords or playing cards?  Do you like board games?  Do you like party games like taboo or win-lose-or-draw?  Then there are video games that you'd like.  Do you like reading or watching tv or sports?  Shoot, there are STILL video games that you'd enjoy.

I've seen several games recently that... are arguably even hard to describe as games.  One such one I saw at the last NY gaming meetup and it involved trying to guess what words are trending on twitter.  The premise sounds insanely stupid. (At least it did to me) but when I saw it, I was shocked that it was actually quite compelling! Go ahead and give it a try.  Not for everyone, but shoot, even Twitter can be turned into a game! (And I royally suck)

Anyhow, gotta get crackin' if I'm going to get this next build done.  Got XP implemented and working (even though it threw balance straight out the window).  Next up I've got to redo the UI and convince Cat that this idea in my head makes sense.  (Well, have to convince myself too)

Wednesday, May 11, 2011

New artist joins the effort!

Had a chat with Peet Cooper today. He is going to have a stab at concepting out art direction for Flip Out. He is incredibly talented and we're very excited to have him help us out!

Google IO

Oh, totally forgot in my last post.  If you haven't followed Google IO, I have to say I'm pretty excited.

Google seems to be stepping up to the plate and at least for us developers are gaining parity with Apple as far as quality of Market and app discover-ability is concerned.  Will definitely be a crazy eye opening experience when we deploy on all markets simultaneously and see how the markets take it, and at least now the Android market might have a fighting chance against the iTunes behemoth... or it might not... but still, pretty exciting time to be a mobile developer, and all the more reason to go multiplatform.

Co-Captain's Log

Trying to develop a game while also trying to enjoy time off here and there AND blog about it is not an easy task.  So Cat and I are going to try to do a nightly post... no matter what.

Yesterday we had a long discussion about the direction we're taking the game.  It's always an amusing experience since obviously different people will have different ideas, and it takes good communication to come to an agreement.  There have been things that we implement for the sake of trying it out and play testing, and things that we end up reverting because it worked better "the old way."

We slacked off for a solid week, so now we're buckling up and getting back to business.

The biggest change we've made is we're moving away from time based and towards a turn based mechanic.  Think less tetris/puzzle fighter and more puzzle quest/gyromancer.  Code wise it was a breeze thanks to the way Cat implemented the timer logic.  Basically he created a timer service that yells out notifications based on whatever and whenever you tell it.  Since the monster attacks are listening for those notifications to know when to do their attacks, it was as easy as removing the timer, and replacing it with code that sends out the notifications whenever the player touches cards.  BAM, we're now turn based.

Friday, May 6, 2011

One Point Five Months in

We've now been working on the game for a little over 1.5 months, and I'm pretty pleased with the progress we've made so far (and that's with very little work being done in the last week).  I'm going to put up a video on Youtube to show the current state of affairs this weekend.

We released our "Friends and Family" build which was more proof of concept than anything else.  It's interesting because despite the fact that we tried to tell everyone that it doesn't represent the final game, everyone pretty much assumes that what they're playing is extremely close to the end result despite the fact that a large chunk of the game mechanics are not implemented, there is still no final art, and no music.  Heck, there isn't really even a menu or an ability to pause (or even suspend) the game at this point.  What we really wanted to do was just get a feel for the core "game mechanic" of matching cards.

But I'm very pleased with the friends and family build.  Despite how much it's lacking, I think it was successful in that it demonstrated that it is possible to make a game that is fun with extraordinarily simple mechanics.  (Though not for lack of examples already out there, Tiny Wings is doing amazingly well and is arguably even simpler than a match game).  We had a fair amount of feed back (13 people) and we selected from a diverse group from gamers to non-gamers, male/female of various age groups.  We didn't expect the hardcore to be hooked on it as the game is missing most of the "addictive" components and has almost zero re-playability.

It also demonstrated how well Corona does in fact work.  The game ran on 8 different types of devices without so much as a hiccup: OG Droid, Evo, Droid 2, Droid X, Droid Pro, Incredible, and even iPad and Xoom.

We'll likely need to increase the quality of some of the assets so that it looks better on the iPad and Xoom than it currently does, but I'm pretty pleased with how little effort that took.  So kudos to Corona.  They get a thumbs up from me.  A few little quirks here and there that we've run into, but all in all, very solid.

The amount I've learned from this experience so far has blown my mind.

We finally got an artist for the monsters.  We found her on Deviant art, pretty much what we were looking for.  We're still trying to figure out what to do about backgrounds, UI elements, buttons, special effects.  Right now I've hacked them all together myself.  Has given me newfound respect for people who work on photoshop for a living (though, I'm using GIMP myself).  So amazingly painful and time consuming.  Definitely not something I particularly enjoy, and I look forward to replacing all of that garbage with something more professional.

Music and sound effects... wow.  Haven't even started on that yet, and judging by the feedback I've received, it's something we need to get on top of soon, but I've not even got the faintest idea about how to go about that.