Thursday, October 18, 2012

What happens in the final stage of development?

We're in the process of getting Trick Shot Bowling into the Windows 8 release.  Here are the notes of what we've done in the past month or so to get ready.

Done
* Fix/check pin sound modulation
* Fix gray text
* Fix minimap arrows
* Make interrupt pause removal not add to the gui stack
* Fix touch input for throwing the ball
* Fix ad spacing issues with new admob
* (No repro) Fix sound delay
* Icons
* Sidebar pause menu
* High/low graphics settings with lower res reflection
* Prevent gutterball sound in the ball pit
* Tweak gutterball sound zone, possible to hit without leaving the lane.
* Prevent gutterball sound from continuing to play if you skip
* Portrait
* Make pins heavier
* Make a 4 player game, exit the app, restart the app, start a new game with 4 players without clicking any add/remove players buttons.  Scorecard only has a player name for player 1.
*Play halfway through a game. Going back to the main menu and starting a new game does not reset the scorecard.
*in trick shot mode, pins sometimes do not disappear from the alley (may be related to skip button in some cases)
*in trick shot mode (at least), pins sometimes are not fully stabilized at the beginning of a ball (may be related to skip button, less certain in this case) (may or may not happen only between balls in the same frame)
* Stop the gutterball sound when the ball hits the ballpit
* Have two players with different balls.  Bowl a trick shot game with second ball.  Exit. Start a new non-trick shot game.  Player 1 uses player 2’s ball.
* Throw a ball down the lane, wait for it to hit the ball pit and immediately bring up the pause menu, go to ball select, wait for the skip button to show up, and then go back.  You will get stuck on the skip screen.
* In the store, select a ball (other than the 8lb and 44lb balls) and resume the game. Go back to the store and select the ball that has the same weight as the previously selected ball. Note that the rotating display ball model has not changed. This bug is probably related to the fact that the two balls share the same ball model. - Entity properties not properly being applied when a duplicate mat is in the scene.
*ball changes color visibly in the back of the alley when the player for the next ball is using a different ball color
* Make a low graphics option that doesn’t draw at full screen
* Ball textures
* Second page of balls
* Make ball properties do stuff (spin, speed)
* Modify pin icon to include a dollar sign
* Make sensitivity slider
* User was having trouble with the input being too sensitive to use. The arrow may be resetting too quickly, making spin too hard for new players.
* “Press any key to skip” -- should say “Press a key or touch the screen to skip.”
* Make trick shot alley screenshot be of trick shot alley
* Make starting pins be 0
* Remove framerate counter
* Link to tutorial from pause.
* “Draw an arc” in tutorial -- fix too-literal wording
* DDS the ball textures and ball icons
* Remove IAP page from win8 menus
* It appears to be possible to make the guide arrows disappear in the tutorial. Repro steps unknown.
* Implement openURL
* Text background during tutorial has a little white line at the top
* Ball pricing
* Final score gui was only showing first 8 frames, and no player name.
* It is also possible for a player to be using one ball but show a different ball’s icon. I am not sure what the repro steps are yet. (might be related to per-frame per-ent stuff in the shader)
* Store screenshots
* Promo images

Saturday, April 28, 2012

Porting to the Blackberry Playbook


A few months ago RIM decided to add native C++ support to the Playbook.  Our ears perked up a little.  Then they gave out a ton of Playbooks to developers at GDC and we managed to snag a couple.  We're always working on a dozen things at once so we didn't do anything with them.  Then we ran into some RIM folks at MassDiGI, who pointed out that there aren't any 3d snowboarding games out!  Time to port!!!

The Playbook SDK is a custom install of Eclipse, which we're pretty familiar with from Android development.  It really didn't take long to get a sample Hello World app up and running.  One point of confusion I ran into is there are template C apps, but the only option for C++ is an empty app.  I tried modifying one of the C apps to use C++ and never got anywhere.  I ended up starting over with an empty C++ app and adding a basic empty class to get it to compile.  It took me the better portion of a day to figure out how to get it to recognize C++ classes without compile errors, which 5 minutes with someone who knows what he's doing could have prevented.

Next up was getting all our platform-independent code to compile.  This consists of right clicking the navigator window, import files from file system, and clicking the "create links in workspace" checkbox under advanced.  This imports the files as symbolic links, so no need to duplicate!  Eclipse likes to have everything live under the project directory so I was a little worried about that part.

Then I had to set the include directories.  It took me a long time to find the right place, though it sounds fairly obvious.  Right click the project and go to properties.  Then under "C++ Build" click "Settings", "QCC Compiler", and "Preprocessor".  If I added directories from the workspace it didn't follow the symbolic links, so instead I had to add from file system.  When I did this, Katie couldn't compile because we were including files in "/users/Yrgol/...".  The fix for this is to include relative to the "${PWD}" directory.  After that, we had our engine compiling!  Time to add the platform layer.

The platform layer was actually the simplest one that I've seen.  Our entire Blackberry-specific codebase is 1500 lines long.  We had to add libjpeg and libpng texture loaders, and alut sound loaders.  We used sample code to initialize our OpenGL context.  The main loop is very simple and reminds me of old Windows programming, where we spin in a for loop and ask for system events every frame.  This is way easier than plugging into the event model that iOS and Android use.

