Monday, September 23, 2013

Flight Odyssey Released

We are proud to announce that Flight Odyssey has now been released on the Google Play Store for Android and the App Store and is now also available at the Amazon Appstore for Android.
Android app on Google Play Available at Amazon
Not sure? Try it for free on Google Play. If you run an app review site, work in the journalism/media field, or have at least 1000 friends/followers on a Social Media website and are interested in reviewing our game, please contact us at FlightOdyssey+Promo@gmail.com to request a free promotional code.

Here are some helpful links for new players:


Current versions: v. 1.006-1.028 Built with Corona SDK

Friday, September 20, 2013

Closure

Lua and Javascript are surprisingly similar languages, as I was happy to learn (coming from a Javascript background). Both of them are very loose in handling data types, don't require classes, and have a nice feature called closure. That's by no means an exhaustive list of similarities, of course. However, today I thought I'd write about some differences in how each of them handles closure. Take a look at the two code samples below:

Lua:
 
function main()
    local printFunctions={}
    local i,j
    for i=1,10 do
        local printi = function()
            print(i)
        end
        printFunctions[i]=printi
    end
    for j=1,10 do
        printFunctions[j]()
    end
end

main()

Javascript:
function main()
{
    var printFunctions=[]
    var i,j
    for(i=0;i<10;i++)
    {
        var printi = function()
        {
            console.log(i);
        }
        printFunctions[i]=printi
    }
    for(j=0;j<10;j++)
    {
        printFunctions[j]()
    }
}

main()

Both of these would appear to be identical. They create 10 functions which simply print the value of i. Then, each of the functions is called. You would expect the result to be "0 1 2 3 4 5 6 7 8 9," right? That's correct in Lua, but not for Javascript. Javascript prints "10 10 10 10 10 10 10 10 10 10."

UPDATE:
The following explanation is not accurate. See this Stack Overflow question for details.

Inaccurate explanation:
So why does this occur? It occurs because Lua and Javascript handle closure in different ways. Lua treats the closure as part of the function reference itself (see this reference), and therefore each time you create a function reference you get a new copy of the variable. The function is created 10 times, with i having values from 0 to 9 during those initializations, and therefore the numbers 0 to 9 are printed.

Javascript, on the other hand, creates a closure based on the variable declarations (see this reference). Since i was declared in the main function, i can only have one value for each time the main function was called. The main function was only called once, so i has only one value, and that value is 10 at the point when the functions are called.

Perhaps this is better explained with another example. What if we changed the anonymous function to print j instead of i? In Lua, nil is printed 10 times because at the point where the function is declared, j is nil. By contrast, in Javascript, the numbers 0 through 9 are printed, because at the point where the function is called, the j from the main function ranges from 0 to 9.

Hopefully that was helpful to anybody else familiar with Javascript and trying to learn Lua. If anybody else has a better way of explaining the difference, please feel free to leave a comment.

Useful Tools and Thank Yous

Now, I know that my Credits blog post already thanks all the groups who helped make Flight Odyssey possible. However, that was kind of cold and legal, so I'd like to take this opportunity to talk a little bit about each of the services that were most helpful. The purpose is twofold: first, to give out some well-deserved credit, and second, to help other developers who are trying to build apps without a huge infrastructure of support.

Let's start off with Clker.com, one of the most crucial resources in my search for images. Clker.com provides clipart/vector images licensed under CC0 (effectively public domain). It has a huge variety of images, and the price is right! The majority of my images come from this website, so I am incredibly grateful.

That said, let me point out a few caveats that may be of aid to other developers. First of all, the search engine built-in to Clker.com is pretty awful. My recommendation is to just use Google Images, but limit the search to Clker.com using the advanced search options. The other major issue is the ads. When I initially found Clker.com, I was using Chrome AdBlock, so I didn't realize that this was a problem. However, as soon as I switched to Firefox, I suddenly realized the website's ulterior motive in providing this great public service: lots of ads! (In fact, I was so surprised by the ads that at first I though they were being inserted by a virus on my computer.) Related to this is the fact that many images on Clker.com are actually downloaded from openclipart.org, so it may pay to try that site as well and see which you prefer.

