Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm developing a game where the player quickly has to tap/click on various shapes such as squares, circles, triangles, stars and so on. I'm now struggling with the following task: I'm searching for a normalized size for each shape, so that every shape is equally difficult to hit. E.g. given a circle with a radius r, how do I find the length l of the corresponding square?

At first glance I thought: Easy. Just make all shapes share the same area A. So, in the example above, l = sqrt(pi). http://en.wikipedia.org/wiki/Squaring_the_circle

But on second thought, this does not seem to be the best metric. Imagine a star with many long, thin, pointy arms or a very long but thin line. Even if they have the same area as a circle or square, they are still more difficult to hit.

So, what might be a better approach? Maybe something involving the "form factor" (circumference squared divided by area C²/A)?

share|improve this question
add comment

2 Answers

up vote 7 down vote accepted

Sounds like play testing is going to be the best strategy here.

You can use your idea of making all the shapes the same area to start with. Then add a "shape factor" to modify the size if need be. You can use this shape factor to apply to every object of a specific shape. Once you've tested enough, you'll have shape factors you can use for each shape.


Alternatively (and more difficult to implement), use a circle to scale them all. Take a circle of radius X, and ensure that each generated shape has the same surface area inside the circle.

For example, below, the star is scaled so that its surface area within the circle is the same surface area as the square has inside the circle:

enter image description here

(Likely not actually scaled correctly since I just did it in paint)

share|improve this answer
add comment

Sounds like Fitts's Law.

illustration of clicking a target of width W at a distance D in time T

Fitts's law is a very good approximation for the speed of humans hitting targets by moving along a straight line.

Shannon formulation of Fitts's Law

where:

  • T is the average time taken to complete the movement. (Traditionally, researchers have used the symbol MT for this, to mean movement time.)
  • a represents the start/stop time of the device (intercept) and
  • b stands for the inherent speed of the device (slope). These constants can be determined experimentally by fitting a straight line to measured data.
  • D is the distance from the starting point to the center of the target. (Traditionally, researchers have used the symbol A for this, to mean the amplitude of the movement.)
  • W is the width of the target measured along the axis of motion. W can also be thought of as the allowed error tolerance in the final position, since the final point of the motion must fall within ±W⁄2 of the target's center.

You can treat the line from target 1 to the next target 2 as your straight line. Then calculate an average participant's a and b constants by experiment. This allows easily calculating an appropriate W (width) for every instance of the problem.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.