WIP: Arcade style airplane game - Contest Entry

@mifth said:
About FakeParticleBlow... Possibly there will be a solution:
http://hub.jmonkeyengine.org/groups/graphics/forum/topic/blending-issue-with-a-palm/
http://hub.jmonkeyengine.org/groups/free-announcements/forum/topic/ships-with-cannons/?topic_page=1&num=15
http://hub.jmonkeyengine.org/groups/free-announcements/forum/topic/ships-with-cannons-1/
http://hub.jmonkeyengine.org/groups/general-2/forum/topic/overuse-blendmode-alpha/


Thank you. This will be one of the next steps.

I am still fighting with the collisions. Basically i wanted to use:
[java]
rootNode.collideWith(spatial,results);
[/java]
but this gives me a UnsupportedCollisionException:
[java]
com.jme3.collision.UnsupportedCollisionException
at com.jme3.collision.bih.BIHTree.collideWith(BIHTree.java:459)
at com.jme3.scene.Mesh.collideWith(Mesh.java:858)
at com.jme3.scene.Geometry.collideWith(Geometry.java:444)
at com.jme3.scene.Node.collideWith(Node.java:494)
at AirStrike.Controllers.zeppelinControl.controlUpdate(zeppelinControl.java:35)
at com.jme3.scene.control.AbstractControl.update(AbstractControl.java:90)
at com.jme3.scene.Spatial.runControlUpdate(Spatial.java:553)
at com.jme3.scene.Spatial.updateLogicalState(Spatial.java:671)
at com.jme3.scene.Node.updateLogicalState(Node.java:147)
at com.jme3.scene.Node.updateLogicalState(Node.java:154)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:259)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:149)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:185)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:223)
at java.lang.Thread.run(Thread.java:722)
[/java]
It seems that i cannot check a collision with a spatial. The question is how do i generate a from the model?
Is there a list of the collidable's ?

try to use spatial as a Node.

@mifth said:
try to use spatial as a Node.

Unfortunately the same:
[java]
INFO: Child (Models/Airplanes/zeppelin.blend) attached to this node (Root Node)
Nov 14, 2011 3:13:06 PM com.jme3.app.Application handleError
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
com.jme3.collision.UnsupportedCollisionException
at com.jme3.collision.bih.BIHTree.collideWith(BIHTree.java:459)
at com.jme3.scene.Mesh.collideWith(Mesh.java:858)
at com.jme3.scene.Geometry.collideWith(Geometry.java:444)
at com.jme3.scene.Node.collideWith(Node.java:494)
at com.jme3.scene.Node.collideWith(Node.java:494)
at AirStrike.Controllers.zeppelinControl.controlUpdate(zeppelinControl.java:36)
at com.jme3.scene.control.AbstractControl.update(AbstractControl.java:90)
at com.jme3.scene.Spatial.runControlUpdate(Spatial.java:553)
at com.jme3.scene.Spatial.updateLogicalState(Spatial.java:671)
at com.jme3.scene.Node.updateLogicalState(Node.java:147)
at com.jme3.scene.Node.updateLogicalState(Node.java:154)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:259)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:149)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:185)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:223)
at java.lang.Thread.run(Thread.java:722)
[/java]

I am using this code:
[java]
((Node)this.zeppelin).collideWith(core.getRootNode(), result);
[/java]

Hm, i tracked down the error to:

BIHNode.java

[java]

int added = col.collideWith(t, results); //line 222

[/java]

where t is a triangle



The call to col.collideWith() contains: (in the BoundingSphere.java)

[java]

public int collideWith(Collidable other, CollisionResults results) {

if (other instanceof Ray) {

Ray ray = (Ray) other;

return collideWithRay(ray, results);

} else {

throw new UnsupportedCollisionException();

}

}

[/java]

so i come to the conclusion that only collision with rayā€™s are supported

It is not possible to check collision with bounding boxes or bounding spheres. It causes UnsupportedCollisionException. Btw it could be cool if they could support it. Check the collisions with geometries or nodes instead.

Looking good man. Good luck :slight_smile: Love the smooth movement of the space ship.

Good news. The physics problem is solved. I simply use Bullet, donā€™t know why i did not implement it in the first time. Bullet is pretty fast, on my machine i have only a very small loss of fps.

Here is a video, shooting zeppelinā€™s :slight_smile:

http://www.youtube.com/watch?v=mTND_IPKSqk

1 Like

COooooooool! -

Puh,ā€¦that looks really great!!!

EPIC! :smiley:

Great work man, itā€™s already a valid entry at this stage.

really nice work mate :slight_smile:

So itā€™s time for an update,

I have refactored the code, from now on adding different enemys only 4 lines need to be changed. I have createded controls for ships and not moving airplanes. Whats left is a control for moving airplanes.



On the video you can see a testscene with zeppelins and flakships. The flakships already aim at the players position. If you donā€™t kill them before they are on your position you probably will die. (in the future) Currently no event gets fired when the enemys hit you.



http://www.youtube.com/watch?v=rd1mebqZZE4



Knows issues: when the playerPlane flyes into an enemy a lot of collision events get's fired, the game drops to 0-FPS. Not yet sure how to awoid this. I assume it's due the higher polygon count in the playerplane. Most likely once i react on the collisions this issue will be away anyways.

Since the overall perfromance should not change much in the future i am curious how the game runs on other machines.
You can download the various distributions here: http://airstrike.custom-codez.com/download/
*Note* i have only tested the windows version. My Linux netbook is not capable of running it and i currenty have no access to a mac.
If possible can you please report following:

1) FPS on your machine. (resolution, cpu, gpu) if possible
2) What do you think of the control? Is it to unprecise for avoiding targeted projectiles/missiles, or collecting some things

Thank you very much.

At next i will implement the HUD, followed by a start menu and the server connection for synchronizing stats.
1 Like

It looks nice, however, I canā€™t seem to be able to download the game. The window opens, but when I save the file, it doesnā€™t download - halting after about 2%.

hm strange, i tried all three downloads, they seem to work fine for me. Anyone else problems with the download?

I can download the mac version just fineā€¦

ā€¦ but the shader fails to compile on apples AnalGL:

21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: WARNUNG: Bad compile of:
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: #define ANY_DIR_Y 1
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: #define CHANGE_DIR 1
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: uniform mat4 g_WorldViewProjectionMatrix;
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: uniform float g_Time;
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: #if defined (ANY_DIR_Y) || defined (ANY_DIR_X)
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: uniform float m_TimeSpeed;
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: #endif
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main:
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: attribute vec3 inPosition;
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: attribute vec2 inTexCoord;
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main:
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: varying vec2 texCoord;
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: varying vec2 texCoordAni;
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main:
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: void main(){
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: gl_Position = g_WorldViewProjectionMatrix * vec4(inPosition, 1.0);
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main:
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: g_Time *= m_TimeSpeed;
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: texCoord = inTexCoord;
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: texCoordAni = inTexCoord;
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: #if defined (ANY_DIR_Y) && !defined (CHANGE_DIR)
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: texCoordAni.y += g_Time;
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: #elif defined (ANY_DIR_Y) && defined (CHANGE_DIR)
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: texCoordAni.y -= g_Time;
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: #endif
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: #if defined (ANY_DIR_X) && !defined (CHANGE_DIR)
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: texCoordAni.x += g_Time;
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: #elif defined (ANY_DIR_X) && defined (CHANGE_DIR)
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: texCoordAni.x -= g_Time;
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: #endif
21.11.11 16:44:44,430 [0x0-0x178b78a].AirStrike.Main: }
21.11.11 16:44:44,431 [0x0-0x178b78a].AirStrike.Main: 21.11.2011 16:44:44 com.jme3.app.Application handleError
21.11.11 16:44:44,431 [0x0-0x178b78a].AirStrike.Main: SCHWERWIEGEND: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
21.11.11 16:44:44,431 [0x0-0x178b78a].AirStrike.Main: com.jme3.renderer.RendererException: compile error in:ShaderSource[name=Shaders/FakeParticleBlow/FakeParticleBlow.vert, defines, type=Vertex] error:ERROR: 0:20: Left-hand-side of assignment must not be read-only

Somehow the shader isn't 100% compliant, you need these "blow" shaders? They seem to blow ^^

^^ and this is why itā€™s always good to test shaders on a Mac! :slight_smile:

I see. Hm looks like i have to reactivate my hackint0sh.

Any parameter i can set the shader compilation to a stricter mode on windows?



I the meantime i have removed the engine on the Mac version.



However, i am still using some filters which seems not be compatible with some gfx cards.

Currently SSAO, water, bloom, translucent and FXAA filters are in use. Plan is to deactivate some of the filters if GL_MODE does not support it.

Must have been something with the server. Everything works fine now. Sorry for the hassle.



Upon opening the gameā€¦ it crashed :confused: I tried running it on Windows 7 x64.



Procedure:



I double-clicked the executable and chose the default resolution etcā€¦ However, the game exited some seconds after the new window came up. This window had no objects or models whatsoever - just a black screen.