It seems like the Playbook NDK is a little more sensitive compared to other platforms, which is good and bad.  Porting exposed several null pointer accesses that somehow weren't causing crashes elsewhere.  It also exposed a leak in how we managed textures!  I won't be neglecting to call glDeleteTextures anymore.

Assets are added to the project by creating a directory under your project directory on the file system, and dropping your files in.  There's an extra step of letting the packager know which files you want to include by editing the "bar-descriptor.xml" file.  Big Mountain Snowboarding has about 400 data files, and I entered them by hand before finding the correct way to do this.  Double click the bar-descriptor.xml file, then click the assets tab.  When I do this nothing shows up, but if I resize the window magic appears.  You then have a GUI with an easy way to add all your data files.

Lots of debugging later and it's time to submit, but not so fast!  First you have to get your publishing account approved, which seems to be a manual process.  If I had known this I would have applied at the start of the port instead of the end.  First you have to submit a request, wait 48 hours, then submit some documentation, and wait another 48 hours.  I don't think their account approval team works weekends.

The submission process itself is fairly pain-free.  The only real annoyance was I had to create a PayPal account in order to sell apps.  I'm a bit wary due to various stories of PayPal deciding to just seize other developers money in the past, but no choice.  I'll try not to leave too much in the PayPal account at any time if we actually make any sales.

You have to create a large promo graphic, and upload up to 50(!) screenshots at no larger than 640x640.  I'm not sure why the 640 limit exists considering the playbook is 1024x600, but it shouldn't be that big a deal.  It would be nice if they also included an option to include a video like Google Market.  I can't say anything about being on the app store yet or if anyone actually buys the apps considering only one of our apps has been out for less than a day.

Sunday, March 11, 2012

Lights-out mode in Android

As I noted in the last post, Google and players like it when you use the "lights out" option to hide the status bar during games. I spent a couple hours today figuring out how to do that.

1) Wrap all of this code in a check to see if we are on Android 3 or higher so we can still run on 2.3.

if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {

2) Find the right view. We create a GLView in our startup code, so this part is easy for us. Otherwise you'd want to add an android id to the top view in the layout file, and then use findViewById to find it.

(in layout definition) android:id="@+id/RootView"
(in startup code) View root=findViewById(R.id.RootView);

3) Toggle the visibility flag to SYSTEM_UI_FLAG_LOW_PROFILE

view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);

4) Set up a visibility listener to re-hide the menu bar after a delay when it becomes visible again. Otherwise when you touch the bar it will stay visible forever. We add the delay in because things go wonky if you rehide in the unhide notification.

view.setOnSystemUiVisibilityChangeListener(

new View.OnSystemUiVisibilityChangeListener()

{

public void onSystemUiVisibilityChange(int visibility)

{

if (visibility == 0)

{

Runnable rehideRunnable = new Runnable()

{

public void run() {

view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);

view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);

}

};

Handler rehideHandler = new Handler();

rehideHandler.postDelayed(rehideRunnable, 2000);

}

}

});

Wednesday, March 7, 2012

Tips every Android developer should know, or things we're doing wrong and need to fix in our Android builds.

A couple Google engineers, Dan Galpin and Ian Lewis, gave a talk at GDC this morning on things people do that prevent their apps from getting featured. Here are my notes on what they said.


1) Don't run in compatibility mode. Google hates the menu button on newer Android devices, so set the target SDK version to the newest (15).

2) Games that use the lights out menu option are cool. This is View.Status_Bar_Hidden.

3) Don't override the basic button behavior like volume or home or power. The back button is fair game though. Back should be treated as the escape key and not a quick exit button because it is easy to accidentally press it on honeycomb and ice cream sandwich.

4) Don't use a "do you want to quit" button when hitting back from the main menu. Just exit.

5) Don't play music on the lock screen when coming back from sleep. This one has driven us nuts trying to figure out. You have to overload onWindowFocusChanged as well as the sleep functions, and they can be called in any order.

6) Gracefully cleanup your OGL contexts.

7) For in-app purchases, don't assume your app will be open when the confirmation comes through.

8) Always have a tablet promo graphic. They scale this down to use it for feature spots on phones. This is the big banner that shows up when viewing the game on the web or on a tablet.

9) Localizing the market text is recommended, with the languages EFIGS-CJK.

Tuesday, February 28, 2012

Black bars on the Kindle Fire

The Kindle Fire is a little different from all other Android devices. 1.30 Big Mountain Snowboarding was just released on the Amazon app store so we could support those users. It has a bug where there is a black bar at the top of the screen and all the button presses are off unless the game is launched from landscape with the power cord facing right.

This is because Kindle Fire is the only device I've heard of which calls onSurfaceChanged twice.

public void onSurfaceChanged(GL10 gl, int w, int h) {

if (!mWasInitialized){

// game init

mWasInitialized = true;

}

else {

// resize the game window

}

}

1.30.1 has been uploaded and fixes this issue. I would update the game description if Amazon allowed developers to write their own promo text. Instead the best I can do is add a discussion at the bottom of the page with the workaround and wait for patch approval.