Tuesday, April 30, 2013

Little touches Make a game

Ok, so that statement is a bit is a major one and a bit over the top. There are in fact Many aspects of game creation that really Makes a game.

FEEL

That is one word that I love to tell myself when working on anything in my games. From alien AI to button reactions to.. well anything in my games. I try very hard to make each element feel good, naturally responsive and sometimes entertaining.

Here is my latest example:
In my latest endeavour I have  my spaceship at the bottom of the screen. It only moves side to side, controlled by my finger position. I take the Delta and max that. If however I am under the Max Delta (max speed in some sense) I take the Delta and halve it. This gives the ship a lovely smooth movement to the final desired resting place on screen. How many games simply move the ship to its final destination? Well not mine.


Here is what it looks like.. The part to notice is where the ship comes to rest and how smooth it looks like.


Ship movement smoothing from Robert Toone on Vimeo.


Laters
Da Voodoochief

Monday, April 29, 2013

Not Space Invaders

A few people have been talking to me about my last blog post. Where I stated that I wasn't going to create a Homage to Space Invaders and what makes me worry so much about it.

I do not think that I can safely create a game that has the look and feel of another game, even if it was only going to be on the first level. By making my game look and feel like another, especially famous games. I run the risk of someone taking me to court for copying their game. Copying in fact the parts that make it individual and stand out. So if I plagiarize that feel and look, I am taking it's most recognizable parts.

So instead I am taking a step away from this and moving forward with another game that I have titled 'Invaders' at least as a working title.

This will also effect another game I have been working on the design. The idea is to take a nice single screen platform game and create something new, but once again the idea was to get people to recognize the type of game my new one is. That was going to be achieved by looking similar to Donkey Kong. Once again I realise I do not want to take the chance on someone suing me. Even if I make it a much more in depth game with massive amounts of variety added.

I must mention why I am interested in creating Homage style games to these arcade classics. Simply put, I am a fan, I was a fan when they came out and I was an avid arcade game player. I got into the arcade game players championship in England and I have a very strong feeling that these game types could be re-introduced to the current games players, and on the current touch screen devices. However just making ones that people don't perceive as a classic will seriously lower my chance to bring this gamestyle to the current crop of players. It is way too easy to get lost in the sheer amount of games released each day.

Good luck in whatever you create and play,
Da Voodoochief

Sunday, April 28, 2013

Space Invaders Cloning

Cloned games tend to come in two main varieties.
1. Exact replicas and should be called replicas, and although I say exact, I actually mean as exact as the developers could manage.
2. Take the games experience and recreate it and add new stuff to this experience. I like to think of these more as an Homage.

Now I have to say here that when I play most of the number 1 type, I am usually disappointed as the new version tends to look like the original and tends to be not quite as good an experience. Though there are very occasionaly those that feel better than the original due to not being an exact copy.

Number 2 is my favourite type to play, but also to create myself. I have done sveral Homages in various forms, and some people think are related to a completly different game, haha. Not sure that is a good or bad thing to be honest. The worst part of this type of game I find is that developers haven't really added anything new that I can see beside a few more powerups , or maye a new type of firepower. If that's gonna be it, I will probably be disappointed with the game when I get to play it. Still, I do tend to find myself drawn to these arcade styles of games myself, and that leads me to...

What am I going to do next? while I await graphics to finish up HoopFighter for the iPad I am busy designing and expanding on several ideas I have. Now Hoopfighter has been a long dev cycle for me and so I would like the next one to be shorter. However in reality I tend to find that I like the feel of a game to be.. just right.. So I really need to make sure my game has less dev time by making the levels simpler in nature, and therefore easier to test. When I created 'A Shooter' for example it took me 2 months or so to code, and then a further 2 months to create and balance the feel for each level vs what firepowers you would/could have, alongside balancing for the additional 2,3 and 4 player modes. I also tend to feel that a lot of arcade style games that people put out, they spend all their time coding in powerups and numerous enemies only to not do much more than random triggering of enemies. And some enemy combinations can be very difficult to play against.

So get on with it I hear ya ask!

