Author Topic: Alien Runner W.I.P  (Read 35344 times)

Offline zammbi

  • float
  • ****
  • Posts: 360
    • View Profile
Re: Alien Runner W.I.P
« Reply #15 on: August 10, 2010, 11:59:45 pm »
Quote
I thought about it, but i think i'll make this game a free one for various reasons. If it performs well, i can still create some commercial stuff on top of it if i want to.
Fair enough, that's probably a better idea. Get the traffic then sell the product. In that case, any download link soon?  8)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: Alien Runner W.I.P
« Reply #16 on: August 18, 2010, 10:56:38 pm »
I've decided to release a compatibility test, because the emulator just doesn't cut it...here's the download: http://www.jpct.net/jpct-ae/download/alpha/ar/AlienRunner-AE.apk

This version has been created using the 2.2 SDK, i.e. it should support the devices' native resolutions. At least it does so in the emulator. Minimum version is Android 1.5.

My main interest is the mip mapping: AE now has two ways to create the mip maps: By CPU and by GPU. It tries to detect which one to use, i.e. it actually should use the GPU way on most current devices (and the CPU on my Galaxy...). However, when running it in the emulator, the GPU way is detected (which is correct), but the results look ugly when using 16 bit textures. Creating mip maps by the CPU doesn't work at all in the emulator, everything turns out white. So the big unanswered question is: Does the current version creates proper mip maps on real devices using the detected way?

About the game itself: It's a kind of racing game with some jump'n'run elements. Controls are simple: Steer left/right either by touching or by using the trackball/dpad if available. That's all. Try to collect diamonds, jump over obstacles and try to beat par time. All this will give you points. The more, the better. If you complete a race with a higher score than before, your last run will be saved and you'll race against yourself as a ghost racer the next time.

There's no sound or music right now and only one level.


Offline raft

  • quad
  • ******
  • Posts: 1970
    • View Profile
    • http://www.aptalkarga.com
Re: Alien Runner W.I.P
« Reply #17 on: August 19, 2010, 12:14:46 am »
looks very nice ;D the commodore thingy is also very cute..

Code: [Select]
I/jPCT-AE ( 5989): Mipmaps generated by the GPU in 2mscreated by the GPU. i didnt notice anything wrong

Code: [Select]
I/jPCT-AE ( 5989): Changing thread priority...do you increase renderer thread priority ?

renders around 30fps steadily. when level completes fps drops down to ~20 but i guess that is intentional

i've a crash when returning from options view. happens all the time
Code: [Select]
E/AndroidRuntime( 5947): Uncaught handler: thread GLThread 8 exiting due to uncaught exception
E/AndroidRuntime( 5947): java.lang.RuntimeException: [ 1282168257757 ] - ERROR: Tried to set an undefined texture as default!
E/AndroidRuntime( 5947): at com.threed.jpct.Logger.log(Logger.java:159)
E/AndroidRuntime( 5947): at com.threed.jpct.Object3D.setTexture(Object3D.java:3201)
E/AndroidRuntime( 5947): at com.threed.jpct.games.alienrunner.Particle.setTexture(Particle.java:79)
E/AndroidRuntime( 5947): at com.threed.jpct.games.alienrunner.ParticleManager.addParticle(ParticleManager.java:169)
E/AndroidRuntime( 5947): at com.threed.jpct.games.alienrunner.ParticleManager.addEmitter(ParticleManager.java:100)
E/AndroidRuntime( 5947): at com.threed.jpct.games.alienrunner.Player.move(Player.java:492)
E/AndroidRuntime( 5947): at com.threed.jpct.games.alienrunner.AlienRunner$MyRenderer.updateGameState(AlienRunner.java:591)
E/AndroidRuntime( 5947): at com.threed.jpct.games.alienrunner.AlienRunner$MyRenderer.onDrawFrame(AlienRunner.java:728)
E/AndroidRuntime( 5947): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1116)
E/AndroidRuntime( 5947): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:975)

Offline paulscode

  • double
  • *****
  • Posts: 863
    • View Profile
    • PaulsCode.Com
