Planet Gamedev

GPGPU.org

NVIDIA Kepler GK110 Architecture White Paper

by Mark Harris at May 21, 2012 12:35 AM

NVIDIA Kepler GK110 Die Shot

This white paper describes the new Kepler  GK110 Architecture from NVIDIA.

Comprising 7.1 billion transistors, Kepler GK110 is not only the fastest, but also the most architecturally complex microprocessor ever built. Adding many new innovative features focused on compute performance, GK110 was designed to be a parallel processing powerhouse for Tesla® and the HPC market.

Kepler GK110 will provide over 1 TFlop of double precision throughput with greater than 80% DGEMM efficiency versus 60‐65% on the prior Fermi architecture.

In addition to greatly improved performance, the Kepler architecture offers a huge leap forward in power efficiency, delivering up to 3x the performance per watt of Fermi.

The paper describes features of the Kepler GK110 architecture, including

  • Dynamic Parallelism;
  • Hyper-Q;
  • Grid Management Unit;
  • NVIDIA GPUDirect™;
  • New SHFL instruction and atomic instruction enhancements;
  • New read-only data cache previously only accessible to texture;
  • Bindless Textures;
  • and much more.

#AltDevBlogADay

That’s Not Normal–the Performance of Odd Floats

by Bruce-Dawson at May 20, 2012 08:51 PM

Denormals, NaNs, and infinities round out the set of standard floating-point values, and these important values can sometimes cause performance problems. The good news is, it’s getting better, and there are diagnostics you can use to watch for problems.

In this post I briefly explain what these special numbers are, why they exist, and what to watch out for.

This article is the last of my series on floating-point. The complete list of articles in the series is:

The special float values include:

Infinities

Positive and negative infinity round out the number line and are used to represent overflow and divide-by-zero. There are two of them.

NaNs

NaN stands for Not a Number and these encodings have no numerical value. They can be used to represent uninitialized data, and they are produced by operations that have no meaningful result, like infinity minus infinity or sqrt(-1). There are about sixteen million of them, they can be signaling and quiet, but there is otherwise usually no meaningful distinction between them.

Denormals

Most IEEE floating-point numbers are normalized – they have an implied leading one at the beginning of the mantissa. However this doesn’t work for zero so the float format specifies that when the exponent field is all zeroes there is no implied leading one. This also allows for other non-normalized numbers, evenly spread out between the smallest normalized float (FLT_MIN) and zero. There are about sixteen million of them and they can be quite important.

If you start at 1.0 and walk through the floats towards zero then initially the gap between numbers will be 0.5^24, or about 5.96e-8. After stepping through about eight million floats the gap will halve – adjacent floats will be closer together. This cycle repeats about every eight million floats until you reach FLT_MIN. At this point what happens depends on whether denormal numbers are supported.

If denormal numbers are supported then the gap does not change. The next eight million numbers have the same gap as the previous eight million numbers, and then zero is reached. It looks something like the diagram below, which is simplified by assuming floats with a four-bit mantissa:

image

With denormals supported the gap doesn’t get any smaller when you go below FLT_MIN, but at least it doesn’t get larger.

If denormal numbers are not supported then the last gap is the distance from FLT_MIN to zero. That final gap is then about 8 million times larger than the previous gaps, and it defies the expectation of intervals getting smaller as numbers get smaller. In the not-to-scale diagram below you can see what this would look like for floats with a four-bit mantissa. In this case the final gap, between FLT_MIN and zero, is sixteen times larger than the previous gaps. With real floats the discrepancy is much larger:

image

If we have denormals then the gap is filled, and floats behave sensibly. If we don’t have denormals then the gap is empty and floats behave oddly near zero.

The need for denormals

One easy example of when denormals are useful is the code below. Without denormals it is possible for this code to trigger a divide-by-zero exception:

float GetInverseOfDiff(float a, float b)
{
    if (a != b)
        return 1.0f / (a - b);
    return 0.0f;
}

This can happen because only with denormals are we guaranteed that subtracting two floats with different values will give a non-zero result.

To make the above example more concrete lets imagine that ‘a’ equals FLT_MIN * 1.125 and ‘b’ equals FLT_MIN. These numbers are both normalized floats, but their difference (.125 * FLT_MIN) is a denormal number. If denormals are supported then the result can be represented (exactly, as it turns out) but the result is a denormal that only has twenty-one bits of precision. The result has no implied leading one, and has two leading zeroes. So, even with denormals we are starting to run on reduced precision, which is not great. This is called gradual underflow.

Without denormals the situation is much worse and the result of the subtraction is zero. This can lead to unpredictable results, such as divide-by-zero or other bad results.

Even if denormals are supported it is best to avoid doing a lot of math at this range, because of reduced precision, but without denormals it can be catastrophic.

Performance implications on the x87 FPU

The performance of Intel’s x87 units on these NaNs and infinites is pretty bad. Doing floating-point math with the x87 FPU on NaNs or infinities numbers caused a 900 times slowdown on Pentium 4 processors. Yes, the same code would run 900 times slower if passed these special numbers. That’s impressive, and it makes many legitimate uses of NaNs and infinities problematic.

Even today, on a SandyBridge processor, the x87 FPU causes a slowdown of about 370 to one. I’ve been told that this is because Intel really doesn’t care about x87 and would like you to not use it. I’m not sure if they realize that the Windows 32-bit ABI actually mandates use of the x87 FPU (for returning values from functions).

The x87 FPU also has some slowdowns related to denormals, typically when loading and storing them.

Historically AMD has handled these special numbers much faster on their x87 FPUs, often with no penalty. However I have not tested this recently.

Performance implications on SSE

Intel handles NaNs and infinities much better on their SSE FPUs than on their x87 FPUs. NaNs and infinities have long been handled at full speed on this floating-point unit. However denormals are still a problem.

On Core 2 processors the worst-case I have measured is a 175 times slowdown, on SSE addition and multiplication.

On SandyBridge Intel has fixed this for addition – I was unable to produce any slowdown on ‘addps’ instructions. However SSE multiplication (‘mulps’) on Sandybridge has about a 140 cycle penalty if one of the inputs or results is a denormal.

Denormal slowdown – is it a real problem?

For some workloads – especially those with poorly chosen ranges – the performance cost of denormals can be a huge problem. But how do you know? By temporarily turning off denormal support in the SSE and SSE2 FPUs with _controlfp_s:

#include <float.h>
// Flush denormals to zero, both operands and results 
_controlfp_s( NULL, _DN_FLUSH, _MCW_DN );// Put denormal handling back to normal. 
_controlfp_s( NULL, _DN_SAVE, _MCW_DN );

This code does not affect the x87 FPU which has no flag for suppressing denormals. Note that 32-bit x86 code on Windows always uses the x87 FPU for some math, especially with VC++ 2010 and earlier. Therefore, running this test on a 64-bit process may provide more useful results.

If your performance increases noticeably when denormals are flushed to zero then you are inadvertently creating or consuming denormals to an unhealthy degree.

If you want to find out exactly where you are generating denormals you could try enabling the underflow exception, which triggers whenever one is produced. To do this in a useful way you would need to record a call stack and then continue the calculation, in order to gather statistics about where the majority of the denormals are produced. Alternately you could monitor the underflow bit to find out which functions set it. See Exceptional Floating Point for some thoughts on this, or read this paper.

Don’t disable denormals

Once you prove that denormals are a performance problem you might be tempted to leave denormals disabled – after all, it’s faster. But if it gives you a speedup means that you are using denormals a lot, which means that if you disable them you are going to change your results – your math is going to get a lot less accurate. So, while disabling denormals is tempting, you might want to consider investigating to find out why so many of your numbers are so close to zero. Even with denormals in play the accuracy near zero is poor, and you’d be better off staying farther away from zero. You should fix the root cause rather than just addressing the symptoms.

iPhone Development

The Gospel of Treadmill

by noreply@blogger.com (Jeff LaMarche) at May 20, 2012 04:18 PM

Since the treadmill desk experiment I've been engaged in isn't directly related to iPhone Development, I've been trying not to fill up this blog with posts about it, but it has now been several months and I thought one last post on the subject was in order.

I'm still extremely happy with using a treadmill desk and will never willingly go back to full-time sitting. I still sit a few hours a day: I treadmill for about eight hours, six days a week, averaging just under three miles per hour. However, my work days are almost always longer than eight hours, so after that, I switch to sitting. Although my rate of weight loss has slowed (partially attributable to spending a month away from my desk: two weeks in Europe for conferences and two weeks on vacation), my weight is still going in a fairly steady downward motion. The first two months, I averaged between ten and fifteen pounds a month of weight loss. Now, it's closer to eight pounds a month on average (plus I gained a few back while traveling). At this pace, it'll take me a while to get my weight where I want it (in other words, if you're at WWDC and want to find me, you still need to look for a fat guy), but that's okay, because I don't have to think about losing weight. I just go to work. I don't have to remember to go to the gym or to go for a run and I don't have to make time in my day for it. I just go to work, which I have to do anyway and actually enjoy doing.

More important than the number on the scale, though, is how I feel, and I certainly feel better than I did when I was at this same weight on the way up. In fact, physically, I feel better than I have in a decade, despite the fact that I still have a fair bit of weight to lose. For years, I've had pretty serious back problems that trace to an injury I sustained in 1997. Since then, almost any time I've had to do significant lifting or heavy physical labor, I've ended up in agony for a few days, sometimes to the point of not being able to walk; sometimes to the point where the twenty steps from my bed to the bathroom were nearly unbearable.