I want to do a single screen shooter. I am not truly enamored of the shmups on the iPad and tablets at present. Though of course I cannot possibly play them all. I am sure there are some excellent ones I have not tried yet. In fact there are several I like. But I think there is room for me to do one that will feel different to people. So i started with wanting to pay Homage to Space Invaders. I figured this was an excellent starting point, to look like SI on the first level, and then expanding on every level after that. Only I realised I am worried about possible copyright infringement. So After 11 pages of design I have scrapped that. Still I love several of the over arching ideas I had for the game and so now I am gonna roll them into a new single screen shooter idea.

 The reason for a single screen shooter as opposed to a scrolling one, is two-fold. I do not want to have to work on all those over time triggers and balancing them, wheras on a single screen shooter, I can simply trigger them all and get balancing. It is a MUCH much smaller job. On another not a single screen game will allow the players to see everything at once and know what they face. This is a really great feature when you realise that most people owning tablets have never really played much in the way of shmups. I discovered that with Pellmell and A Shooter on the Xbox360 a while back, and boy was I surprised that players didn't know how to dodge a single trajectory bullet.

So now I have a very new design, incorporating a lot of the new enhancements and treatments I had for the original design. I am quite excited about starting it at some point, and I ave already designed 13 enemies spacecraft. Now I need to move onto the powerups for the players ship and how he earns the powerups that will be of so helpful in killing the alien invasion.

Laters Da Voodoochief

ps. I'll do some pictures at some point.

Wednesday, April 24, 2013

Texture Packer C++ Exporter pt2

Here is the second part of my C++ exporter Blog posting. Below I will detail all you need to export your own '.cpp' file, like the one I listed in yesterdays post.

Here is the exporter.xml file that allows me to choose the C++ exporter script I have created.
<exporter version="1.0">
    <!-- identifier of the exporter -->
    <name>CPlusPlus</name>
    <!-- display name of the exporter for the combo box -->
    <displayname>C Plus Plus</displayname>
    <!-- description of the exporter -->
    <description>C++ Exporter</description>
    <!-- exporter version -->
    <version>1.0</version>
 
    <!-- currently only one file allowed - more to come with update -->
    <files>
        <file>
            <!-- name of this file variable -->
            <name>cplusplus</name>
            <!-- human readable name (for GUI) -->
            <displayname>cplusplus Texture</displayname>
            <!-- file extension for the file -->
            <fileextension>cpp</fileextension>
            <!-- name of the template file -->
            <template>cplusplus.txt</template>
        </file>
    </files>

    <!-- target framework supports trimming -->
    <supportstrimming>true</supportstrimming>
    <!-- target framework supports rotated sprites -->
    <supportsrotation>true</supportsrotation>
    <!-- rotated sprites direction (cw/ccw) -->
    <rotationdirection>cw</rotationdirection>
    <!-- supports npot sizes -->
    <supportsnpot>false</supportsnpot>
    <!-- supports file name stripping (remove .png etc) -->
    <supportstrimspritenames>yes</supportstrimspritenames>
    <!-- supports texure subpath -->
    <supportstexturesubpath>yes</supportstexturesubpath>
</exporter>

And here is the 'cplusplus.txt' file that contains the script itself for the exporter to create that wonderful output.
char tp_version[] = "cpp = 1.0";
char textureName[] = "{{texture.fullName}}";
int  textureWidth  = {{texture.size.width}};
int  textureHeight = {{texture.size.height}};

struct  sSPRITE_INFO
{
 char name[32];
 bool rotation;
 float texturePoints[4];
 int size[2];
 int offset[2];
 int originalSize[2];
};

{% for sprite in allSprites %}
sSPRITE_INFO  {{sprite.trimmedName}} = {
  "{{sprite.trimmedName}}", // name
 {{sprite.rotated}}, // rotation
 { {{sprite.frameRect.x}}, {{sprite.frameRect.y}}, {{sprite.frameRect.x|add:sprite.frameRect.width}}, {{sprite.frameRect.y|add:sprite.frameRect.height}} }, // TexturePoints
 { {{sprite.frameRectWithoutRotation.width}}, {{sprite.frameRectWithoutRotation.height}} }, // size
    { {{sprite.cornerOffset.x}}, {{sprite.cornerOffset.y}} }, // corner offset, relative to original sprite
    { {{sprite.untrimmedSize.width}}, {{sprite.untrimmedSize.height}} }, // original sprite width
};
{% endfor %}