Re: Alien Runner W.I.P
« Reply #18 on: August 19, 2010, 01:48:43 am »
Runs at 30 fps on my Droid X, and everything looks good.  Also able to bring up other windows on top and return to the game without any problems.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: Alien Runner W.I.P
« Reply #19 on: August 19, 2010, 07:04:09 am »
i've a crash when returning from options view. happens all the time
What a buch of crap this surface management on Android is...instead of getting better with newer versions, it seems to get worse. In the next version of Android, the surface will most likely be changed once you take a single look at it... >:(

Just to be sure, that this is the problem. Can you post the log around this crash? Looks like as if it gets an onSurfaceChanged-event...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: Alien Runner W.I.P
« Reply #20 on: August 19, 2010, 07:08:21 am »
BTW: 30fps is limit of the build in frame rate limiter. It's on by default but can be disabled in the options menu (press "center" on the dpad)...given that you make it back alive into the game...

However, the game logic won't run any faster though, so a higher fps is just a waste of battery power.

Offline zammbi

  • float
  • ****
  • Posts: 360
    • View Profile
Re: Alien Runner W.I.P
« Reply #21 on: August 19, 2010, 07:28:05 am »
Quote
(press "center" on the dpad)
That's annoying can you change it to the normal options button instead?

When I go back out of options I get a null pointer crash:

Quote
at drawVertexArray(GLRenderer.java:1906);
at world.draw(World.java:1310);

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: Alien Runner W.I.P
« Reply #22 on: August 19, 2010, 09:34:30 am »
Most likely the same reason that causes raft's problem... :-[

Offline raft

  • quad
  • ******
  • Posts: 1970
    • View Profile
    • http://www.aptalkarga.com
Re: Alien Runner W.I.P
« Reply #23 on: August 19, 2010, 02:46:43 pm »
here it is:
Code: [Select]
I/jPCT-AE ( 7027): Memory usage after compacting: 5247 KB used out of 9863 KB
I/jPCT-AE ( 7027): Surface created!
I/jPCT-AE ( 7027): Initializing surface with width: 800/height: 480
I/jPCT-AE ( 7027): Visibility lists disposed!
I/jPCT-AE ( 7027): Disposing VBOs!
I/jPCT-AE ( 7027): Renderer disposed!
I/jPCT-AE ( 7027): OpenGL vendor:     Qualcomm
I/jPCT-AE ( 7027): OpenGL renderer:   Adreno
I/jPCT-AE ( 7027): OpenGL version:    OpenGL ES-CM 1.1
I/jPCT-AE ( 7027): OpenGL renderer initialized (using 2 texture stages)
I/jPCT-AE ( 7027): Loading Texture...
D/dalvikvm( 7027): GC freed 270 objects / 199360 bytes in 53ms
D/dalvikvm( 7027): GC freed 2 objects / 48 bytes in 45ms
I/jPCT-AE ( 7027): Loading Texture...
I/jPCT-AE ( 7027): [ 1282221747181 ] - ERROR: Tried to set an undefined texture as default!
D/dalvikvm( 7027): GC freed 33 objects / 1376 bytes in 48ms
W/dalvikvm( 7027): threadid=15: thread exiting with uncaught exception (group=0x4001b178)
I/dalvikvm-heap( 7027): Grow heap (frag case) to 13.289MB for 6291472-byte allocation
D/dalvikvm( 7027): GC freed 5 objects / 6291624 bytes in 58ms
E/AndroidRuntime( 7027): Uncaught handler: thread GLThread 8 exiting due to uncaught exception
E/AndroidRuntime( 7027): java.lang.RuntimeException: [ 1282221747181 ] - ERROR: Tried to set an undefined texture as default!
E/AndroidRuntime( 7027): at com.threed.jpct.Logger.log(Logger.java:159)
E/AndroidRuntime( 7027): at com.threed.jpct.Object3D.setTexture(Object3D.java:3201)
E/AndroidRuntime( 7027): at com.threed.jpct.games.alienrunner.Particle.setTexture(Particle.java:79)
E/AndroidRuntime( 7027): at com.threed.jpct.games.alienrunner.ParticleManager.addParticle(ParticleManager.java:169)
E/AndroidRuntime( 7027): at com.threed.jpct.games.alienrunner.ParticleManager.addEmitter(ParticleManager.java:100)
E/AndroidRuntime( 7027): at com.threed.jpct.games.alienrunner.Player.move(Player.java:492)
E/AndroidRuntime( 7027): at com.threed.jpct.games.alienrunner.AlienRunner$MyRenderer.updateGameState(AlienRunner.java:591)
E/AndroidRuntime( 7027): at com.threed.jpct.games.alienrunner.AlienRunner$MyRenderer.onDrawFrame(AlienRunner.java:728)
E/AndroidRuntime( 7027): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1116)
E/AndroidRuntime( 7027): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:975)
I/Process (   80): Sending signal. PID: 7027 SIG: 3
I/dalvikvm( 7027): threadid=7: reacting to signal 3
I/dalvikvm( 7027): Wrote stack trace to '/data/anr/traces.txt'

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: Alien Runner W.I.P
« Reply #24 on: August 19, 2010, 02:52:16 pm »
Just great! It creates a whole new surface just because the layout gets visible again. How stupid is that!?  >:(

Offline raft

  • quad
  • ******
  • Posts: 1970
    • View Profile
    • http://www.aptalkarga.com
Re: Alien Runner W.I.P
« Reply #25 on: August 19, 2010, 04:18:17 pm »
i guess you should be prepared for a surface recreate everytime

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: Alien Runner W.I.P
« Reply #26 on: August 19, 2010, 04:59:07 pm »
Obviously...it's still bad design IMHO. OpenGL binds a lot of stuff to the context. Creating a new one all the time causes bad performance, uses more memory etc....it's just a bad idea. And instead of making it better they seem to make it worse, because 1.5 doesn't do this. Annoying...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: Alien Runner W.I.P
« Reply #27 on: August 19, 2010, 11:28:16 pm »
Ok, i've updated the apk with a version that should be able to handle new surface and activity creations. At least it works in the emulator. On my phone, reviving the activy from being paused seems to have a 50% chance of crashing, a 10% chance of rendering faulty geometry and maybe a 40% chance of actually coming back to normal.

In the 2.2 emulator, it plays a game of Activity pong at startup...create, pause, stop, resume, destroy, create...just stupid IMHO.

Offline raft

  • quad
  • ******
  • Posts: 1970
    • View Profile
    • http://www.aptalkarga.com
Re: Alien Runner W.I.P
« Reply #28 on: August 20, 2010, 02:26:58 am »
yeap it seems okey now. no crash.

dont worry about your phone. i had similar problems with G1, but on N1 it's all ok. i've never seen a native crash.

Offline raft

  • quad
  • ******
  • Posts: 1970
    • View Profile
    • http://www.aptalkarga.com
Re: Alien Runner W.I.P
« Reply #29 on: August 20, 2010, 04:50:40 am »
another exception. this happens after your application is pushed to background and mine came to foreground. i also hold a wake lock, this must be related to it.

Code: [Select]
I/jPCT-AE ( 7962): Activity stopped!
D/libEGL  ( 8879): loaded /system/lib/egl/libEGL_adreno200.so
D/AndroidRuntime( 7962): Shutting down VM
W/dalvikvm( 7962): threadid=3: thread exiting with uncaught exception (group=0x4001b178)
E/AndroidRuntime( 7962): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime( 7962): java.lang.RuntimeException: Unable to stop activity {com.threed.jpct.games.alienrunner/com.threed.jpct.games.alienrunner.AlienRunner}: java.lang.RuntimeException: WakeLock under-locked wtf?
E/AndroidRuntime( 7962): at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:3227)
E/AndroidRuntime( 7962): at android.app.ActivityThread.handleStopActivity(ActivityThread.java:3272)
E/AndroidRuntime( 7962): at android.app.ActivityThread.access$2500(ActivityThread.java:119)
E/AndroidRuntime( 7962): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1880)
E/AndroidRuntime( 7962): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 7962): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 7962): at android.app.ActivityThread.main(ActivityThread.java:4363)
E/AndroidRuntime( 7962): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 7962): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 7962): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
E/AndroidRuntime( 7962): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
E/AndroidRuntime( 7962): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 7962): Caused by: java.lang.RuntimeException: WakeLock under-locked wtf?
E/AndroidRuntime( 7962): at android.os.PowerManager$WakeLock.release(PowerManager.java:304)
E/AndroidRuntime( 7962): at android.os.PowerManager$WakeLock.release(PowerManager.java:279)
E/AndroidRuntime( 7962): at com.threed.jpct.games.alienrunner.AlienRunner.onStop(AlienRunner.java:230)
E/AndroidRuntime( 7962): at android.app.Instrumentation.callActivityOnStop(Instrumentation.java:1169)
E/AndroidRuntime( 7962): at android.app.Activity.performStop(Activity.java:3797)
E/AndroidRuntime( 7962): at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:3224)
E/AndroidRuntime( 7962): ... 11 more