Planet Dash (For android) released! Download link inside! :D

Hi,



I really want to create this planet dash game but I’v had some problems with exporting aswell as getting it to work at all.

Now finaly I managed to publish it and everything but this is not the full game or even an alpha.

If you download it please reply here to tell me how much it lagged.

Because on my device the lag is durable but really destroys the beauty of the game.



Anyways, here is the link: https://play.google.com/store/apps/details?id=andrew.planetdash

The reason it’s released is to know if it only lags on my galaxy nexus or if it lags on all devices.



Let me hear what you think :smiley:

1 Like

CONTROLS:

-Tap to set direction of the rocket

-Click blue button to launch

-Double tap during flight to kill yourself

-Tap during flight to boost (doesnt work)

-Click backbutton to get up the menu



The reset doesn’t work well either, but yea. This is only to check how much it lags, i’ll release better app once I fix this lag.

I tested your game on my nexus one, and yes it “lags”. I would just say that it’s slow though, “lag” usually implies a network dialog with a server afaik.

my android version is 2.3.6.



You could maybe let the framerate display for testing. So people would be able to give you numbers instead of “yeah it’s slow” :stuck_out_tongue:



Are you using the lighting material? If you do I recommend setting the vertexLighting flag to true, you’ll have a nice boost (at a cost of rendering quality, but that should be ok).



do you have custom shaders?

@nehon I appriciate you took time testing it :slight_smile:



No I only use unshaded.j3md material.

But I noticed what Might be causing the trouble…

When I get a material I save it in an array so that if more planets would have same look then they share material. Maybe this array of materials is taking up all memory making less memory for the rendering to be done on?

Here is the whole code used when getting a material:

[java]private static ArrayList<Material> textures = new ArrayList<Material>();



public static Material Texture(String name, boolean transparency) {

Material mat = getMaterial(name);

if (mat != null){

return mat;

} else {

mat = new Material(MainGame.getAsset(),“Common/MatDefs/Misc/Unshaded.j3md”);

mat.setName(name+","+transparency);

if (transparency){

mat.setTransparent(true);

mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);

mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);

}



Texture img = ImageLoader.Load(“textures/”+name);



img.setWrap(WrapMode.Repeat);

img.setMagFilter(Texture.MagFilter.Nearest);

mat.setTexture(“ColorMap”, img);



textures.add(mat);

return mat;



}

}



private static Material getMaterial(String name) {

for(Material mat : textures){

if (mat.getName().equals(name)){

return mat;

}

}

return null;

}[/java]



If this would be the problem, how can I increase my memory to account for this?

Or should I simply store the images in an array instead of the full material?

The frame rate is bad on my HTC sensation

It crashed on my Samsung Galaxy Spica when I started it. My phone still runs Android 1.5, but the Google Play store says it should run on devices from Android 1.5 and up.



However according this thread it shouldn’t run on my phone:

http://hub.jmonkeyengine.org/groups/android/forum/topic/jme-on-android-without-opengl-2/



Have you tried it in the Android emulator with Android 1.5 ?

1 Like

Sorry, I set the api level to 3 which meens 1.5 can run this. Its because I tought it would help the problem with finding this on google play. This is fixed upon next update.

Thanks for the headsup vortex :slight_smile:

It’s silly.

I reduced the graphical part to bare minimum. The spaceship is launched from a triangle, flying around sharp-edged-wanabe-spheres. It’s using no textures nothing. And it still lags much!



I noticed the framerate drops very much as you get furthur away. Could this problem really be that I should use some LOD calculations?

I dont really want to set the fustrum to low, even using 500 will lag, and then Im unable to see the goal because it’s further away than that.



Now as I’m using 500 as farfustrum I still cant get it to work.

I’m so tired of this. I don’t reach a nice flow until it’s only my singlecolored rocket flying so far away from everything else that all I can see is the rocket and the squares flying out of it’s butt first THEN it will run smoothly.

This is a serious graphical issue and I have no idea what Im doing wrong.

Here is the complete code of the MatrialManager (the ones used everywhere to create a material):

[java]package material;



import java.util.ArrayList;



import start.MainGame;

import material.ImageLoader;



import com.jme3.material.Material;

import com.jme3.material.RenderState.BlendMode;

import com.jme3.material.RenderState.FaceCullMode;

import com.jme3.math.ColorRGBA;



import com.jme3.texture.Texture;

import com.jme3.texture.Texture.WrapMode;



