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

Messages - zbych

#1
Projects / Craft The Path 2
October 02, 2015, 08:43:54 PM
I have recently published the sequel of my game: "Craft The Path 2".
It has improved block hit detection (this version uses "ray cast", don't ask how i have done it in 1st version ;) ), second major addition is first person camera - this was quite a challenge, but unfortunately I have failed in some cases: "climber" the block where you can climb up and down might not work in "some cases" in 1st person camera. I have also added new blocks TNT, coal and other things. I didn't have enough ideas to create levels that is why it has only 25 levels.


https://play.google.com/store/apps/details?id=com.zr.minecraft.path.two

#2
Projects / Re: Cut The Clothes
May 04, 2015, 10:00:36 AM
Quote from: EgonOlsen on May 04, 2015, 06:57:53 AM
Interesting...I found the controls hard to understand. Even with the initial help text, it took me several tries to find out that I have to touch the screen somewhere to enter cutting mode and release it to actually do the cut. Why is that? Why don't I draw all the time and cut once a section is completed? Is there any benefit from stacking colored sections and cut them all at once?

When you are in drawing mode the pencil move slower, that's why when you are chased by enemy you can escape them by releasing draw mode but then you lose lines already drawn.
#3
Projects / Cut The Clothes
May 03, 2015, 03:30:36 PM
Hi.

Finally I managed to finish my game "Cut The Clothes". The idea for it comes from arcade (coin op) game called "Dancing Eyes". The game was released in Japan only, and the hardware of this arcade was similar to PSX One, allowing it to display 3D textured graphics - that's the short history :)
Your task is to move along the grid lines and draw closed area, when you do it the selected area (part of clothes) will disappear, the goal is to remove all "panels".
Implementing it was a small challenge, I had to take care of things like: line drawing, depth buffer inaccuracy, grid creation, graph cycle detection, detection of panels inside cycle, changing the visibility/color of panels - for this I am using dedicated shader that's why I am able to control visibility of more than hundred panels without performance lost.
You can find jPCT logo and address in "about" section.

I will be glad for positive ratings on GoolePlay. Thanks ;)

https://play.google.com/store/apps/details?id=com.zr.cut.clothes



#4
Support / Re: Disappearing transparent geometry
April 26, 2015, 01:22:31 PM
I have figured it out, it was my fault - the missing geometry was discarded by depth test, because it was covered by other object rendered to depth buffer only.
#5
Support / Disappearing transparent geometry
April 25, 2015, 09:31:44 PM
In some cases when camera moves around object (transparent object) a part of this object disappear. As you can see on second image, a part of object is missing.
Is it possible to set some kind of flag to disable this geometry "culling" (the back-face culling is disabled for this object)?
When I disable transparency for this object it is rendered ok.
#6
Support / Drawing Lines
October 26, 2014, 09:15:51 PM
I was searching how to draw lines in jPCT but didn't found any good solution that's why I want to present my code and ask: what are possible problems with this solution? I am suspecting that when object/triangle leave camera sight the lines might disappear. Will it cause other problems and how to prevent them?


