Make an FPS in 7 Days – Game idea: “Follow”

Next week is the 7DFPS challenge – design, code, ship a game in 7 Days, on the theme of “first person shooter”. I want to do something unique and interesting. Here’s one of my ideas.

(if you like this idea, please re-tweet this to vote for it – I’ll decide which to do based on which one(s) people like most) Other ideas: “Runners”, “Metamorphosis”)

Title: “Follow”

Premise: what makes an FPS unique/special among games is the visceral, immersive nature. Almost every *other* genre of game gives you 360-degree vision. This was originally to compensate for the way “a computer” fails to use most of your human “peripheral” senses (depth, perpheral vision, positional sound, etc). The most obvious difference with FPS’s: you can’t see what’s behind you.

In most FPS’s, you only have to worry about your own skin. You spin around frequently to check no-one is sneaking up on you. You strafe round corners so that a head-on enemy doesn’t get a chance to blindside you as you slowly rotate around the corner. Stealth games let you “lean” to make up for the danger of corners.

Core gameplay

Follow is different: you are invulnerable, and you’re being followed by creatures you’re trying to rescue / lead to safety. Because they’re always behind you, you cannot see when they’re being attacked – you can gun down all opposition, then turn round to find out everyone’s been eaten behind your back.

But if you walk backwards everywhere, you’re bound to fall off a cliff, or run into an enemy and only notice it when your followers go down in a hail of fire.

Challenges to the player

Moment to moment during the game, the player has to compromise between the following tensions:

  1. Avoid static obstacles/dangers (look where you run) … vs … prevent followers from wandering off (look behind you, at followers)
  2. Takedown enemies (charge forwards, run around obstacles) … vs … lead carefully (avoid leading your followers into traps / fields of fire)
  3. Hands-off (followers wander and get into danger) … vs … Hands-on (use non-lethal weapons to herd and cluster your followers, so you can keep them alive more easily)
  4. Get to level-end / safety quickly (lose lots of followers) … vs … slow, stealthy “no man left behind” (slower and painstaking but higher success rate)

Upgrades

Three interwoven upgrade paths:

  1. Player: might/damage/speed
  2. Relationship with followers: trust/obedience
  3. Followers: speed/intelligence/resilience

At end of each level, you get cash in a virtual currency based on how many followers you rescued, how quickly – and how much they like you.

(if you got them to the end by bullying … they won’t like you so much as if you gently nudged throughout)

Weapon availability

Potentially: various unique weapons only “unlocked” when you achieve difficult non-shooting things, e.g.:

  1. Complete a level with 100% survival of followers
  2. Keep followers at 90% or above happinness for 5 levels in a row
  3. Complete a level in under 50% of the “par” time

Ideally, those weapons would be complementary to the achievement. e.g. for the “complete a level fast” award, you’d get something that made it easier to complete levels stealthily (you’ve already mastered “moving fast”, so this gives you something valuable).

…also: if you don’t like playing fast, this gives you a high cost/reward incentive to do so: you want to play stealthily, you want the uber-weapon for stealth … so you need to take a break from stealth-play to go earn it.

Summary

I like this idea because:

  • …it’s an FPS about protecting people, rather than slaughtering them
  • …it emphasizes the vulnerability of “people other than myself”
  • …it demonstrates that making yourself into a super-soldier may be ultimately useless and unrewarding
  • …it makes the purely-tactical parts of an FPS a lot more strategic, as core gameplay – rather than relying upon “map design” and/or “multiplayer team tactics” to provide all the strategy

Preview of a new game: “Peace by other means” – Screenshots1

I’ve just posted some screenshots + notes for Reddit’s Screenshot Saturday, for the iPad game I’ve been working on for almost 2 years now.

small-IMG_0205

