www.jpct.net

jPCT-AE - a 3d engine for Android => Projects => Topic started by: EgonOlsen on July 18, 2010, 10:16:26 pm

Title: Alien Runner W.I.P
Post by: EgonOlsen on July 18, 2010, 10:16:26 pm
As mentioned in the "new version" thread, i've started working on a kind of racing game, Alien Runner is the working title.

(http://www.jpct.net/img/alienrunner.png)
This is the first working version with placeholder objects, random level setups and a lot of glitches.
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on July 18, 2010, 10:18:20 pm
This is the current state:

(http://www.jpct.net/img/alien_runner_1.png)
Jumping over wood...

(http://www.jpct.net/img/alien_runner_2.png)
Passing the gates...

It has some less glitches, some optical enhancements like better lighting, blob shadows and particles as well as a basic level loader (but no real levels yet...).
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on July 20, 2010, 10:54:12 pm
Most of the actual level elements are in place now. I've added collectable items (little diamonds) and water pool that slows you down. Controls have improved too.

(http://www.jpct.net/img/alien_runner_3.png)
Water pool in the distance and collecting a diamond

(http://www.jpct.net/img/alien_runner_4.png)
Destroying a wall by bumping into it multiple times

(http://www.jpct.net/img/alien_runner_5.png)
Collecting again...
Title: Re: Alien Runner W.I.P
Post by: raft on July 21, 2010, 12:19:41 pm
looks very nice ;) how do you make the shiny effect of diamonds and wall particles ? they are not actual 3d particles i suppose..
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on July 21, 2010, 12:34:54 pm
The glow is a textured plane with a white spot texture with alpha (BTW: beware of the the default conversion to 16bit that AE applies to textures. It somehow has a problem with alpha channels...i have to look into that) located in the middle of the diamond. The rubble is just a simple particle effect with particles using a rubble texture.
Title: Re: Alien Runner W.I.P
Post by: raft on July 21, 2010, 01:24:08 pm
when does this 16 bit conversion occur ? when creating the texture or loading the image from resource ? i tend to load images with oldy class.getResourceAsStream(..) method as it's the most portable way

so all the rubble pieces are different planes ?
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on July 21, 2010, 01:44:20 pm
When uploading the texture to the GPU, i.e. at the latest possible stage. The rubble pieces are simple textured, billboarded triangles that act like as if they were emitted by a fountain...just like the stars in Robombs when you collect an item.
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on July 21, 2010, 10:30:54 pm
The alpha/16bit-issue is fixed now. I've uploaded a new jar of AE.
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on August 03, 2010, 09:53:18 pm
Added some stuff like score- and time counter, multi colored crystals, achievements...the only major thing that's still missing is a virtual opponent (like a ghost car in some racnig games).

Right now, i'm working to get a good "flow", i.e. to make the racing fun...not too easy and not too difficult, let a slow down feel just right, limit the jumps...that kind of stuff. The method that does the player's physics already looks pretty terrible... ;)

(http://www.jpct.net/img/alien_runner_6.png)
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on August 09, 2010, 11:19:21 pm
The "ghost player" has been added in its basic form and some level decorations are in. Due to the latest improvements to the engine's core and some optimizations in the game's code itself, it isn't any slower than before.

Oh, and the sky now has soft scrolling instead of being static.

(http://www.jpct.net/img/alien_runner_7.png)

Title: Re: Alien Runner W.I.P
Post by: zammbi on August 09, 2010, 11:30:05 pm
Looking great. Going to try sell this one? Since there is a lack of nice 3d games(none really running on low dervices) you might get some good money :)
Title: Re: Alien Runner W.I.P
Post by: Thomas. on August 10, 2010, 07:43:43 pm
How can I create skybox, please? ... something like is in your game...
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on August 10, 2010, 09:10:18 pm
It's not a skybox, it's just a bitmap blitted into the background. That's cheaper performance wise and for this game, it works just fine. If you have to use a real skybox or -dome, i tend to put the dome/box object in another world and render it in the same framebuffer. Just like i did with the skydome in this example: http://www.jpct.net/wiki/index.php/Advanced_example (http://www.jpct.net/wiki/index.php/Advanced_example)
Title: Re: Alien Runner W.I.P
Post by: Thomas. on August 10, 2010, 09:12:31 pm
Ok, thanks, I try it  :)
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on August 10, 2010, 11:13:33 pm
Looking great. Going to try sell this one? Since there is a lack of nice 3d games(none really running on low dervices) you might get some good money :)
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.
Title: Re: Alien Runner W.I.P
Post by: zammbi 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)
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen 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 (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.

Title: Re: Alien Runner W.I.P
Post by: raft 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)
Title: Re: Alien Runner W.I.P
Post by: paulscode 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.
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen 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...
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen 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.
Title: Re: Alien Runner W.I.P
Post by: zammbi 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);
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on August 19, 2010, 09:34:30 am
Most likely the same reason that causes raft's problem... :-[
Title: Re: Alien Runner W.I.P
Post by: raft 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'
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen 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!?  >:(
Title: Re: Alien Runner W.I.P
Post by: raft on August 19, 2010, 04:18:17 pm
i guess you should be prepared for a surface recreate everytime
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen 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...
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen 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.
Title: Re: Alien Runner W.I.P
Post by: raft 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.
Title: Re: Alien Runner W.I.P
Post by: raft 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
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on August 20, 2010, 07:18:49 am
I'm releasing the wake-lock in onStop(), because otherwise, i got errors that i haven't before stopping the application. Looks like as if somebody was a bit exception happy and decided to throw one if you release an already released lock...now that makes sense.
I'm going to put a try-catch around it and swallow it...
Title: Re: Alien Runner W.I.P
Post by: raft on August 20, 2010, 07:27:05 am
i do acquire() and release() at onResume() and onPause() methods. but first check isHeld() and the opposite. no problem so far
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on August 20, 2010, 07:32:35 am
Great, i'll do that too then. isHeld() sounds pretty stupid in german, because it means isHero()... ;)
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on August 25, 2010, 09:36:52 pm
Uploaded a new version with some fixes, a simple level selection and a (really) short second level. The options menu can now be accessed by pressing the options buttons. Controls have been unified so that touch screen and dpad act in the same way.

Can somebody with a fast device please try to disable "eco mode" in the options menu and report the frame rate!?
Title: Re: Alien Runner W.I.P
Post by: raft on August 25, 2010, 09:54:56 pm
with eco mode disabled, it runs @31-32 fps.

some observations:
* at landscape orientation back button is at lower right. so we sometimes accidentally touch it. this brings up level selector and from there, there is no way to continue level. a resume button or similar may help. i pause the game when back button is touched and resume again with second touch
* when options view is visible, returning the game with back button may again help
* at the moment, game somehow caches back button touch when options activity is visible and when we return to game level selector pops up
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on August 25, 2010, 11:21:02 pm
Thanks for the feedback. On my phone, back button is on the upper left when in landscape orientation and it's impossible to touch it by accident...i guess the layouts differ... ;) I'll make the back button pause the game and bring up the level selector and make it resume a paused game after release, just as you suggested. I'm always lazy with such tedious stuff...

Your phone is still running 2.1?
Title: Re: Alien Runner W.I.P
Post by: paulscode on August 26, 2010, 12:44:56 am
please try to disable "eco mode" in the options menu and report the frame rate
It runs 47-49 fps on my Droid X with eco mode disabled.
Title: Re: Alien Runner W.I.P
Post by: raft on August 26, 2010, 01:01:02 am
Quote
Your phone is still running 2.1?
yes, despite all its insistence to upgrade to 2.2 ;D
Title: Re: Alien Runner W.I.P
Post by: Thomas. on August 26, 2010, 07:46:17 pm
on Galaxy S it is running about 30 with eco mode... without 56 ... phone is running on 2.1
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on August 26, 2010, 08:06:12 pm
Galaxy S is a real beast...
Title: Re: Alien Runner W.I.P
Post by: Thomas. on August 26, 2010, 08:19:58 pm
56 frames per second are limited by screen, not GPU  :) ... Are you planning support openGL 2.0? mainly shadows and reflections :)
And please, how can I do free spotlight? if I can...
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on August 26, 2010, 09:27:53 pm
You can place infinite light sources and you can use specular lighting on Objects (Object3D.setSpecularLighting(<boolean>)), but no real (as far as OpenGL permits "real spot lights" anyway) spot lights. That's mainly because desktop jPCT doesn't support them either and that vertex lighting on Android is pretty much broken. Even attenuation doesn't work neither in the emulator nor on my phone...all you get is a wrongly lit polygon mess.

