Wow, it’s great to see how many people have been enjoying Galcon for the Palm Pre Plus! I have gotten some really great feedback, so I’ve put together an update! All of the in-game issues are related to the integration with the WebOS features, so I’m documenting the bug report and the solution here.

Item 1: Back gesture quits the app – Resolved, 95%

This was really easy. I just capture the SDL key event for SDLK_ESCAPE and handle that as a “back” button. The nice thing is due to all my work on the Android port where users demanded back button support, I had already added this feature! So coding this only took about 5 minutes. (The Android work I’m building on took a good day, so enjoy the back features, they work throughout the whole game!)

The only shortfall of this fix is that when you use the back gesture from the main menu the app doesn’t minimize, it just sits there. I could have it quit, but I’m not sure that would be better. I’ll have to see what users say. The PDK does not have a PDL_MinimizeApp() function or anything yet, so I’ll just leave it as is now. The user can still tap the gesture area to minimize the app.

Item 2: Reduce idle CPU usage – Minor, no ideal solution

One user noticed Galcon was still using 2% cpu when minimized. This is probably due to OpenGL rendering, which I really don’t need to continue doing when the app is minimized. I considered reducing this to 0%, but if you are paused while in a multiplayer game you might want to be able to see the occasional visual update to the game. And when you are really done playing anyways, it’s best to quit the game anyways. So for now, I’m leaving this issue as-is, since I don’t think it would be an improvement to change how it works now.

Item 3: Respect the phone’s mute switch – Not a bug

I did a bit of searching in the Palm developer forums and found this answer: “No, the mute slider can’t be checked. When I asked our interface team about this, they say that the switch is a “ringer mute” switch, not a general system mute, so it doesn’t affect the volume of game or navigation programs.” So, yeah, sorry, nothing I can do about this.

Item 4: Local multiplayer not working – Minor, no solution found

I got a report from a user that local multiplayer wasn’t working, and it seems that is the case. I tried using “PDL_SetFirewallPortStatus” to enable access to the Galcon port, but that didn’t seem to improve it. From checking in the forums it might be something a bit more complicated relating to how the firewall / networking works on the phone. Fortunately, you can do 1v1 games if you just join a 1v1 server with your friend at the same time, so this is a pretty minor issue in the grand scheme of things.

Item 5: Unable to type numbers – Workaround warning added

This was a known bug from the beginning, due to how the PDK and SDL works, when a user presses the number pad and then presses a number key, a letter is sent to the SDL app. The only way to get a number is for the user to hold down the number pad key and the number key. The Palm developers have told me that my options are to hack in a translation (which wouldn’t respect international keyboards), or wait until a future release for a PDK function that could do a translation for me. Since a hack that would break it worse for some users isn’t any good, and I want to do an update soon, I’ve decided to do the next best thing and prompt the user with a tip at the top of the Settings screen telling them of the physical workaround of not letting up on the number-pad key.

—

So, not a perfect update, but I’m very happy that I’ve been able to develop a solution for the back gesture . And I think the addition of the warning with the keyboard issue is a reasonable workaround. The other items I’ve verified, but not found ideal solutions for. I also want to add Pixi support, but I hear that 1.4.5 isn’t going to be released to the Pixi, so there isn’t much rush for this to be put out. Once I get ahold of firmware to dev on the Pixi I’ll try and update Galcon for it though.

-Phil

P.S. I’m just about to submit this update, so it probably won’t hit the store for a couple days.

I’ve just completed and submitted my port of Galcon to the Palm. The entire process took 2.5 days. Here’s my play-by-play of the porting process. A huge thanks goes out to Mike Kasprzak for hand-holding me through the process and co-writing this post. If you’re doing a Palm port, be sure to read the whole blog post over before you begin so you get the big picture. Also, not everything is exactly in the right order, so that’ll give you the birds-eye view.

Day 1: Preparing the device for Development

11:00

– Unbox the Palm Pre Plus.

– Figure out how to plug in the USB. This is a bit tricky, you gotta really yank on that plastic tab on the side to get it off.

– Install a SSH key. This way I don’t have to keep pressing return on the password entry during SSH sessions.

$ pdk-ssh-init localhost:10022

1:45

– Verify installation by using a Palm demo app. This is an important step! This step shows you where the example code and scripts are and you’ll be referring to those when you build your own build/deploy/packaging scripts for your own app. And if it works, you know your Palm is ready to go!

– [This should be irrelevant as Palm gets their SDK’s and firmware all synced across the networks] The PDL_Init error is actually the device talking back to you. I had to go into the src folder and comment out PDL_Init to get it to run. This error is due to the 1.4.1.1 firmware on my Palm Pre Plus .. 1.4.5 is required for apps. Had to do some hacks to get around this, won’t bother explaining, as this shouldn’t matter in a few days.]

3:00

– Rebuild simple sample app with PDL_Init included, works fine

3:30

– Got a copy of Mike’s app and tried it out. Works nicely.

Day 2: Porting the App

– 10:30

Hacking up the /opt/PalmPDK/share/samplecode/simple/mac example building, packaging and deployment scripts. Mostly just getting them to work with my code. Was pretty straightforward if you know shell stuff. I’m doing my work on the Mac, so I have a bash shell at hand all the time.

– 11:30

Got it compiling with a few tweaks. using rsync over ssh to deploy my game I’m a big fan of rsync. Here’s my “deploy” script:

PDL_Init(0); // in init function
PDL_GetCallingPath(char *buffer, int bufferLen); // to find out where our app is being launched from so i can find my data files
PDL_GetDataFilePath(char *dataFileName, char *buffer, int bufferLen); // find out where my app can write save games and settings.. the buffer is a fullpath to where we can save a file to
PDL_LaunchBrowser(const char* Url); // go to interwebs
PDL_Quit(); // wrap it up

Here are a few tips from Mike that I found really helpful:

About the Palm itself:

There’s a touch strip beneath the LCD screen. Gesture up or down from the middle of the strip to bring up the menu.

To “Card” (minimize) a running application, gesture upward or tap on the gesture strip

To close an application, throw the card away (up)

To delete an application, hold down the keyboard button with a square on it, then tap the icon of the app you want to remove.

When you plug a device in, Just Charge is the ideal mode. USB mode is useful for copying files via drag+drop, but you can’t run things while in USB mode

Linkable Libraries

-lSDL

-lGLES_CM (for OpenGL ES 1.1)

-lGLESv2 (for OpenGL ES 2.0)

-lSDL_mixer

-lpdl (Palm specific calls)

SDL Tips

The following call is required BEFORE setting your graphics mode, yet after initializing SDL

SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1);

The number represents the OpenGL ES version. 1 for 1.1, 2 for 2.0.

webOS actually supports blending what you do against hardware decoded video. Unfortunately, this feature is on by default. The alpha value in the frame buffer decides weather video will bleed through or not (even if no video is displayed). To disable writing Alpha to the framebuffer, use this call.

Then just copy all those files, and the app files into a folder named the same as your app id (com.galcon.app.igalcon for example) then run palm-package against that folder and you’re done! Here’s a checklist from Palm that helped me through a few things: