Main Menu
Menu

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.

Show posts Menu

Topics - raft

#41
Support / memory issues
October 15, 2010, 02:52:55 PM
as my game evolves, i begun to run into memory issues. game itself runs ok, fits the budget, but these things typically happens after pressing home and returning back. see the exception below.

i guess this happens when jPCT tries to restore textures after a GL surface lost. i dispose the FrameBuffer, null the reference and call MemoryHelper.compact() before creating a new one.

what else can i do?

E/dalvikvm-heap( 6803): 131072-byte external allocation too large for this process.
W/OSMemory( 6803): External allocation of 131072 bytes was rejected
W/dalvikvm( 6803): threadid=15: thread exiting with uncaught exception (group=0x4001b178)
E/AndroidRuntime( 6803): Uncaught handler: thread GLThread 8 exiting due to uncaught exception
E/AndroidRuntime( 6803): java.lang.OutOfMemoryError
E/AndroidRuntime( 6803): at org.apache.harmony.luni.platform.OSMemory.malloc(Native Method)
E/AndroidRuntime( 6803): at org.apache.harmony.luni.platform.PlatformAddressFactory.alloc(PlatformAddressFactory.java:145)
E/AndroidRuntime( 6803): at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:67)
E/AndroidRuntime( 6803): at java.nio.ReadWriteDirectByteBuffer.<init>(ReadWriteDirectByteBuffer.java:51)
E/AndroidRuntime( 6803): at java.nio.BufferFactory.newDirectByteBuffer(BufferFactory.java:95)
E/AndroidRuntime( 6803): at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:71)
E/AndroidRuntime( 6803): at com.threed.jpct.GLRenderer.convertTexture(GLRenderer.java:754)
E/AndroidRuntime( 6803): at com.threed.jpct.GLRenderer.blit(GLRenderer.java:1265)
E/AndroidRuntime( 6803): at com.threed.jpct.GLRenderer.execute(GLRenderer.java:1661)
E/AndroidRuntime( 6803): at com.threed.jpct.FrameBuffer.blit(FrameBuffer.java:591)
E/AndroidRuntime( 6803): at raft.glgui.android.TexturePack.blit(TexturePack.java:256)
#42
Support / setting polygon texture
October 14, 2010, 02:08:50 AM
I have a merged object which is serialized with desktop jPCT. i change textures of some polygons during the course of the game. this works fine in desktop jPCT. but in AE I got some strange behaviour:

* with one subobject to change texture this works fine
* with a couple subobjects, i only get a result by setting texture of first one and this operation sets textures of other subobjects too. setting texture on other subobjects has no effect

i suspect this thing requires, build(false) method. if this is the case, there is no such method in AE, how can i serialize such an object from desktop jPCT?

i've also tried calling compile(true) before serialization but didnt help.
#43
Support / lighting mode and ambient light
September 24, 2010, 08:39:55 PM
i need to set ambient light to a high value to make details of textures visible. but in that case i cant properly set color of glow planes. -i guess- because of over lighting they seem white. and seems as calling

Object3D.setLighting(Object3D.LIGHTING_NO_LIGHTS);

has no effect with ambient light. so what can i do in this case except changing ambient light ?
#44
Support / merging objects with transparency
September 22, 2010, 07:37:57 PM
seems as it has no effect merging objects with transparency. in the final merged object all transparency has gone. is this intentional ?

i've also tried setting one of object's transparency via PolygonManager, but in that case merging objects throws a NPE. ie. following code:

Object3D one = Primitives.getBox(1, 1);
//one.setTransparency(0);
for (int p = 0; p < one.getPolygonManager().getMaxPolygonID(); p++) {
one.getPolygonManager().setVertexAlpha(p, 0, 0f);
one.getPolygonManager().setVertexAlpha(p, 1, 0f);
one.getPolygonManager().setVertexAlpha(p, 2, 0f);
}

Object3D two = Primitives.getBox(1, 1);
two.translate(0, 3f, 0);
two.translateMesh();
two.getTranslationMatrix().setIdentity();

Object3D merged = Object3D.mergeObjects(one, two);


throws:
Exception in thread "main" java.lang.NullPointerException
at com.threed.jpct.Object3D.appendToObject(Unknown Source)
at com.threed.jpct.Object3D.mergeObjects(Unknown Source)
at tmp.MergeTransparent.main(MergeTransparent.java:34)


btw, i'm a bit unclear what PolygonManager().setVertexAlpha(..) does. in my tries i saw no effect of it.
we set alpha values of vertices not the polygon. how exactly does it work ?
#45
Support / compile
August 20, 2010, 07:23:41 AM
i know compile() method is removed because all objects are compiled in AE but it may still make sense to put it back. it's is useful as a preperation before game begins. if i dont miss something, at the moment we are forced to serialize even the simplest objects like particles. particles are typically cloned from a master and at each cloning a compile occurs
#46
Support / some effects
August 17, 2010, 06:43:25 AM
how would you implement these effects ? i've also written my ideas but maybe there are better ways