public class MaterialManager {





public static Material Wireframe(){



Material mat = new Material(MainGame.getAsset(), “Common/MatDefs/Misc/Unshaded.j3md”);

mat.setColor(“Color”, ColorRGBA.Red);

mat.getAdditionalRenderState().setWireframe(true);



return mat;

}



public static Material Wireframe(ColorRGBA c){



Material mat = new Material(MainGame.getAsset(), “Common/MatDefs/Misc/Unshaded.j3md”);

mat.setColor(“Color”, c);

mat.getAdditionalRenderState().setWireframe(true);

return mat;

}







public static Material unshadedColor(ColorRGBA color) {

Material mat = getMaterial(“Color:”+color.toString());

if (mat != null){

return mat;

} else {

mat = new Material(MainGame.getAsset(),“Common/MatDefs/Misc/Unshaded.j3md”);

mat.setName(“Color:”+color.toString());

mat.setColor(“Color”, color);

textures.add(mat);

return mat;

}

}



private static ArrayList<Material> textures = new ArrayList<Material>();



public static Material Texture(String name, boolean transparency) {

Material mat = getMaterial(name);

if (mat != null){

return mat;

} else {

mat = new Material(MainGame.getAsset(),“Common/MatDefs/Misc/Unshaded.j3md”);

mat.setName(name+","+transparency);

if (transparency){

mat.setTransparent(true);

mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);

mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);

}



Texture img = ImageLoader.Load(“textures/”+name);



img.setWrap(WrapMode.Repeat);

//img.setMagFilter(Texture.MagFilter.Nearest);

mat.setTexture(“ColorMap”, img);



textures.add(mat);

return mat;



}

}



private static Material getMaterial(String name) {

for(Material mat : textures){

if (mat.getName().equals(name)){

return mat;

}

}

return null;

}



public static Material unshadedColor(ColorRGBA color, boolean doubleside) {

if (doubleside){



Material mat = getMaterial(“ColorD:”+color.toString());

if (mat != null){

return mat;

} else {

mat = new Material(MainGame.getAsset(),“Common/MatDefs/Misc/Unshaded.j3md”);

mat.setName(“ColorD:”+color.toString());

mat.setColor(“Color”, color);

//mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);



textures.add(mat);

return mat;

}

} else {

return unshadedColor(color);

}

}

}[/java]



Please tell me if Im using the wrong materials somewhere…

I don’t think the issue is in the materials, I think its the models you’re using. How many vertices are there? Are those planets fully detailed? Perhaps you can enable the statistics view for us to see?



P.S: It runs horribly on my Motorola Xoom tablet (1 fps).

App updated! Goto proto dash and click update if you already downloaded it :slight_smile:

Now you can see the fps and debug things aswell.

It is also reduced to bare minimum on the graphical part.

Still there is 1500 verts all the time and about 7k triangles at some point.

How can a tetra looking planet have 7k triangles?! I really dont get it :frowning:

mhhh even 7k triangles shouldn’t be a problem.

What does the log tells you? do you have a lot of garbage collection log?

Not at all, I think…

Something like this is printed over and over again while playing:



06-18 10:54:11.496: W/OGLESShaderRenderer(20918): WARNING OGLESShaderRenderer 10:54:11 AM no location for uniform [m_VertexColor]

06-18 10:54:11.496: I/OGLESShaderRenderer(20918): RENDERING A MESH USING VertexBufferObject

06-18 10:54:11.496: I/OGLESShaderRenderer(20918): INFO OGLESShaderRenderer 10:54:11 AM renderMeshDefault(com.jme3.scene.Mesh@4193dfe8, 0, 1)

06-18 10:54:11.496: I/OGLESShaderRenderer(20918): setVertexAttrib(VertexBuffer[fmt=Float, type=Position, usage=Dynamic, elements=180], null)

06-18 10:54:11.496: I/OGLESShaderRenderer(20918): GLES20.glBindBuffer(34962, 4270061)

06-18 10:54:11.496: I/OGLESShaderRenderer(20918): GLES20.glVertexAttribPointer(location=2, numComponents=3, format=Float, isNormalized=false, stride=0, data.capacity=180)

06-18 10:54:11.496: I/OGLESShaderRenderer(20918): setVertexAttrib(VertexBuffer[fmt=Float, type=TexCoord, usage=Dynamic, elements=120], null)

06-18 10:54:11.496: I/OGLESShaderRenderer(20918): GLES20.glBindBuffer(34962, 4340062)

