Friday, 4 March 2016

EarthHope Fiction Part 3:The Simulation Tank

Part 3

Max watched as one of the latest recruits emerged,visibly shaking, from the simulation device.  He knew it would take the lucky lad a little while to recover before being immersed in the simulator again.  No one emerged from the simulator unaffected by it but typically it made the recruit stronger having mastered their fears.

The simulator was as close to real warfare as was humanly possible.  It worked as a kind of flotation tank in which the recruit was immersed fully and a number of electrodes were attached to neural pathways to stimulate sensations of pain, loss, joy, confusion, boredom and a host of other positive and negative emotions that fluctuated in a semi random pattern.

Typically this was one of the later stages of development of the recruits.  Basic training included firing weapons, handling the ships and other essential formation drills.  But this stage was where most recruits either passed or failed.  After each successful completion they were debriefed and given time to recover.  Failure sometimes occurred in which case a lengthier time was given for them to prepare anew unless they decided to quit.

Here they were tested in a safe environment to see whether they could survive the rigours of battle - both the conflict stages and the downtime.  Both aspects were dangerous to a pilot.  The obvious dangers of physical harm during engagement were complemented by the more subtle dangers of mental breakdown during downtime.

During downtime a recruit's mind could wander, could focus on the what-if scenarios and ruminate on endless scenarios that might never occur.  The simulator had a good understanding of human behaviour and knew how to trigger different emotions at different times, as well as triggering different lines of thought.

Max knew that with enough training in the simulator the recruits would be ready for anything. EarthHope Second Division fleet had one of the toughest simulators and was known for producing quality pilots above all else.


Thursday, 3 March 2016

Earth Hope Pilot:Max Part 2

Part 2

Not a moment too soon the final AioSenti cruiser disintegrated under the concentrated fire of the remaining EarthHope fighters.

Max looked around.  In space there is no horizon, only endless void - but you can still pick up the shape of other vessels carefully if you know what to look for and where to look - and also what not to look for and what to avoid. The glare of the twin suns in this system is blinding and gazing at them could distract you from less easily visible dangers in the void.

He'd learned a lot since his time in the cadets.  Basic training prepared him but it wasn't until his first real engagement that he realised which parts were useful and which were not.  His flight instructor sergeant had drilled him well. She'd known precisely what to say, and what to do to get the most out of him.  She'd been a tough officer to serve under but she knew her stuff and had given him the skills to face real combat.  He was very thankful for such officers. Some of the officers weren't as good and most people learned quickly to avoid those ones - the old adage about those who teach can sometimes be true but thankfully in this case it wasn't.

With the most recent skirmish over Max lay back in his cockpit and dreamed of what he'd do when he got back to the carrier.  Most likely he'd get a call from one of his juniors to help with something.  And the flight commander may not be entirely happy with how he performed today - he'd made a couple of wrong turns and ended up almost having a collision.  But what he looked forward to was the carrier library.  They had some actual books there. Real books.  Books hadn't existed for centuries but this carrier had some. The flight commander was a bit eccentric like that.  He also kept meticulous hand written notes - a habit that had gone out of fashion long ago.  Something about better way of committing it to memory or something.

Yes. Max would go through some of the art books when he returned to base. There were some pictures of meadows and fields that he liked to see - such a long way from home out here.

Fiction:Max, the EarthHope fighter pilot - part 1

Part 1

Max had been a pilot with EarthHope 2nd division fleet for two months and 28 days now.  In a couple of days he was due to get some well needed R&R.  The last 3 weeks had seen him fight in only half a dozen sorties but he'd seen some of his best mates get injured and killed.  He himself had had a few close shaves.  Those he fought with came and went. Newbies, greens - the inexperienced.  Most of them didn't make it past the first sortie.  If they survived - they might survive a couple more and hopefully learn some valuable techniques for getting through.  But they still needed a lot of luck.
If high command gets it wrong and sends the wrong signals, or if the enemy just happens to be better on the day there's not a lot you can do.  Max had heard of entire squadrons lost because some fool in command thought they'd try something new and innovative without having tested the idea in the simulator first.  Dozens of lives lost simply because someone wanted to experiment.

