Showing posts with label Flights of Fancy. Show all posts
Showing posts with label Flights of Fancy. Show all posts

Friday, March 29, 2013

Interegnum and Continuation

DON'T PANIC

Do you have your towel?  Good.  Understand tho - since we can't card you, there simply won't be any serving of Pan Galactic Gargle Blaster's.  Sorry - but Management simply insists - no one, but no one, is served. 

On to our story.

Hic.

Team C - good solid name that.  Not pretentious at all.  Not the uppity Team A, no sir.  Nope.  Too snobbish if you know what I mean.  Oh and not the social climber Team B - keep an eye out on those people...

No - we are Feet Of Clay - Solid Middle - Good Ole Team C. 

Sigh.

Guess we are gonna loose a lot of money over this decision.  Who wants to deal with a bunch of average SLAP!!!  Ouch!  Okay OKAY - yes I'm with the team all the way!  You betcha.  Team C all the way!

Where was I?  Oh yeah.

Ahem.

Flights of Fancy is going to continue.  Yes, we have decided - we really really need this on our resume's - oops, did I let out too much?  Anyway!  Yes - Flights of Fancy is going to be getting released as a playable Beta SOON!  Just don't ask me what SOON means okay?  I mean - you think we have the budget for a product lawyer?  Heck we can't even afford LegalZoom stuff.  Jeez.  Soon means as soon as we get it out is what SOON means.  Okay?  Got your towel?  Good.  Remember, don't panic.

Okay.

So - I'm going to keep cronicling - I mean chronicling - I mean adding stuff - to this blog as we go along.  Maybe others in the team will too - maybe not.

Yes the professor posted our grades.  No you don't get to know how bad - uh - I mean - whatever.  Forget it!! Move On! No - we are NOT endorsing any kind of political hack - I mean - whatever...

Next Blog Post - Sprites!  Sounds!!  Music!!!!

Monday, March 11, 2013

JSON and the boolean medusa

John had provided blessed silence - added a mute button.  Just one thing tho - state was not being saved from scene to scene.

I figured since I had grasped that nettle before it would be a fairly straight forward task to add the mute state to the other options that were also being kept.

And as we all know, the road to hell is paved with good intentions...

It all started so simply.  I wasn't sure if the Corona SDK JSON module would save anything but a value inside quote marks - the typical "this is a string".  So I started out using "true" and "false" as values in the save state for muting a scene.

Uh oh - John was using the value as a boolean.  Snap.  That's when I thought to see if the JSON routine would save it as a value without the quote marks - and was happy to see that it would.  Awesome.

Except - when going thru the game - the file would get saved with quote marks and errors would get thrown.

Poor Medusa...


Several hours later I removed all the places where I was writing the value wrapped in quotes - and happy day it worked.  So - level one and two have the code that saves the state and sets the mute button based on the state value when the scene starts up.

A couple of housekeeping measures this week too.  Added boss ship movement and shooting to level 2.  The boss shooting had been in the code - just wasn't getting fired due to a small type in the function call.  Level 2 uses different planes from level 1 - and I randomized hits to the enemy planes, you have a 1 in 2 chance of making a fatal hit.

Oh - Professor Jia had suggested our team create a poster for the final presentation:


Sunday, February 10, 2013

Offering the red pill...

So this week is about choices. 

The player was given the ability to make a choice during the demo/training scenes - but we weren't doing anything game wise with the players pick, at least up until now.

I've got a version in my SVN repo for the team to demo - now if the player decides to assist the Axis powers he/she gets to shoot down what would usually be the good guys airplanes.

Let's start with Snoopy's favorite ride - a Sopwith Camel.  This is currently the default Allied ship the player is going against.

Keeping with the RAF motif - the second enemy fighter the player goes against is a S.E.5a.

And the boss is a RAF RE.7 two seat light bomber/recon/fighter.

So, how does this work.  We  have two modules - a background and a ship module.  Using the JSON file created when a player makes a choice in level 0 -