06-18 10:54:11.496: I/OGLESShaderRenderer(20918): GLES20.glVertexAttribPointer(location=0, numComponents=2, format=Float, isNormalized=false, stride=0, data.capacity=120)

06-18 10:54:11.496: I/OGLESShaderRenderer(20918): setVertexAttrib(VertexBuffer[fmt=UnsignedByte, type=Color, usage=Dynamic, elements=240], null)

06-18 10:54:11.496: I/OGLESShaderRenderer(20918): GLES20.glBindBuffer(34962, 4410063)

06-18 10:54:11.496: I/OGLESShaderRenderer(20918): GLES20.glVertexAttribPointer(location=1, numComponents=4, format=UnsignedByte, isNormalized=true, stride=0, data.capacity=240)

06-18 10:54:11.496: I/OGLESShaderRenderer(20918): drawTriangleList(1)

06-18 10:54:11.496: I/OGLESShaderRenderer(20918): INFO OGLESShaderRenderer 10:54:11 AM GLES20.glBindBuffer(GLES20.GL_ELEMENT_ARRAY_BUFFER, 4,480,064)

06-18 10:54:11.496: I/OGLESShaderRenderer(20918): INFO OGLESShaderRenderer 10:54:11 AM glDrawElements(), indexBuf.capacity (90), vertCount (60)

06-18 10:54:11.496: I/OGLESShaderRenderer(20918): GLES20.glTexParameteri(3553, GLES20.GL_TEXTURE_MIN_FILTER, 9729)

06-18 10:54:11.496: I/OGLESShaderRenderer(20918): GLES20.glTexParameteri(3553, GLES20.GL_TEXTURE_MAG_FILTER, 9729)