Max needed the R&R.  In one sense it would be welcome relief.  But on another level he dreaded it. Partially because he knew it was only temporary. The respite and relief he would receive from the fighting would only serve to heighten the sense of dread and anticipation as those last few days of rest evaporated.  But there was worse than the dreaded anticipation.

Most of his friends and families had only experienced civilian life.  They'd not had to worry about whether some small enemy vessel would get past their defences and tear a rent in the hull causing the precious oxygen to leak out catastrophically. Or whether he would make it back alive or in one piece each night - or even whether the carrier he was stationed on would still be there on his return.

Max didn't talk about the goings on at the front lines with his family.  It was too hard.  His mother could sense the tension in Max and it caused her pain.  Max didn't like causing her pain.  The difference in the two worlds - the front line and civilian life was too great to be comprehensible to those who hadn't experienced it.  Sometimes in the name of survival you just had to do what needed doing.  In a spaceship, a precarious little bubble in the void you were effectively alone once you engaged.  Unlike ground combat - in a 3d environment with no cover, perfect visibility - it was a killing area.  This made it hard to make friends on the front line - not like in traditional combat as you couldn't help each other out.  There was no communication between the fighters but they knew that their success depended on each of them doing their job.  There was no one to blame should someone fuck up because if one failed - none of you would be returning home.

In two days Max would be eating dinner with family, most likely a roast - his father cooked a great roast.  Sometimes it felt he had to be emotionally stronger at these events - with those who loved him and he loved - than on the front lines. He knew he would be changed by the experience.  The last great war against the cybernetic AioSenti had seen innumerable men and women return changed people by the horrors they had experienced.  Ancient terms were used to describe it. Shell shock. Thousand yard stare.  Look '44'.

Max closed his eyes and hoped dinner would be lamb this time.

Sunday, 21 February 2016

Run its course

Run Its Course

At this stage the game of Star Dancer has run its course.  

It has been available for download in its completed form since October 2015.  It has had almost 1,000 downloads for each version (free and full) in that time.  The majority of full version downloads took place in the month of January. 

As of February with the rankings reset for Google Play i've noticed that the game has ceased receiving attention.  

I know that were I to release an update regularly that would boost its position in the charts temporarily but the game's release period is effectively over.

I will continue playing it myself. During its time in the sun it had probably half a dozen people who really got into it. The majority discarded it almost immediately.  However I enjoy it.

As a permanently single bloke, never married, I once quipped to a close friend of mine that my efforts to market the game were about as successful as my efforts to find a female companion.  There's a lot of truth there it seems - at least going by the relative success in each of the two arenas.  

Anyway I enjoy the game, and I put a heap of work into it over the course of the year - it is valuable to me even if it doesn't receive any attention.  It would have been nice if more people had played and enjoyed it but there's always the next game that I build that may receive a bit more attention, though unlikely.

I won't advertise this post on twitter, facebook or email it to friends.  There's still a surprise in my game which will appear later in the year - just a short message to some people who play it - but I doubt it will be noticed as the game fades into complete obscurity.

It was quite disheartening back in December/January when every attempt I made to market the game fell flat. But that's how it goes. Kind of like life.

best regards,
Matt

Thursday, 11 February 2016

Code Written for Star Dancer

Code Written for Star Dancer
(or how I made my fingers bleed)


When I put Star Dancer together there were a number of different disciplines and procedures that had to be completed, ranging from design to art to music and so on. The majority of the work that I produced involved coding.  I have already demonstrated the cost of development as being approximately $7000 for art assets and so on in another blog post.

However the actual amount of coding work that I did was substantial to say the least.

Every few months I would run a program that gave me some estimate of the amount of code written as part of the runtime but also as part of the development process. Since some of the game's assets were generated in external code files not included in the game itself I included much but not all of these.

The coding took place after business hours (I worked a day job) and usually averaged out to be about 20 hours per week for a 6 month period with an additional couple of months at a far reduced hourly amount per week (about 2 hrs) in the post release phase when the occasional enhancement and bug fix was released.

The total hours of coding equated to approximately 500-600 hours of code over the course of 2015 for Star Dancer.

Because I don't charge myself for coding this saved me a lot of money by doing it myself!  Had I hired myself out to a client for the same amount of time I would have expected no less than $100 per hour to work in my own time (ie in addition to my full time job for the inconvenience) and would have cost a client approximately $50k-$60k.