* gravity tile which makes things heavier then they are. i planned to use a billboarded transparent plane over the tile with a texture with small downward arrows on it. then change the UV coordinates in time such that arrows move downwards.
* lava (or similar) tile which kills the player. some particles maybe spawn over it but this may be a performace killer if number of lava tiles increase
* teleport or portal tile: billboarded plane with a texture like the shield in robombs. uv coordinates can be changed to provide some motion
* exit tile: with glow effect
#47
say, i have multi texture object, for example a merged one. when GL surface is recreated textures are gone. in order to restore the object's state, calling Texture.keepPixelData(true) is the only way, right? otherwise, i can't load textures again and call setTexture on the object, because it's a multi texture object.
#48
Support / transparency
August 05, 2010, 03:39:54 PM
i've problem with transparent objects on nexus one. they seem rigid, not transparent.

this is how it looks on emulator:


and on N1:


it was ok on G1 too. is there anything i can try ?
#49
Support / hiding part of a merged object
August 03, 2010, 09:41:42 PM
is it possible to make some part of an object invisible ? if we somehow now the polyon ids..
#50
Support / Nexus one & multi touch
August 03, 2010, 06:54:36 AM
i've spent several hours to implement a multi touch based control system. basicly one joystick like touch button on one side of screen and one jump button on other side. i've tried several different ways. none were as good as i expected. movement goes jerky at some point. finally i tried 4 separate arrow buttons and a jump button. didnt help either.

then after some googling, found this post:
http://groups.google.com/group/android-developers/browse_thread/thread/d0aa3eea8fd9a2b8/fcc36fe03fe8886d

it basicly says, N1's screen is not capable of multi touch. when two touch points come too closer or their axes come closer, hardware cannot separate two signals. their coordinates flip. as this is a hardware issue, there is no workaround. many HTC phones have the same issue since they use the same screen.

and a video visualizing the fault:
http://www.youtube.com/watch?v=qzhUzq6bTPg

i bought this phone to develop this game. i feel robbed >:(
#51
Support / StackOverflowError
July 29, 2010, 12:46:42 AM
happens almost immediately in a relatively large scene: 60x20 grid where each cell is a primitive box. in 20x20 it happens again but later

Uncaught handler: thread GLThread 8 exiting due to uncaught exception
java.lang.StackOverflowError
at com.threed.jpct.VisList.qsort(VisList.java:168)
at com.threed.jpct.VisList.qsort(VisList.java:172)
at com.threed.jpct.VisList.qsort(VisList.java:173)
at com.threed.jpct.VisList.qsort(VisList.java:173)
at com.threed.jpct.VisList.qsort(VisList.java:173)
        ...


#52
Support / blit size and performance
July 25, 2010, 05:59:43 PM
hello,

does blit (image) size have any impact on performance ? for example 100x100 or 128x128 make any difference ? i think, since they are already uploaded it shouldn't be noticable but can't be sure.

thanks
#53
Support / blitting and drawing lines
July 18, 2010, 06:26:51 PM
hello,

i'm drawing lines with open gl commands. this seems to work alone, however when i blit something between the lines, blitting somehow interleaves with lines.

what i do is basicly init projection and ortho mode, disable textures, draw lines and disable projection again

this is the lines only. all seems ok


this is how it looks when a blit text. blitting is not correct, and after first blit, other lines are not drawn


i've figured that, blitting assumes textures are enabled. so after drawing a line, i re-enable textures. this corrects blitting but lines are still missing


any ideas ?
#54
Support / blitting without a world
July 12, 2010, 01:40:20 AM
i've noticed that blitting doesnt work without a world. is this intentional ? if so i can live with a dummy empty world.
i've planned to use that for blitting menu

this works as expected
buffer.clear(Color.BLACK);

world.renderScene(buffer);
world.draw(buffer);
world.drawWireframe(buffer, Color.WHITE);
buffer.update();

// blit something

buffer.displayGLOnly();


but this does not
buffer.clear(Color.BLACK);

// blit something

buffer.displayGLOnly();


#55
Support / compatibility with desktop version
July 06, 2010, 08:57:12 PM
hi,

i'm a developing a game for android. as i dont have a device at the moment, it seemed natural to develop game logic in desktop version and port to android. however there are some practical difficulties in this approach. there are some minor differences in api's and that forces me to either duplicate the code or abstract the actions with interfaces or so. a bit overkill or performance killer for such simple tasks.

i believe making both api's as identical as possible is highly beneficial. in theory android version can be a subset of desktop version. AE is still in alpha state so i suppose it wont be problem for anyone.

the differences i've noticed and my two cents:
* Light class moved from util package to regular package. i guess this is for hiding world.addLight method. deprecating desktop's old Lights and Light class may be an option. or the other way around
* As android doesnt have awt color, AE uses a seperate RGB color class. same can be added to desktop version.
* desktop doesn't have Texture.keepPixelData() method. it doesnt make sense in desktop version but a method can still be added. indeed desktop version can have false as default and android can have true

just my two cents
r a f t
#56
this happens after an Object3D is removed from the world. if i also make the object invisible, no exception is thrown. no big deal indeed.
happens on both versions (desktop and AE)

Exception in thread "main" java.lang.NullPointerException
at com.threed.jpct.Object3D.transformVertices(Unknown Source)
at com.threed.jpct.World.renderScene(Unknown Source)
#57
Support / NullPointer @ GLRenderer.drawVertexArray
June 30, 2010, 01:05:23 AM
any ideas what may cause this ? i've tried to create a test case but no luck since now.

E/AndroidRuntime( 2703): Uncaught handler: thread GLThread exiting due to uncaught exception
E/AndroidRuntime( 2703): java.lang.RuntimeException: java.lang.NullPointerException
E/AndroidRuntime( 2703): at raft.jumpy.android.WhatActivity$MyRenderer.onDrawFrame(WhatActivity.java:230)
E/AndroidRuntime( 2703): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:955)
E/AndroidRuntime( 2703): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:887)
E/AndroidRuntime( 2703): Caused by: java.lang.NullPointerException
E/AndroidRuntime( 2703): at com.threed.jpct.GLRenderer.drawVertexArray(GLRenderer.java:1758)
E/AndroidRuntime( 2703): at com.threed.jpct.World.draw(World.java:1277)
E/AndroidRuntime( 2703): at com.threed.jpct.World.draw(World.java:1059)
E/AndroidRuntime( 2703): at raft.jumpy.android.WhatActivity$MyRenderer.onDrawFrame(WhatActivity.java:202)
E/AndroidRuntime( 2339): ... 2 more