I'm glad that you mentioned OpenGL ES 2.0, because that gives me the chance to do a little rant on this topic:

<rant>
What the hell were they thinking when they designed ES 2.0? It's incompatible with 1.0/1.1! Unlike in "real" OpenGL, where you can still use all features down to 1.0 even in a 4.1 context (unless you create a "pure" context, which makes no sense at all), they decided to make ES 2.0 completely shader based and dropped everything fixed function based.

That has several drawbacks:

Shader are a great thing! They give you a flexibility that you don't have with the fixed function pipeline. However, the design of ES 2.0 forces you to do everything in a shader, which is just plain stupid IMHO, because it stresses the hardware with no need, is much harder to maintain and creates a gaint hurdle to people who want to start programming OpenGL ES.
</rant>

However, support for ES 2.0 will eventually come in the future. But i need hardware that supports it to add it (the emulator just sucks) and i currently don't have any.
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on August 26, 2010, 10:40:44 pm
And another version that implements most (all?) of the control/button changes that raft suggested as well as some different, still more or less random, level selection graphics.
Title: Re: Alien Runner W.I.P
Post by: raft on August 26, 2010, 10:52:14 pm
cool, much better now ;)

there is one more thing i've noticed: i tend to keep my finger on screen and move it as required. this makes the character vibrate. i believe this happens because of continuous touch events around touch point. you may want to filter those events. i dont know how, maybe a threshold may help
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on August 26, 2010, 11:01:02 pm
There is a kind of dead spot around the current position, but it doesn't depend in screen resolution...maybe it should.
Title: Re: Alien Runner W.I.P
Post by: raft on August 26, 2010, 11:02:35 pm
i guess so. DIP based or similar..
Title: Re: Alien Runner W.I.P
Post by: Thomas. on August 27, 2010, 05:48:04 pm
In OGL 1.0 or 1.1 I can not use shadows and reflection? or just jPCT for android do not support it? If I look on Nova or Need for speed for android, both games use reflections... and Quadrant benchmark have shadows... I found another grafic engine on http://www.imgtec.com/powervr/insider/powervr-demos.asp , but it is very complicated for me...
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on August 27, 2010, 08:48:47 pm
In 1.0/1.1, you can do stencil shadows if the hardware/driver supports it. This is what the Quadrant demo uses (judging from the screen shots, it just crashes on my phone). jPCT-AE (as well as jPCT) doesn't support stencil shadows, because their use is limited, they have several drawbacks and are computational intense, because you have to recalculate the shadow silhouette of each object for each frame (i.e. determine the "edge" where an objects polygons switch from front to back facing and extrude this into the scene). Stencil shadows are hardly used today. Doom 3 was using them as well as F.E.A.R, but i don't know of any other game that does.
Today, shadow mapping is being used most of the time and you can't that in 1.0/1.1