public class SimpleLineManager {

public class LineSegmentContainer {
public int segmentLen;
public FloatBuffer segmentBuffer;
public SimpleVector segmentColor;
}

static final int COORDS_PER_VERTEX = 3;
private final int VERTEX_STRIDE = COORDS_PER_VERTEX * 4; // 4 bytes per member

private ArrayList<LineSegmentContainer> _lineSegments;
private GLSLShader _lineShader;
private Object3D _root;
private IRenderHook _renderHook = new IRenderHook() {
@Override
public void setTransparency(float arg0) {}
@Override
public void setCurrentShader(GLSLShader arg0) {}
@Override
public void setCurrentObject3D(Object3D arg0) {}
@Override
public boolean repeatRendering() {
return false;
}
@Override
public void onDispose() {}
@Override
public void beforeRendering(int arg0) {
drawLines();
}
@Override
public void afterRendering(int arg0) {}
};

public SimpleLineManager(GLSLShader lineShader) {
_lineSegments = new ArrayList<SimpleLineManager.LineSegmentContainer>();
_lineShader = lineShader;

float[] vertices = { 0,0,0, -0.0001f,0,0, 0.0001f,0,0};
float[] uvs = { 0,0, 1,1, 1,0};
int[] indices = {0,1,2};

_root = new Object3D(vertices, uvs, indices, 0);
_root.setShader(_lineShader);
_root.setRenderHook(_renderHook);
}

public void addToWorld(World w) {
w.addObject(_root);
}

private void drawLines() {
GLES20.glLineWidth(10f);
int verticesHandle = GLES20.glGetAttribLocation(_lineShader.getProgram(), "position");
int lineColorHandle = GLES20.glGetUniformLocation(_lineShader.getProgram(), "lineColor");
GLES20.glEnableVertexAttribArray(verticesHandle);
for(LineSegmentContainer ls : _lineSegments) {
GLES20.glUniform3f(lineColorHandle, ls.segmentColor.x, ls.segmentColor.y, ls.segmentColor.z);
GLES20.glVertexAttribPointer(verticesHandle, COORDS_PER_VERTEX, GLES20.GL_FLOAT, false, VERTEX_STRIDE, ls.segmentBuffer);
GLES20.glDrawArrays(GLES20.GL_LINE_STRIP, 0, ls.segmentLen);
}
GLES20.glDisableVertexAttribArray(verticesHandle);
}

public void addLineSegment(float[] coords, SimpleVector color) {
ByteBuffer bb = ByteBuffer.allocateDirect(coords.length * 4);
bb.order(ByteOrder.nativeOrder());
FloatBuffer vertexBuffer = bb.asFloatBuffer();
vertexBuffer.put(coords);
vertexBuffer.position(0);
LineSegmentContainer lsc = new LineSegmentContainer();
lsc.segmentBuffer = vertexBuffer;
lsc.segmentColor = color;
lsc.segmentLen = coords.length/3;
_lineSegments.add(lsc);
}

public Object3D getRoot() {
return _root;
}
}


vertex shader

precision mediump float;

uniform mat4 modelViewProjectionMatrix;
attribute vec4 position;
//attribute vec3 normal;
varying vec4 varVertexColor;

void main(void) {
gl_Position = modelViewProjectionMatrix * position;
}


fragment shader

precision mediump float;

uniform vec3 lineColor;
uniform float alpha;

void main (void)
{
vec4 base = vec4(lineColor.xyz,alpha);//varVertexColor ;
gl_FragColor = base;
}
#7
Projects / Re: Craft The Path
October 26, 2014, 08:11:29 PM
Quote from: Wolf17 on October 14, 2014, 03:53:33 PM
   Nice puzzle concept ! Seeing so much of your projects/ works inspired by minecraft's blocky graphics , you are probably a great minecraft  fan, I think  ;D :D!!
The look and feel  of the game is enhanced due to  ambient occlusion ! You mentioned about fake AO.
May you please tell me something about it ? And also can it be extended to complex models, geometries instead of simple blocks?

Sorry for so late reply but I don't come to this forum too often, and looks like I have missed the notification. Anyway my idea is very simple and unfortunately it can't be used for other type of geometry - when I generate surface I check if it is surrounded by other blocks when it is then I decrease "color intensity" of given vertex. This color intensity is stored as separated vertex attribute so the rest of the work is done by shader.
#8
Projects / Re: Craft The Path
September 01, 2014, 10:24:09 PM
Quote from: Thomas. on September 01, 2014, 10:15:18 PM
Nice idea, it reminds me Lemmings :)