static const sSPRITE_INFO *{{texture.trimmedName}}[] =
{ {% for sprite in allSprites %}
  &{{sprite.trimmedName}},{% endfor %}
};

// Enumeration for defining the image indices for the lookup table above
enum
{ {% for sprite in allSprites %}
  SA_{{sprite.trimmedName}},{% endfor %}
};


Obviously you can change this to export whatever you want to customize the output to your needs. This will hopefully give you a good starting point.

G'night
Da Voodoochief
aa

Tuesday, April 23, 2013

Texture Packer C++ Exporter pt1

I have written about how excellent the Texture Packer is, and you can find out more by visiting the site at http://www.codeandweb.com/texturepacker.

I am using this tool for my Marmalade code and to that end I am using the language C++. There was no C++ output for the texture packer so I created my own. I have realised recently that although I have mentioned this in past posts. I have not divulged my exporter scripts.

It creates a '.cpp' file for me, and although it isn't a perfect solution, it is very easy to deal wiht its 'issues'. The issue I face when running Texture Packer is that within my '.cpp' file I also have the enumeration of the sprites, this enumeration needs to be copied into a '.h' file and removed from the '.ccp' file. That is so I can use the enumeration to choose which sprite to render from anywhere in my drawing routines.

Here is a sample of the output.
char tp_version[] = "cpp = 1.0";
char textureName[] = "sprite_atlas.png";
int  textureWidth  = 2048;
int  textureHeight = 2048;

struct  sSPRITE_INFO
{
 char name[32];
 bool rotation;
 float texturePoints[4];
 int size[2];
 int offset[2];
 int originalSize[2];
};


sSPRITE_INFO  BlueDream_Final = {
  "BlueDream_Final", // name
 false, // rotation
 { 1704, 1004, 1858, 1130 }, // TexturePoints
 { 154, 126 }, // size
    { 0, 0 }, // corner offset, relative to original sprite
    { 154, 126 }, // original sprite width
};

static const sSPRITE_INFO *sprite_atlas[] =
{
  &BlueDream_Final,
};

// Enumeration for defining the image indices for the lookup table above
enum
{
  SA_BlueDream_Final,
};


After I have generated this file I simply cut the Enum table and place into my header file.

You can see from the code that I declare a 'struct' that will allow me to easily acccess the elements that are important to rendering each sprite. You may also notice that I use the Enumeration to index into the Sprite Info array that has pointers to all the individual sprite structures. Using these sprite structures allows me to easily render the sprite.

I will continue with this development posts. Next post will be showing you how I created this '.cpp' file.

G'night
Da Voodoochief

Saturday, April 20, 2013

Marmalade Video packaging issue

www.madewithmarmalade.com is the SDK I am using as my cross platform Dev Kit (as i am sure you already know!). I like this SDK, it has a lot going for it, even if occasionally I get stuck on some naming convention or something... Well I have had a problem I have not been able to fully focus on these last couple of months. It has to do with playing Video on the iPad. I really require this feature for the HoopFighter game.. So it is something that had to be solved.

The problem I had is an odd one, or seemed it till I solved it that is. Like many of my problems they seem to be off the wall.

Marmalade uses the Native video playing system on whatever device you are on. So all I really have to do is point at a nice mp4 file and tell it to play it. Now there are a few caveats to this from the code side. It is possible to break the video playing by messing with the draw surfaces while te video is playing. This complicates things when trying to figure out what the vidoe is not playing.

I have posted before so I am gonna shortcut this to... I traced the problem to what I belieevd was the issue, that being the video file could not been seen by the hardware as existing.

Then I started looking into the zip file that the ipa file is created from. I could see that my mp4 file was not visible inside the zip, in fact it was being zipped up as an asset and placed in the dzip (.dz) file. This is great for installing a smaller IPA to ya iPad. I realised that the samepl that DID work did not package up the mp4 files. Now the dzipping auto process excluded a few file types that I included in my assets section of my control file (.mkb). However it did not exclude the mp4 I needed it too.