local playerScore = require "playerScore"
local mySide = playerScore.whichSide() --pulls the value from the mycurrentstate.json file
some function()
     if (mySide == "A") then
         --do some Allied stuff --I love warm beer and haggis
     or
         --do some Axis stuff --I love bratwurst und sauerkraut!!
     end
end
 
This way the 'knowledge' of what choice the player makes is only available to those modules that need it. 
 
However this isn't going to be as pure as an OO narzi would like it to be.  I'm thinking to keep things compact and easy we may well have to have various scenes in on the players choice - some things may happen different depending the story line specific to the side the player chose. 
 
And I added a new background to our game:

I found this site:  http://www.spiralgraphics.biz/packs/terrain_civilization/index.htm

If you download and install their Genetica viewer you  get access to a lot of images, then can change the image size, then save it as a jpeg or png file type.

Once I saved an image I used Paint.NET to carve out the final image and size it to fit our game.
 
The red pill reference - that's a rabbit hole for another time...

Wednesday, November 21, 2012

Installation for Amazon Kindle Fire


General Notes


Flights of Fancy is not yet available thru Google Market or Amazon.  The file needs to be manually downloaded and then installed on your device.

Installation for Amazon Kindle Fire


Download our Amazon Fire Flightsof Fancy apk file to your PC.

If you don’t have a file manager installed, you will need one.  Select Apps, Store and look up either EasyInstaller or ESFile Explorer and install.  Both of these are free from the Amazon Apps for Android Store and are compatible for Kindle devices.

You have to turn on Allow Installation of Applications in your Kindle Fire.  Navigate to Settings, More, Device, and click the ON button next to Allow Installation of Applications from Unknown Sources.  Click OK at the warning; this will get turned off later.  Click the Home icon.

Connect your Kindle Fire to your PC using a USB cable.  Once your PC recognizes it, copy our Flights of Fancy.apk file to your Kindle Fire; then select the Disconnect button on your Kindle to safely unplug the USB cable from the PC.

I’m going to use ES File explorer for the rest of the guide.  Navigate to Apps, Device, ES File Explorer and select it.  Navigate to where you placed our Flights of Fancy apk file.  Select it and a screen is displayed asking if you want to install the application.  Choose Install. 

Once completed, our app is installed.  Now would be a very good time to turn OFF Allow Installation of Applications from Unknown Sources from Settings, More, Device.

We hope you enjoy Flights of Fancy!

Installation for Android devices


General Notes


Flights of Fancy is not yet available thru Google Market or Amazon.  The file needs to be manually downloaded and then installed on your device.

Installation for Android devices


Download our Android Flightsof Fancy apk file to your PC.

If you don’t have a file manager for your device, you will need one.  ASTROfile manager is one often mentioned for Android devices, it’s free and it is available from the Market.  You will need to install it before you can continue.

You have to allow your device to install from “Unknown Sources”; these are non-Market apps.

To do this, navigate to Menu, Settings, Applications.  Make sure the box marked Unknown Sources is checked.

Once you have a file manager installed, connect your Android device to your PC using a USB cable.

Mount the external card and copy our .apk file from your PC to your device.

Once the file has is on your Android device, navigate to it using your file manager and select it.  I’m going to use ASTRO File Manger as the example.  You should get a dialog box that allows you to install our app; select Open App manager.

On the installation pages that follow, select Install.

Once completed, our app is installed.  Now would be a very good time to uncheck Unknown Sources from Menu, Settings, Applications.

We hope you enjoy Flights of Fancy!

Sunday, November 11, 2012

Player State

My task this week was to display the players high score.  A simple task yet it lead to several paths...

Okay, so first up was just to display a simple high score.  I built a way to keep this tidbit of information, using the json library available in the corona sdk.

It's nice, what gets created is a essentially a name/value pair list.  Nice and light, especially for this use.  So our game has two of these data constructs - one keeps the current level and score values (it gets zeroed out at the start of the game), then there is another key value pair that holds onto the highest level and score achieved by the player, as well as a simple counter that holds onto the total score number for the player.  Not sure if there is any value to that yet, but we'll see.