Next, Bitbucket. I hate to admit it, but this is my first project where I've used a formal version control system. I can assure you wholeheartedly that I will be using it for my next project as well. At least once or twice I was spared from hours of work by a backup in Bitbucket, and several times the reassurance that the backup was there let me be more aggressive in making changes. To put it bluntly, version control is awesome, and Bitbucket implements it really nicely. Not only do the provide you with free private repositories for up to 5 users, they also have a nice GUI (SourceTree), a decent issue tracking system, and everything you would expect out of a paid Version Control system (despite being free). One caveat: they don't have an official mobile app or a mobile-friendly website (helpful things when testing on devices and reporting issues), but BitBeaker is an Android app which interfaces through their REST API and works nearly as well as an official app would.

TexturePacker logoAnother major issue I've faced in my project is performance. Some performance issues, of course, are related to memory consumption, while others are more complex. One tool, though, that I believe has greatly improved Flight Odyssey's performance is TexturePacker. I first discovered TexturePacker when I read this article/video. Just like Corona SDK, that video made some pretty bold claims about the performance benefits of TexturePacker, but they appear to be true. I'll admit I was skeptical at first, particularly when the initial impact of the software was to increase texture memory usage by a factor of 6 (since all images had to be loaded, not just the ones in use). Nonetheless, when I ran my app on a device, performance appeared to have dramatically improved. I still don't really know how that worked, but I suppose the theories presented in the video must be accurate. Not only does TexturePacker improve performance, it also provides a better way of organizing sprites, unlocks several features of Corona SDK that are only available with sprite sheets (like easy animations), and can decrease the size of the app. The biggest drawback is that it costs $40 to get the full version. Fortunately, you can use the essential mode for free (though it lacks some of the optimizations) and bloggers/framework developers can get a free license for the full version.

Some other helpful tools include GIMP (a great way to fine-tune the free clip art from Clker.com for a specific purpose), Paint.NET (like GIMP but lighter weight), ImageAlpha (for image compression), and Notepad++ (once I discovered that you can create a workspace in the sidebar, I never had to use another text editor).

Built with Corona SDK And of course, this list could never be complete without Corona SDK. I've mentioned before how impressive it is, to the extent that it inspired me to create this app, but it can't hurt to repeat it.

That's all, and thanks for reading! If you would like to suggest any other helpful tools for independent game development, feel free to leave comments!

Thursday, September 19, 2013

Demo Video