What I could not understand was that the dzipping process was happeneing because of something I had done more than a year ago. Way back then I added to my control file a section called 'deployments' and in that section I added the command 'auto-derbh'. This is a great way to have the build process and the deployment process create a nicely dzipped assets section. Very nice, very automatic and not what I needed.

The answer in the end was simple...
I removed the 'Auto-derbh' from the control file and rebuilt and re-deployed. In my new IPA zip file i could finally see the individual assets listed in my MKB control file. Now my Video was playing in my game and on the iPad.

By this time I had a lot of test code in my game. So after about an hour I had that all removed but video still playing.

Note: I should mention that when I deployed to my PC, that video worked regardless of the Auto-derbh command. This really obfuscated the issue for me.

I hpe this helps someone who is having issues with not being able to list a file and getting it to install as a file and not part of the dz file system.

Laters
Da Voodoochief

Thursday, April 18, 2013

iPad install proble #5 Resolution

In my last update to this bug I was struggling to get the game to install to the iPad. I had tried replacing either the certificate or the provisioning file to no avail. Yet I was certain that my issue lay there.

As it happens I was correct. I did of course take a circuitous route to solving this issue though.

The main problem was the developer certificate. I could make new ones, but in none of them could I setup for ios development, only do a cert for in app purchases and such, which I am not interested in. The developer radio button just stayed inactive. I came back to the apple developer screen many times over the period of a few days as I figured this must be my issue.
It was in fact the issue and the way I eventually got this option to highlight is..
1. I was delving into the apple dev forums, looking for any clue to this problem, when on the second day of searching someone had newly posted the same problem for people doing renewals, such as me.
2. This poster had the same exact issue, ad luckily enough another developer had figured out how to solve the issue. It was simple, though I did not believe it at the time, till I tried
3. Delete (revoke) all old and out of date certificates.
4. Yes, number 3 is correct. Once you have no more out of date certs, you can create a new one that will allow you to set it as a development cert.
5. I was so annoyed, there is no documentation that I could find telling me this. There was no cursor over help to say why this option was low lighted and unavailable. I wasted hours on this. I then posted a thank you to that thread as a few others have done.

With my new found confidence I decided to try and go and take a stride and not a step to get on the iPad.

I tried to use what the apple and marmalade documents describe as a wildcard provisioning file. Then I would not have to create any more game specific ones, as I could this wildcard one for all my tests and developments for many games. This sounded like a brilliant idea and so I pursued this for the next couple of hours. In the end I simply could not get the Deployment tool from Marmalade to create my ipa, it kept telling me that I needed to have a full name. Though in the Marmalade docs it explicitly tells me I am allowed to do this.

So I gave up on the wildcard and simply created a new provisioning file based on my old name.

Whammo.. Just going through the whole process again, now I could create a real cert was enough and the next IPA file deployed without a hitch.

Thanks as usual go to my peers who write stuff and solve stupid problems that should never have existed in the forums.

Massive thanks also to www.testFlightApp.com for simply being an amazing product that allowed me to try and install many times in a fluid manner. I also have to mention that through twitter those guys also offered to help me with my deployment issues. Are they fantastic or what!

g'night
Da Voodoochief

Wednesday, April 17, 2013

Neglected due to workload

It's been a week, a week without any Blog posts..

I am a little disturbed by this as I do not want to neglect this side of my development and communication. Though I do have several good reasons for the absence.

My wife has had to travel back to see her parents as her Dad is not well. This has left me as an excited but also tired single Dad for a while. Meanwhile at work there are milestones to hit and although I may not have actually been in the workplace, I was working on what I could from home. Add to that the Hoopfighter issues I was having and Whammo, no blog posts.

I intend that to change not just with this post but there will be more in the next several days. Including the final outcome of the iPad install issue and video playing on my iPad.

Have a good one,
Da Voodoochief

Monday, April 8, 2013

iPad version not installing part #4

Here I am several days into my problems. I wish I could work on this more full time as this problem would be solved so much quicker. However my life is not like that and my day job and family press my Indie dev time (oh and sleep as well, i really need to get rid of that).