And you are right :D
My first idea was to make something similar to Lemmings with minecraft motif. But I thought that many creepers with independent path finding and logic will kill every device that is why I decided for one user-controlled character.
#9
Projects / Craft The Path
September 01, 2014, 08:55:26 PM
Hi everyone.

I want to present my newest game: Craft The Path. The goal of game is to build a way (by appropriate adding or removing blocks) for the creeper, so he can walk to exit. It isn't so easy because you have limited number of blocks and pickaxe hits.
Some technical info: the game is using modified version of "flat shader" -  I call it "fake ambient occlusion", the collision of touch point and box is done by calculating line-sphere intersection, and path for creeper is created using A* (a star) algorithm.
I wanted to add to this game wallpaper (together with wallpaper editor) but there is problem with TextureManager - when the wallpaper and game are in one application then they will share TextureManager in that case the wallpaper service and game activity mess up with each others textures (I am loading resources in dedicated threads).
Link to game:  https://play.google.com/store/apps/details?id=com.zr.minecraft.path


#10
Projects / Craft World 3D Live Wallpaper
March 31, 2014, 01:20:51 PM
My another small production, with motif of Minecraft. This time I have created Minecraft world in spherical coordinates. This construction is very simple, that is why it cannot have things like caves, and another drawback - the cubes closer to poles are deformed. I have decided not to use shaders because I don't want the flat shaded surfaces (the flat shader consume more memory) and after few tests it looks like rendering the scene using GL 1 was bit faster than GL 2.
I was thinking about game using this kind of generated world, but so far I don't have reasonable ideas.

https://play.google.com/store/apps/details?id=com.zr.minecraft.world

#11
Support / Re: How to force object creation?
January 06, 2014, 09:33:21 PM
Thanks for advices. Disabling VBO looks as best option for me.
#12
Support / Re: How to force object creation?
January 06, 2014, 08:45:33 PM
The "blocks" share geometry but the other types of objects not necessarily (for example track segments can't share geometry).
#13
Support / Re: How to force object creation?
January 06, 2014, 08:12:52 PM
Maybe I have explained it wrong, but the problem is with "VBO creation". The objects are build and compiled but when I call FrameBuffer.draw() only for few of them are created VBOs, and during the game I can see all the time messages: "creating buffers" and "VBO created for object..", and in situation when the larger group of objects becomes visible for the camera, the slow devices are freezed for few seconds.
#14
Support / Re: How to force object creation?
January 06, 2014, 04:55:47 PM
I am still unable to resolve this problem. The objects are added to world and their visibility is set to FALSE. In the initialization procedure I want to force objects to be created, so I make something like this (the objects might appear behind camera):

for(int i=0;i< _blocks.length; ++i) {
  _blocks[i].lBlockObj.setVisibility(true);
  _blocks[i].rBlockObj.setVisibility(true);
  _trackGen.getPositionAtTime(_tempVector, 2000, 0);
  _blocks[i].lBlockObj.root.clearTranslation();
  _blocks[i].lBlockObj.root.translate(_tempVector);
}
world.compileAllObjects();
world.renderScene(frameBuf);
world.draw(frameBuf);
clenup();


but instead of series of messages "VBO created for object 'object' " I got:
I/jPCT-AE(7001): Additional visibility list (195) created with size: 512
The cleanup procedure makes objects invisible again. I am suspecting that this group of objects might freeze the game for a few seconds on slow devices. The objects have attached a shader so there is additional pause for shader compilation. Am I doing something wrong?
#15
Projects / Music Ride 2
December 28, 2013, 07:27:58 PM
I would like to present second version of my game "Music Ride 2".
Compared to previous version this is much improved – completly new race generation algorithm (track has turns now), much interesting game modes, possibility to shot etc.
For those who didn't know first version: Music Ride 2 is a rhytmic-racing game. Based on selected by user song it generates racing track, and our task is to collect rhythm gems, the idea of this game is very similar to PC game Audiosurf.

https://play.google.com/store/apps/details?id=com.zr.music.run