Experiments
Games for Humanity
by Paolo on Aug.12, 2009, under Experiments
Last Friday, I found out my mother had a stroke. When I initially got the news, my father said that she was fully aware but the doctors weren’t even sure if she could regain her ability to move her right arm, the right side of her body or even be able to speak. She is still in the ICU right now, but the doctors have found positive signs for some neurological recovery but it will take a lot of work and therapy. We are still awaiting a full prognosis and would appreciate you keeping my mother in your thoughts and prayers.
It’s times like this that you really evaluate what truly matters in your life and how small are the things we hold dear to ourselves. All the things we waste time upon instead of truly treasuring the people who make life worth living. And one of the serious offenders for taking time away from loved ones is games.
The key to games is understanding that games can be powerful servants but awful masters. Few people realize that games are more than just a past-time – gaming is one of the most powerful tools for accessing and repairing damaged parts of the brain and can be a great boon for humanity rather than a massive time waster that widows wives and orphans children.

Games can repair the brain
Games are a powerful tool not just for education, but for real neurological benefit. My initial foray into gaming was making games whose task is to stimulate neurological functioning. Many of these games would seem very inane and resemble variations of the game “Memory”, but given enough time and practice these games can actually improve brain function, delay the onset of Alzheimer’s disease, and rehabilitate stroke symptoms.
What got me thinking was that my mother will need these kinds of games for her rehabilitation as well as entertainment to enjoy. But a great number of games that she loves and enjoys are simply not accessible for persons without fine motor skills. One may not think that using a mouse is a “fine motor skill” but for persons with severe neurological damage, a mouse is so much harder to use than a keyboard. How many games out there do you know are designed for use with a single hand that is not a mouse?

Not meant for accessibility
I’ve taken a lot of thought and decided that after I release my fall game that I will dedicate myself to making not only games that my wife and kids will enjoy, but that my mother can access and use with limited motor function. I used to be one of the first web technology experts at Booz | Allen | Hamilton for the U.S. Government standards for accessibility (Section 508 of the Americans with Disabilities Act), and so I am familiar on how all technologies can be utilized to overcome all sorts of neurological and physiological disabilities.
Games don’t have to be just mere entertainment and escape. Games can be an instrument of true freedom and a great boon to humanity and the human drama.
Actionscript 3.0 Discovery – Going Old School
by Paolo on May.20, 2009, under Experiments, Programming
One of the biggest reasons to go to Actionscript 3.0 is a massive performance boost you gain from older versions of Flash. Michael James Williams sent me this link to a forum post to prove the point:

Over 5000 Arrows at 30 fps
Mike Grundvig posted on his blog how he got this to work and after reading it over twice, it is very “old school” in how it is accomplished.
The way Flash does programmatic animation is pretty simple. You take a MovieClip instance on the screen and you simply adjust the x,y values to get it to move. Flash takes care of the redrawing of the screen for you with no flicker. What Mike Grundvig did was do all the drawing himself. Instead of using Flash to draw the final output on the screen, he takes all the calculations on the back-end, draws onto a BitmapData object and swaps out the resulting BitmapData with the Bitmap currently being displayed. In other words, he is doing a kind of low-level “double buffering” using Flash Bitmaps.
When I was a kid programming in BASIC in the Apple II+, I would wonder how computer games made smooth animations. My problem was when I created a picture and I wanted to “flip” to the next frame of the animation, I had to clear the screen and draw the next frame. The clearing of the screen caused a moment of blackness before the next frame was rendered. What I didn’t understand was how to “double buffer” which is something much lower level than I could have achieved in BASIC. I had to understand assembly language to accomplish that.
Effectively what “double buffering” does is skip clearing out the screen. Instead of working on 1 screen, you are working on 2 screens. First you draw the screen. And instead of clearing it off for the next screen, you do all your drawing logic on the second screen while the first screen is being displayed. Once drawing is completed, you simply flip from the first screen to the second screen like a flip-book. That removes the flicker effect of having to draw, erase, and draw again.
Modern graphical engines like Flash take care of this logic for you and are incredibly efficient. Thus, instead of having to figure out how to draw when you move your MovieClip 10 pixels to the right on the next frame, Flash does all the drawing for you. But it comes at an expense of CPU cycles to figure out all that drawing logic for you. You can see the effects of this drainage in Space ROX when I started adding particle effects and Asteroids.

Space ROX V 0.5
Now compare the performance of only a couple hundred particles in my Space ROX demo to the thousands of arrow particles shown in Mike Grundvig’s demo here.
Sometimes it pays to go back to the basics.
Actionscript 3.0 Discovery – A “FacePalm” Moment
by Paolo on May.15, 2009, under Experiments, Programming

I just discovered the “Bitmap” and “BitmapData” classes in Actionscript 3.0 from this blog tutorial on FlepStudio.
Here is an example of what his tutorial and sourcecode looks like:

Actionscript 3.0 - Bitmap and BitmapData Tutorial
This class could have saved a ton of performance and speed in Strike Eagle. In Strike Eagle, the moving background is a series of movieclips placed side-by-side and continually scaled which is a huge performance hit in the system. It would have performed so much faster if I was simply blitting onto a bitmap.
Also, all the particle effects in Space ROX could have used the bitmap treatment saving tons of processing power and reducing the total number of movieclips.