The good news is that I believe I have found the problem. After my last posts about the problem being elsewhere not in my actual game or setup of my game. I decided to go looking into what else could be wrong. This led me to the Certificates, Keys and Provisioning files. I found that just coincidentally that my Development Identity Key and Certificate were both generated on the 1st of April in 2012. AHHH! (no April fools joke, unless it was on me this year of course).

When I saw the date on these files I thought to myself that they might have only been valid for a year from creation date. Once I went onto the Apple dev site I could see that was true. YAY I found the problem, I should be 10 minutes or so away from running on my iPad (I thought).

Only it hasn't quite worked out that way, and I have no idea why.

Now I dislike the Apple Certs, Keys and Provisioning stuff, and the main reason I hate it is that It seems hard for my mind to follow. It would get much easier I am sure if I was working with another developer or two and we could discuss all it's idiosyncrasies. I do not have that pleasure at this time. Another way to sort this all out would be if I had to do this kind of thing a bunch of times. So far though I have created these files once.. a year ago. I simply cannot remember all the aspects of creating and associating them properly. So I must go back and relearn what I did the first time. Only I also remember it took me some time to get it working back then.. gah!

Well I made a new Cert and Key and placed them in the appropriate location in Marmalade. Then I rebuilt the IPA file and uploaded it to testFlight. Then I failed once more to get the download to finish on my iPad. Ok, so what was next? I then created a new provisioning file and put that onto my iPad. Then I recreated my IPA once more and uploaded to testFlight. Once again it simply does not finish downloading, with the same cryptic message.

Right now I am sure that I found the issue, only my simple resolution did not fix the problem. The only choice I have now I feel is to start over on the whole setting up of my Certs and Keys etc, as I am positive the problem is still in there.. somewhere.

Laters
Da Voodoochief

Friday, April 5, 2013

Not installing on iPad part 3

Here I am again, still failing at being able to put apps onto my iPad. The latest trail I have followed and my conclusions below...

I use a subversion (SVN) system to not just save all my work, but to allow other team members to work with me. I pay for the service and it has always proven reliable. I have never had a reason to do anything but place my latest changes into its repository. Thst is until tonight.

Thanks to a very nice person on twitter  from @testflightapp they were able to point me to the instructions on installing older (not latest) version of my uploads onto my iPad. It was in the end very simple, but I never found the answer myself. I love my peers and those excellent people at testFlight.

Here are my steps tonight:
1. I downloaded older version of my game from testFlight and zoned in on which one went wrong. Even though I really knew which one first failed me, I was hoping for more information. I did get the date and time of the last uploaded and tested working build.

2. I used the date and time to go into my repository to grab a version from before that mark. I then built it expecting it to be the same as the one that last worked. To no avail though, it still would not install.

3. I went back a week and tried again. Once more this new build did not install.

4. I went to an example video test App i used several weeks ago and left it in a working state. However as with my game, it simply will not install.

Conclusion:
Something has changed that is not directly placed inside my game that is causing me to fail the install.

Plan of Attack:
I have no idea why making ipa files now fails on install. I will do a beyond compare with everything I can, only not sure what to look for.
Going to post on Marmalade help forums and hope someone else has a clue, though I cannot supply them with a lot of relevant info it seems.

Da Voodoochief

Still not installing on iPad

I worked on trying to figure out why my installation is not working...