Concerning reflections: All reflections i've seen so far in OpenGL ES 1.0/1.1 were simply flipped geometry approaches. The idea is simple: Just render the same geometry that if above the reflecting surface again below the reflecting in a mirrored way. You are free to do this in jPCT-AE, it's just pretty costly, because you render the whole scene twice into a full blown frame buffer.
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on August 28, 2010, 12:30:01 am
i guess so. DIP based or similar..
Its actually another problem caused by the translation from 2D touch coords into 3d player coords. I tried to improve it, but it's very hard to test on my phone, because it plays like shite when using the touch screen in that manner. Can you give it a try and report back, if it's any better  ???
Title: Re: Alien Runner W.I.P
Post by: raft on August 28, 2010, 12:51:08 am
it's better but it still sometimes vibrates. couldnt find the pattern, just sometimes happens. not too much
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on August 28, 2010, 09:35:30 am
 I know the reason, i just have to find a proper to fix it... ??? Thanks for testing.
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on August 28, 2010, 08:27:27 pm
Uploaded a new version. Any better now?
Title: Re: Alien Runner W.I.P
Post by: raft on August 28, 2010, 09:11:28 pm
yes, definetely. no vibration at all at N1
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on August 28, 2010, 09:28:21 pm
Good, it seems to be fixed then... ;D Thanks again for testing.
Title: Re: Alien Runner W.I.P
Post by: raft on August 28, 2010, 09:39:22 pm
no problem at all. it's nice to see how you progress ;)
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on September 30, 2010, 11:46:13 pm
Has some simple sound effects now. I tried to add music too, but it either needed too much memory or was annoying because it looped after a few seconds, so i finally decided against it.

BTW: Use ogg, not wav when using the SoundPool...
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on October 07, 2010, 11:30:19 pm
I've published it in the Android market as a kind of preview version after finishing the third level to see how it goes and to get some feedback.

