Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Kaiidyn

Pages: [1] 2
1
Feedback / IRC channel?
« on: March 10, 2011, 04:06:11 pm »
Would it be an idea to make an irc channel for quick help or random chit-chat?

2
Support / Different screen resolutions
« on: March 05, 2011, 02:19:38 pm »
Just some thoughts here.

I am developing on a SGS with a screen res of 800x480...
I was thinking about blitting etc for graphical user interface (menu, hud, etc)
But how can I take different screen resolutions into account, eg 480x320...


edit: I got a loading texture 800x480 that I want to blit, but Texture says that 800 is unsupported width, how would I go about making loading texture?

3
Support / Out of memory
« on: February 24, 2011, 02:41:09 pm »
I'm starting to get really frustrated with this error...

Code: [Select]
Out of memory on a 3527724-byte allocation.
 FATAL EXCEPTION: GLThread 9
 java.lang.OutOfMemoryError
     at java.io.ByteArrayOutputStream.expand(ByteArrayOutputStream.java:93)
     at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:218)
     at com.threed.jpct.ZipHelper.unzip(ZipHelper.java:30)
     at com.threed.jpct.GLRenderer.convertTexture(GLRenderer.java:766)
     at com.threed.jpct.GLRenderer.setTextures(GLRenderer.java:2151)
     at com.threed.jpct.GLRenderer.drawVertexArray(GLRenderer.java:2064)
     at com.threed.jpct.World.draw(World.java:1341)
     at com.threed.jpct.World.draw(World.java:1122)
     at gp.itsolutions.Render.onDrawFrame(Render.java:87)
     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1332)
     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)

I am rewriting and cleaning the code for what I have now in my mmo game (in a separate project)
and get this error when (I think) loading the terrain from zip file (as ZipHelper is mentioned in the error)
But the fact is, I did not change anything compared to my old code, except for the fact that I created a separate class for loading and disposing the terrain...

Terrain class:
Code: [Select]
public class Terrain {
private Object3D terrain = null;
private Texture terrainTexture = null;
private ZipInputStream zis = null;

public Terrain(World world){
try {

if(terrainTexture == null)
terrainTexture = new Texture(Gameplay.resources.openRawResource(R.raw.terraintexture));

if(!TextureManager.getInstance().containsTexture("terrainTexture"))
TextureManager.getInstance().addTexture("terrainTexture", terrainTexture);

if(zis == null){
zis = new ZipInputStream(Gameplay.resources.openRawResource(R.raw.terrain));
zis.getNextEntry();
}

if( (terrain == null) && (zis != null) ){

terrain = Loader.loadSerializedObject(zis);

terrain.setScale(20);
terrain.setTexture("terrainTexture");
//F.tileTexture(terrain, 25);
terrain.compile();
terrain.build();
world.addObject(terrain);

}

} catch (Exception e) {
e.printStackTrace();
}
}

public void dispose(){
if(terrainTexture != null){ terrainTexture = null; }
if(terrain != null){ terrain = null; }
if(zis != null){ try { zis.close(); } catch (IOException e) { } zis = null; }
}
}

I have tried several attempts to try and fix it, but I can't get the right one..
Figured a second pair of eyes might help..

4
Support / SkyBox missing feature?
« on: February 23, 2011, 11:36:53 am »
It is possible to initialize the skybox using
Code: [Select]
new SkyBox(1024);So without the textures,
However there is no way to set the textures at a later stadium.
At least, not that I could find.
Maybe add some functions like SkyBox.setNorth or SkyBox.setTextures(n, e, s, w) ?

5
Support / What does jPCT stand for?
« on: February 19, 2011, 07:23:39 pm »
Just wondering..

6
Support / SkyBox and Camera Rotation
« on: February 17, 2011, 10:34:50 pm »
I added a skybox to my game, but when I rotate my camera, I'm always facing the same side of the skybox.. its like its a far away billboarded object.
is there any fix for this?

