Skip to main content

Success and crashes

One day has passed, and PewPew is doing well. It has entered the Hot android app category on AppBrain.com, and I am receiving a lot of positive feedback. While monitoring twitter I found 14n3 saying "Oh man, making a review of PewPew, this game rocks!". Always gratifying.
Unfortunately, there are a few people reporting crashes.
Since PewPew is very stable on the iOS devices, the crashes must stem from Android specific code I added. There are two areas where I am not sure I am doing everything right:
It's either the handling of the application life cycle, specifically the part where I have to reload the openGL data when the game is resumed, or the http requests to upload and download the scores and replays.
Those thing would pose no problem if PewPew was a Java application like most Android applications, but it is 99% a C++ app with a thin Java wrapper (and thus uses JNI). To reduce the amount of JNI code I cut some corners.
At first I started using the Android Java API for the http requests, but then I realised it involved doing a boatload of JNI functions and threads, so I decided to use a C++ library. Curl and Boost are the most well known C++ libraries for that kind of job, but they are also completely overkill and would require too much time to integrate in PewPew. I searched for a light alternative and found HappyHTTP.
HappyHTTP does all what I need, and can be integrated into a project simply by adding a .h and .cpp file. The only problem is that it uses C++ exceptions. I can't use exceptions in PewPew even if I wanted to, because currently the Android NDK does not support exceptions handling and STL usage at the same time! I quickly hacked an exception-free version of HappyHTTP, but I may have messed up some things up, which may cause the crashes on some devices under certain conditions...
I hope I fix everything quickly so that I can resume doing the fun stuff: working on new levels and game modes.

Comments

  1. Hey,

    Love the game, good job.

    You can use an NDK compiled to use Exceptions and RTTI on Android if needs be, checkout the CrystaX.NET builds.

    http://smartctl.net/android/ndk-r4.php

    I don't believe there is any major downside, and you can follow the alterations they made to get yourself an NDK R5 version if you need it. Could make your life easier?

    ReplyDelete
  2. Brilliant work!!!! I have played Gun Bros,and after about 2 minutes of game play I deleted it off of my EVO 4G. Your game however has me ADDICTED. The graphics/gameplay is simply amazing. I look forward to PewPew2 for the android. Keep up the great work!!!

    ReplyDelete
  3. This game is so frigging amazing!!! Its soo good the best game for my Android HTC Desire Z it works perfectly 0% lag and i LOVE that you can watch replays!!!!

    The only complaint is that there is some guy who is cheating the scores in all game modes and when i watch his replay he gains lik 1200 points but yet he is on top of the lists!!!

    Anyway BEST GAME EVER I LOVE YOU :D

    ReplyDelete
  4. Benjamind >
    Thanks, I did not know about Crystax :) Now that I've managed to get everything working with the regular SDK, I am going to stay with it.

    Anil Nair >
    Thanks :)

    Oscar >
    I am working on preventing cheating !

    ReplyDelete
  5. I've been running the first edition on my Metro PCS LG M690 just fine. Love the design and game play. Maybe next edition look into the utilization of the integrated accelerometers for advanced controls of the ship.

    ReplyDelete
  6. Thanks for making pewpew for android. Awsome game!!!

    ReplyDelete
  7. How did you make the graphics in Pew Pew? Did you use Adobe Flash?

    ReplyDelete

Post a Comment

Popular posts from this blog

PewPew Live's look in a nutshell

Occasionally someone will asked how I obtained the PPL look. In a nutshell: Draw everything with lines, including the text and the various icons. It's a lot of work, but besides looking unique it creates a consistent appearance which is a thing that a lot of indie games struggle with. The lines are screen-space projected lines with miter joins. Draw the lines with additive rendering. This means that if a red and green line overlap, the overlap will be yellow. There are a few things not drawn with additive rendering (like the background of buttons to improve readability), but they are exceptions. Add bloom. There's lots of different bloom implementations. Nowadays I use a bloom that is similarly to the one in  blender's eevee . If you see banding, use dithering. Optional: Add even more post-processing like (very slight) chromatic aberration, lens dirt, scan lines, curved monitor, and vignette. No post-processing, just lines Bloom! Ignore the missing bloom at the top All the...

A general state rollback technique for C++

I wanted to write this post for a while. It describes a C++ technique to implement rollback in the context of multiplayer games that I feel is quite interesting and useful. The tl;dr is: don't bother serializing individual objects, just rollback all the memory. Rollback-based multiplayer I've been working on a multiplayer version of PewPew, and for reasons that are outside of the scope of this post, I chose to implement multiplayer with deterministic lockstep and rollback. The basic idea behind rollback-based multiplayer is that the inputs of players are replicated to all the players. Whenever a player receives the inputs of another player, the state of the game is rolled back to the point where the input happened and fast-forwarded back to the present so that the state shown to a player takes into account the inputs of the other players. Because history is being re-computed, some events get undone. For example, it's possible a player saw themselves taking a bonus, but aft...

Ridiculously cheap depth of field effect for lines

I'm working on PewPew's sequel, for which I've revamped the graphics. Instead of drawing lines directly using OpenGL, each individual line segment is made up of two triangles whose vertexes are computed with shaders. Getting lines in 3D space to be properly displayed on a 2D screen is not trivial. In PewPew's sequel I use the screen-space projected lines, a technique very well described in the  Drawing Lines is Hard  post. The upside of drawing the lines yourself is that you are fully in control, which allows you to implement nice things such as joints, perspective, and even simulate depth of field. https://en.wikipedia.org/wiki/Depth_of_field Usually depth of field (DoF) in video games is implemented using a post-processing step that blurs the pixels with an intensity that is a function of the depth of the pixels. When we are rendering lines, we can approximate DoF directly when rendering the lines by having the vertex shader increase the width of lines and r...