So next up was a task to display the high score value.  Fairly easy to do, John created a topScore library file to which I added the functionality to read from the json table, then display the high score.

Well - that was so easy I figured I might as well add the highest level the user attained.  Few more minutes of coding and done.

Okay - but my current gaming obsession is Fallout New Vegas.  Second time around in fact.  And that reminded me - there are achievements in the game based on hitting certain criteria.

So I built a quick if...elseif...else structure and then got some simple achievements displayed.

Nice, but not all that satisfying.  Besides, it just looked like it was going to get clumsy trying to keep that up and running in case the rest of the team liked the idea.

This really needs to be a table based data construct - so I found that lua/corona sdk supports SQLite tables.  Built a nice quick and dirty one using SQLite Admin - and changed the code from the ugly if...elseif...else structure to a sql call to the database.  Took a bit more time to get the correct code but it's in place.

The payoff will be later on - this is a solution a number of other developers use to not just keep player state in but also stats of the various objects in a game. 

Here is a screenshot of our topscore page from the game:

Monday, November 5, 2012

Hurricane Sandy

I'm becoming a veteran of this I guess - last year was Irene, this year Sandy.  I live in a semi-rural area - which means my water comes from a well.  No electricity no water.  However, I do live on a lake, so getting water for other use (think flushing...) is only a bucket away.

We stocked up on water - bottled and filled up a number of water jugs - got propane, positioned tools, camping gear, all the other things that need to be done before the storm hits and power goes out for several days.

We lucked out - lost power for a bit over 24 hours - Monday afternoon to Tuesday evening.

So - after the clean up, got back into coding.  I extended and refactored our scoring scheme - instead of just using a text file, I found that Lua has a fairly robust support for JSON.  It becomes almost trivially easy to have a SQL-less data table get created, read from and written to using the built in JSON library.  So I've got the following libraries:

File IO - general functions to read, write and append files; functions to write to and read from Lua tables.

User State - functions that use the File IO library that write or read user state; right now current level and current score, functionality for highest level and score started on.

Player Score - a centralized set of functions that use the User State library to write out or read from the user state tables.

Code has been added to the main.lua as well as the three user level lua files that writes out the user score.

Plan is to further extend this code so as to have the highest level achieved and total accumulated score to also be saved.

Sunday, October 28, 2012

A gotcha and a gripe

Gripe first.

Once again, need to learn a 'new' way to concatenate strings.

One would think such a common programming task would be easily done regardless of language. 

One of course would be wrong.

Lua furrowed new ground for me here - no pipes, no use of the ampersand or the plus sign.  No sir!  Instead Lua uses two dots to indicate the concatenation of two stringvalues.  Go figure.

Lua concatenation: string3 = string1..string2

Gotcha next - spent some time trying to figure this one out. Kept getting an obscure error.  I was calling a function in another file - had the proper initializing statement in the file trying to use the function:

requires ( "filename" )
 
Instead of using the name space idea common to Java or .NET, Lua has you put this line into your functions:
 
module(..., package.seeall);
 
Added that as a line to my two new files and no more errors.

Friday, October 26, 2012

Corona SDK and good architectural practices


John has created an architecture document using UML following good Agile practices.  There are factories, components and other well laid out logical blocks that should allow us to parse out tasks, and develop in an iterative way.

Now the question is, will Lua/Corona SDK support such a way of doing this kind of work.  After all, it is a scripting language, using a main.lua file that controls the code that gets run.

After doing some looking around for demos and examples of displaying text to users I found that yes, indeed Lua does allow the ability to create discreet Lua modules, which can be treated as if they were classes.

The module sits in the same directory as the main.lua file; a variable is named and pointed to the module such as:

·         local director = require("director")

·         ui = require( "ui" )

Lua variables are global by default; so ui is now used throughout the application.  The local keyword keeps the director variable scope limited to the current code module.

Now we can create code modules and use already code modules easily, without creating spaghetti bowls of code in our common main.lua file.  And keep within the spirit of John’s architectural plan to boot.

Sunday, October 21, 2012

More adventures in the Paleofuture


