官术网_书友最值得收藏!

Development insights on Android TV and STBs

Firstly, Android TV game development requires a focus on two specific things:

  • Large shared display
  • Landscape resolution with lower dpi

A large display is always a plus from a player's perspective, but that increases the overhead for graphic designers to optimize the assets accordingly. At the same time, the display can be shared with multiple users, so the developer has to make sure that all the user actions can always be synced with the display.

TVs are big in comparison to any other Android devices. The stretch from a 5" to 50" to a 150" screen can expose poor graphical quality. So, the following points need to be considered while developing games for Android TVs:

  • Check the textures of the game—low resolution textures often look poor when stretched on Android TV
  • 3D models might have jagged curves on TV because there are too few polygons
  • Particle effects may need reworking for the TV's big screen if there are too few emitters, patterns, or colors
  • Anti-aliasing is often not required on Android devices with small screens that have a high pixel density, but it effects a considerable visual difference for a TV.

Now the next challenge is the input control system. There can be multiple controllers for the game. The TV can be directly controlled by some other Android device, or by a remote control.

However, any Android console or STBs can be used as well. In this case, a game controller or a D-pad control is much more useful for games.

To use a controller or a D-pad, a game developer should be very specific about using the proper control button for each functionality. When multiple players are playing a game, each with their own controller, it is important to map each player-controller pair.

It is an optional advantage to specify the game inside the AndroidManifest.xml file under the application tag, as follows:

<application
<!-- other declarations and tags -->
android:isGame="true"
<!-- other declarations and tags -->
>

This will help separate the game from other regular applications, and will show it under the games category on the Android TV home page.

There are a few other declarations that can be made according to the requirements.

To declare support for game controllers, use the following code:

< uses-feature android:name="android.hardware.gamepad" android:required="true"/>

The developer must include the "touchscreen required false" declaration in the AndroidManifest.xml file, as it is used by Play Store for filtering. If it is missing, Play Store does not show the app to Android TV users in the search results:

< uses-feature android:name="android.hardware.touchscreen" android:required="false"/>

It is very good practice for all Android TV game developers to specify the non-required features of Android to get rid of the extra library hassle. For example, a TV does not have an accelerometer or gravity sensor, so marking them as non-required is a good development practice. This can be done as follows:

<manifest ...>
  <application ...>
    ...
    <!-- Requiring the camera removes this listing from Android TV search results -->
    <uses-feature android:name="android.hardware.camera" 
      android:required="true" />

    <!-- Making accelerometer optional has no impact on Android TV filtering -->
    <uses-feature android:name="android.hardware.sensor.accelerometer" android:required="false" /> 
  </application>
</manifest>

UI and game design

Each game UI has to follow the design that will support the control scheme, that is, the UI should completely support the input controller and elements, and the screen has to be designed accordingly. This is a major difference between mobile/tablet game development and Android TV game development.

As we are discussing the development on Android TV, a developer must consider how it would feel to play a game on Android TV from a distance of 4-10 feet while sitting on a couch or on a bean bag. Here is the check list that a developer should look for:

  • All text should be clearly readable
  • UI buttons and other elements should match the overall layout without harming the readability and visibility of the whole screen
  • A controller must control all the possible tasks while playing the game, as nobody would like to get up frequently to control the TV

Overscan

Unlike phone and tablet screens, TVs can lose some space at the edges of the screen to overscan. Although many TVs now use fixed-pixel technologies like LCD, many brands still lose edge detail. Be sure to leave a region around the outside of the TV screen free from important UI and gameplay elements. A good rule-of-thumb is to have a 5-10% margin of totally free space, and a 10-20% margin before drawing important elements.

If developers are using standard Android components for their UI, then they can use the built-in overscan support that was made available in Android Jelly Bean. If the UI is custom OpenGL or OpenGL ES code, or is using a game engine's UI system, the developer will have to cater for overscan in the Android TV interface design.

主站蜘蛛池模板: 开平市| 枣强县| 平度市| 岱山县| 临武县| 柞水县| 乌鲁木齐市| 怀宁县| 光山县| 东阳市| 江源县| 葵青区| 堆龙德庆县| 久治县| 永仁县| 梓潼县| 茶陵县| 南康市| 长治市| 措美县| 开封市| 调兵山市| 南郑县| 修水县| 江油市| 黄骅市| 汝城县| 比如县| 五原县| 鹤山市| 雷山县| 天祝| 军事| 泗水县| 石泉县| 新民市| 汾阳市| 南投县| 固安县| 晋江市| 璧山县|