these are the previous log entries, if helps. btw, these objects are cloned from a master. the master is built indeed but warning still complains about they are not built yet.
I/jPCT-AE ( 2339): [ Wed Jun 30 01:38:57 GMT+03:00 2010 ] - WARNING: Object object13 hasn't been build yet. Forcing build()!
I/jPCT-AE ( 2339): Subobject of object 11/object13 compiled to flat fixed point data using 48 vertices in 2ms!
I/jPCT-AE ( 2339): Object 11/object13 compiled to 1 subobjects in 7ms!
I/jPCT-AE ( 2339): [ Wed Jun 30 01:38:59 GMT+03:00 2010 ] - WARNING: Object object14 hasn't been build yet. Forcing build()!
I/jPCT-AE ( 2339): Subobject of object 12/object14 compiled to flat fixed point data using 48 vertices in 1ms!
I/jPCT-AE ( 2339): Object 12/object14 compiled to 1 subobjects in 4ms!
I/jPCT-AE ( 2339): [ Wed Jun 30 01:38:59 GMT+03:00 2010 ] - WARNING: Object GeoSphere0_jPCT13 hasn't been build yet. Forcing build()!
I/jPCT-AE ( 2339): Subobject of object 13/GeoSphere0_jPCT13 compiled to flat fixed point data using 240 vertices in 3ms!
I/jPCT-AE ( 2339): Object 13/GeoSphere0_jPCT13 compiled to 1 subobjects in 13ms!
#58
may i suggest to add Loader.loadSerializedObject(..) method to desktop version ? so porting between AE and desktop version will be much easier.
i'm aware that we can do it via DeSerializer, but i suppose a unified way allows using same code in both versions.

r a f t
#59
Support / missing cloned objects
June 24, 2010, 11:48:28 PM
somehow my cloned objects are missing. they dont appear. i clone them with object3d.cloneObject()

same thing happens when i copy them with
new Object3D(object3d, true); // reuse mesh
but this works ok:
new Object3D(object3d, false); // dont reuse mesh

any ideas ?
#60
Support / fake shadows
June 24, 2010, 05:46:58 PM
hi,

i'm working on a simple ball game. as the ball can jump, it's crucial to notify the user over which tile the ball is. a shadow is the most obvious way but it's not supported in android version. even if it is supported, i doubt it will perform good enough.

so what's the best way of faking simple shadows ? most simple solution will be to highlight the tile without any shadow. calculating where shadow will be and modifying tile's texture may be an option but it wont be easy and will not perform good because of continuous texture uploading. what else can i do ?

thanks,
r a f t