My first actual programming job was doing Visual Basic – version 3.  I was getting into the nuts and bolts of C, C++ and Visual C++, but a job is a job and there you go.
Well – except…
The job was up in Park Ridge IL.  Seems there is a colony of Russian emigres in Park Ridge – as a lot of the code I started looking at looked very familiar – it ‘felt’ like C, not Visual Basic.  Which was a good starting place – as while a lot of the bad things classic VB would allow you to do was in the code base; there were a lot of other high level styles as well. 
Well, anyway I started my library of books etc. for my job.  One of first books I got was Bruce McKinney’s Hardcore Visual Basic.  It’s out of print, but Amazon still lists it.  The first chapter in McKinney's book gave a thumbnail history of the BASIC language, and provided some thoughts on what he termed the spirit of Basic. 
From that beginning followed chapters on how to turn what is often viewed as a weak, hobbyist language into ways to create high performance enterprise level product.  Yes, a lot bad code was written, and the language allowed that to happen.  But - a craftsman could quickly turn out journeyman level code in a fairly quick time.  To bring this back to my beginning paragraphs - you could write functions in Basic/VB that were similar to the type of functions you could write in C.  Well - maybe not as tersely, but the concept could remain the same.
The reason I mention all this is Lua, the language we are using for this project, in a lot of ways reminds me of the later versions of classic Visual Basic (versions 4 thru 6).  Lua is not an object oriented language, in that does not fully implement the three pillars of object oriented programming:
·         Encapsulation

·         Specialization/Inheritances (this doesn’t exist)

·         Polymorphism
Instead, it’s a lovely object based scripting language.  And it’s written in the Spirit of Basic – make things simpler than possible.
I think Edsger W.Dijkstra would hold as much disdain for Lua as he had for BASIC – but Dijkstra must not have been running into the programming sheep versus the non-programming goats problem other, later Computer Science instructors have been.
Summing up, I’m finding Lua to be much like classic Visual Basic was – fun, easy – potential to make very messy code that will at least run, probably poorly; yet with the potential to create elegant and well written programs.

Sunday, October 14, 2012

Back to the paleofuture

Back in the day - when Java were a wee acorn in the minds eye of Gossling - Microsoft used to ship an icon creator as a part of Visual Basic and Visual C++ (aye - these were the days of yore before even Visual Studio came about)...

The reason I mentioned that was I started to take some open source sprite/png images I found and re-purpose them for our game.

I found a top down image of a 'german' biplane - as a gif file.  Saved it as a png, opened it up in Paint.Net.  Added a solid line in front of the plane and saved it as image A, removed the solid line, kept a little bump in front of the plan and saved it as image B.  With the Corona MovieClip functionality got a 'prop' animation with very little work on my part. 




Next part - a bit more work on my part, and the flashback to the image icon builder.

Found a top down jpeg image of a Fokker tri-plane.  Did the same work - saved it as a png file - but I wanted a transparent background.

Well - found that with Paint.Net - if I stayed careful, I could use the delete tool on any white space I found and that caused it to be set to transparent.  After about a half hour or so got an image with a transparent background - saved one image again with a solid line in front of the engine, another with just a bit of a bump in the front one.

Ran the game - oops too big.

Re sized it down a bit - and now we have German bi planes as well as a bit larger German Fokker tri-plane menacing our hero.





