Wednesday, February 12, 2014

Lost in Training

Iced Z
    "I've have lost my mojo."  - Austin Powers

    Lately, this quote runs through my head a lot.  I have been mentally spinning my wheels on the game design for a number of reasons.  One of those reasons is that I have been really cramming a lot of new knowledge into my overstuffed, books lying around, half-done experiments, wizard's attic of a mind.   "Don't mind the crow.  He always sounds hungry."  I like to think of myself as more of an eccentric wizard from an old Excalibur film, but most likely I am more kook than cook when it comes to creating things.  I usually have a ton of different ideas banging around in my head and just pull out a few to start turning them into a product.  This past week it feels like there are too many ideas and ways to implement those ideas to just focus on a few.  Nothing feels right yet and time is running out.
   Adding to this issue, and probably a major contributor, is my extra development training with 3D graphics and the SpriteKit API.   The 3D program, Blender, is very complex and oddly compelling to me.   When I have a spare moment, I like to crack open the program and tinker with a new 3D modeling task.  Usually with a tutorial video playing on the other monitor because I would never figure these things out by experimentation alone.  It helps to have an expert guide you through the process the first few times.  It would also help to have a bit more talent in the graphics area, but we work with what we have sometimes.  "Oh be quiet, Crow.  I am trying to write here."  Anyway, this takes up time and diverts my brain more than I would like.  I can't use the modeling at the moment, but does seem like there is something there...
   Where was I?  Oh yeah.  Distractions.   Along with the 3D modeling, a book about Sprite Kit that I have been waiting to be published finally arrived last week.  IOS Games By Tutorials has been pretty engaging and I have learned a few things and filled in some gaps in others.   The latest chapters have covered physics, level design, and combining actions to make interesting animations, sounds and effects.  It is a good book and I recommend it highly to those of you that just would like to tinker at building games.  I am half-way through the book and still picking up great tips on building a quality game that is fun and maintainable.  Unfortunately, it is easier to just work on one more chapter than to go back to my actual game development.  Given that we are approaching the middle of the February, I really should put the book down and finish the latest game App.
   Which brings me to the crux of my problem.  Every new technique or programming tip could potentially move my game ideas in a new direction.   Usually this is a good direction.  I have discovered better ways to handle level design and the way the game objects behave on the screen.  Other times, it is just reinforcing my knowledge on the subject or verifying something I had discovered through my earlier experiments.  In the end, it brings a lot of extra thoughts to my game idea and starts the wheels spinning again.   "Yes Crow, I was getting to that."  The worse part is, the more I train, the less I produce on my own product.  This adds to the guilty feeling that I am shirking my work.  Even though I have been training and studying a lot lately.
    I probably just need to pull back, look at the big picture, and pick a route to travel for now.  On the other hand, the next few chapters cover Tile Maps which could be really useful for a slightly different game.  
   "Yes, yes Crow.  I am ready to get back to work."






   

Friday, February 7, 2014

Rebecca: Random Acts of Kindness

It has been a hectic week or so.  I left last Wednesday for a business trip.  While I was away, Ben discovered a wet area in our home office.  After a few days of stress and 2 very nice plumbers, the cause of the wet area was found and fixed.  Over the weekend, we had guests.  Since we live in the  Seattle area, we got the Seahawk fever and cheered for our awesome home team.

As I started a new work week, I was already dragging from water leaks, house guests, and Seahawk mania.  And then...I caught the cold that everyone has been sharing (thanks to my daughter).  I have spent the week wallowing in self-pity, complaining about too little time and energy to do all that needs to be done, and giving myself lots of excuses for being lazy.

Early this morning (5:30am), I reluctantly and grudgingly headed out for a business appointment.  Needing caffeine, I stopped at Starbucks (actually drive-thru).  I got an extra special treat.  The car ahead of me paid for my coffee...a random act of kindness.  Wow, what a wake-up call to stop and be thankful.  Thankful that Starbucks has drive-thru, thankful that Seahawks won, thankful that we had wonderful family visiting over the weekend, thankful that Ben handled the plumbing hiccup, thankful that I was feeling better, and thankful for the kindness of a stranger.



Wednesday, February 5, 2014

Particles - Seahawks Edition


    I fear that I have not explained particles well enough in the last post, so I am adding another today.  The beauty of particles, is that you take one image, a small image, and replicate it in some way.  Maybe you replicate it into many places on a screen.  That is one particle system. A bunch of dots on the screen is one representation of a particle system.  The system is accurate at that moment, but the next second, it will look different.  Why?  The particles moved.  Hence, the term "particle system" with system being the more important term here.   
  The beauty of a particle system is the ability to describe how long one particle will behave.  Behave is a bit obscure, but to programmers this mean describing what will happen to this particle in its lifetime.  It is an example of the worse kind of interrogation:
