Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1

Chapter 24 ■ Optimizing game assets and COde, and game prOfiling Using netBeans


Click the image with the color gradient, in this case that is the San Francisco Bay Bridge, as shown
selected in Figure 24-27. This will show us the large quadrant image so that we can see if there are any
dithering patterns.


Figure 24-27. Select an image that will show dithering to zoom the game board in closer to see whether the
image looks the same


As you can see, there are no visible dithering patterns (dot artifacts) that can be seen when this is used
as a texture map on the i3D game board, so this shows that we can successfully use indexed color for the
texture maps on this i3D board game and not suffer any perceived reduction in the quality of the deliverable.
This gives a professional result, and everything looks like it is using true color, right down to that steel hoop
in each quadrant, which still looks like steel with no perceptible dithering whatsoever. Next, let’s look at
optimizing your 16-bit digital audio assets.


Optimizing Audio: Use 16-Bit at a Lower Sample Rate


We did a good job covering how to optimize digital audio using Audacity 2.1.3, so I recommend using
16-bit audio sample resolution and optimizing the sample rate (48, 44, 32, 22, 16, 11, or 8kHz) until you hear
a quality change. We already have 16-bit 44.1 kHz (used currently) and 16-bit 22.05 kHz, which is half as
much data for each of our sound effect samples yet sounds very similar in quality. If you wanted to use the
smaller digital audio memory footprint, you could simply reference the more optimized audio assets in your
loadAudioAssets() method body.
I will leave this memory versus quality decision completely up to you at this point. If you wanted to
go back into Audacity and optimize the other three sample rates, such as THX (48 kHz) or 32 kHz or even
16 kHz, you can listen to your resulting 16-bit audio quality for each sampling rate and decide how much
system memory you want to use for each level of digital audio quality.
Notice that you can use different sampling rates for each of your digital audio assets in your game. Some
sound effects will hold up (quality-wise) to lower (11 and 16 kHz) sampling rates, whereas others (musical,

Free download pdf