Golden Hammer Software is a Boston-based game company mostly focusing on mobile games. Our cross-platform game engine supports OSX, iOS, Android, and Windows. Our games are Big Mountain Snowboarding, Scribble Worm, and Castle Dungeon.
Sunday, June 23, 2013
C++ Subsets
Friday, May 17, 2013
Google Play Game Services for Android setup tutorial
- Your app must use Google APIs instead of Android SDK.
- You must use a signed release build for testing, with the same SHA entered into the google play console.
- You must import the google-play-services_lib project into eclipse. Just grabbing the lib is not good enough.
- Use the Android SDK Manager to download "Google Play services".
- Right click in the Package Explorer window and select Import.
- Under "Android" select "Existing Android Code Into Workspace". Click next.
- Under "Root Directory" click browse and select [android-sdk-dir]/extras/google/google_play_services/libproject/google-play-services_lib.
- Make sure "Copy projects into workspace" is selected. You want a copy of the version downloaded from google.
- Right click your project and select properties
- Select "Android"
- Make sure "Google APIs" is selected.
- Under library click "Add" and select google-play-services_lib
- Also set the lib project as a reference. Right click your project, go to project references, and make sure google-play-services_lib is selected. Otherwise it won't export with your retail build.
- Go to play.google.com/apps/publish and sign in
- Click the control pad icon to go to the new Google Play Game Services page.
- Click "Add a new game" and fill out the details.
- Select your new game, and click on "Linked apps".
- Add a new android app and link to your store entry.
- Click the "Authorize your app now" button after saving.
- Enter your SHA1 signing certificate. You won't be able to change this later. To find your key, export a signed retail apk from eclipse and sign with the key that you use for publishing. At the end of the process it will tell you the SHA1.
- Go to the google play games console for your app and click testing.
- Add your google account as a tester.
Unable to retrieve 1P application 1234567890 from network
Unable to load metadata for game
- Grab your app's id from the google play console. If you select the controller icon and then select your game you will see something at the top that looks like YourAppName - 1234567890
- In your project in eclipse open res/values/strings.xml.
- Add: <string name="app_id">1234567890</string>
- Open your manifest file, and add this inside your application node: <meta-data android:name="com.google.android.gms.games.APP_ID" android:value="@string/app_id" />
// determine if the user has google play services installed.
// if not, try to install it.
// should be called in onResume so we know that it got installed.
public void validateGooglePlayServices()
{
int checkGPServices = GooglePlayServicesUtil.isGooglePlayServicesAvailable(mActivity.getApplicationContext());
if (checkGPServices != com.google.android.gms.common.ConnectionResult.SUCCESS)
{
mServicesAvailable = false; Dialog gpsDialog = GooglePlayServicesUtil.getErrorDialog(checkGPServices, mActivity, 1);
if (gpsDialog != null) {
gpsDialog.show();
}
}
else
{
mServicesAvailable = true; }
}
private GamesClient mGamesClient = null;
private String mScopes[];
public void initClient()
{
validateGooglePlayServices();
if (!mServicesAvailable) return;VectorscopesVector = new Vector ();
scopesVector.add(Scopes.GAMES);
mScopes = new String[scopesVector.size()];
scopesVector.copyInto(mScopes);
GamesClient.Builder gcBuilder = new GamesClient.Builder(mActivity, this, this);
gcBuilder.setGravityForPopups(Gravity.TOP | Gravity.CENTER_HORIZONTAL);
gcBuilder.setScopes(mScopes);
mGamesClient = gcBuilder.create();
}
- Export a signed release build
- Uninstall your app from your device
- Install your new apk using [android-sdk-dir]/platform-tools/adb install yourgame.apk
- Launch the game, and watch the log cat window in eclipse.
Friday, January 18, 2013
Cross platform SDK cheat sheet
Build C++
Navigate to directory where the jni/Android.mk file is (there may be multiple projects -- do them in order of dependency).
Type into Terminal:
~/android-ndk-r8b/ndk-build
Get Crash Log Info:
Type into Terminal:
Determine where are a crash is in C++:
android-ndk-r7b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-addr2line -C -f -e libBMSnow.so 000708e6
Export a signed android apk:
Right click on the project in eclipse
Go to “Android tools”
Click export signed apk
Uninstall builds from device, and then use adb to install the signed apks for testing
Install a signed android apk:
~/src/android-sdk-macosx/platform-tools/adb install SWNookTab.apk
iOS
Create a pvr texture
Download PVRTexTool from http://www.imgtec.com/powervr/insider/powervr-pvrtextool.asp
From the command line use:
/Applications/PVRTexTool/PVRTexToolCL/MacOS_x86/PVRTexTool -f OGLPVRTC4 -i alley1icon.png -m -yflip0 -o ../GHBowlingiOS/alley1icon.pvr
MAC
Record a video
Go to applications and launch quicktime player
Run the mac build and resize the window to whatever
Quicktime menu bar: file, new screen recording
Click the little down arrow next to the record button to make it use microphone
Click the record button and choose record part of the screen.
Drag over the app window
Click record.
Touch all files in a directory
find . -exec touch {} \;
Get into Sandbox mode in GameCenter
https://devforums.apple.com/thread/168811?tstart=0
Submit a new binary
In dev studio, Product->archive.
When that build finishes, organizer shows up.
Click the new binary in organizer, and click distribute.
Select Mac App Store
Log in to itunes connect when prompted
Select the application. You must have already set the app to ready for upload on the web site.
To fix “does not contain a single-bundle application” error
From Tim Swast on stackexchange: “Turns out it is an issue with dependent projects in XCode 4. If this happens to you, go through the Build Settings for all your dependent projects (e.g. static libraries) and make sure that the "Skip Install" option under "Deployment" is set to YES.”
To get a receipt during development:
1) Sign the app with a development provisioning profile (not retail)
2) Make the app exit(173); from main.
3) Run the app once from finder (not from xcode)
Windows
Make a DDS file
contrib/texconv.exe -f [format] -o [outputdirectory] [file]
for format, use BC3_UNORM for textures that have alpha, BC1_UNORM for opaque textures
Windows Phone
Add data file(s) to the project (the C# project)
-Make an empty folder in the project to put the file(s) into initially
-Select Add -> Existing Item on the empty folder
-Multiselect all files you wish to add.
-Next to the “Add” button, click the arrow, select “Add as Link”
-Multiselect all the files in the previously empty folder. Right click and select “Properties”
-Set “Copy to Output Directory” to “Copy if Newer” Close the properties window
-Drag the files to the actual folder that the game will be looking for them in (ex: SB in the SBPhone project)
Data file Protip for the WinPhone C# project editor: Let the editor help you pick the right version of the files.
If you are including files that are versioned across platforms, add the highest priority folder first. EG: Add files from the SBWinPhone directory, then the SBWin8 directory, then the SBMac directory, then the SBIphone directory.
When you drag from the dummy folder into the real folder, it will only copy items that do not already exist in the real folder. You can then remove the remaining items from the project.
Query memory use:
Windows::Phone::System::Memory::MemoryManager::ProcessCommittedBytes
(use %llu with printf)
Blackberry
To install a pre-built binary:
You can deploy your signed bar file using the blackberry-deploy utility included in the bin folder. Follow the instructions here: http://www.tidevs.org/topic/6-how-to-deploy-a-bar-application-to-the-bb10-alpha-dev-device/ Make sure the device is in developer mode.
./blackberry-deploy -installApp -password DEVICE_PASSWORD_HERE -device IP_ADDRESS_OF_DEVICE -package /Users/YOUR_USER_NAME/Downloads/Apps_for_the_Dev_Alpha/Facebook.bar
Thursday, October 18, 2012
What happens in the final stage of development?
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
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.