06-18 10:54:11.496: I/OGLESShaderRenderer(20918): GLES20.glTexParameteri(3553, GLES20.GL_TEXTURE_WRAP_T, 33071

06-18 10:54:11.496: I/OGLESShaderRenderer(20918): GLES20.glTexParameteri(3553, GLES20.GL_TEXTURE_WRAP_S, 33071

06-18 10:54:11.504: I/OGLESShaderRenderer(20918): setShader(Shader[language=GLSL100, numSources=2, numUniforms=3, shaderSources=[ShaderSource[name=Common/MatDefs/Misc/Unshaded.vert, defines, type=Vertex], ShaderSource[name=Common/MatDefs/Misc/Unshaded.frag, defines, type=Fragment]]])

06-18 10:54:11.504: I/OGLESShaderRenderer(20918): GLES20.glUniformMatrix4fv set Matrix4.g_WorldViewProjectionMatrix

06-18 10:54:11.504: W/OGLESShaderRenderer(20918): WARNING OGLESShaderRenderer 10:54:11 AM no location for uniform [m_VertexColor]

06-18 10:54:11.504: I/OGLESShaderRenderer(20918): RENDERING A MESH USING VertexBufferObject

06-18 10:54:11.504: I/OGLESShaderRenderer(20918): INFO OGLESShaderRenderer 10:54:11 AM renderMeshDefault(com.jme3.scene.Mesh@419b41a8, 0, 1)

06-18 10:54:11.504: I/OGLESShaderRenderer(20918): setVertexAttrib(VertexBuffer[fmt=Float, type=Position, usage=Dynamic, elements=180], null)

06-18 10:54:11.504: I/OGLESShaderRenderer(20918): GLES20.glBindBuffer(34962, 4550065)

06-18 10:54:11.504: I/OGLESShaderRenderer(20918): GLES20.glVertexAttribPointer(location=2, numComponents=3, format=Float, isNormalized=false, stride=0, data.capacity=180)

06-18 10:54:11.504: I/OGLESShaderRenderer(20918): setVertexAttrib(VertexBuffer[fmt=Float, type=TexCoord, usage=Dynamic, elements=120], null)

06-18 10:54:11.504: I/OGLESShaderRenderer(20918): GLES20.glBindBuffer(34962, 4620066)

06-18 10:54:11.504: I/OGLESShaderRenderer(20918): GLES20.glVertexAttribPointer(location=0, numComponents=2, format=Float, isNormalized=false, stride=0, data.capacity=120)

06-18 10:54:11.504: I/OGLESShaderRenderer(20918): setVertexAttrib(VertexBuffer[fmt=UnsignedByte, type=Color, usage=Dynamic, elements=240], null)

06-18 10:54:11.504: I/OGLESShaderRenderer(20918): GLES20.glBindBuffer(34962, 4690067)

06-18 10:54:11.504: I/OGLESShaderRenderer(20918): GLES20.glVertexAttribPointer(location=1, numComponents=4, format=UnsignedByte, isNormalized=true, stride=0, data.capacity=240)

06-18 10:54:11.504: I/OGLESShaderRenderer(20918): drawTriangleList(1)

06-18 10:54:11.504: I/OGLESShaderRenderer(20918): INFO OGLESShaderRenderer 10:54:11 AM GLES20.glBindBuffer(GLES20.GL_ELEMENT_ARRAY_BUFFER, 4,760,068)

06-18 10:54:11.504: I/OGLESShaderRenderer(20918): INFO OGLESShaderRenderer 10:54:11 AM glDrawElements(), indexBuf.capacity (90), vertCount (60)

06-18 10:54:11.512: I/OGLESShaderRenderer(20918): GLES20.glTexParameteri(3553, GLES20.GL_TEXTURE_MIN_FILTER, 9729)

06-18 10:54:11.512: I/OGLESShaderRenderer(20918): GLES20.glTexParameteri(3553, GLES20.GL_TEXTURE_MAG_FILTER, 9729)

06-18 10:54:11.512: I/OGLESShaderRenderer(20918): GLES20.glTexParameteri(3553, GLES20.GL_TEXTURE_WRAP_T, 33071

06-18 10:54:11.512: I/OGLESShaderRenderer(20918): GLES20.glTexParameteri(3553, GLES20.GL_TEXTURE_WRAP_S, 33071

06-18 10:54:11.512: I/OGLESShaderRenderer(20918): setShader(Shader[language=GLSL100, numSources=2, numUniforms=3, shaderSources=[ShaderSource[name=Common/MatDefs/Misc/Unshaded.vert, defines, type=Vertex], ShaderSource[name=Common/MatDefs/Misc/Unshaded.frag, defines, type=Fragment]]])

06-18 10:54:11.512: I/OGLESShaderRenderer(20918): GLES20.glUniformMatrix4fv set Matrix4.g_WorldViewProjectionMatrix

06-18 10:54:11.512: W/OGLESShaderRenderer(20918): WARNING OGLESShaderRenderer 10:54:11 AM no location for uniform [m_VertexColor]



But I assume that this is just normal headsup nothing that could cause the lag… correct?

mhhh those logs has been removed from the renderer (right @Momoko_Fan?). What version do you use?



Logging can kill perf at some extend and, it looks like you have plenty of them. Not sure it’s the issue though…

1 Like

Hmm, look at the timings. Those lines of logging were all generated in around a 10th of a second… if that’s typical then that’s around 3 or 4 hundred lines of logging per second…and logging is known to have poor performance on Android…



@Addez - try turning off those logging levels and trying again…if that works then I’d investigate what’s causing the warnings too but at least you know what was hammering performance…

1 Like

Seriously?!

Turning off logging made it all boost to 17 fps and then a maximum of 22 fps when only seeing the rocket!

Same result using textures :slight_smile:



Only problem now is the nifty.

When launching then Im up in max 5fps but as soon as I’v launched it’s back to 17 fps (which is fairly ok).

Should I try not to use nifty at all? Or why does it lag this much over just one button?

what does nifty handles? the green button on the right?

If you used a button control try to just change it to an image with an interact onclick.

The controls in nifty are a bit complex and some just kill fps on android.

I think it was because something keept opening the already opend menu. Well, it’s fixed now.

Now my game works great! 14fps in launch mode and about 20 while flying.

After hours of work I can finaly say that I’m really satisfied :smiley:



I’m making another thread dedicated to this game that will contain the game and all its updates. Thanks alot for all help guys :smiley:

@Addez: The Google Play page now says that your app requires Android 2.1. Have you tested it on a Android 2.1 device ? jME is supposed to run on Android 2.2 or higher.



I can try if I can update my phone to Android 2.1. Then I can test it for you if you want.

1 Like

Ohsnap! I tought jme was for 2.1 .-.

I’ll change it to 2.2 then :slight_smile:

Thanks for the intel :smiley:

At least the manual says this:

User Requirements:

  • Android 2.2 device or better
  • Graphic card that supports OpenGL ES 2.0 or better



    I personally would be very happy if it would run on Android 2.1 too.
1 Like