(http://www.jpct.net/img/alien_qr.png)

market://search?q=pname:com.threed.jpct.games.alienrunner



Title: Re: Alien Runner W.I.P
Post by: raft on October 14, 2010, 07:19:59 pm
sounds fit very well too. looks and runs quite fine on N1.

how do you display the loading screen? another view or blitting image to frame buffer before anything else is loaded?
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on October 14, 2010, 08:44:13 pm
Yes, it's just blitting something else before the rest is loaded with some sleep time to give the loading thread the cpu power it needs.
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on October 17, 2010, 09:43:55 pm
@anybody with a higher res device: Does the sky look right? Because it actually should as it's scaled according to the framebuffers width. But it doesn't look good in the emulator, hence the question...
Title: Re: Alien Runner W.I.P
Post by: zammbi on October 18, 2010, 01:24:35 am
Quote
Does the sky look right?
Seems fine on mine.

How do you change the map without a keyboard?
Maybe you should add a quit button on screen somewhere since the back button doesn't quit.
If I open the keyboard on the loading screen it still crashes.

Title: Re: Alien Runner W.I.P
Post by: raft on October 18, 2010, 05:52:17 am
Quote
Does the sky look right?
seems ok on my N1
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on November 17, 2010, 08:31:45 am
Had the possibility to run it on a Samsung Galaxy S with 2.2 installed. It never dropped below the Samsung's fps limit of 56 fps no matter what i did...very cool!
Title: Re: Alien Runner W.I.P
Post by: Thomas. on November 27, 2010, 01:47:03 pm
Had the possibility to run it on a Samsung Galaxy S with 2.2 installed. It never dropped below the Samsung's fps limit of 56 fps no matter what i did...very cool!
Is it your SGS? When will be support for OGL 2.0? ;D
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on November 27, 2010, 02:59:58 pm
No, it wasn't mine. Support for 2.0 will be added when i have a capable phone and there's actually a real need for it. Currently, i don't see any...
Title: Re: Alien Runner W.I.P
Post by: raft on December 14, 2010, 12:25:59 pm
Has some simple sound effects now. I tried to add music too, but it either needed too much memory or was annoying because it looped after a few seconds, so i finally decided against it.

BTW: Use ogg, not wav when using the SoundPool...

seems as SoundPool is not suitable for -relatively- long sounds like music. -at least on N1- MediaPlayer can effectively handle a few minutes long music files
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on December 14, 2010, 03:00:27 pm
Thats because SoundPool decompresses after loading and MediaPlayer doesn't. However, using MediaPlayer on a phone like mine leaves not enough cpu available for the game to run fast enough.
Title: Re: Alien Runner W.I.P
Post by: paulscode on December 14, 2010, 05:57:06 pm
I'm working on a software mixer in native code.  It might be a better option for long sounds.  I'll post the code when I get it working.
Title: Re: Alien Runner W.I.P
Post by: Prafful on February 09, 2011, 03:55:54 pm
Is "alien runner" code available for study?
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on February 09, 2011, 05:37:09 pm
Not yet, but i can zip the project files and upload it if it helps to look at some undocumented. messy code.
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on February 09, 2011, 06:04:08 pm
Here's the project: http://jpct.de/download/AlienRunner-AE.zip (http://jpct.de/download/AlienRunner-AE.zip)

Edit: A word about the license for these sources...basically, it's the same "do with it whatever you want"-license with one exception: I don't want to see modified Alien Runners appear in the market. You are free to use the sources, extract stuff, add stuff...build your own game based on them. But please don't change two textures and call it Belien Runner or similar. It's not worth it anyway, because Alien Runner is only a mediocre game.
Title: Re: Alien Runner W.I.P
Post by: Thomas. on February 10, 2011, 09:29:03 pm
Thanks, it is useful :)
Title: Re: Alien Runner W.I.P
Post by: Prafful on February 15, 2011, 03:06:51 pm
Thanks, it is useful :)
No worries, EgonOlsen: I will try to document the code and publish it back. It might help other learn the engine like it helped me.
Title: Re: Alien Runner W.I.P
Post by: tbtest550 on May 13, 2011, 05:27:57 am
 I have a simple question after learning your code. why don't u use collisonevent and collisionlistener to instead of foreach. does it because of the efficiency ???
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on May 17, 2011, 11:20:51 am
I use this polling instead of the events to avoid object creations. Each event creates a new instance and on older devices, this may become an issue.
Title: Re: Alien Runner W.I.P
Post by: Disastorm on July 25, 2011, 11:02:58 am
Hey just installed this game and its pretty good, but I think one main thing you should do (also multiple people mentioned it on the comments on android market) is to add a way to exit the game...  its a bit strange only being able to exit with the home button, most games allow exit by using the Back button at the very least.  Keep in mind the home button doesn't actually even exit the game either, the user has to go back to the application list and close it out from there.
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on July 25, 2011, 09:49:11 pm
I never cared about this, because i personally never use anything but the home button to "exit" something. That it doesn't really exit is by design and i find that handy from time to time (it also annoys me at other times...).