Yesterday, I set out to create a demo video for Flight Odyssey. I knew it wouldn't be easy, but I expected the tricky part to be the video editing. You see, previously I had tried screen recording directly from a device using adb, but since I was getting frame rates around 0.2 fps (5 seconds per frame), I decided to just record the simulator. It turns out that wasn't much easier.
The first thing I tried was CamStudio, a free, open source screen recording software that I had used previously for a demo. I knew that it was a bit clunky (as free software tends to be), but I did not realize one crucial difference between my past use and this one. The last time I had used this software, I was demo-ing a piece of UI heavy business software. Frame rate was nearly irrelevant as I simply clicked on buttons and typed in text. By contrast, Flight Odyssey runs at about 30 fps, and at any speed slower than 20 -25 it looks unacceptably laggy. CamStudio recorded at about 10 fps, not to mention that there was no obvious way to hide the cursor and record audio.
So, I did a quick Google search and came up with two alternative screencasting programs, ZD Soft Screen Recorder 5.4 and Screencast-O-Matic. ZD Soft started off badly by recording with an odd codec (Xvid MPEG-4 Codec). After I had wasted about an hour trying to view the files it produced (which wouldn't open in QuickTime or Windows Media Player in their default configurations), I finally was able to view them using Aiseesoft Total Video Converter Platinum. They ran extremely smoothly at just about 30 fps (perhaps the odd codec helped?), but of course it was too good to be true - there was a watermark. I didn't want to spend $40 to get the full version of ZD Soft, and I didn't feel it was morally right to remove the watermark (though it wouldn't be too hard, if you left enough whitespace around the part of the screen that you're capturing), so I tried Screencast-O-Matic. Same story.
Finally, I thought I'd go back to CamStudio and give it one more shot. A little bit of searching revealed that even though the "Record Speaker" option wasn't working, this could be easily worked around by using "Record Microphone and setting the speaker as the only input mechanism in the Control Panel. The annoying cursor could be removed with the Cursor Options command. So, all thenmimor annoyances were resolved and only the main problem remained. Suddenly, I realized that there was a menu command called Video Options that I had been overlooking (I'm not sure why). It contained an option to reduce video quality and increase maximum frame rate (set by default to 10 fps for unknown reasons) which I quickly took advantage of.
All was not yet resolved, though. The resulting video, though taken at a whopping 40 fps, was a complete mess. The graphics were blurry and any movement left long artifacts trailing behind. Furthermore, any attempt to increase graphics without decreasing frame rate led the game itself to lag. Ultimately, I found a happy compromise at 20 fps and switched to recording on a desktop computer for better performance. Finally, I had my video, right?
Of course not. iMovie wouldn't recognize the file format that CamStudio produced. So, one last step was necessary - back to Aiseesoft Total Video Converter to convert .avi to. m4a. At last, all was well.
Hopefully that was helpful to anybody else hoping to make a video demo of an app - the video I made is available here on YouTube. Thanks for reading!

Sunday, September 8, 2013

Beginning of the Odyssey

Flight Odyssey began with an app called Finger Hoola, which was the free app of the day on Amazon's Android store one summer day in 2013. It was "Made with Love & Corona SDK," it claimed, and that made me curious.

So I did some research on Corona SDK, and I liked what I saw. It bragged making development 10 times faster than Objective C 2.0 or Java for Android development, the two most popular "native" tools for smartphone app development. That's a bold claim, but from what I could tell, it was true, at least for relatively small programs. My previous attempts at apps had used Objective C 2.0 and ended in disaster.

Not only was Corona SDK less over-engineered, it also boasted that it could be deployed to four different app stores (Android, iOS, Kindle Fire, Nook) without rewriting code. That was another impressive claim, considering the vast differences in architecture between Android and iOS (Kindle Fire and Nook are really just forks of Android, but they have their own app stores). The only other tool that I had used that could be compiled for multiple mobile platforms was Adobe Flash Builder (4.5.1+). I'm currently working on a game using Flash Builder as well, but it's indefinitely on hold for several reasons. First of all, the game was begun before Adobe released support for mobile platforms, and Adobe did not make it very easy to migrate the project to the new system. Furthermore, while Flash Builder is definitely easier to work with than Java or Objective C (in my opinion), Corona SDK is even easier for most tasks. The one advantage that Flash Builder does hold is that it supports compilation for Blackberry, while Corona SDK does not.

I'll do more comparisons of Flash Builder and Corona SDK in a future post, but to make a long story short, I was extremely excited to try making an app in Corona SDK, so I started looking around for ideas. I tried to solicit some from my brother, but he was no help. So, I just started experimenting with Corona SDK and waiting for an idea to hit me.

After a few weeks passed, one day I noticed my brother playing a game called Hill Climb Racing, where a player drives a car over 2D hills doing tricks and collecting coins. He seemed to be having fun playing it (he had unlocked almost all of the cars), and when I tried my hand at it I found it relatively amusing. At that point, I thought it was just another free game, but a few hours later, I had an idea: What if I made a similar game, but instead of driving a car you could fly an airplane?

My brother seemed to like the idea, so I commenced development of a prototype and added him to the team. Naturally, we added some twists to make the gameplay totally unique. Players not only control the throttle, but can also tilt the device to control the angle of the plane. Furthermore, instead of starting at the beginning of a scene each time you play, gameplay takes place in one huge world that you are free to slowly explore. Players can complete missions and collect coins - but be sure to land safely or you won't get to keep the money!

My brother and I have been working on the game for several months, and now that it is nearing completion I hope that you will find it enjoyable!

Monday, September 2, 2013

Credits


Flight Odyssey would not have been possible without the following contributors, organized by license and content type.
You can contact us at flightodyssey@gmail.com if you have any questions, concerns, or ideas for improvement.
Our website is flightodyssey.blogspot.com, where you can always find the most recent and accurate version of these attributions.
If you believe that we used your intellectual property in our game but mistakenly failed to attribute it here (or attributed it incorrectly), please contact us immediately at FlightOdyssey+IP@gmail.com. We will make all necessary corrections and will put your attribution at the very top.
Also, please note that modifications have been made to some graphics and sounds in accordance with the respective license agreements. To the extent permitted by the respective license agreement, copyright to the modifications made to the graphics/sounds is retained by Alan and Joel Jaffe.

Direct Contributors

Head ProgrammerAlan Jaffe
Assistant ProgrammerJoel Jaffe
Head ManagerJoel Jaffe
Assistant ManagerAlan Jaffe
DirectorAlan Jaffe
Assistant DirectorJoel Jaffe
Head Resource AcquirerJoel Jaffe
Head World ArchitectJoel Jaffe
Assistant World ArchitectAlan Jaffe
Head of Quality AssuranceJoel Jaffe
Assistant of QAAlan Jaffe
Copyright of the design, code, gameplay, appearance and all other portions of the game not specifically attributed below is retained by Alan and Joel Jaffe (©2013, all rights reserved).

Major Frameworks, Services, and Tools

Corona SDK by Corona Labs. In our opinion, this is a really great tool! (We also used the grass image from the physics project template.)
TexturePacker by Code'n'Web. Another great tool!
Bitbucket
Dropbox
GIMP

Creative Commons Attribution

Images

Perito Moreno Glacier (David Wilbanks) / CC BY 2.0
Control tower of Munich Airport (High Contrast) / CC BY 3.0 DE
Basic blue button pause icon (Double-J designs) / CC BY 3.0
Arrow back left icon (App-bits) / CC BY 3.0
Airplane off take icon (Visual Pharm) / CC BY 3.0
Email icon (Jigsoar) / CC BY 3.0
Planet website icon (Mihaiciuc Bogdan) / CC BY 3.0
Speaker icon (Designmodo) / CC BY 3.0

Images (lite-version only)

Premium icon (Aha-Soft) / CC BY 3.0

Sounds

Propeller sound (Pullover aus Milch) / CC BY 3.0
Retro Coin Collect sound (DrMinky) / CC BY 3.0
Water splash sound (soundscalpel.com) / CC BY 3.0

Linkware

Free for Commercial Use

Freeware

SIL Open Font License v1.10

Fonts used in logo

Oxygen Mono (Vernon Adams)
Cabin Sketch (Impallari Type)

The MIT License

MIT License Notice: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

UI Images and Styles

Scripts

device.lua device detection script (Corona Labs)

CC0 1.0 Universal

(Public Domain Dedication)

Images

(A few might not actually appear in the game)
Cannonball: http://www.clker.com/clipart-cannon-balls.html
Blue arrow: http://www.clker.com/clipart-3551.html
Whale: http://www.clker.com/clipart-ascending-whale.html
Navy ship: http://www.clker.com/clipart-navy-ship.html
Fighter jet: http://www.clker.com/clipart-fighter-plane.html
Tank2: http://www.clker.com/clipart-tank-6.html
Bomb: http://www.clker.com/clipart-6795.html
Parachute: http://www.clker.com/clipart-parachute-1.html
Soldier: http://www.clker.com/clipart-244000.html
Crawling Soldier: http://www.clker.com/clipart-23842.html
Cannon: http://www.clker.com/clipart-cannon-3.html
Sky background: http://www.clker.com/clipart-238112.html
Coin: http://www.clker.com/clipart-coin-1-1.html
Snake: http://www.clker.com/clipart-155687.html
Big truck: http://www.clker.com/clipart-black-semi-truck.html
Dolphin: http://www.clker.com/clipart-dolphin-outline-grey.html
Shark: http://www.clker.com/clipart-great-white-shark-3.html
Cloud2: http://www.clker.com/clipart-cloud-blue-background-72px.html
Ship: http://www.clker.com/clipart-29747.html
Tank: http://www.clker.com/clipart-military-tank-1.html
Bird: http://www.clker.com/clipart-blue-bird-left.html
U.F.O: http://www.clker.com/clipart-ufo-in-metalic-style.html
Glider: http://www.clker.com/clipart-28757.html
Space shuttle: http://www.clker.com/clipart-12125.html
Rocket ship 2: http://www.clker.com/clipart-rocket-9.html
Rocket ship: http://www.clker.com/clipart-rocket-7.html
Helicopter: http://www.clker.com/clipart-30006.html
Hot air balloon: http://www.clker.com/clipart-24141.html
Drone: http://www.clker.com/clipart-predator-drone.html
Cargo Plane: http://www.clker.com/clipart-white-jumbo-jet.html
Aircraft Carrier: http://www.clker.com/clipart-aircraft-carrier-ship.html
Fighter Jet: http://www.clker.com/clipart-f14-tomcat-1.html
Wright Brother Airplane: http://www.clker.com/clipart-red-blue-wings-biplane.html
Bus: http://www.clker.com/clipart-yellow-bus.html
Hotel: http://openclipart.org/detail/23988/big-house-by-anonymous-23988
Thunderstorm cloud: http://www.clker.com/clipart-cloud-with-lightning-bolt.html
Penguin: http://www.clker.com/clipart-cartoon-penguin-2.html
PolarBear: http://www.clker.com/clipart-polar-bear-walking.html
Bear: http://www.clker.com/clipart-bear-3.html
Factory: http://www.clker.com/clipart-1773.html
Barn: http://www.clker.com/clipart-barn-4.html
Hill: http://www.clker.com/clipart-simple-green-hill.html
Cactus 2: http://www.clker.com/clipart-23317.html
Skyscraper: http://www.clker.com/clipart-85735.html
Camel http://www.clker.com/clipart-52291.html
Sand storm: http://www.clker.com/clipart-desert-storm.html
Truck: http://www.clker.com/clipart-old-truck.html
Road: http://www.clker.com/clipart-road-with-passing-zone.html
Apartments: http://www.clker.com/clipart-buildings-12.html
School: http://www.clker.com/clipart-school-building-1.html
Lamps post 2: http://www.clker.com/clipart-street-lantern-old.html
Lamp posts: http://www.clker.com/clipart-bigger-twin-street-light.html
Tent: http://www.clker.com/clipart-3499.html
Apartments: http://www.clker.com/clipart-greyscale-apartment.html
Car: http://www.clker.com/clipart-car-green-cartoon-transport.html
Train tracks: http://www.clker.com/clipart-train-tracks.html
House: http://www.clker.com/clipart-3513.html
Ocean: http://www.clker.com/clipart-ocean-floor.html
Island: http://www.clker.com/clipart-tropical-island.html
Igloo: http://www.clker.com/clipart-cold-climate-scene.html / http://openclipart.org/detail/176338/igloo-by-qubodup-176338
Tree 2: http://www.clker.com/clipart-modifiedtree.html
Snowflake: http://www.clker.com/clipart-map-symbol-winter-recreation-area-black.html
Snowman: http://www.clker.com/clipart-188904.html
Sand: http://www.clker.com/clipart-sand5.html
Cactus: http://www.clker.com/clipart-11150.html
Clouds: http://www.clker.com/clipart-25459.html
Trees: http://www.clker.com/clipart-tree-clip-art-3.html
Propeller plane: http://www.clker.com/clipart-220687.html
Raindrop: http://www.clker.com/clipart-24966.html
Switch airplanes: http://www.clker.com/clipart-15304.html
Mountain: http://www.clker.com/clipart-6457.html
Pond: http://www.clker.com/clipart-water-pond.html
Gas can: http://www.clker.com/clipart-gas-pump2.html
Tornado: http://www.clker.com/clipart-tornado-20.html
Arrow: http://www.clker.com/clipart-1842.html
Updraft: http://www.clker.com/clipart-upward-arrow-blue.html
Downdraft: http://www.clker.com/clipart-upward-arrow.html
Blimp: http://www.clker.com/clipart-air-ship-balloon.html

Sounds

Public Domain

Free to use

Images

Buttons: http://www.cssbuttongenerator.com/ (From v. 1.028 and later)

Scripts

Corona SDK Wrapper Class (Michael Milwa - "Restrictions: This class is free to use")

City Names

Fair Use

Quotes

Some gameover quotes from The Hitchhiker's Guide to the Galaxy (Douglas Adams and Garth Jennings)

Icon/Image Search Engines

Clker.com ("The online royalty free public domain clip art" - in our opinion, a great source for CC0 Public Domain images!)
ICONFINDER
IconArchive

Sunday, September 1, 2013

Instructions

Welcome to Flight Odyssey pilot training! Here's all the basics you need to get up and running. If you already know some of it, feel free to click the following links and skip ahead.

The Throttle (Back to Top)

Maneuvering in the Air (Back to Top)

Your First Landing (Back to Top)

Options at the Runway (Back to Top)

What if I run out of fuel?

More about Missions

More about Planes

Click the button on the left to instantly taxi to the left side of the runway, so you can take off towards the right. Or, click the button on the right to instantly taxi to the right side of the runway, so you can take off towards the left.

The door button will exit you from the game and take you to the menu, where you can view the instructions - which you're looking at right now!

Missions (Back to Top)

Back to runway options

On the missions page, you can choose a mission to accept, cancel your current mission, or keep your current mission. You can only do one mission at a time, so choose wisely!

Different missions give different amounts of coins and experience. Each time that you complete a mission, you'll get half as much money and experience.

Planes (Back to Top)

Back to runway options

On the plane page, you can switch which plane you are flying, upgrade a plane that you own, or buy a new plane. Scroll up and down to see all of the available planes. Every plane can be unlocked in two ways: If you gain the amount of experience needed, you will unlock the plane for free. Otherwise, you can buy it using coins.

Upgrades (Back to Top)

Back to planes

You can upgrade your plane to improve its maneuverability, fuel tank, stability, or safety by clicking on the upgrade button. Each property can be upgraded up to 10th level.

Coins (Back to Top)

Fuel (Back to Top)

Back to runway options

Don't ever run out of fuel, or you'll immediately crash (even if you're on the ground)! If you're having an issue with fuel, be sure that you're refueling every time you land. If that doesn't solve the problem, you may need to upgrade your plane's fuel tank or buy a new plane with a larger fuel tank. Some runways are just too distant from each other to be reached with a basic plane!

Another helpful hint: If you enter a menu while at a runway, your plane will automatically refuel.

Weather (Back to Top)

Various weather conditions will be introduced to you as you proceed through the game. If you want a sneak peak, here's some hints:

Puffy clouds make your plane harder to see.

Winds will push your plane right or left.

Rain and snow will push your plane downwards.

Updrafts and downdrafts will push your plane up or down (respectively).

A tornado will spin your plane around and likely crash it.

A thunderstorm is perfectly safe - until lightning strikes.

The Pause Menu (Back to Top)

And finally, remember that you can pause the game at any time if you need a few seconds to think or want to review the instructions. When you return from the main menu, you'll appear at the last runway you successfully landed at.

Contact Information (Back to Top)

That's all! If you have any questions, please contact us at FlightOdyssey+Public@gmail.com or visit our website: flightodyssey.blogspot.com.

Thursday, August 29, 2013

Introducing Flight Odyssey

We are proud to announce that our first app, Flight Odyssey is now under development and scheduled for release in late September.

Fly a plane from runway to runway, complete missions and collect coins! Gain money and experience, and exploit your wealth to unlock new planes!

The app boasts:
  • Unique gameplay. Slide the throttle and tilt your device to control the plane's flight.
  • A huge, rich world to explore
  • More than 50 runways to visit
  • More than 200 missions to complete
  • Six different themes to enjoy
  • Eight different airplanes to fly
  • Custom music and engaging sound effects (not supported on all devices)
  • Interactive obstacles to dodge

More information will be coming soon, but if you're interested in learning more please contact us at FlightOdyssey+Public@gmail.com. If you're interested in beta-testing the app, please contact us at FlightOdyssey+Beta@gmail.com.