When are you born?  What is your life span?  What color are you?  What time do you change colors?  Whats your new color?  Are you changing sizes at any time?  Can we push you over here?
The system is what describes what the particle does.  Throw in all the variables that answer all of these questions and you have a bunch of seemingly similar objects behaving in a remarkably way.    The objects move in a manner that is similar, but unique to each objects manner.  
    That is confusing until you see one object behave according to a system of rules.  Just layer another object behavior on the same area, and you begin to see the complex system described.  Essentially, each object has their own agenda and will follow it's own system to complete the agenda.  Particle systems are like that.  
"Every one go left, but grow and shrink as you do it." 
    Take 30 objects that follow the command and you get an interesting jog to the left.

Seahawks Section

    The Seahawks 
    Watching todays local celebration of the Seahawks bringing home the Super Bowl trophy reminded me of a particle system.  (Not to knock on the celebration.   I am a local Seahawks fan and really was moved by the celebration and the team's excellent response to the fans.)  Everyone is there and moving around within a manner consistent with their individual system.  Looking at each individual moving around you would not notice any specific pattern.  On the other hand, pulling the camera back you can see a lot of people all enjoying the celebration.  They are moving all over the place and create a very unique view of fans enjoying a celebration.  Take a picture a few hours later and the the image would look very different.  It is all relative to time and the location and the clothing and the light of the day and... you get the point.  Each person is doing their own thing, but the picture of all the elements is surprisingly complex.  
    Much like a particle system.

Go Hawks!

Particles And Special Effects

Explosion
Trailing Particles
Starfield Effect
                   
Ever wonder how some games create those cool effects like a fire burst, engine flame, explosion or smoke?  Well unless they are big fans of creating every frame of an animation and then programming the way each frame's timing, they probably use particles.  Particle system are a programatic way of taking a small image and using a set of commands to make that image appear all over the place in a semi-consistent manner.   You can specify many different aspects of the particle system and get wildly different effects.  Each particle will move, grow, live, die all within the constraints you specify.  Oh yeah, they are super cool too.
    Game developers have been using them for a while, but you had to do some tinkering to get the effect you were thinking about.  In the past, you needed to experiment with a custom coded program to try out the different effects.  You could code up a framework to show off different particle effects  and then capture all the various elements to recreate in your App.   Myself, I found a nifty program called Particle Designer to experiment with the different effects to get my desired results.  It was well worth the money and many developers were creating some excellent examples of what can be done with particles.
    In fact, my first use of particles was in Letter Rain to show the rain drops falling in the background.   I did also use frame animation to show the letters splashing, but a more realistic effect could have been done using particles.  Building the rain effect was a matter of experimenting and adding some custom code overrides into basic UIView, which is the basic 'screen' for most Apps.  It was fun and educational, but tedious to work with when you needed to adjust the system.
   Last year, Apple really upped the ante for developers by making particle effects much easier to use by adding particle design to the XCode development environment.  Now you can view particle designs within the development tool and even better, save the environment file for later import into your App.  It is much easier now to add your favorite effect to a game.  One caveat is that you will need to be using the latest iOS 7 operating system on your device.  C'est la vie.  I had already made this choice when I started building the latest game in Sprite Kit, so I might as well use everything that is available.
    The last few days I have been trying to tie all the various programing elements like physics, 3D images, and now particles into a coherent game design.   It is fun and the effects are well received by the kids, but you can really see how most Apps need a team of specialists to get the right product created.   Given my limited resources, it is simpler to just scale back the expectations in order for the project to get completed on time.   Lucky for me, particles have become much easier to create and use in a game.  It is once less thing I have to scale back my expectations on.  Hopefully, the final product will reflect this.
    Now do I need flames or glowing fireflies behind those throwing disks?





Friday, January 31, 2014

Why not add another dimension?


    I must confess that for the last two days I have been playing with an excellent 3D design program, Blender.  It is open source and very powerful, but complex to an aspiring 3D artist.  Aspiring, may be a bit too strong a word.  I am just jealous of some of the game images that I see in other games.  Most of the interesting strategy/tower defense/war games have nice 3D looking pieces and elements.  If you have the right 'models' with various screen-shots of movement, you can make a pretty sophisticated 3D looking game using 2D game methods.  Using Sprite Kit over the past few days has increased my desire for some good images to go with the gravity and particle effects.     During one of my weak moments I wondered if any good 3D programs were out there that I could tinker with to create some images.  My current drawing program, Art Text, is good for simple buttons, text art, and signs and symbol creation.  I love the program, but for 3D modeling I needed a whole other animal.  Blender is that beast and I have loving playing with it.
    I have tinkered with 3D drawing in the past.  Most notably, a few years ago I picked up Hash Animation:Master and built some fun 3D models and walked them through doors and such.   I learned a lot about 3D modeling from working with that program.  Where the camera, light sources, and mesh shapes are in 3D space, etc...   It has been a few years now since I played with 3D modeling, but occasionally you wonder how the industry is progressing.  Once a programmer dips his toe in the water of a technology, it is hard to keep him out of the pool.  And who doesn't want to model objects in 3D?  They are the coolest things you can show off, especially when you spin around the model or make it move around.  Throw in 3D printers and you can see why my interest in this technology just will not die.  It is the future in a lot of ways.
    For now it is a diversion from the game I am putting together.  I am trying to get the next game done by the end of February.  That does not leave a lot of time for fancy graphics, so I will be using the computer to draw most simple elements.  It is just not the right time to build a game with a 3D model look, but some day...  Until that day, I will occasionally steal some time from work to play with Blender and build cool little models of flying scooters or space ships or whatever the heck that thing is turning into...

Monday, January 27, 2014

Rebecca: Revenge of the nerds

Over the past few weeks, Ben has been learning how to throw objects in iOS (I think that is the program language for his app development).  My understanding is the development environment has some basic physics, like gravity, already incorporated.   Ben, however, has spent the last few weeks muttering about vectors, angles, velocity, mass, and a lot of physics terms that make my tummy cramp.  Physics was NOT my favorite subject in college.  As Ben learns how to use physics to successfully throw objects, bounce dots, and manipulate velocity, he excitedly shows me.  To me, honestly, it looks like the old hand-held football game...the one with the red dashes.

In the last 2-3 days, he has been working on moving objects from point A to point B.  That requires Trigonometry.  Today, he was muttering about the tangent and the hypotenuse.  I reflexively yelled "SOHCAHTOA, some old horse caught another horse taking oats away."  I showed my brilliance by giving the formulas for sin, cos, and tan.  Thank you Mrs. Agnew.  Be proud...I remembered something from high school trig.  Looking back, I am certain that I sat in Trig wondering if I would ever use these very hard math formulas.  Who knew?  You do need them.  All those years of math agony make practical sense now.  It was fun to watch Ben move a "person" around the screen.

So finally, nerdom has some benefits, AND today's tweens think nerds are cool.  My tween child thinks cool nerds include peers that love Rick Riordan books, kids that watch Hobbit movies, even adults that follow Star Wars or Star Trek, and definitely, adults that have made mega riches on some really cool computer game.  Not adults that remember SOHCAHTOA from high school math.



It's Alive!!!


    Well the prototype app is now throwing disks all around a screen and hitting targets with a nice splashy effect.  Even better, the physics models are working great at the moment.    See what a week of studying past physics lessons and experimenting will accomplish for you?  Sometimes you have to just bite the bullet and soldier through the effort to build something that matches your idea.   Essentially, the same look and feel of this game could be simulated using simple pointA to pointB movements with some algorithms to handle collision.  This I have used in the past, and it is not that difficult to get the system up and running.  Letter Rain is a good example of this type of code.  The problem is introducing a new object to the 'world'.  If the design is right, the new object will be adjusted to pretty easily with minor updates to the system.  On the other hand, what is more simple than to add another barrier, rock, or missile with it's own physic properties?  Then the things bounce around as you designed it and you don't have to worry about those custom algorithms.  This is what I did most of last week.  I introduced new game objects to the physics world and really like how the whole thing behaves.   Very nice.
   This brings me to this week.  I have designed the transition screens for each level to show a simple instruction and graphic to complete that level.  I like it so far, but do need to create more images for the future levels/instructions.  My graphic skills are pretty limited, but so far the pictures are looking pretty good.  If I need to up the ante on the illustrations, I can always find someone more talented in the future.   For now, it is best to put the framework in place with 'placeholder' images that can be swapped out later.  So I have a few illustrations more to do this week for the future levels.
   I decided to make this a level type game.  You know, do this simple task, get a pellet, and move on to a more complicated level.   (Good job!  Now hit two targets!)  Story of my life.  I love pellets!  
Now I have to design each level and try to ramp up the complexity to make the game more challenging.  My only problem is that I am not 100% sure what the game action will be in the end.  This will take some more trial testing on the family/friends, but for now I can work on creating level designs and the background structures to hold the level information.  Once the levels can be poured into some simple data structures, I can adjust and create more levels more easily.  At least, that is the plan.  One step at a time. 
    Where is that pellet?