What have I found out so far,
1. I had an old debug version of my game from the 24th March, only a week older than my last working version. Cool. I put this up on testFight and downloaded to my iPad and it installed. This tells me there that it was a recent change and more importantly that my iPad is fine, and not the problem.
2. I tried to use www.testFlightApp.com to download previous versions as I was going to try and zone in on exactly when it went wrong, so I could get a date and time from a good version (last known good they call it). I was not able to figure out if this is possible with testFlight though, so it was a dead end.
3. I compared all my pList files (two of them) from my current version with the debug version that worked. They are exactly the same... How sad, and disappointing.
4. I compared my debug mkb file with the current one and once again found no differences. That means the two places that install info is situated have not changed (as they shouldn't have tbh). Still more disappointment.
5. Went off sulking and wondering what to try next.

6. Woke up this morning with an answer. I will start by grabbing dated and timed versions from my SVN repository and get to the point that it worked, and then went wrong on the next submit. This will most likely take me several hours, but at least it should eventually lead me very close to the problem.

Conclusion:
1. My iPad is fine even after its recent install. YAY!
2. Reading posts all over the internet tell me my provision file is wrong OR my plist file. But they both appear fine.
3. I have no idea what could have changed to make it not install

Heres hoping,
Da Voodoochief

Thursday, April 4, 2013

Installation broken on my iPad

I use this amazingly helpful system called TestFlight, you can check out their web page at www.testflightapp.com. It allows me to upload version (builds) of my iPad game and then distribute it to anyone in the world with a an internet connection to their iPads. Amazing and awesome and has worked flawlessly this lat 6 weeks.

Now however the installation tells me that it cannot install at this time (what does that really mean though?), and gives me the options 'Done' or 'Retry'. I have tried both a number of times in the last few days, but I always get the same error. Now I will say that I really do not believe this is anything bad to do with testFlight at all. As this is my first error with testFlight I am not sure how to approach it... Still, once I find anything good out I shall mention it here :)

I am convinced it is my game and something I must have inadvertently changed and broke. Though I have been coding gameplay and menu stuff and nothing that should alter the installation process.

I have about a week to go on this title and now I have run into this last minute brick wall. This is where having team mates really packs a punch and helps ya through or around the wall.

Still, I'll never give up, so tonight I will be doing some major revision testing. see what I can find out, cos at the moment I am clueless.

Note: this means I cannot yet supply my video of Blades02 at this time...

Laters
Da Voodoochief

Wednesday, April 3, 2013

Reaction Designed Enemies

Following on from my previous post about creating enemies and what fun it is. I have just created a new one and once more enjoyed the process.

I have no idea if I will be getting any new graphics for my enemies, so I am working on keeping the number of new enemy images to a minimum by re-using one I already have. So previously I reused the Spiky ball and simply colored it a little different, and of course gave it different flight characteristics. I still need more enemy types for Kal to battle past and I also wanted something different, something that would make the player react when he first encounters the enemy. Such initial reaction are hard to earn, but even harder to keep as once an enemy has been seen once it is usually known and turns into 'boring'.. 'never have to think about that enemy again..'. Which I myself as a player can find boring too.

So I decided I wanted to create an enemy that makes a player react, and then has a surprise up it's sleeve, or maybe two :)
This new ones code name is Blades02 and here I will describe what it does and how I hope it will be received y players.

There are several stages to Blades02 all with a specific goal in mind.
Stage1:
 The Hovver Blade appears on the right hand side of the screen higher up than all previous enemies, as if he has appeared over there heads. He fades in over approximately a second and of course there is a sound to compliment this appearance. What I hope to get from this is a player to wonder what the heck that think is gonna do. Also enemies above a player tend to make ya nervous, I hope this works to some degree.
Stage2:
 The Blade disappears by fading down over about 1/2 a second. This should make the player wonder even more what this enemy is up to and start some anticipation.
Stage3:
 Now the Blade has faded to approximately 25% transparency it flys towards Kal at high velocity. Hopefully the player will initially react by jumping or sliding or maybe with an attack, so long as that anticipation has turned to fear for Kals health.
Stage4:
 The Blade actually stops right in front of Kal and fades in to fully solid. It just happens to have stopped right in kicking and punching position (well whaddya know, that was lucky!). This is where the player once again wonders what the Blade is up to, but also is now given their chance to disable it with a swift kick or punch. Killing this enemy will be worth approximately 100 points.
Stage5:
 If the Blade is not killed, after about 1 second it will choose to attack Kal. This it does by flying into his legs, OR flying up and into Kals head. This is a 50/50 random event. I am hoping that the first time the player sees the Blade he will believe that is all it does. Then some random encounter later he will discover ti has more than one option! This will make the player have a choice to either jump OR slide past this enemy, and some quick thinking can earn the player a lot of points, around 1000 for a dodge.

As you can see, this is a multi-phase enemy, and the player will make judgements that will perhaps be wrong, and with it's stealth and threatening and also patient nature I am hoping to surprise players at least a few times.

I just realised I should get some video of this in action. That will come soon :)

Laters
Da Voodoochief