While lines of code is not necessarily a useful metric for measuring productivity it does tell you a little bit about just how much actual code was required to be built since the project was begun from scratch.

So here are some figures for those that enjoy numbers.

Java (Android app) - approximately 25,000 lines of code including approximately 600,000 characters typed.  (comments included)

XML (Android app) - approximately 4,000 lines of XML for approximately 100,000 characters typed.

GLSL (Android app - shader) - approximately 240 lines of GLSL with approximately 8000 characters.

PHP & SQL (Web Backend) - approximately 15,000 lines of code with approximately 350,000 characters typed.

BlitzPlus/Blitz3D (tools/image processing, prototyping ideas, tests) - approximately 25,000 lines of code written including approximately 500,000 characters typed.

The vast majority (over 95%) of this was written between early February and late June 2015.  It was a considerable amount of effort and had I been charging a client only $100 AUD per hour then I'd say they would have been getting an amazing deal in terms of output per hour.

So had I lacked programming skills my game would have been totally impossible for me to develop as a hobby as that would have been easily the greatest cost in development for a project like this.


Wednesday, 10 February 2016

The human cost of space warfare

The human cost of space warfare
or put simply
"why I wouldn't want to be a star fighter pilot ever"


"The average life span of an EarthHope Fighter pilot is 1 minute 35 seconds" - as I have said elsewhere.

From the moment the two fleets drop out of hyperspace and engage in combat there is barely a couple of minutes survival time for one of the fleets' entire crew.

In space there is nowhere to hide, nowhere to run.  Once one of the fleets gets on top of the other  there is little hope of survival for the losing team.

The first few moments of battle are tense as the two fleets approach, at this stage there is no sign or indicator as to which side is going to come off second best. And second best means death in a space battle.

As the opposing line of fighters approach one another the EarthHope pilots expression changes to one of horror as they realise the AioSenti craft have been set to ram.  With no time to change their course one by one a series of bright flares illuminate the night sky as each pair collides.

A handful of EarthHope pilots escape this fate only to find themselves all alone in a sea of combat. Their directives are to attack the larger capital and cruiser vessels.  Flying directly at the nearest cruiser one of the fighters is torn to shreds by a burst of rockets launched from the forward weapon mount on the enemy cruiser.

The remaining fighter pilot glances around the battle space - his capital ship is ablaze and taking heavy damage from AioSenti bombers, the cruisers can offer no support against the enemy light craft but they too are damaged heavily.  Outnumbered and outgunned by what remains of the enemy fleet the EarthHope fighter dodges and weaves knowing it is only a matter of time before he too will become one with the vacuum of space.

The radio chatter has gone silent, all signs of human life in this sector of space vanquished.  The vacuum reigns supreme over the battlefield.


Tuesday, 9 February 2016

Coding Features - How the Lighting is Setup In Space

Coding Features - How the Lighting is Setup in Space

Star Dancer is set in Space. It uses a fake phong shader for the lighting with fake bump mapping.

The fake phong shader uses diffuse and specular components for lighting the space ship (per pixel) using the standard lighting equations for diffuse and specular components. However I ignore the ambient term.  Bump mapping is faked by taking the color map and extracting an average brightness value of the texel for two points - the current actual texel and a slightly offset texel and then using the difference in these to calculate a heightmap that alters the diffuse and specular components as a minor perturbation to the normal for the bumpmap..it is a crude but effective method when applied lightly (the bump mapping is very light - mostly not noticeable).

Given that this is a game not reality I had a bit of creative leeway with the positions of the lights.  In the game I use two light sources to represent a key and a fill light.  I would have liked to have had a back light as well as in a traditional 3 point lighting set up but getting the faint glow around the edges of the ships was going to prove a little difficult in a real time setup for me.  

The key and fill lights are oriented almost 180 degrees apart - slightly off from that, with the fill light being of lesser intensity. Both are white lights.  Because I have only two lights and because they are both static directional lights I include their position directly within the shader itself.  

Typically with game engines lights are expressed as parameters to a shader but because I am not making an engine but am making a game with a specific lighting setup that is unchanging I had no worries about simply expressing these lights as constant light source values in the game that could be built directly into the shader.  Not recommended for a more general purpose lighting solution but for a space environment it works.