Last weekend I dug a drainage ditch and lugged about twenty fifty-pound bags of gravel around my property. Six months ago, that effort would've bought me at least a day or two of agony. I woke up last Monday morning feeling fine. No back pain, no soreness, and I haven't been doing any physical exercise except what I do at my treadmill desk. I don't know whether that's because I'm strengthening my back while walking or simply allowing it to heal by not being hunched in a chair all day (or both), but whatever it is, I like it.

But there's one thing that's even better than the way that I'm feeling now: The fact that the success of my experiment has caused a number of other people to join me. I haven't taken a census of who has picked up treadmill desk-ing since I started, but I can think of close to a dozen offhand and several more who I know are contemplating it. Although they deserve the credit for taking the initiative and putting in the work, it's still really gratifying to have been some small factor in other people making the decision to start. And I'm not the only one spreading the Gospel of Treadmill in our community these days. In fact, Dan's tale is awfully similar to mine, except that I never worked at NASA and my weight numbers are a lot higher than his.

If you have questions about treadmill desk-ing, feel free to hit me up on e-mail or on twitter. I'm @jeff_lamarche on Twitter and you can reach me by e-mail at my twitter handle at mac dot com.



Code Corner

The early days (1/10) - the Apple phase

by admin at May 20, 2012 03:49 PM

I wrote the following text in 1998. I found the original version, written in French, on some old backup CD. I thought it was an interesting read so I translated it (as well as I could, sorry for any obvious mistake), edited it a bit, corrected a few facts, and there it is. The story begins [...]

The early days (2/10) - the Amstrad phase

by admin at May 20, 2012 03:48 PM

Soon enough I am back to my father’s place, enjoying a new school holiday period. I am in Fifth Grade. I come back with undisguised pleasure to the Apple and the adult world. And there, I am shocked! Another machine sits next to the well-known Apple IIe keyboard. Black, green, red: I am in front of [...]

The early days (3/10) - the Atari phase

by admin at May 20, 2012 03:47 PM

I heard a rumor. My brother had a friend whose brother had a brand new computer… Intrigued, I arrived at the friend’s place, whose brother was the happy owner of an Atari 520 STF. This was a mythical machine whose prowess I had read about in the first issue of Génération4. But I approached it [...]

The early days (4/10) - from games to demos

by admin at May 20, 2012 03:46 PM

ST games had an interesting new feature: the “cracked by” intros. ST games were unreal for me, coming from the CPC. But these intros were the ultimate form of unreality, unidentified mutant objects that surpassed anything I had ever seen in video games - and I had seen a lot. Better. These intros were better. Better [...]

The early days (5/10) - Holocaust

by admin at May 20, 2012 03:45 PM

The group was born one day at a computer convention, the “Salon de la Micro”, in 1990. I went with a friend, coder-wannabe like me, from High School. Let’s see… I got my “baccalaureat” in 1992, so I was at the time in Tenth Grade. This computer convention was the event of the year for [...]

The early days (6/10) - The Snork Party

by admin at May 20, 2012 03:44 PM

My first coding-party was the Snork. And with it came the pleasant certainty to now formally belong to “the elite”. Being invited to a coding-party felt like a validation, a solid proof that our work was good enough, evidence that in one way or another we were now recognized as peers by people we considered [...]

The early days (7/10) - Choice of Gods

by admin at May 20, 2012 03:43 PM

Our first official demo under the Holocaust label emerged in late 1992. Its name was Choice of Gods, from a Clifford D. Simak novel, even though I got introduced to it through an illustration from Chris Moore. Its gestation was long enough - almost two years - and the childbirth painful. Too ambitious, too much [...]

The early days (8/10) - Rising Force

by admin at May 20, 2012 03:42 PM