Other things of note.  Tom Resource was flogged to provide level information.  He got the Entente (English major - can't just say the Good Guy side) levels done, posted to our Google Drive.  I'm going to add his comments:

Here is the ENTIRETY of the Entente campaign I wrote up, with attendant clarifications on the terms I used. Pretty crude and breaks multiple rules of sentence formation and basic English, I am well aware, but I know you software guys: you can write a program to move the sun over if I give you enough time, so keep it quick and simple if at all possible... 

I like his faith in software engineers!  Good kid.

Thursday, October 4, 2012

The Writers Appel

Yes - I'm getting into the spirit of the old style pulp/serial's of the time and subject we picked for the game.  I'm using this as a reference...

Storyboard
Level One: Introduction
Introduction to flight controls with a senior instructor’s prompts appearing as text on screen. It becomes clear the PC is a test pilot experimenting with the first deployment of a new prototype fighter equipped with laser and plasma weaponry, as well as the abilities to hover like a helicopter and achieve low and high speeds at the push of a button. The instructor explains basic flight controls and introduces the concepts of the fighter, including the Eternity Drive (the fighter essentially runs by tapping off of a micro singularity or black hole, allowing for virtually infinite fuel reserves and power for its primary weapons). The PC engages in basic target practice (live drones?), and when he initializes the higher functions of the Eternity Drive, is propelled into darkness. The PC emerges into an unfamiliar dawn as a blue biplane and black triplane are firing away at each other. The player has to make a decision here of which to assist; after shooting down their chosen target, they accompany the surviving plane home. Discovering the date to be 1915, the shocked pilot offers their assistance in the quickly expanding global conflict known as the Great War (WWI).
 
Level Two: Second Battle of Ypres
Entente Side: The PC is ordered to assist in any way possible after the mass retreat from the line due to German gas attacks. The PC destroys a few observation balloons before being jumped by a squadron of triplanes. After the destruction of the triplanes, a cutscene triggers in which the pilot lands to assess the situation, and receives orders from a ranking officer to destroy as much of the German artillery as possible to assist with the retaking of the line and prevent German exploitation of their successful gas attacks. While destroying the artillery batteries, a German Ace (the Black Knight) intrudes and begins attacking with incendiary rounds. After shooting down the Ace, the PC witnesses him retreating from the wreckage of his plane to the advancing German troops.
 
Central Side: The PC is ordered to assist German advances in the wake of successful gas attacks. He must defend the observation balloons from French and British biplanes. After shooting down the final biplane, a cutscene ensues in which the German commander order the PC to destroy and remaining British artillery behind the lines. A British Ace emerges (the White Knight) and begins a boss battle against the PC using incendiary rounds. After shooting down the Ace, the PC witnesses him retreating from the wreckage of his plane to join the retreating British troops.

An Editors Riposte

Hi Tom  (our resource),
First of all; we need to keep this simple for a couple of reasons - there are only 16 weeks left of dev time (this is counting up both class sessions); and we don't have a graphics person/team organic to the group.
So - we are going to be stuck with whatever 2D images/sprites we can find that are open source. That being said, I'd stay as close to 'real world' as possible. Later on if the team stays together and we want to go full bore development then we can get a lot more wild.
So with that caveat - I'd say stay with normal zeppelin for the times etc.
And yes - I think you have it as the player levels up there needs to be
Increase in player hit points
Increase in NPC hit points
Increase in number of NPC's
Sprinkling of tougher NPC's (on both sides - think squadron ace's fighting against and fighting with)
With maybe a boss battle against an enemy ace and their squadron
Some way for the player to add capabilities to their ship
And yes - there needs to be zeppelins...
And I like the idea of the user having to make a choice right away.
So taking your story line I've come up with a concept of the initial story -
Player takes off in airplane (now here is the where some background information is going to have to be fleshed out - how does the guy keep his bird gassed up? Load up bullets? That sort of stuff. So clearly we are going to have to have our hero come from the future, with some kind of air frame that uses X fuel that never runs dry) - some kind of event happens and player transported to the skies over WWI Europe; Axis and Ally dawn patrol squadron getting ready to duke it out and our hero is smack dab in the middle of the fight.
Here again some kind of background information on the aircraft - it needs to be slow enough to be able to fight against bi-planes. We are almost really talking about the kind of vessel that was in the Descent series - ability to hover, move slow then fast etc.
Once the player makes a decision - the enemy npc's get killed and the player lands with 'his team' at their base. That finishes the intro, gives a nice segue to some kind of cut scene and then an invite to go on another patrol or some other task.

A Perilous Junction

So 'our resource' - budding writer - does ask for some clarifications.

Got your note, couldn't read all of your handwriting but I got the gist of it.  Couple of questions for your and your team...

