Creating Games Using Intel Tools, Part 1: Starting With Splash Screens Share your comment!

New visualization tools and libraries can simplify the creation of games, and support the gamification of IT. In this four-blog you’ll see how a game is creates from start to finish

 

Intel has tools that can help create sizzling games. This blog is the first in a series of four that uses the Intel tools and APIs to create a demonstration game. The final product will be a playable game that employs several of the Intel tools. The source code, for each step of the process, can be downloaded from https://sourceforge.net/projects/go-parallel-game/.

The first installment (this blog) uses Intel Performance Primitives to blur-in an image in a splash screen. The second installment uses OpenMP to spawn multiple threads which each use the A* algorithm to find the shortest path from an opponent character to the player character. The third installment uses machine learning to train opponents to do a better job to find and attack the player. And finally, the fourth installment pulls it together for a complete game.

The Splash Screen

Most games start with a splash screen. For this game, the splash screen is an image that starts off being very blurred, and comes more and more into focus. The following images show several stages of blurring from the beginning to the end.

splash1

splash2

splash3

splash4

splash5

Intel Performance Primitives

Intel Performance Primitives (IPP) were used to do the image blur. Specifically, the ippiFilterBoxBorder_8u_C3R was used to blur the image from very blurred to no blur. A timer was used to incrementally change the display image blur as the following code shows.

 

The createBlurredImage() method is where the actual blurring happens. It first creates a temporary buffer with which the method will do its work. Then, a call to ippiFilterBoxBorder_8u_C3R() is made. The important parameters are the source buffer (with the original un-blurred image), the destination buffer (into which the blurred image will be placed), and the blur size (in the demonstration program this value ranges from 31×31 to 1×1 as the image comes more into focus). The large the blur size, the more blurred the image will be. When it is 0x0, there is no blurring. You can see the createBlurredImage() below.

 

Conclusion

When you think of writing games, think of how the Intel tools can help. The Intel Parallel Studio Suite has tons of things that can help your application scream. And that is what we all want when we write games. Of course, making lots of money on a game is good, but Intel can only help you with performance, and not the monetization.

Posted on February 6, 2017 by Rick Leinecker, Slashdot Media Contributing Editor