Tuesday, June 11, 2013

Unity3D on Android

When porting a unity3d game to Android, one of the main issues is textures.

Symptoms:
Textures are completely black - so you see a black screen instead of the default unity`s blue, and textured meshes seem invisible.
Or textures are almost completely grey

Solution:
1. Create multiple APK`s. each uses the right compression.  For example HTC-Desire HD phone has a Qualcomm snapdragon GPU which supports "ATC" compression.
This step is only in the build (few separate builds)

2. On some devices, this will still not solve the problem. In that case, on the texture import settings, on "Texture Type" choose "Texture" instead of "Advanced"  and Format="Compressed".
On the build-settings, choose "Don`t override".





Override for Android and textures (from here)
ETC supported by all, but no alpha, which is very important for games.
DXT supported by Tegra.   [Asus-transformer]
PVRTC support by Imagination PowerVR
ATC supported by Qualcomm snapdragon  [HTC-desire-HD]
RGBA 16 means 4096x4096=32MB
RGBA 32 is what will become of unsupported compression type per device (put DXT texture on non-tegra and it will expand to 4096x4096=64MB and take lot`s of memory!!!!)

Android Build (from here)
There is an option "Texture Compression". By default, Unity uses ETC1/RGBA16 texture format for textures that don't have individual texture format overrides.

Sunday, January 6, 2013

Free-To-Play buisness model

Free-To-Play business model

 

When to use it?

  1. If the platform you are using requires high number of downloads for easy discovery, like Android/iOS app-stores , chrome-store , browser plugins/extensions.
  2. If your audience is a "first-time" gamer, which never payed for a game - as this is a great barrier for download.
  3.  


What part of the game will cost?

  1. For single-player games:
    1. [strong]  some levels are free. You need to buy the game to unlock a bulk of additional levels.
    2. [medium] some levels are free. You need to buy levels , one by one. It`s a bit weak as if the user need to buy 0.5$ level two times in an hour, s/he will think again whether to buy the next one.
    3. [weak]  customization

  2. For multi-player games:
    1. [strong]  unlock hero-type
    2. [medium] customizations which are apparent to other users.
    3. [weak ]  experience-boost / weapon-boost.


Unity Networking is easy? part -2-





For a FPS-like game, a good networking implementation need to have few points:
[It`s a summary of  a article on HalfLife networking]

Client-side
  • Client-predication - user input cause immediate change in the game , but can be fixed later in the server overrides it.
  • Interpolation - always add a delay of ~100ms to all other-users. Even if their ping is really small. Thus when you draw their location you will interpolate real, past positions with the exact positions.
  • Extrapolation - on in the case of severe latency problems, the interpolation delay may not be enough and you simply don`t know where the user is right now.  Here you extrapolate future location from the last known ones, but as with any extrapolation, it`s not accurate.

 Server-side:
  • State calculations and communications.
  • lag compensation - if you trust client shooting-report, no need for this.
    If you don`t and you want to prevent this type of cheating, you will need to get the shooting direction and calculate hits yourself.  As the client is running in old-time, you will need to "re-wind" the players positions and calculate the hit in the old times.