(using http://www.jpct.net/forum2/index.php/topic,1873.msg13762.html#msg13762 )

7
Support / Rotate camera around point
« on: February 12, 2011, 04:21:26 pm »
How do I rotate my camera around the player when moving my finger over the screen? (on all axis)
what I currently have is this
Code: [Select]
camPos.x = (float) (Math.sin(me.getX()%360 * (Math.PI/180)) * -1.5f);
camPos.z = (float) (Math.cos(me.getX() * (Math.PI/180)) * 2.25f);

but this does not take the player position into account.. and is probably plain bad maths =p (i suck at them lols)

Kind regards,
Kaiidyn.

8
Support / Polygon picking?
« on: February 09, 2011, 11:01:35 am »
So I got my terrain now.
What I need now is something like polygon picking?
I want to be able to tap the terrain at any position and return the world-space coordinates of where I tapped the terrain.
I think the most logical way to do this is to check which polygon is being tapped on, and return it's (x y and z) position..
I was looking at http://www.jpct.net/wiki/index.php/Picking but the 'fast way' does not work on android ( ? ) as world.getVisibilityList() does not exist..

9
Support / Framerate and movement
« on: February 07, 2011, 09:25:10 pm »
When moving an object in the render loop.. lets say.. rotateX(0.01f); it will rotate faster with higher framerate and rotates slower with lower framerate..
If i remember correctly, some other sdk i once used had a function or something called AccurateTimeElapsed..
I'm not sure what it does but when calling eg, rotateX(0.001f * AccurateTimeElapsed); it would rotate at the same speed on any framerate..
is there some similar method or whatever in jPCT?
Or if someone knows how it works so that I can implement it myself ?

Kind regards,
Kaiidyn.

10
Support / Landscape, Model or Heightmap?
« on: February 04, 2011, 09:53:27 pm »
What is better to use for a landscape/terrain with hills etc,
an 3D model (3ds?) or an Heightmap texture..

I have been screwing around with heightmaps for a bit now, attempting to make a nice (easy to use (HARD TO MAKE;o) class for it.
but is it really worth the effort.. ? or could I better use a model for terrain.. (looking at resource usage for mobile devices)

I'd rather use heightmaps, but what I cant figure out is a nice way to read the file..
As the one in the wiki (i posted) has like 3 for loops that needs to loop through the x*y size of the image.
and that consumes a whole lot of time..
I am trying to get a 256x256 heightmap image to load.. but it takes about 4 minutes just to loop through the for's..
Anyone know of a better way to handle heightmaps?

Or maybe a proper way to use a model with collision detection (get y from specific x/z on the object)..

Kind regards,
Kaiidyn..

11
Projects / Thanatos Online, a MMORPG for Android
« on: February 02, 2011, 01:20:41 pm »
I am working on a Massive Multiplayer Online Role Playing Game for android (and other platforms to come)

Details can be found here: http://thanatosonline.wikidot.com/

Let me know what you think, and if you have any suggestions to add.. don't hesitate to tell me :)
eg. what works, what is playable, and what do you like to play/see in an mmo for mobile devices.

Kind regards,
Kaiidyn.

12
Support / Input text field
« on: January 27, 2011, 01:48:29 pm »
How would i go about making a working input text field?
Like enter your name to add high-score or something.

Thanks in advance,
Kaiidyn.

13
Support / Per pixel lighting/shadows
« on: January 19, 2011, 01:29:22 pm »
I have a simple box with a light, but the light casts on the triangles of the box and that is..... ugly.. =p
Is there any way to enable a per pixel lighting or shadow casting?
if so, how would i go about doing that?

14
Support / Heightmap Terrain
« on: November 29, 2010, 08:59:16 pm »
managed to get heightmap working, and want to share it with all of you :)

When using it make sure you have a Texture Manager with a TextureID ready, (I used a flat gray 128x128 image for this)

Code: [Select]
public class Terrain {

public static float HighestPoint = 0;


static Bitmap bmp = null;
static String pixel = null;
public static Object3D Generate(int X_SIZE, int Z_SIZE, TextureManager tm, String TextureID){

bmp = BitmapFactory.decodeResource(SpaceGrabber.resources, R.drawable.terrain); // the heightmap texture (128x128 due to memory limitations?)

float[][] terrain = new float[X_SIZE][Z_SIZE];

for (int x = 0; x < X_SIZE-1; x++) {
for (int z = 0; z < Z_SIZE-1; z++) {

pixel = Integer.toString(bmp.getPixel(x, z), 16);
terrain[x][z] = Integer.parseInt(pixel.charAt(1) + "" + pixel.charAt(2), 16);

if(terrain[x][z] > HighestPoint){
HighestPoint = terrain[x][z];
}
}

}
for (int x = 0; x < X_SIZE - 1; x++) {
for (int z = 0; z < Z_SIZE - 1; z++) {
terrain[x][z] = (terrain[x][z] + terrain[x + 1][z] + terrain[x][z + 1] + terrain[x + 1][z + 1]) / 4;
}
}
Object3D ground = new Object3D(X_SIZE * Z_SIZE * 2);

float xSizeF = (float) X_SIZE;
float zSizeF = (float) Z_SIZE;

int id = tm.getTextureID(TextureID); // I used a gray 128x128 texture

for (int x = 0; x < X_SIZE - 1; x++) {
for (int z = 0; z < Z_SIZE - 1; z++) {

TextureInfo ti = new TextureInfo(id, (x / xSizeF), (z / zSizeF), ((x + 1) / xSizeF), (z / zSizeF), (x / xSizeF), ((z + 1) / zSizeF));
ground.addTriangle(new SimpleVector(x * 10, terrain[x][z], z * 10), new SimpleVector((x + 1) * 10, terrain[x + 1][z], z * 10),
new SimpleVector(x * 10, terrain[x][z + 1], (z + 1) * 10), ti);

ti = new TextureInfo(id, (x / xSizeF), ((z + 1) / zSizeF), ((x + 1) / xSizeF), (z / zSizeF), ((x + 1) / xSizeF), ((z + 1) / zSizeF));
ground.addTriangle(new SimpleVector(x * 10, terrain[x][z + 1], (z + 1) * 10), new SimpleVector((x + 1) * 10, terrain[x + 1][z], z * 10), new SimpleVector((x + 1) * 10,
terrain[x + 1][z + 1], (z + 1) * 10), ti);
}
}

return ground;
}
}

15
Support / Position in world-space
« on: November 24, 2010, 01:43:28 pm »
I need to get the position of my object in world space.
and with that I need to get the terrain height (terrain generated with this script: http://www.jpct.net/forum2/index.php/topic,1343.0.html )

Something like

Code: [Select]
SimpleVector playerPosition = new SimpleVector();
playerPosition.set(player.getPositionInWorldSpace());
ground.getHeight(playerPosition.x, playerPosition.z);

Is this possible?

Kind regards,
Kaiidyn.

Pages: [1] 2