The Rising Force episode is one of my fondest coding-related memories. It happened at a coding-party, the Crystal Summer Convention II (CSC2). The Rising Force name obviously comes from Yngwie Malmsteen’s band. Let’s just say that at the time, we were fans. And it seemed to fit us like a glove. (For the record, I [...]

The early days (9/10) - Japtro

by admin at May 20, 2012 03:40 PM

The snippets of code used in Rising Force had not been created expressly for the CSC2. They were taken from a much more ambitious project started earlier, codenamed Japtro. At the time there was a plethora of demos with strange, creative labels. Traditionally it all started with intros and demos. But soon enough some hybrids [...]

The early days (10/10) - Blood

by admin at May 20, 2012 03:39 PM

There was something missing. Just before releasing Japtro we had attended the Intermedia Forum, during which we had discovered the Flipo. This was the first demo from Diamond Design – a bunch of wizards that included, among others, some ex-Oxygene members. That demo was a jewel. They did things that we did not know how [...]

Physics-Based Animation

animationphysics

by Christopher Batty at May 20, 2012 01:43 PM

Junggon Kim, Nancy Pollard

We propose a fast physically based simulation system for skeleton-driven deformable body characters. Our system can generate realistic motions of self-propelled deformable body characters by considering the two-way interactions among the skeleton, the deformable body, and the environment in the dynamic simulation. It can also compute the passive jiggling behavior of a deformable body driven by a kinematic skeletal motion. We show that a well-coordinated combination of (1) a reduced deformable body model with nonlinear finite elements, (2) a linear-time algorithm for skeleton dynamics, and (3) explicit integration can boost simulation speed to orders of magnitude faster than existing methods, while preserving modeling accuracy as much as possible. Parallel computation on the GPU has also been implemented to obtain an additional speedup for complicated characters. Detailed discussions of our engineering decisions for speed and accuracy of the simulation system are presented in the paper. We tested our approach with a variety of skeleton-driven deformable body characters, and the tested characters were simulated in real-time or near real-time.

Fast Simulation of Skeleton-Driven Deformable Body Characters


animationphysics

by Christopher Batty at May 20, 2012 01:41 PM

Jie Tan, Greg Turk, Karen Liu

We present a physically-based system to simulate and control the locomotion of soft body characters without skeletons. We use the finite element method to simulate the deformation of the soft body, and we instrument a character with muscle fibers to allow it to actively control its shape. To perform locomotion, we use a variety of intuitive controls such as moving a point on the character, specifying the center of mass or the angular momentum, and maintaining balance. These controllers yield an objective function that is passed to our optimization solver, which handles convex quadratic program with linear complementarity constraints. This solver determines the new muscle fiber lengths, and moreover it determines whether each point of contact should remain static, slide, or lift away from the floor. Our system can automatically find an appropriate combination of muscle contractions that enables a soft character to fulfill various locomotion tasks, including walking, jumping, crawling, rolling and balancing.

Soft Body Locomotion


GPGPU.org

Benchmarking Analytical Queries on a GPU

by dom at May 20, 2012 08:02 AM

This report describes advantages of using GPUs for analytical queries. It compares performance of the Alenka database engine using a GPU with the performance of Oracle on a  SPARC server. More information on Alenka including source code: https://github.com/antonmks/Alenka

Confetti Special FX

Many Area Lights / Screen-Space Soft Shadows

May 20, 2012 07:01 AM

This is an old demo from the Korean Game Developer Conference 2010. We showed this off during our talk: Many Area Lights / Screen-Space Soft ShadowsMany Area Lights / Screen-Space Soft Shadows

DirectCompute on Intel® Ivy Bridge

May 20, 2012 07:01 AM

Wolfgang wrote a blog entry for INTEL on DirectCompute running on Ivy Bridge http://software.intel.com/en-us/articles/microsoft-directcompute-on-intel-ivy-bridge-processor-graphics/ Let us know what you think.

GDC 2012 Interview

May 20, 2012 07:01 AM

We were interviewed on GDC. I like Gabe Newell’s hat http://software.intel.com/en-us/videos/channel/visual-computing/game-developers-discuss-ivy-bridge-directx11-support-at-gdc-2012/1622190917001

Bitsquid

Playing (with) Video

by Niklas (noreply@blogger.com) at May 20, 2012 07:01 AM

So you want to play some video? Shouldn't be too hard, right? Just download some video playing library and call the play_video() function. Easy-peasy-lemon-squeezy.

Well, you have to make sure that the video is encoded correctly, that the library works on all platforms and plays nice with your memory, file, sound and streaming abstractions, and that the audio and video doesn't desynchronize, which for some inexplicable reason seems to be a huge problem.

But this is just technical stuff. We can deal with that. What is worse is that video playback is also a legal morass.

There are literally thousands of broad patents covering different aspects of video decompression. If you want to do some video coding experiments of your own you will have to read, understand and memorize all these patents so that you can carefully tip-toe your code and algorithms around them.

Of course, if you had a big enough pool of patents of your own you might not have to care as much, since if someone sued you, you could sue them right back with something from your own stockpile. Mutually assured destruction through lawyers. Ah, the wonderful world of software patents.

So, creating your own solution is pretty much out of the question. You have to pick one of the existing alternatives and do the best you can with it. In this article I'm going to look at some different options and discuss the advantages and drawbacks of each one:

  • Just say no

  • Bink

  • Platform specific

  • H.264

  • WebM

There are other alternatives that didn't make it to this list, such as Dirac, Theora, and DivX. I've decided to focus on these five, since in my view H.264 is the best of the commercial formats and WebM the most promising of the "free" ones.

An initial idea might be: Why not just do whatever it is VLC does? Everybody's favorite video player plays pretty much whatever you throw at it and is open source software.

Unfortunately that doesn't work, for two reasons. First, VLC:s code is a mix of GPL and LGPL stuff. Even if you just use the LGPL parts you will run into trouble on platforms that don't support dynamic linking. Second, the VLC team doesn't really care about patents and just infringe away. You can probably not afford to do the same. (As a result, there is a very real threat that VLC might be sued out of existence.)

A quick introduction

Before we start looking at the alternatives I want to say something short about what a video file is, since there is some confusion in the matter, even among educated people.

A video file has three main parts:

  • Video data (H.264, DivX, Theora, VP8, ...)

  • Audio data (MP3, AAC, Vorbis, ...)

  • A container format (Avi, Mkv, MP4, Ogg, ...)

The container format is just a way of packing together the audio and video data in a single file, together with some additional information.

The simplest possible container format would be to just concatenate the audio data to the video data and be done with it. But typically we want more functionality. We want to be able to stream the content, i. e. start playing it before we have downloaded the whole file, which means that audio and video data must be multiplexed. We also want to be able to quickly seek to specific time codes, so we may need an index for that. We might also want things like audio tracks in different languages, subtitling, commentary, DVD menus, etc. Container formats can become quite intricate once you start to add all this stuff.

A common source of confusion is that the extension of a video file (.avi, .mkv, .mp4, .ogg) only tells you the container format, not the codecs used for the audio and video data in the container. So a video player may fail to play a file even though it understands the container format (because it doesn't understand what's inside it).

Option 1: Just say no

Who says there has to be video in a game? The alternative is to do all cut scenes, splash screens, logos, etc in-game and use the regular renderer for everything. As technology advances and real-time visuals come closer and closer in quality to offline renders, this becomes an increasingly attractive option. It also has a number of advantages:

  • You can re-use the in-game content.

  • Production is simpler. If you change something you don't have to re-render the entire movie.

  • You don't have to decide on resolution and framerate, everything is rendered at the user's settings.

  • You can dynamically adapt the content, for example dress the players in their customized gear.

  • Having everything be "in-game visuals" is good marketing.

If I was making a game I would do everything in-game. But I'm not, I'm making an engine. And I can't really tell my customers what they can and cannot do. The fact is that there are a number of legitimate reasons for using video:

  • Some scenes are too complex to be rendered in-game.

  • Producing videos can be simpler than making in-game content, since it is easier to outsource. Anybody can make a video, but only the core team can make in-game content and they may not have much time left on their hands.

  • Playing a video while streaming in content can be used to hide loading times. An in-game scene could be used in the same way, but a high-fidelity in-game scene might require too much memory, not leaving enough for the content that is streaming in.

As engine developers it seems we should at least provide some way of playing video, even if we recommend to our customers to do their cutscenes in-game.

Option 2: Bink

Bink from RAD game tools is as close as you can get to a de facto standard in the games industry, being used in more than 5800 games on 14 different platforms.

The main drawback of Bink is the pricing. At $ 8500 per platform per game it is not exactly expensive, but for a smaller game targeting multiple platforms that is still a noticeable sum.

Many games have quite modest video needs. Perhaps they will just use the video player for a 30 second splash screen at the start of the game and nothing more. Paying $ 34 000 to get that on four platforms seems excessive.

At Bitsquid our goal has always been to develop an engine that works for both big budget and small budget titles. This means that all the essential functionality of an engine (animation, sound, gui, video, etc) should be available to the licensees without any additional licensing costs (above what they are already paying for an engine). Licensees who have special interest in one particular area may very well choose to integrate a special middleware package to fulfill their needs, but we don't want to force everybody to do that.

So, in terms of video, this means that we want to include a basic video player without the $ 8500 price tag of Bink. That video player may not be as performant as Bink in terms of memory and processor use, but it should work well enough for anyone who just wants to play a full screen cutscene or splash screen when the CPU isn't doing much else. People who want to play a lot of video in CPU taxing situations can still choose to integrate Bink. For them, the price and effort will be worth it.

Option 3: Platform specific

One approach to video playing is to not develop a platform-independent library but instead use the video playing capabilities inherent in each platform. For example, Windows has Windows Media Foundation, MacOS has QuickTime, etc.

Using the platform's own library has several advantages. It is free to use, even for proprietary formats, because the platform manufacturers have already payed the license fees for the codecs. (Note though, that for some formats you need a license not just for the player, but for the distribution of content as well.) The implementation is already there, even if the APIs are not the easiest to use.

The biggest advantage is that on low-end platforms, using the built-in platform libraries can give you access to special video decoding hardware. For example, many phones have built-in H.264 decoding hardware. This means you can play video nearly for free, something that otherwise would be very costly on a low-end CPU.

But going platform specific also has a lot of drawbacks. If you target many platforms you have your work cut out for you in integrating all their different video playing backends. It adds an additional chunk of work that you need to do whenever you want to add a new platform. Furthermore, it may be tricky to support the same capabilities on all different platforms. Do they all support the same codecs, or do you have to encode the videos specifically for each platform? Do all platforms support "play to texture" or can you only play the videos full screen? What about the sound? Can you extract that from the video and position it as a regular source that reverbs through your 3D sound world? Some platforms (i.e. Vista) have almost no codecs installed by default, forcing you to distribute codecs together with your content.

Since we are developing a generic engine we want to cover as many platforms as possible and minimize the effort required to move a project from one platform to another. For that reason, we need a platform independent library as the primary implementation. But we might want to complement it with platform specific libraries for low end platforms that have built-in decoding hardware.

Option 4: H.264 (MPEG-4, AVC)

Over the last few years H.264 has emerged as the most popular commercial codec. It is used in Blu-ray players, video cameras, on iTunes, YouTube, etc. If you want a codec with good tool support and high quality, H.264 is the best choice.

However, H.264 is covered by patents. Patents that need to be licensed if you want to use H.264 without risking a lawsuit.

The H.264 patents are managed by an entity known as MPEG LA. They have gathered all the patents that they believe pertain to H.264 in "patent pool" that you can license all at once, with a single agreement. That patent pool contains 1700 patents. Yes, you read that right. The act of encoding/decoding a H.264 file is covered by 1700 patents. You can find the list in all its 97 page glory at http://www.mpegla.com/main/programs/avc/Documents/avc-att1.pdf.

I am not a lawyer, as they say on Slashdot, but this is my best understanding of how this patent game works:

  • Buying a license from MPEG LA gives you the right to use the 1700 patents in the pool.

  • This doesn't mean you can't be sued for patent infringement. Anyone that holds a patent which is not one of the 1700 in the pool could claim that H.264 infringes on it and sue you. That seems unlikely, MPEG LA has made an effort to gather all relevant patents, but there is no way to be certain.

  • MPEG LA doesn't by itself go after people who use H.264 without a license, that is up to the holders of the 1700 patents in the pool.

The licensing terms of H.264 are irritating, but not necessarily a big financial burden:

  • If you distribute an encoder or decoder you can distribute 100 000 copies for free, then you have to pay $ 0.20 per unit.

  • If you distribute a H.264 encoded movie, it is free if it is shorter than 12 minutes, then you have to pay $ 0.02 per copy.

Note that unlike the case with other popular codecs such as MP3, it is not just the decoder/encoder that you need to license, you also need a license just for distributing H.264 content.

From what I've been able to discern, but don't take my word for it, a game that only plays a fixed set of movies/cutscenes would not be regarded as a general decoder (even though it contains decoding software), but rather as content, which means you would pay $0.02 per copy sold if you had more than 12 minutes of video in your game and nothing otherwise (you would still need to obtain a license though).

Of course, if you support H.264, you may also want to support AAC, the standard audio format that accompanies it. AAC is covered by a separate licensing body (Via Licensing) that has its own licensing terms. I haven't investigated them in any great detail.

You have to decide for yourself how well these terms sit with you. At Bitsquid we finally decided that if we should have a standard video playing facility, it should be one that people could use without thinking too much about patents and licensing (to the extent that is possible).

Option 5: VP8 (WebM)

VP8 is a "free" video codec owned by Google. It is covered by patents, but Google has granted free use of those patents and also provides a BSD licensed library libvpx for encoding and decoding video files. The format is also endorsed by the Free Software Foundation.

It is generally acknowledged that when it comes to quality, VP8 is not quite as good as H.264, though the differences are not enormous. So you are trading some visual quality for the convenience of a license free format.

There has been some discussion (most of it about a year ago) about whether VP8 really is unencumbered by patents. MPEG LA claimed that it knew several patents that VP8 was infringing and showed interest in creating a "patent pool" for VP8 similar to the one it holds for H.264. Nothing has come of that yet and MPEG LA has not disclosed which patents it thinks VP8 is infringing, which means that Google cannot really respond to the allegations. It is hard to know how much stock to put in this and whether anything will come of it.

You could argue that with this potential "threat" against VP8, it would be better to use another "free" alternative such as Dirac or Theora. However, there is not much evidence that they would fare better. Everyone who makes a "free" codec tries their best to make sure that they don't infringe on any patents. But with thousands of these patents around, each open to legal interpretation, there is just no way to be sure.

This is just the sad state of affairs of software patents. And you are not safe with the commercial formats either. Even if you have licensed the 1700 patents in the MPEG LA patent pool, someone can still sue you for violating patent number 1701. No one in this business offers indemnification against patent suits. Not Google. Not MPEG LA. Not Bink (I think).

It all becomes a question of risk. Bink has been around a long time without being sued, which is reassuring. VP8 hasn't been around that long.

Will there be patent claims made against VP8? Maybe. Who knows. Similar threats were made against Theora, but nothing happened there. If it does happen, Google will most likely fight back and the whole thing will drag on in the courts. Will there be patent claims against you for using VP8? Seems extremely unlikely. Games are not interesting enough targets. Video decoding is not our main business, and we can easily switch technology if needed. Phone manufacturers, YouTube and TV companies are more interesting targets.

Do you have to care about any of this at all? Up to you to decide.

Our conclusion

None of these alternatives are really attractive, it is more about picking the least worst than finding the best, which is frustrating for a perfectionist with self-worth issues. Good cases can be made for all of them. This is what we have decided:

  • We will provide VP8 decoding on all platforms through libvpx. All other things equal, the "most free" format will give us most flexibility in the long run.

  • We will not (at least not right now) support matroska or other advanced container formats. Instead, we will play the videos from simple IVF streams. Sound will be played as Vorbis files through our regular sound system so we get positioning, reverb, etc.

  • If needed, we will complement this basic approach with platform-specific libraries that take advantage of the hardware decoders on low-end platforms (phones and tablets).

  • Customers that need to play a lot of movies while doing other CPU intense tasks and that aren't happy with the performance of libvpx are recommended to look into Bink.

  • Customers that are worried about "patent risk" with VP8 are recommended to do whatever their lawyers tell them to do. (Use Bink, a platform specific library, obtain a H.264 license or avoid video all together.)

#AltDevBlogADay

Playing (with) Video

by Niklas Frykholm at May 20, 2012 06:49 AM

So you want to play some video? Shouldn’t be too hard, right? Just download some video playing library and call the play_video() function. Easy-peasy-lemon-squeezy.

Well, you have to make sure that the video is encoded correctly, that the library works on all platforms and plays nice with your memory, file, sound and streaming abstractions, and that the audio and video doesn’t desynchronize, which for some inexplicable reason seems to be a huge problem.

But this is just technical stuff. We can deal with that. What is worse is that video playback is also a legal morass.

There are literally thousands of broad patents covering different aspects of video decompression. If you want to do some video coding experiments of your own you will have to read, understand and memorize all these patents so that you can carefully tip-toe your code and algorithms around them.

Of course, if you had a big enough pool of patents of your own you might not have to care as much, since if someone sued you, you could sue them right back with something from your own stockpile. Mutually assured destruction through lawyers. Ah, the wonderful world of software patents.

So, creating your own solution is pretty much out of the question. You have to pick one of the existing alternatives and do the best you can with it. In this article I’m going to look at some different options and discuss the advantages and drawbacks of each one:

  • Just say no

  • Bink

  • Platform specific

  • H.264

  • WebM

There are other alternatives that didn’t make it to this list, such as Dirac, Theora, and DivX. I’ve decided to focus on these five, since in my view H.264 is the best of the commercial formats and WebM the most promising of the “free” ones.

An initial idea might be: Why not just do whatever it is VLC does? Everybody’s favorite video player plays pretty much whatever you throw at it and is open source software.

Unfortunately that doesn’t work, for two reasons. First, VLC:s code is a mix of GPL and LGPL stuff. Even if you just use the LGPL parts you will run into trouble on platforms that don’t support dynamic linking. Second, the VLC team doesn’t really care about patents and just infringe away. You can probably not afford to do the same. (As a result, there is a very real threat that VLC might be sued out of existence.)

A quick introduction

Before we start looking at the alternatives I want to say something short about what a video file is, since there is some confusion in the matter, even among educated people.

A video file has three main parts:

  • Video data (H.264, DivX, Theora, VP8, …)

  • Audio data (MP3, AAC, Vorbis, …)

  • A container format (Avi, Mkv, MP4, Ogg, …)

The container format is just a way of packing together the audio and video data in a single file, together with some additional information.

The simplest possible container format would be to just concatenate the audio data to the video data and be done with it. But typically we want more functionality. We want to be able to stream the content, i. e. start playing it before we have downloaded the whole file, which means that audio and video data must be multiplexed. We also want to be able to quickly seek to specific time codes, so we may need an index for that. We might also want things like audio tracks in different languages, subtitling, commentary, DVD menus, etc. Container formats can become quite intricate once you start to add all this stuff.

A common source of confusion is that the extension of a video file (.avi, .mkv, .mp4, .ogg) only tells you the container format, not the codecs used for the audio and video data in the container. So a video player may fail to play a file even though it understands the container format (because it doesn’t understand what’s inside it).

Option 1: Just say no

Who says there has to be video in a game? The alternative is to do all cut scenes, splash screens, logos, etc in-game and use the regular renderer for everything. As technology advances and real-time visuals come closer and closer in quality to offline renders, this becomes an increasingly attractive option. It also has a number of advantages:

  • You can re-use the in-game content.

  • Production is simpler. If you change something you don’t have to re-render the entire movie.

  • You don’t have to decide on resolution and framerate, everything is rendered at the user’s settings.

  • You can dynamically adapt the content, for example dress the players in their customized gear.

  • Having everything be “in-game visuals” is good marketing.

If I was making a game I would do everything in-game. But I’m not, I’m making an engine. And I can’t really tell my customers what they can and cannot do. The fact is that there are a number of legitimate reasons for using video:

  • Some scenes are too complex to be rendered in-game.

  • Producing videos can be simpler than making in-game content, since it is easier to outsource. Anybody can make a video, but only the core team can make in-game content and they may not have much time left on their hands.

  • Playing a video while streaming in content can be used to hide loading times. An in-game scene could be used in the same way, but a high-fidelity in-game scene might require too much memory, not leaving enough for the content that is streaming in.

As engine developers it seems we should at least provide some way of playing video, even if we recommend to our customers to do their cutscenes in-game.

Option 2: Bink

Bink from RAD game tools is as close as you can get to a de facto standard in the games industry, being used in more than 5800 games on 14 different platforms.

The main drawback of Bink is the pricing. At $ 8500 per platform per game it is not exactly expensive, but for a smaller game targeting multiple platforms that is still a noticeable sum.

Many games have quite modest video needs. Perhaps they will just use the video player for a 30 second splash screen at the start of the game and nothing more. Paying $ 34 000 to get that on four platforms seems excessive.

At Bitsquid our goal has always been to develop an engine that works for both big budget and small budget titles. This means that all the essential functionality of an engine (animation, sound, gui, video, etc) should be available to the licensees without any additional licensing costs (above what they are already paying for an engine). Licensees who have special interest in one particular area may very well choose to integrate a special middleware package to fulfill their needs, but we don’t want to force everybody to do that.

So, in terms of video, this means that we want to include a basic video player without the $ 8500 price tag of Bink. That video player may not be as performant as Bink in terms of memory and processor use, but it should work well enough for anyone who just wants to play a full screen cutscene or splash screen when the CPU isn’t doing much else. People who want to play a lot of video in CPU taxing situations can still choose to integrate Bink. For them, the price and effort will be worth it.

Option 3: Platform specific

One approach to video playing is to not develop a platform-independent library but instead use the video playing capabilities inherent in each platform. For example, Windows has Windows Media Foundation, MacOS has QuickTime, etc.

Using the platform’s own library has several advantages. It is free to use, even for proprietary formats, because the platform manufacturers have already payed the license fees for the codecs. (Note though, that for some formats you need a license not just for the player, but for the distribution of content as well.) The implementation is already there, even if the APIs are not the easiest to use.

The biggest advantage is that on low-end platforms, using the built-in platform libraries can give you access to special video decoding hardware. For example, many phones have built-in H.264 decoding hardware. This means you can play video nearly for free, something that otherwise would be very costly on a low-end CPU.

But going platform specific also has a lot of drawbacks. If you target many platforms you have your work cut out for you in integrating all their different video playing backends. It adds an additional chunk of work that you need to do whenever you want to add a new platform. Furthermore, it may be tricky to support the same capabilities on all different platforms. Do they all support the same codecs, or do you have to encode the videos specifically for each platform? Do all platforms support “play to texture” or can you only play the videos full screen? What about the sound? Can you extract that from the video and position it as a regular source that reverbs through your 3D sound world? Some platforms (i.e. Vista) have almost no codecs installed by default, forcing you to distribute codecs together with your content.

Since we are developing a generic engine we want to cover as many platforms as possible and minimize the effort required to move a project from one platform to another. For that reason, we need a platform independent library as the primary implementation. But we might want to complement it with platform specific libraries for low end platforms that have built-in decoding hardware.

Option 4: H.264 (MPEG-4, AVC)

Over the last few years H.264 has emerged as the most popular commercial codec. It is used in Blu-ray players, video cameras, on iTunes, YouTube, etc. If you want a codec with good tool support and high quality, H.264 is the best choice.

However, H.264 is covered by patents. Patents that need to be licensed if you want to use H.264 without risking a lawsuit.

The H.264 patents are managed by an entity known as MPEG LA. They have gathered all the patents that they believe pertain to H.264 in “patent pool” that you can license all at once, with a single agreement. That patent pool contains 1700 patents. Yes, you read that right. The act of encoding/decoding a H.264 file is covered by 1700 patents. You can find the list in all its 97 page glory at http://www.mpegla.com/main/programs/avc/Documents/avc-att1.pdf.

I am not a lawyer, as they say on Slashdot, but this is my best understanding of how this patent game works:

  • Buying a license from MPEG LA gives you the right to use the 1700 patents in the pool.

  • This doesn’t mean you can’t be sued for patent infringement. Anyone that holds a patent which is not one of the 1700 in the pool could claim that H.264 infringes on it and sue you. That seems unlikely, MPEG LA has made an effort to gather all relevant patents, but there is no way to be certain.

  • MPEG LA doesn’t by itself go after people who use H.264 without a license, that is up to the holders of the 1700 patents in the pool.

The licensing terms of H.264 are irritating, but not necessarily a big financial burden:

  • If you distribute an encoder or decoder you can distribute 100 000 copies for free, then you have to pay $ 0.20 per unit.

  • If you distribute a H.264 encoded movie, it is free if it is shorter than 12 minutes, then you have to pay $ 0.02 per copy.

Note that unlike the case with other popular codecs such as MP3, it is not just the decoder/encoder that you need to license, you also need a license just for distributing H.264 content.

From what I’ve been able to discern, but don’t take my word for it, a game that only plays a fixed set of movies/cutscenes would not be regarded as a general decoder (even though it contains decoding software), but rather as content, which means you would pay $0.02 per copy sold if you had more than 12 minutes of video in your game and nothing otherwise (you would still need to obtain a license though).

Of course, if you support H.264, you may also want to support AAC, the standard audio format that accompanies it. AAC is covered by a separate licensing body (Via Licensing) that has its own licensing terms. I haven’t investigated them in any great detail.

You have to decide for yourself how well these terms sit with you. At Bitsquid we finally decided that if we should have a standard video playing facility, it should be one that people could use without thinking too much about patents and licensing (to the extent that is possible).

Option 5: VP8 (WebM)

VP8 is a “free” video codec owned by Google. It is covered by patents, but Google has granted free use of those patents and also provides a BSD licensed library libvpx for encoding and decoding video files. The format is also endorsed by the Free Software Foundation.

It is generally acknowledged that when it comes to quality, VP8 is not quite as good as H.264, though the differences are not enormous. So you are trading some visual quality for the convenience of a license free format.

There has been some discussion (most of it about a year ago) about whether VP8 really is unencumbered by patents. MPEG LA claimed that it knew several patents that VP8 was infringing and showed interest in creating a “patent pool” for VP8 similar to the one it holds for H.264. Nothing has come of that yet and MPEG LA has not disclosed which patents it thinks VP8 is infringing, which means that Google cannot really respond to the allegations. It is hard to know how much stock to put in this and whether anything will come of it.

You could argue that with this potential “threat” against VP8, it would be better to use another “free” alternative such as Dirac or Theora. However, there is not much evidence that they would fare better. Everyone who makes a “free” codec tries their best to make sure that they don’t infringe on any patents. But with thousands of these patents around, each open to legal interpretation, there is just no way to be sure.

This is just the sad state of affairs of software patents. And you are not safe with the commercial formats either. Even if you have licensed the 1700 patents in the MPEG LA patent pool, someone can still sue you for violating patent number 1701. No one in this business offers indemnification against patent suits. Not Google. Not MPEG LA. Not Bink (I think).

It all becomes a question of risk. Bink has been around a long time without being sued, which is reassuring. VP8 hasn’t been around that long.

Will there be patent claims made against VP8? Maybe. Who knows. Similar threats were made against Theora, but nothing happened there. If it does happen, Google will most likely fight back and the whole thing will drag on in the courts. Will there be patent claims against you for using VP8? Seems extremely unlikely. Games are not interesting enough targets. Video decoding is not our main business, and we can easily switch technology if needed. Phone manufacturers, YouTube and TV companies are more interesting targets.

Do you have to care about any of this at all? Up to you to decide.

Our conclusion

None of these alternatives are really attractive, it is more about picking the least worst than finding the best, which is frustrating for a perfectionist with self-worth issues. Good cases can be made for all of them. This is what we have decided:

  • We will provide VP8 decoding on all platforms through libvpx. All other things equal, the “most free” format will give us most flexibility in the long run.

  • We will not (at least not right now) support matroska or other advanced container formats. Instead, we will play the videos from simple IVF streams. Sound will be played as Vorbis files through our regular sound system so we get positioning, reverb, etc.

  • If needed, we will complement this basic approach with platform-specific libraries that take advantage of the hardware decoders on low-end platforms (phones and tablets).

  • Customers that need to play a lot of movies while doing other CPU intense tasks and that aren’t happy with the performance of libvpx are recommended to look into Bink.

  • Customers that are worried about “patent risk” with VP8 are recommended to do whatever their lawyers tell them to do. (Use Bink, a platform specific library, obtain a H.264 license or avoid video all together.)

This has also been posted to The Bitsquid blog.



Morgan3D / Twitter

morgan3d: RT @mattpharr: I just learned that Physically Based Rendering is now available as a straight-up PDF: http://t.co/zemWXyMA. It looks quit ...

May 20, 2012 06:31 AM

morgan3d: RT @mattpharr: I just learned that Physically Based Rendering is now available as a straight-up PDF: http://t.co/zemWXyMA. It looks quit ...

iPhone Development Tutorials and Programming Tips

How Many Downloads It Takes To Hit The Top 25 In Each App Store Category

by John at May 20, 2012 12:01 AM

I’ve received a few requests for more marketing resources on this site after posting the list of app review sites, and came across a post containing some information that is useful for anyone promoting iOS apps.

Something that pretty much everyone who is releasing an app wants to know is what exactly will it take to reach the top 25 downloads within an app store category and know how much promotion is necessary – and get a better idea of an app’s potential.

This information is from a company known as Distimo that provides app store analytics and provide a good insight into the download requirements for a free or paid app to hit the top 25 in each category.

Here are a couple of the charts from the Distimo blog showing the download requirements for free and paid apps:



You can read the full post from Distimo on their blog here with more detailed breakdowns including charts for specific game categories.

While these are averages based on a sample of information – it’s always good to have a target to shoot for. It’s interesting to see the disproportions between paid and free apps in some categories.

©2012 iPhone, iOS 5, iPad SDK Development Tutorial and Programming Tips. All Rights Reserved.

.
DeliciousTwitterFacebookLinkedInEmail


Humus

Anti-aliasing – The past, present and the future

May 19, 2012 11:58 PM



Geeks3D Forums

NVIDIA drivers 302.11 for Linux, FreeBSD and Solaris

May 19, 2012 01:44 PM

Quote
Changelog 302.11
    * Added support for calculating the physical size and DPI of each
      RandR 1.2 Output using the EDID Detailed Timing Description.

    * Fixed a bug that prevented a workaround for the invalid EDID in certain
      AUO lap...

GPGPU.org

5th Workshop on UnConventional High Performance Computing 2012

by dom at May 19, 2012 09:49 AM

Together with EuroPar-12, the 5th Workshop on UnConventional High Performance Computing 2012 (UCHPC 2012) will take place on August 27/28 at Rhodes Island, Greece. The workshop tries to capture solutions for HPC which are unconventional today but could become conventional and significant tomorrow. While GPGPU is already used a lot in HPC, there still are all kind of issues around best exploitation and productivity for the programmer. Submission deadline: June 6, 2012. For more details, see
http://www.lrr.in.tum.de/~weidendo/uchpc12

Geeks3D Forums

Fraps 3.5.1 Released

May 19, 2012 06:29 AM

Fraps 3.5.1 - 18th May 2012

- Added support for exFAT drives writing larger than 4 Gigabytes
- Fixed crash when large custom resolutions used in game



Game From Scratch

This is why I say C++ isn’t a beginner friendly language

by Mike@gamefromscratch.com at May 19, 2012 01:17 AM

 

 

You often hear people say things like “It’s memory management that makes C++ difficult”, this is patently false.  What makes C++ so incredibly difficult for new users ( and experienced ones! ) is the complexity.  Note, I didn’t say difficulty, I said complexity.

 

Today was one of those perfect examples, one of those experiences that I want to point at and say “THIS IS WHY YOU SHOULD LEARN WITH A DIFFERENT LANGUAGE!”.  Yes, that was shouting. 

 

 

Here’s the story.  Today I had a reader request guidance on how to make a release build of my C++ tutorial.  This was a really good request, so I put it together in tutorial form.  Something quickly dawned on me… I’ve never built this tutorial in release mode.  It was pretty obvious that I hadn’t because, well, it didn’t work!   Oops, my bad.

 

 

Let’s take a look at what happened, I want to see if you can guess what the problem is.  A gold star to whoever gets it before I reveal the answer at the end of this post.  That gold star offer applies to C++ veterans and new developers alike, this is a somewhat tricky one, especially considering the starting point!

 

 

So, I was building Pang 9 ( my Pong tutorial ) in release mode.  I downloaded the project files from here if you want to follow along at home.  I simply extracted the project, then I downloaded the full SFML 1.6 SDK, imported the Visual Studio 2008 project into Visual Studio 2010 and compiled the DLLs for multithreaded release mode, and copied those DLLs into my release directory.  Code compiles just fine under release, so then I run it ( within Visual Studio ) and:

 

 

image 

 

Uhoh… this can’t be good!  The offending line of code is right here:

 

sf::Music* SoundFileCache::GetSong(std::string soundName) const { std::map<std::string,sf::Music *>::iterator itr = _music.find(soundName); if(itr == _music.end()) { sf::Music * song = new sf::Music(); if(!song->OpenFromFile(soundName)) <----- EXCEPTION IS HERE { delete song; throw SoundNotFoundExeception( soundName + " was not found in call to SoundFileCache::GetSong"); } ..... SNIP ......

Well, there is a big bad pointer right above the line, that seems an obvious candidate doesn’t it?   Well don’t waste your time on that train of thought, the pointer isn’t the issue.  The .find call seems a likely candidate too, it isn’t though.

 

Hmm, lets start looking there, ill set a breakpoint and trace into the _music.find() call.  Oh yeah, this a release mode only bug, so our hands our tied on the debugging side of things… great.  Alright, lets take a closer look.

 

image

 

 

<Bad Ptr>.  Oooh, that’s not good.  Obviously I’ve done a bad allocation here somewhere, but that just doesn’t make sense, not with the way this data type works.  In fact, the only place these pointers are even allocated is in this actual method, and we haven’t even got to that code yet!

 

For some reason, our empty map ( it hasn’t been used yet, this is the first call ), is returning a Bad Ptr instead of working as expected.  This can’t be right?  But wait… that’s a red herring anyways, isn’t it, after all our exception has nothing to do with the Bad Ptr or the std::map at all, this is just the IDE sending us on a wild goose chase. We can literally boil it down to exactly two lines of code:

 

sf::Music * song = new sf::Music(); if(!song->OpenFromFile(soundName))

 

Now we are getting somewhere, we have isolated our reproduce case down to exactly a two line program!  Hmmm, both are just standard SFML calls.  Short of being out of memory, nothing here should be able to fail.  So then, what the hell is causing this problem???

 

 

// ANSWER TIME, got your guess yet?  Did you get it right and I owe you a gold star?  Let’s find out!

 

 

Well, long story short, it’s our SFML dlls built for Visual Studio 2010.  See, this is our first method call into any SFML DLL and it’s causing an explosion… but, why the heck is that???

 

 

Well, lets take a trip over to the SFML 1.6 project and check out how I built them.  All I did was download the SFML 1.6 project for Visual Studio 2008, delete all the examples and set my build mode to Release DLL and compiled everything.  Hidden between the various warnings was one very very very important but cryptic message:

 

image

 

A bunch of warnings as a side effect of the import process, and one extremely important warning… the ahah moment if you will:

 

Warning    8    warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library    C:\temp\t\SFML-1.6\build\vc2008\LINK    sfml-graphics

 

Say what?

 

 

Now here is the thing, with C++ libraries need to be IDENTICAL.  You link debug to debug, multithread to multithread, etc…  At the same time, you have to link Visual Studio 2010 binaries to Visual Studio 2010 binaries ( although not all versions are binary incompatible, VS 2005 and 2008 could share libraries I believe ), and this here is the source of all the trouble!

 

The sfml-graphics graphics library statically links to a lib called freetype, and this library isn’t compatible with Visual Studio 2010.  Download the newest version, extract it into the extlibs folder, recompile and PRESTO, problem solved.

 

 

 

So there you go, an unhandled exception in a call to open an audio file ended up actually being caused by a statically linked font library in a 3rd party graphics dll!

 

 

Still think it’s memory management that makes C++ tricky for beginners?  The biggest problem is, new developers run into this stuff almost immediately.  You need to conquer so much to get up and running with C++, the linker being one of the earliest and most daunting obstacles.  I honestly don’t expect anyone with a few months of programming experience to have been able to puzzle this one out.  It’s exactly these kinds of things that make people throw up their hands saying “Oh screw it, programming is too hard!”.  I don’t like a quitter, but frankly in this case… they are right!

 

 

Of course, this is by no means limited to C++.  I have had very similar experiences with Java where some XML file feeding another XML file feeding a code generator called by Maven puked out a message code like “Error, unknown problem”.  Thing is, with no other programming languages do you encounter this kind of problem until you are ready to deal with the complexity.  In C++, you start dealing with this crap on day 1.

 

So this, is one such reason why I say C++ isn’t a beginner friendly language!

iPhone Development Tutorials and Programming Tips

Library For Easily Working With Ruby On Rails Apps With Objective-C Code Generation

by John at May 18, 2012 10:34 PM

There are a number of excellent open source libraries out there for communicating with RESTful services such as the excellent MKNetworkKit, and AFNetworking.

Today I came across an open source framework for communicating with Rails servers offering a vast number of features for easily communicating with Ruby On Rails projects.  The library can even auto-generate Objective-C code, and for those who want to stick with Ruby now supports RubyMotion.

The library is NSRails from Dan Hassin.

Here’s a list of features taken from the Github page:

- High-level API, yet flexible enough even to work with any RESTful server
- Highly customizable “syncing” with your Rails attributes
- Nesting supported for relations like has-many, belongs-to, etc
- Asynchronous requests
- Autogenerate NSRails-ready Objective-C classes from a Rails project
- Supported in RubyMotion and MacRuby

Here’s a video demonstrating how easy it is to integrate a Rails web based service with an iOS app using NSRails:

You can find the source repository here, and extensive documentation is available in the wiki.

You can find the NSRails homepage here.

Definitely worth an extended look.

©2012 iPhone, iOS 5, iPad SDK Development Tutorial and Programming Tips. All Rights Reserved.

.
DeliciousTwitterFacebookLinkedInEmail


AMD at Play

DiRT Showdown

by David Doel at May 18, 2012 10:00 PM

Get Dirt Showdown Free

Buy a select AMD product and receive a copy of Dirt® Showdown™ FREE!

Overview

>> Play the demo on Steam!
DiRT Showdown is a brand new dive in and drive adrenaline rush of speed, style and destruction from the creators of the multi-award winning DiRT series. Players jump into a new world of arcade racing with pick up and play controls, speeding, tricking and smashing their way to ‘Showdown’ finals to compete against rivals in front of thousands of fans in a vibrant festival atmosphere.

There are three broad categories to DiRT Showdown’s stunning world of action-sport racing. Players will use nitrous to blast past rivals and negotiate courses filled with ramps, multiple routes and obstacles in racing events. Gaming’s most advanced damage engine is pushed to its limits in demolition derby events, where players smash and crash their way to victory in jaw-dropping, bone-jarring style. Finally, in Hoonigan events gamers can demonstrate their freestyle driving skill in huge free-roaming stunt parks with new accessible controls.

In the career mode, globe-trotting Showdown players will travel from Miami to San Francisco, London to Tokyo and other famous locations earning the adulation of the crowd at hyper-energised, frenzied, unsanctioned race events. Over 50 different events across four championships challenge gamers in a variety of conditions – sun, snow, and rain -- through the day and under the floodlights at night.

With an exciting mix of licensed and bespoke cars and powered by the EGO Game Technology Platform for phenomenal graphical performance and stunning damage, DiRT Showdown will be the new standard for arcade driving delirium.

www.youtube.com/watch?v=k7kqc69nVv0

Features

Features:
  • The talent that brought the world Colin McRae DiRT, Colin McRae DiRT 2, The BAFTA Award winning Race Driver GRID™ and DiRT 3 (Metacritic: 87) is developing DiRT Showdown. Using the award winning EGO Game Technology Platform known for its killer visuals, weather, and damage system, DiRT Showdown sets the new technical benchmark for arcade racing thrills.
  • Accessible, pick up and play controls combine with spectacular events and stunning graphics to deliver high octane, dive in and drive thrills from event one.
  • Ken Block’s all new Gymkhana 4 HFHV Ford Fiesta debuts alongside a varied selection of vehicles across a range of classes. From saloons and muscle cars to pick-up trucks, hearses and vans.
  • Courses are littered with obstacles, pinch points, multiple-routes and ramps.
  • Players will crash, smash and bash their way through a range of demolition derby themed events.
  • A new accessible handling system lets players let loose in free-roaming, freestyle stunt parks. Perform trick runs to competitive stunt events, explorations challenges and more.
  • Issue Showdown Challenges so players can test themselves against their friends whether they are online or not.
  • From San Francisco to Miami, Nevada to Michigan, Tokyo to London, each of DIRT Showdown’s locations delivers a unique atmosphere for a wide range of events.
  • Whenever a large crash happens, players can see ‘kill cams’ from several angles showing how the carnage unfolds. In single player events, gamers can also upload clips direct to YouTube.

DirtShowdown1
DirtShowdown2
DirtShowdown3
DirtShowdown4
DirtShowdown5



Developed by: Codemasters

Published by: Codemasters

© 2012 The Codemasters Software Company Limited (“Codemasters”). All rights reserved. “Codemasters”®, the Codemasters logo and “DiRT”® are registered trademarks owned by Codemasters. “DiRT Showdown”™ and “EGO”™ are trademarks of Codemasters. Ford Motor Company Trademarks and Trade Dress used under license to Codemasters. All other copyrights or trademarks are the property of their respective owners and are being used under license. Developed and published by Codemasters.



Procedural World

Radiosity Screenshot

by MCeperoG (noreply@blogger.com) at May 18, 2012 08:01 PM


Here is a quick update on the radiosity. In this image there is only ambient light. Sunlight will make it more interesting for sure.


Game From Scratch

Applying FarSeer Physics to PSSDK

by Mike@gamefromscratch.com at May 18, 2012 06:48 PM

 

Someone on the PlayStation Suite forum recently asked if there was an implementation of the Box2D physics library that would work with PS Suite.  Initially Box2Dx looked encouraging, but in the end it relied on some unsafe ( as in the keyword ) code, plus it was quite a bit out of date.  In my searching though, I did stumble upon the Farseer XNA a prominent XNA physics library.  It depends on some XNA data types, but nicely, the library includes them!

 

So I set about trying to get FarSeer working with PlayStation Suite, which proved to be a fairly simple task.

 

First you need to create a PlayStation suite library, then copy across all of the code/folders from the archive.  Make sure it is FarSeer Physics Engine class you download, the other versions have dependencies that don’t work.  Now you have to make one very small code change.  You need to open DynamicTreeBroadPhase.cs and change internal struct Pair : … to public, like this:

 

public struct Pair : IComparable<Pair> //MJF made public

 

And that’s it.

 

Compile it as a PlayStation Suite library and add it as a reference to your project and you are off to the races.  You can download the DLL I compiled for PlayStation Suite right here if you don’t want to or can’t build it yourself.

 

Now, the reason I’m not really calling this a tutorial is, I haven’t bothered to actually take the time to figure out how to use FarSeer, I just modified their sample enough to verify it runs on the PlayStation Vita.  Due to the screwy decision to make the origin the bottom left, you need to alter their examples accordingly, but otherwise everything works fine.  Here is a sample of extremely poorly configured gravity.

 

using System; using System.Collections.Generic; using Sce.Pss.Core; using Sce.Pss.Core.Environment; using Sce.Pss.Core.Graphics; using Sce.Pss.Core.Input; using Sce.Pss.HighLevel.GameEngine2D; using Sce.Pss.HighLevel.GameEngine2D.Base; using FarseerPhysics.Common; using FarseerPhysics.Controllers; using FarseerPhysics.Dynamics; using FarseerPhysics.Factories; namespace FarTest { public class AppMain { private const float MeterInPixels = 64f; public static void Main() { Director.Initialize(); Scene scene = new Scene(); scene.Camera.SetViewFromViewport(); Vector2 midPoint = scene.Camera.CalcBounds().Center; // Create circle and ground sprites Texture2D texture = new Texture2D("/Application/circleSprite.png",false); TextureInfo ti = new TextureInfo(texture); SpriteUV sprite = new SpriteUV(ti); sprite.Quad.S = new Vector2(98,98); sprite.Position = new Vector2(midPoint.X - 98/2,Director.Instance.GL.Context.GetViewport().Height-98); Texture2D texture2 = new Texture2D("/Application/groundSprite.png",false); TextureInfo ti2 = new TextureInfo(texture); SpriteUV sprite2 = new SpriteUV(ti); sprite2.Quad.S = new Vector2(512,64); sprite2.Position = new Vector2(midPoint.X - 512/2,0); //Physics time World world = new World(new Microsoft.Xna.Framework.Vector2(0,-10)); Body circleBody = BodyFactory.CreateCircle(world,96f /2f,1f, new Microsoft.Xna.Framework.Vector2(sprite.Position.X,sprite.Position.Y)); circleBody.BodyType = BodyType.Dynamic; Body groundBody = BodyFactory.CreateRectangle(world,512f, 64f/2,1f, new Microsoft.Xna.Framework.Vector2(sprite2.Position.X,sprite2.Position.Y)); ; groundBody.IsStatic = true; groundBody.Restitution = 0.9f; groundBody.Friction = 0.4f; // Now update the sprite //circleBody.ApplyLinearImpulse(new Microsoft.Xna.Framework.Vector2(0,-50)); sprite.Schedule( (dt) => { sprite.Position = new Vector2(circleBody.Position.X,circleBody.Position.Y); world.Step(dt); }); scene.AddChild(sprite); scene.AddChild (sprite2); Director.Instance.RunWithScene(scene); } } }

 

 

And here are the results:

 

physics

 

 

The only real gotcha in the code is to make sure you use the Microsoft.Xna.Framework.Vector2 when calling FarSeer code and PSS’s Vector2 when dealing with PSS code.

 

 

Obviously, my ground is a bit bouncy, my gravity is a bit wonky, but it is a working physics simulation! Smile

Geeks3D Forums

AMD APP SDK 2.7

May 18, 2012 05:55 PM

Direct downloads:
http://developer.amd.com/Downloads/AMD-APP-SDK-v2.7-Windows-64.exe
http://developer.amd.com/Downloads/AMD-APP-SDK-v2.7-Windows-32.exe
http://developer.amd.com/Downloads/AMD-APP-SDK-v2.7-lnx64.tgz
http://developer.amd.com/Downloads/AMD...



XNA Creators Club - News List

Have you updated to Windows Phone 7.5?

May 18, 2012 04:35 PM

Soon you'll need Windows Phone 7.5 installed on your phone to buy, download, or update apps from Marketplace.

Game From Scratch

New C++ Tutorial post. Covers compiling for release and distribution

by Mike@gamefromscratch.com at May 18, 2012 03:49 PM

 

 

At the request of a reader I put together a guide on how to build your SFML 1.6 project in release mode, then how to package it for distribution.

 

It’s part of the main tutorial series, but can be accessed directly here.  If you are looking into how to distribute a release version of your SFML game, be sure to check it out

 

 

In doing so, I ran into a NASTY C++ related problem, which I will mention in a post shortly!

OpenGL

VR Bathroom Design Software joins VR Kitchen

May 18, 2012 02:38 PM

Following the successful launch of VR Kitchen (News Feb 07), VR Bathroom is now available. Professional bathroom designers can use the OpenGL capabilities of their PC to show customers a high quality walk-through presentation of their new bathroom. VR Bathroom Pro employs a simple drag and drop interface for adding items from an extensive library of bathroom products.



Planetary engine Proland released in Open Source

May 18, 2012 02:37 PM

INRIA is pleased to announce that Proland has been released as Open Source. Proland is a C++/OpenGL library for the real-time realistic rendering of very large and detailed 3D natural scenes on GPU. It is capable of rendering entire planets from ground to space. Proland is released under a dual GPLv3/commercial license. You can try it by downloading the precompiled Windows demo.

I Need to Make Games

Origin Story: Brian Clarke, Assoc. Development Director of Art | Trion

by Destin Bales at May 18, 2012 02:01 PM

What was your first job in the gaming industry?

I started as a terrain artist for Mythic Entertainment on Warhammer Online.

 

Did you find it difficult to get your first job given that you had no prior experience?

I consider myself very fortunate. I was actually approached for the job by one of the artists already at Mythic. The reason I was found though, was that I had posted my level design class final up on a popular forum call Polycount. If anything, that taught me how important it was to network and get your portfolio and other work out there for others to see.

 

What sort of training or education did you complete in advance of applying for your first position?

I went to an art school for two years to learn the tools that I would use as an artist in the game industry.

 

What is your job today?

Associate Development Director of Art at Trion for Rift.

 

For someone interested in starting a career making games today what is the main piece of advice you would offer them? 

One of the major factors for being a good artist in the game industry is being able to accept critique. Posting work on public forums for others to critique then making changes to your work from that feedback, I feel, is essential for growth and it shows everyone (including potential employers) that you are serious about what you do. It takes a lot to stay on top of what’s new in the art side of video games so communication and willingness to learn are very important especially after school. You never finish learning art.


iPhone Development Tutorials and Programming Tips

Open Source: Nifty Eye-Catching Animated Tile Menu Control

by John at May 18, 2012 06:35 AM

Some time ago I listed a library for creating animated pop out curved menus inspired by the Path 2 app.

Today I came across another library that in my opinion allows you to make menus that are even more eye-catching allowing you to create an animated menu using a set of icons.

You can even set the menus up to be left and right handed, have multiple pages of icons (ie. have one tile open another menu of tiles).

There are so many possibilities with this control – you ‘ll need to see it in action to get a better idea:

You can find the component on Github here.

Matt also has an interesting write-up about his thoughts on designing the control on his blog which makes for a very interesting read.

©2012 iPhone, iOS 5, iPad SDK Development Tutorial and Programming Tips. All Rights Reserved.

.
DeliciousTwitterFacebookLinkedInEmail




Gamasutra Feature Articles

A Personal Journey: Jenova Chen's Goals for Games

May 18, 2012 04:00 AM

I'm about half way through my interview with Jenova Chen when I get the impression that I've annoyed him. Talking about Thatgamecompany, and the limitations of working with only eight other people, I ask Chen if, given the resources, he'd like to develop a more mainstream game. "Well," he replies, "what is mainstream?" Immediately, I can sense his frustration: Journey, his latest game, has just become the fastest-selling PlayStation Network release ever. The many months ...

Icare3D Blog

GTC 2012 Talk: "Octree-Based Sparse Voxelization for Real-Time Global Illumination"

by Cyril Crassin (noreply@blogger.com) at May 18, 2012 04:54 AM

This week I gave a talk at the NVIDIA GPU Technology Conference about a fast sparse voxelization technique that I worked on at NVIDIA in the context of my real-time global illumination approach (using voxel cone-tracing inside a sparse voxel octree).

Slides: (PPTX, 50MB), (PDF, 7MB)
Video (if you want to enjoy my french accent): http://www.gputechconf.com/gtcnew/on-demand-gtc.php#1465

In this talk I first give an overview of the real-time GI approach, before quickly detailing the new GPU voxelization and octree construction algorithm.

This sparse voxelization technique will be published in the OpenGL Insights book that will be out for Siggraph.


Lost Garden

Looking to hire unicorn programmer for Spry Fox

by Daniel Cook (noreply@blogger.com) at May 17, 2012 04:55 PM


Hi everyone -- my company Spry Fox is looking to hire a senior-level engineer/developer. If you are not this person but have worked with someone you love and trust, let me know!

Job title
We don't really do titles here. Feel free to call yourself something amusing and/or impressive.

What we're looking for...
  • Senior level engineer (five to ten years of work experience, minimum.)
  • Can program both the front end and back end of an original online game - by themselves or as half a team of two
  • Has worked on multiple shipped games in the past
  • Very comfortable with frequent, rapid iteration (daily to weekly)
  • Excited about original, free to play games
  • Familiarity with Flash and Unity is a major plus but not a requirement. It's actually more important for whomever we hire to be flexible and not wedded to any given language, as we frequently find ourselves adjusting our tech to meet specific circumstances.
  • You must be a self-starter who can work effectively without being closely managed or prodded. This is a company for entrepreneurs, not worker bees.
  • Reliability and honesty are essential.  We love working with nice people. 
  • Location is not an issue; we all work remotely. But if you live in Seattle or the Bay Area, you'll get to have lunch with us pretty regularly. :-)
About us
Spry Fox is a successful developer of online games that have collectively reached over 30m people. Our titles include Steambirds, Triple Town, Realm of the Mad God and Panda Poet. We are passionate about two things: making great original games and bringing happiness to the world.  It is kind of a sweet gig.

Send unicorn intros to jobs@spryfox.com

take care,
Danc and David



GPGPU.org

CUVILib v1.2 released

by dom at May 17, 2012 07:21 AM

TunaCode has released CUVILib v1.2, a library to accelerate imaging and computer vision applications. CUVILib adds acceleration to Imaging applications from Medical, Industrial and Defense domains. It delivers very high performance and supports both CUDA and OpenCL. Modules include color operations (demosaic, conversions, correction etc), linear/non-linear filtering, feature extraction & tracking, motion estimation, image transforms and image statistics.

More information, including a free trial version: http://www.cuvilib.com/

Gamasutra Feature Articles

Predicting Churn: Data-Mining Your Game

May 17, 2012 04:00 AM

The sad truth about all online services and games? The most significant churn occurs right the first minutes and hours of gameplay. The issue has been already explored in a numerous ways, with many profound hypothesizes related to usability and simplicity of interface, availability of a free trial, learning curve, and tutorial quality. All of these factors are considered to be very important. We set a goal to investigate why new players depart so early ...

#AltDevBlogADay

The devolution of gaming culture

by Kyle-Kulyk at May 17, 2012 02:54 AM

Gaming culture has a problem and that problem has a lot to do with gamers themselves.  To be clear, I’m not talking about all gamers but rather a subset of gamers whose antisocial behaviour and habits drive people away from gaming.  Analysts at Piper Jaffray recently conducted a survey that found nearly 66% of high school students surveyed across the US claimed they were losing interest in traditional videogames with slightly over 66% stating they were interested in social, mobile games which was an increase from 34% who answered the same question the year prior.  Gaming as we know it is changing for a variety of reasons and one of those reasons is gamers have chosen to turn on each other as well as the people who make the videogames they play.  While gaming culture tries to evolve and leave the primordial seas, certain gamers are busy running along the shore with sharpened sticks trying to force us all back in.

The problem lies with the internet and the anonymity it affords its users.  This effect certainly isn’t limited to just gaming circles but as gamers tend to be a largely wired group of individuals the impact is pronounced.  Gaming has always had a social side but over the decades that’s changed, and you could certainly argue, not for the better.  Back in the 80’s and 90’s, gamers would flock to arcades or journey to friend’s houses to partake in the hottest, latest releases.  To illustrate how it’s changed, imagine four friends over for an afternoon session of GoldenEye sitting in their family den.  Now imagine one of those children lets loose with a barrage of profanity laced, racist, homophobic rants aimed at his fellow gamers.  Or imagine someone’s little sister is also invited to play and subjected to a stream of masturbation and rape jokes.  There’s a very good chance that the child would simply never be invited back for another GoldenEye marathon.  There’s also a chance that little Jimmy’s mother, having overheard the obscene rant would never allow that child in her house ever again and would make a quick phone call to inform the offending child’s parents of their unacceptable behaviour.

This type of antisocial behaviour infects network gaming and social interactions across the internet and therein lies the difference between gaming culture now and gaming culture then.  There are few, if any, social repercussions in gaming today and the impact of these behaviours eats at the fun factor of gaming for a large number of gamers, children and adult alike.  It doesn’t matter if you’re looking to game socially on your console or if you’re looking to partake in a general gaming discussion on the internet, odds are your experience will be sullied by another gamer hiding behind their internet pseudonym.

Researchers refer to this as “toxic disinhibition”.  The anonymity the internet and online gaming networks offers often results in the complete abandonment of social restrictions that would generally be present in face to face interactions such as in the days when we gamed locally with other people in the room.  The result of this “trolling” is we see more and more gamers being turned off of gaming, or seeing their enjoyment of games lessened, thus inhibiting the growth of gaming culture.  The impact of this online disinhibition also affects developers who can find themselves loathe to engage their own fan base for fear of fanboy backlash through internet flaming.

Recently, gamers made headlines for their disproportionate backlash against Mass Effect 3 developer Bioware.  The actions of certain gamers painted all gamers as whiney, entitled children prone to screaming fits when denied their pacifier.  Bioware found itself facing a FTC complaint while its writers and staff were targets of hate campaigns and death threats as some found the end of their latest game offering to be unsatisfactory.  Other gamers and non-gamers alike shook their collective heads in disbelief.  Blizzard also suffered a ridiculous backlash from gamers when screenshots of their now released Diablo 3 title were deemed “too bright” by some prior to the game’s launch, prompting Blizzard to mock the users by releasing screenshots containing unicorns shooting rainbows from their posteriors.  While Blizzard used the experience to have a bit of fun, the example illustrates a growing trend among gamers to instantaneously and viciously attack developers and other gamers alike for even perceived slights and as a whole, the gaming community becomes a less inviting place.

The online disinhibition effect certainly isn’t limited to gaming forums either as the development community itself isn’t immune from unprofessional behaviour.  I’ve seen my own personal blog postings regarding my development experiences targeted by other developers leveling harsh and often unfair criticisms.  For example, I’ve had a developer lambast the simply inclusion of our company logo on a splash page because “no one cares about your company”.  I’ve even had a local developer I didn’t know and had never met criticize my company online for the slight of not consulting with their group prior to launching our first game.  This type of challenging behaviour is far more likely to be witnessed online than in face to face interactions or official business communication and unfortunately it is becoming more prevalent.

They say in general you need a thick skin to blog but backlash I received from a recent blog post made me question the value of blogging my own experiences as a developer.  I posted a personal blog listing some of the complete, all in one game engines available that may be of interest to independent developers.  While researching game engines for my company I would have found such a blog useful as I looked for a game engine that offered features I required, such as Android and iOS porting and clearly the blog was not meant as an in depth review piece.  As I had not the opportunity to try each engine I listed, I made sure to note that where I was unfamiliar with the engine I was simply relaying information and opinions from various reviews I had come across and I provided links to each product so users could conduct further research.  Rather than promote a thoughtful discussion on the merits of various game engines as I had intended or to provide a starting point for further research, the resulting comments were almost all attacks against myself personally and my attempt to inform other indie developers.

The comments included people calling me a liar, posters comparing my blog to vulgar activities, writers incensed that I didn’t whole heartedly endorse their particular favorite engine.  I even read claims that I was intentionally trying to harm product reputations despite the fact I noted these opinions were sometimes not even mine but were simply being passed along when I lacked particular knowledge of the product being discussed.  I was frankly shocked by the lack of decorum I witnessed in response to a personal blog intended to simply inform and facilitate further research, and if other developers hadn’t contacted me directly to offer their support (with one commenting he would have done it publicly if not afraid of being “flamed” himself) I most likely would have never written another blog regarding my game development experiences.  This general lack of professionalism in a workplace environment would never be tolerated.  Indeed, when gamers and developers are afraid to share ideas due to fear of reprisal it’s time to take a hard look at the current situation and what repercussions this could have to our industry as a whole.  As a community, this type of behaviour should not be allowed to propagate.  I’ve been subjected to all manner of hate mail and threats from casual gamers and stalking fanboys alike over the years writing opinion pieces regarding the games industry, however the lack of professionalism I’ve witnessed since becoming a developer myself truly surprised me.

Gaming culture is suffering due to experiences like this, due to experiences like those Bioware recently endured and due to the ongoing profane, racist and homophobic behaviour tolerated every day in online gaming matches and in internet gaming forums.  The anonymity of the internet mixed with complacency among gamers and developers has led to this situation and the associated cyberbullying that goes along with it but as the genie is out of the bottle with regards to the internet, there is little that we can do to curb its impact.  The removal of anonymity in online gaming by the companies that operate these networks could potentially result in fewer incidents as people are less inclined to act in socially unacceptable manners when their real names and locations are attached to their actions, however this system would still rely on reporting tools that already exist are underutilized by the majority of gamers.  Most prefer to simply ignore the problem, and this does nothing to stem the rise of anti-social behaviour in the gaming community.

As more teens are turning towards social gaming where they can exercise more direct control over their social interactions through use of things like Facebook friend lists, as more potential gamers are turned off by what they see of gamers in the news and more core gamers turn away from online gaming and game forums based on the sliding social environment, today’s gaming culture must change or it will face decline.  We’re already seeing traditional game sales slide as gamers look elsewhere and a shift towards mobile games is evident.  Partial blame falls on gamers themselves for creating and tolerating an increasingly toxic game culture that runs contrary to the social spirit that videogames created for many of us while gaming in the 80’s and 90’s, and even some developers themselves are letting professionalism standards slump in their online communications which itself is the start of a slippery slope.  We can never go back to the way gaming was, but we can shape the future of gaming culture for the better by being conscious of where it went wrong and why.