How pulp hero do you guys feel comfortable with me getting about  this (Ex. level 2 boss a normal zeppelin for the times, or a lightening-spewing steam punk monstrosity?)

<IDEA> Or, as a progression from level to level, normal gradually gives way to more and more insane ideas as the side the PC is fighting against throws anything it can think of against you to try to win back the skies?

Right away - does user get a choice on side they fight for/against, or does it make more sense to do a single "campaign" now; think of alternate campaign as DLC or a sequel if successful (NOTE - hint of fatherly pride here - clearly he DOES get the idea of monitization).

The Editor Strikes Back...

I gave 'our resource' some homework - nothing too complicated...
 
Tom - for Thursday we are going to need:
 
Beginning storyboard
  • Background Story
  • Characters
  • Layout
  • Level complexity - what happens when going from level 1 to 2
  • What begins a level
  • Hazards
  • Top down vs. scroller
  • Cut scenes - how does user get information
  • Missions?
Right now we need at least two levels - game start, next level for our discussion on Saturday.

Oh - we settled on idea #3.
This is going to be 2D - hence the question side scroller or top down.
Keep it simple to start - we can flesh it out more as we go.

The story so far...

I figured I would begin my posts with the story information I got from 'our resource'...

I tasked my youngest son with this - give us a few game ideas that we could use to create a multi platform game.  He responded with:

Working Title: 1938, Pastwatch
Possible genre: Platformer/3rd person
Story basics: Time travel storyline from a projected future into the past, namely mid to late 1938 in Europe. The PC is an agent of a governmental Time Security agency (the Pastwatch) sent to prevent a fellow agent (working name: Romanov) from changing the flow of events leading up to World War II. The story has the potential for multiple endings (possibly based on player’s chosen difficulty level), including ones where Romanov succeeds, succeeds but ultimately fails, the PC wins and the PC assists the antagonist in achieving his goals. The storyline depends on making the player believe Romanov intends to make the Czechoslovakian government stand up to Hitler’s ambitions for German expansion, igniting WW2 earlier and dramatically altering the perspective sides (perhaps even starting a series of smaller wars overall, with fewer overall casualties but a Nazi Germany that survives into the present day facing down a fracturing Soviet Union while the USA remains isolationist). The true story is different: he hopes to ignite the war earlier than actually occurred, of course, but intends for Germany to ally with Poland to invade the Soviet Union, allowing for the two powers to burn each other out and the building of a true European Union to result. The multiple endings can expound on the magnitude of his successes or failures, or even if his attempts to change (Intervention) rather observe (Witness) the past even work.
Possible Hooks: Leader boards for scoring purposes, time attack/trials mode, player decided difficulty levels, multiple endings
 
Working Title: Forerunner
Genre: Shooter
Story basics: As the titular Forerunner to a future alien invasion of the Earth, the PC must destroy as much infrastructure as possible to aid and abet the invasion while keeping overt resistance to a minimum. This means thinking strategically, striking at weaker nations across the planet and isolating more powerful nations before striking at them. A shooter in the purest sense, storyline would be limited to perhaps faux news reports of the PC’s actions and responses to them from across the world that the PC alien character would intercept. The true hook here, of course, is to actually be playing as the dastardly bad guy alien who, at the end of the day, is a punch clock villain whose sole goal is to suppress the elements of effective armed resistance and get his paycheck, while shooting the platitude shouting hero out of the sky.
Possible hooks: Same as above
 
Working Title: Flights of Fancy
Genre: Shooter
Story basics: A freak accident during testing of a prototype fighter equipped with laser and plasma weaponry sends it back to the spring of 1915, in the middle of the 1st World War. Upon encountering an air battle of biplanes and being fired upon by both sides, the PC’s first decision is to decide whom they will assist, the Central or Allied powers. That decision tips the balance of the war in their favor slightly, but the PC must also decide if they will intervene in other ways, such as going out of their way to kill specific individuals (a young corporal in the German Army named Adolf Hitler, for example) or use their historical knowledge to influence the course of history (help stave off the Russian Revolution, for another example).