Thanks for feedback, but i'm not going to change that anymore. Alien Runner was not much more than a case study of the engine that helped to edge out some things. I tried to make a fun game out of that, but it doesn't really work too well IMHO. It's only a mediocre game at best...but it's a good example for the engine.
Title: Re: Alien Runner W.I.P
Post by: Disastorm on July 26, 2011, 10:55:31 pm
I agree its a good example for the engine, I am surprised that there are some people on the market that claimed the graphics aren't good.  TBH I don't think I've seen barely any mobile games with better graphics than Alien Runner really (most are probably around similar graphics), so it makes me wonder what the heck those guys are talking about.
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on July 29, 2011, 08:04:25 pm
I think it's not looking "polished"...it has no fancy menus and blinky buttons and such. And the textures aren't that great either. I did all i could, but that isn't much...
Title: Re: Alien Runner W.I.P
Post by: MrM on September 14, 2011, 04:09:17 am
Since I've been doing 2D/3D design-modelling for 8 years now (not professionally though...), you know, artsy stuff, I can offer a helping hand, if you'd like. I can create some 3D models (not animated or boned, I've never been good at that, nor in anything keyframed :S), textures, normal or bump maps, GUI art (buttons, menu images etc.), if it is to be static static, I don't have much time for animating them...
Title: Re: Alien Runner W.I.P
Post by: MrM on September 14, 2011, 05:05:49 am
Something like the pic in attachments perhaps? Or maybe that style doesn't suit you, I got that kind of feeling from watching the video... Anyway, you can do whatever you want with the picture.

[attachment deleted by admin]
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on September 14, 2011, 06:57:23 am
It's cool, thank you. I'll use it at least for the icons if i find the time to fix the project (it's a bit in a faulty state ATM, because i modified some textures for testing purposes and now it looks screwed...).
Title: Re: Alien Runner W.I.P
Post by: MrM on September 14, 2011, 05:45:50 pm
May I ask for the polycount of your model?
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on September 14, 2011, 09:22:30 pm
That animated alien? I'm not sure...something around 400 IIRC.
Title: Re: Alien Runner W.I.P
Post by: bLAZY on December 31, 2011, 01:09:19 am
Thanks, it is useful :)
No worries, EgonOlsen: I will try to document the code and publish it back. It might help other learn the engine like it helped me.

Did you?
Title: Re: Alien Runner W.I.P
Post by: BABABLACK_911 on December 28, 2012, 06:52:44 am
Hello Egon, are there any other resources available other than the AlienRunner-AE game, So that we can dig in with a few more references?
Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on December 28, 2012, 10:06:49 pm
There are the basic examples in the distribution, the Alien Runner sources and the sources of the An3DBenchXL benchmark here: jpct.de/download/tmp/An3DBenchXL.7z (http://jpct.de/download/tmp/An3DBenchXL.7z) as well as an unfinished prototyp of some kind here: http://jpct.de/download/tmp/Prototype-AE.7z (http://jpct.de/download/tmp/Prototype-AE.7z). If they really add some value in addition to the Alien Runner sources...i don't know. They might not even compile with the latest version of jPCT-AE (but that should be only one or two lines to change to make them compile)...
Title: Re: Alien Runner W.I.P
Post by: BABABLACK_911 on December 29, 2012, 05:37:14 pm
Thanks for the projects, i'd like to say that the prototype one is working. :) Just need to clean up my project all the time before running it. :P
Its a great help to me to understand the concepts more clearly and more clear jPCT-AE :)
Title: Re: Alien Runner W.I.P
Post by: sushobhit on March 25, 2014, 07:08:15 am
Well I downloaded the source of this project to study , to understand the concepts to JPCT programmig but let me confess I got addicted to the GAME (really i am not flattering) it's really fun to play !!!

Title: Re: Alien Runner W.I.P
Post by: EgonOlsen on March 25, 2014, 04:03:13 pm
Thanks. Personally, i consider it to be a mediocre game. It could be much better if i would have polished it a little more. If you want to, feel free to improve it in any way you like.
Title: Re: Alien Runner W.I.P
Post by: mxar on February 01, 2017, 03:32:17 pm
Hi.

The Alien Runner game uses a straight road which is based on Object3d planes.

In case  a developer needs to create a similar game with curved roads what the solution will be?

I'm trying to develop a method which creates a curved road.

The method will be something like this:

Object3D curvedPlane = createCurvedPlane(float innerRadius,float ouRadius,float angle,int quads)

This method is like the ExtendedPrimitives.createTube(float innerRadius, float outerRadius, float height, int quads)
but the height is equal to zero and the tube is not round but is drawn arount to an angle < 360 degrees.

Any idea to help me?

Thanks in Advance.