Doesn’t look like much given how long it’s been in development :(, but I’m hoping it’ll speed up from here!

[homepage for the game]

Along the way, I’ve:

  • built the game
  • taught myself advanced Quartz / CoreAnimation
  • wrote a detailed playable game with AI
  • discovered the hard way that Apple doesn’t use hardware-acceleration properly on iPhone/iPad
  • threw away the 2D renderer, re-designed the game around OpenGL + 3D
  • re-wrote everything in 3D with OpenGL 1.x
  • taught myself OpenGLES 2.0
  • re-wrote everything with shaders

GamesThatTeach: “Let’s Play: Ancient Greek Geometry”

Excellent game for practicing circle/line/compass/ruler construction (as loved by junior-school maths exam writers): The regular polygons have been kidnapped by ninjas. Are you a bad enough dude/tte to construct the regular polygons with nothing but a virtual compass and straightedge?

“It’s a Compass and Straightedge tool/puzzle game written in JavaScript. I’ve always thought Geometric Construction felt like a puzzle, so to me this pairing was quite natural. Compass and Straight edge is a technique for constructing shapes out of circles, straight lines, and their intersection points. You can read the wikipedia here – but watch out, some of the gifs are spoilers for the game.” – http://blog.sciencevsmagic.net/science/lets-play-ancient-greek-geometry/

The exciting thing here is that it shows how to create “perfect” polygons – not estimated, not relying on a pre-made protractor / angle measurer, but 100% accurate, using rules of geometrical construction. For instance, here’s how to draw a perfect pentagon, without any tools beyond the compass/pencil/straight edge:

http://sciencevsmagic.net/geo/#0A1.1A0.1L0.2L3.0L4.4A1.1A4.12L0.17A0.17L21.2L29.0L29.0A6.29A51.N.0L29.29L6.6L0.60A6.29A51.60L73.73A60.6L73.73A6.6A73.6A60.6L161.N.161L6.6L60.60L73.161A6.73A60.142L161.73L142

Firefox won’t save/open PDF files any more

What is it with Firefox’s developers these days? Every other release of Firefox seems to overwrite at least one existing setting … with a broken feature.

Firefox version 22.0 disables your PDF viewer and replaces it with a non-working proprietary viewer from Mozilla

Cure is quick:

Note: this works because “always ask” is less annoying than it sounds. It merely means “let me open it or save it”, and it will use whichever viewer you last used. On OS X that – out of the box! – means the system PDF viewer. Which works perfectly on everything except bizarro-interactive-secure-encrypted Adobe docs/em>

Continue reading

Anatomy of a cluster-f*ck: Imagination’s SDK installer

iOS devices (iPhone, iPod Touch, iPad) are powered by 3D chips branded “PowerVR” from a company branded as “Imagination”.

If you want to develop 3D games/apps, you can do that using Apple’s free tools + SDK. But some of the good stuff – e.g. higher-res textures – you’ll need to dive into PowerVR specifics. This should *in theory* be very, very, very easy. But Imagination does not make it so :(.

All you really need is a few source files, but instead of putting them on their website to for you to download, Imagination has wrapped them up in a 1 gigabyte (broken) self-extractor. And it doesn’t work. It *really* doesn’t work. Read on for some of the joys of just how awful something as simple as a “unzip this file” program can get…

UPDATE: I realised after posting that I left out a very important point. Until this mess, I’d found Imagination’s tech guys to be friendly and helpful, and their tools to be useful and to work fine. They were always badly documented (e.g. very bad error handling, missing key facts like “a 64 megabyte texture requires 3 GIGABYTES of RAM to save”, etc – but they essentially “worked”). Maybe I just got lucky until now, but this installer seems a radical departure in terms of quality and testing. For anyone who’s *not* used the PowerVR stuff before, bear this in mind: IME, this experience is not normal. Also: use the forums – the support team seems pretty responsive.

TL;DR – if you want to load PVR textures on iOS, google for “PVR” and “iOS” and “copyright imagination” and find the header files and source that are embedded in a couple of open-source projects from a couple years back, before Imagination accidentally broke everything.
Continue reading

WordPress: inline “signup email” drop into post or sidebar

My blog posts are info-rich and spam-poor. Most of the “enter your email address” plugins are designed for spam – covered in bling, in-your-face animations, background music, all sorts of crap.

There’s nothing out there, so I made one, using a GPL’d existing project. Feel free to use this yourself.

note: this is an image, not a form!
Screen Shot 2013-06-13 at 13.48.14

Continue reading

Games that teach: Code Combat

http://codecombat.com/campaign = Tower Defence clone where instead of just placing towers … you write basic commands in javascript to manipulate your troops around the map:

This is an early preview build, so it ONLY WORKS WITH CHROME (EDIT: (deleted off topic personal commentary) … Chrome’s native plugin stuff is great, I can see why a lot of devs use it for prototyping … but the politics around Google, and their actions to edge-out more inclusive, free, open browsers is distressing)

Screen Shot 2013-06-10 at 19.36.04

SVGKit 2013 – Recipes (part 2)

(see also the first set of SVGKit recipes)

Change the color of a SVG element like a Path or Circle after the user click on it

CALayer* layerUserClickedOn = ...

if( [layerUserClickedOn isKindOfClass:[CAShapeLayer class]] ) // should ALWAYS be true, but just in case you write your code wrong...
{
   CAShapeLayer* shapeLayer = (CAShapeLayer*) layerUserClickedOn;
   shapeLayer.fillColor = [UIColor redColor].CGColor;
}

Find the CALayer that was generated from a particular SVGElement

NB: Apple/ObjectiveC uses “id” as a keyword, so we had to rename the SVG name “id” to “identifier”.

If your SVG file is legal, and has a unique “id” attribute for every SVGElement, then you can find the CALayer directly from the SVGElement, using the “id” attribute. If your SVG file has no “id” attributes, or the SVGElement you’re searching has no “id” element, then you’ll have to do more work – or fix the SVG file (edit it, add an “id” attribute to the SVGElement that matters, save it … then use this recipe)!

SVGKImage* svgImage = ...
SVGElement* element = ... // see previous SVGKit recipes
CALayer* layer = [svgImage layerWithIdentifier:element.identifier];
... // do something with it...

Clone part of the image, and move it around / change it

First of all, find the part of the SVG you want to clone, e.g. using “Search an SVG file for particular tags / nodes / elements” from the first set of SVGKit recipes.

That gives you an (SVGElement*). Use the previous recipe to get the CALayer. Finally, clone it and use it:

#import "CALayer+RecursiveClone.h" // requires SVGKit version 1.1.0 or later

...
-(void) someMethod
{
   SVGKImage* svgImage = ...
   SVGElement* elementToClone = ... // see previous SVGKit recipes
   CALayer* layerToClone = ... // see recipe above

   CALayer* newLayer = [layerToClone cloneRecursively];
   newLayer.frame = layerToClone.bounds; // reset it to be positioned at (0,0)
   
   // if you want the clone to start in same position as original
   // add this code
   if( calculatePositionOfOriginalLayer )
   {
      CGFloat xOffsetOriginal = 0.0f;
      CGFloat yOffsetOriginal = 0.0f;
      CALayer* parentLayer = layerToClone;
      while( nil != (parentLayer = parentLayer.superlayer) )
      {
         xOffsetOriginal += parentLayer.frame.origin.x;
         yOffsetOriginal += parentLayer.frame.origin.y;
      }
      CGPoint positionOfOriginalLayer = CGPointApplyTransform( layerToClone.position, CGAffineMakeTranslation( xOffsetOriginal, yOffsetOriginal ) );
   }
}

Edit the polygons / lines / shapes after loading

Every “shape” is stored as some form of Apple CGPath object.

CALayer* layerInSVG = ... // use a previous recipe to get the layer from the SVG element
CAShapeLayer* shapeLayer = (CAShapeLayer*) layerInSVG; // if you chose wrong, this will error at runtime
CGPath pathToEdit = shapeLayer.path;

... // edit the path, and create a replacement path

shapeLayer.path = myEditedPath;

Apple doesn’t provide an API to directly edit CGPath objects. They have a C API that let’s you create a callback function that turns the CGPath into a list of draw-calls, that you can then work with. But it takes quite a bit of code to read this, and then convert it back into a CGPath that Apple can draw.

So far, no-one has open-sourced their code for this (I’ve got a private version I wrote for a previous project, but it’s thousands of lines of code). Either petition Apple to add the missing APIs, or find someone to write it for you / license it to you, or write it yourself.

Designing Bomberman with an Entity System: Which Components?

Today I found a new article on implementing a Bomberman clone using an Entity System (in C#) – but I feel it doesn’t quite work.

It’s a well-written article, with some great illustrations. But the authors “Components” struck me as over-complicated and too behaviour-focussed. If you’re designing a game based on an ES, this isn’t a great way to do it – it feels too much towards old-style OOP gameobjects.

This is an opportunity to talk about good and bad directions in Component design. I really like the author’s idea of using Bomberman as a reference – it’s simple, it’s a well-known game, but it’s got a lot of depth. Read the original article to refresh your memory on Bomberman and how it works. Then come back here, and we’ll do a worked example on choosing components for a game. I’ll completely ignore the programming issues, and only look at the design issues.

Continue reading

Mirrors in Unity Free version – almost works

UPDATE: see end of post for another idea…

One of the ways they make you buy Unity Pro is gimping the non-Pro version by taking away Stencil Buffer and Render-to-Texture (needed for … many (most?) of the truly interesting effect you can think of). Except … it’s only needed by old-school OpenGL programmers, because everything RtT does can be mimicked in Shaders. Stencils … maybe also?

Anyway, I’m working on a hobby project and don’t need or want the Pro version for now (I’d like to support Unity, but these days the jump in price is way too expensive, at $X000 (they price-gouge you if you’re purchasing from within EU) for a simple hobby project). If/when we’re using it at work, and I have lots of cash, sure – but for now: can’t find that much money.

For the most part, I’m happy to go without RtT for now – generally speaking, hobby projects don’t “need” those kind of effects (and if they do: maybe it’s not a hobby any more?). There’s just one exception: reflections.
Continue reading

Indie Developers do an AMA…

A bunch of indie game devs (including various friends of mine) are doing an AMA right now on Reddit. Go have a look (and ask some questions) if interested.

I found the answers this question a bit depressing though, given that the audience has increased 100-fold in the last 2 decades. Sad that indie developers still find it almost exactly as hard today as they did in the 1990′s :(.