Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (482)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (548)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2 3 ... 12
1  Game Development / Newbie & Debugging Questions / Re: GLSL Lighting a 3D box on: 2014-08-22 10:19:01
OK, here is your problem. Your shader is designed to work for directional lights. A directional light is one considered to be infinitely far away which has two effects: 1) It (can be considered to have) has a uniform intensity. 2) The rays of light (can be considered to be) are parallel. An example of a real world directional light is the sun. So obviously a directional light doesn't really have a position, only a direction.

Now in fixed function pipeline OpenGL lighting, the direction of a directional light was set with the light's position. I don't know why this is, probably to ease the implementation, but whoever wrote your shader has emulated this behaviour, getting the light's direction from it's position. Now you setting the position to (0, 0, 0) essentially kills the light. But that isn't your only problem, hence why setting it to (10E3, 10E3, 10E3) didn't work either. And it is capital 'E' btw. Lower case e is natural logarithm base.

The dot product only works in the way you are using it when both vectors are normalized. (10E3, 10E3, 10E3) is obviously not normalized giving you undefined results. Either normalize it in the shader or better yet normalize it cpu side before setting it.

Two last things. Since you are using your own shaders, enabling GL_LIGHTING and GL_LIGHT0 does absolutely nothing. And if you want to read about how OpenGL used to do these lighting calculations: http://www.glprogramming.com/red/chapter05.html. It is a good read for explaining lighting things.

Hope I've helped.
2  Java Game APIs & Engines / OpenGL Development / Re: Applying transformations to vertices on: 2014-08-21 22:14:45
Specifications are the programmers holy texts. Well if your tutorial explains the maths, I'll sure as hell read it.
3  Game Development / Newbie & Debugging Questions / Re: GLSL Lighting a 3D box on: 2014-08-21 18:58:53
I think this is more of a problem with how you have set up the light rather than the shader.
4  Java Game APIs & Engines / OpenGL Development / Re: Applying transformations to vertices on: 2014-08-21 18:53:23
I'm afraid it is not obvious. I tried to extract the right numbers from a file to test it out and that came out as a no, but I am almost certain that I didn't get it right. Sorry. What you're saying definitely makes a lot of sense in any case.

COLLADA files are XML based and I am told that technically makes them "human readable." But I think that just means text based rather than pure data. It is certainly possible to follow them once you know what they are about but data is essentially split up into several great long lists of numbers and you have to jump to the right index in that list the whole time. The format is also a bit "all over the place" to allow for great flexibility. Fine for a computer, bit confusing for a human. So in short: us humans can read them but, only with experience and then only with difficulty. Quicker to write a program to read them for you frankly even if it's just one or two models.
5  Java Game APIs & Engines / OpenGL Development / Re: Applying transformations to vertices on: 2014-08-20 10:31:31
I'm afraid I cannot be much help here. I create my models in Blender and export them as COLLADA (.dae) files. Parsing through them gives you the bindShapeMatrix and invBindMatrices.

(What follows is guess work)
I've just looked through the COLLADA files for a couple of my models and in all of them the bindShapeMatrix was the identity matrix. Now these are models with a very simple rigging (it was more to test my COLLADA parser than anything else) so perhaps the bindShapeMatrix is only necessary for more complex skeletons? But the invBindMatrices were not identity matrices which leads me to conclude that your original idea which I shot down in flames is probably mostly right. So perhaps the invBindMatrix is the combination of the joint's default transform with the inverse of the bindShapeMatrix and so when the BSM is the identity matrix, the IBM is just the joint's default transform.

Pure speculation, but speculation that makes sense to me.
6  Java Game APIs & Engines / OpenGL Development / Re: Applying transformations to vertices on: 2014-08-19 16:34:25
am I correct in assuming that the mat4 jointMatrices are the current matrices for each joint? (not the default, but their transforms in the current frame?

Yes. The jointMatrix is the joint's transformation in the current frame.

What is the bindShapeMatrix? is this the current joint's default pose(TPose)?
...
If my assumptions are correct what are the invBindMatrices? are those the default pose matrices as well?

So first off, I don't entirely understand the maths behind skeletal animation (and I don't know what TPose is) but I will share what understanding I do have. Essentially, the joint's transformation is not calculated in object space but in joint space. Joint space is a unique space for each skeleton. The bindShapeMatrix takes the vertex into joint space, where you apply the joint's transform, then the invBindMatrix takes the vertex back into object space. Why the invBindMatrix is unique to each joint, I could not tell you.

That is my understanding - incomplete or flawed as it may be. I am ashamed to say that this is one of the (few) things where I succeeded in implementing something and therefore did not question the maths behind it.

Again, I hope I have been of some help.

Quew8
7  Java Game APIs & Engines / OpenGL Development / Re: Applying transformations to vertices on: 2014-08-16 09:19:18
Well perhaps I can help with that. I'll post a few pertinent sections of my own skeletal animation code.

The vertex program. Or at least a section of it. Because of my in-app shader build process, I don't have direct access to the entire shader.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
attribute vec4 inPos;
attribute vec4 jointWeights;
attribute ivec4 jointIndices;
uniform mat4 bindShapeMatrix;
uniform mat4[~nJointMatrices~] jointMatrices;
uniform mat4[~nJointMatrices~] invBindMatrices;

void main() {
    vec4 vbsm = inPos * bindShapeMatrix;
   
    outPos =
        ( ( vbsm * invBindMatrices[jointIndices[0]] * jointMatrices[jointIndices[0]] ) * jointWeights[0] ) +
        ( ( vbsm * invBindMatrices[jointIndices[1]] * jointMatrices[jointIndices[1]] ) * jointWeights[1] ) +
        ( ( vbsm * invBindMatrices[jointIndices[2]] * jointMatrices[jointIndices[2]] ) * jointWeights[2] ) +
        ( ( vbsm * invBindMatrices[jointIndices[3]] * jointMatrices[jointIndices[3]] ) * jointWeights[3] );
}

Where "~nJointMatrices~" should take the value of the maximum number of joints a model of yours has.

The onPreRendering() method from my SkeletalRenderMode which is called before a batch of skeletal renders. (VertexData.vertexAttribPointer()) mirrors the OpenGL function in parameters)
1  
2  
3  
4  
5  
6  
7  
8  
public void onPreRendering(VertexData vd) {
    shaderProgram.use();
    vd.vertexAttribPointer(0, 3, GL_FLOAT, false, 52, 0); //inPos
   vd.vertexAttribPointer(1, 3, GL_FLOAT, false, 52, 12); //Normal Vector - not shown in shader
   vd.vertexAttribPointer(2, 2, GL_FLOAT, false, 52, 24); //Tex Coords - not shown in shader
   vd.vertexAttribPointer(3, 4, GL_BYTE, false, 52, 36); //jointIndices
   vd.vertexAttribPointer(4, 4, GL_FLOAT, false, 52, 50); //jointWeights
}


The onPreDraw() from same. This is called before each individual skeletal model's render. (The value of bindShapeMatrixVar, invBindShapeMatrix and jointMatrix in this instance would be "bindShapeMatrix", "invBindMatrices", "jointMatrices". The variable names in the shader)
1  
2  
3  
public void onPreDraw(Skeleton data) {
    data.uploadSkeleton(shaderProgram.getId(), bindShapeMatrixVar, invBindShapeMatrix, jointMatrix);
}


The uploadSkeleton() method from Skeleton. (matrixBuffer is just a FloatBuffer that is reused for uploading skeletal matrices)
1  
2  
3  
4  
5  
6  
7  
public void uploadSkeleton(int programId, String bsmVar, String ibmVar, String jmVar) {
    bindShapeMatrix.putIn(matrixBuffer);
    ShaderUtils.setUniformMatrix(programId, bsmVar, matrixBuffer);
    for(int i = 0; i < joints.length; i++) {
        joints[i].uploadJoint(programId, ibmVar, jmVar, matrixBuffer);
    }
}


And the uploadJoint() methods from Joint. (the value of indexString is "[index]" where "index" is the flattened index of this joint)
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
public void uploadJoint(int programId, String ibmVar, String jmVar, Matrix parentWJM, FloatBuffer matrixBuffer) {
    Matrix.times(tempMatrix, parentWJM, jointMatrix);
    tempMatrix.putIn(matrixBuffer);
    ShaderUtils.setUniformMatrix(programId, jmVar + indexString, matrixBuffer);
    invBindMatrix.putIn(matrixBuffer);
    ShaderUtils.setUniformMatrix(programId, ibmVar + indexString, matrixBuffer);
    for(int i = 0; i < children.length; i++) {
        children[i].uploadJoint(programId, ibmVar, jmVar, tempMatrix, matrixBuffer);
    }
}
   
public void uploadJoint(int programId, String ibmVar, String jmVar, FloatBuffer matrixBuffer) {
    uploadJoint(programId, ibmVar, jmVar, new Matrix(), matrixBuffer);
}


The are a couple of caveats to this code. Firstly - there are a maximum of four joints that any vertex can be influenced by. My models are simple so this is fine for me, if you need more then you can move to arrays rather than vec4s.  Secondly - there is a fixed size to the joint matrix arrays. This could be fine, or it could be a waste of space. Variable arrays can be achieved by using textures to send data, or you could be clever and send the matrices of several small models in one go. I'm sure there are more caveats but it has been a while since I wrote this so I forget.

My apologies for the somewhat convoluted nature of this code - I have a framework I have to conform to - but I hope it should serve as a concept example.
8  Java Game APIs & Engines / OpenGL Development / Re: Applying transformations to vertices on: 2014-08-15 13:00:41
Well firstly, the absolute simplest and best way of doing this as you have described it is (as with most things) to use shaders. You pass a uniform array of joint matrices and attribute joint weights for each vertex. The shader is actually pretty simple.

But doing it your way, also possible. You can transform the vertices cpu side and put them in the cpu pre-transformed. I would counsel against making the matrix in OpenGL and retrieving it to do the transformations. If you are going to do things on the cpu, do it all on the cpu. Or rather better "cpu -> gpu" than "cpu -> gpu -> cpu -> gpu" because in these sort of situations, "->" ie transferring data to (and even more so) from OpenGL is actually the slowest part by quite a bit despite the gpu being able to do processes faster.

Doing matrix calculation cpu side also allows the possibility of caching animation matrices which depending on animation and model size/detail can be the better option.

I don't recognize the library you are using but certainly LWJGL has it's own Vector and Matrix classes which are fully capable of doing these operations and I expect others such as LibGDX and JOGL are similar; so doing the calculations yourself isn't even that complex.
9  Java Game APIs & Engines / OpenGL Development / Re: interleaved VBO and textures (Solved) on: 2014-08-15 11:31:36
That's looking very pretty. It's nice to know that I am actually helping projects along.
10  Games Center / WIP games, tools & toy projects / Re: I like smell of polygons in the morning on: 2014-08-12 11:07:07
It's elegant. But I kind of feel there should be a step 6 of rendering a navigable, 3D view of the terrain you create, otherwise what is the point of working out all those oh so pretty polygons. Also some of them look a little odd; I think I see some edges crossing terrain borders and maybe a couple of t-junctions (I presume you are meaning to avoid them). Looking at it in 3D is the only way to be sure they are working well I think.
11  Game Development / Newbie & Debugging Questions / Re: Should I move to LWJGL on: 2014-08-04 14:51:18
It's easier to use if you want to do anything remotely fancy but look what the OP is creating.

Well the example is something the OP created. The reason for the post is because he wants to move beyond that. And really you can do anything 2D in Java2D but you have to move on at some point, why not when you aren't too ambitious to overreach yourself in OpenGL straight away. I really don't think more experience with Java2D helps with learning OpenGL.

In terms of LibGDX (used as a general graphics abstraction library) vs LWJGL (used as a general OpenGL binding/windowing library), and this is a general statement not necessarily applicable here: it's all very well saying that using LibGDX makes your life easier because you don't have to cope with learning OpenGL or writing boilerplate code, but someone has to learn OpenGL and someone has to write the boilerplate code. And if you don't then you will never know what you are missing.
12  Game Development / Newbie & Debugging Questions / Re: OpenGL Fragments on: 2014-07-28 19:53:58
The min function in GLSL works component wise for any type of vector (except booleans). So:

1  
gl_FragColor = min(existing, calculated);


will result in the darkest colour (Manhattan distance style, not absolute magnitude).
13  Game Development / Newbie & Debugging Questions / Re: Using the Java ServiceLoader to load from a Jar inside another Jar. on: 2014-07-24 16:31:07
For future reference, my solution to this was not to do it. I now load my services' jars as external resources. This way makes more sense anyway and was always going to be the final method. The only reason I didn't do it in the first place was to save me writing external resource loading into my resource loading system then and there.

But the question still stands, as a query of interest and potentially to help out others in the future, if someone does know the answer.
14  Discussions / General Discussions / Re: Java Swing GUI Creator on: 2014-07-17 19:44:55
I agree the 3D is fairly poor. It's still very new and I don't doubt it will be improved in time. I was just trying to give an example of the extra features in JavaFX. I also agree that the charting API is a better example.
15  Discussions / General Discussions / Re: Java Swing GUI Creator on: 2014-07-17 09:53:48
JavaFX isn't the panacea even though now what you can do with Swing has become doable with JavaFX but there is not yet any dialog API.

Originally I thought this was a major problem, but then I threw together my own dialog api in a few minutes. It's not the most feature heavy thing (basically just takes a scene and puts it into a dialog box) but it was the simplest thing in the world to make and it works perfectly. And then there are some really good dialog libraries out there.

But as I said in my last post, the great advantage of JavaFX over Swing (for me) is that it is just so much nicer to work with. The API is similar enough to Swing that it is easy to pick up, but with far greater usability and a whole load of features stuck in. JavaFX even has 3D graphics and I'm not talking about beveled buttons.

But I digress.
16  Game Development / Newbie & Debugging Questions / Using the Java ServiceLoader to load from a Jar inside another Jar. on: 2014-07-16 18:43:38
I am using the java.util.ServiceLoader to load plugins/extensions (call them what you want) from a series of Jar files which I store as resources inside my main executable Jar file. I generate an array of URLs which list the locations of the Jar files. I create an URLClassLoader and create a ServiceLoader around this class loader, and then the ServiceLoader does its stuff. Running this from my IDE (NetBeans if it makes a difference) but as soon as I build the project, the ServiceLoader fails to recognize any implementations.

To give an example (they don't add any info but perhaps state it more clearly than I did), here is the log output after running from NetBeans:
Quote
d | PRE_INIT | URL passed to URLClassLoader[0] = file:/.../ARBShaderServiceImpl.jar
d | PRE_INIT | URL passed to URLClassLoader[1] = file:/.../DefaultFramebufferServiceImpl.jar
d | PRE_INIT | URL passed to URLClassLoader[2] = file:/.../DefaultShaderServiceImpl.jar
d | PRE_INIT | URL passed to URLClassLoader[3] = file:/.../EXTFramebufferServiceImpl.jar
v | PRE_INIT | Loader: java.util.ServiceLoader[com.quew8.gutils.desktop.opengl.services.ShaderServiceImpl]
v | PRE_INIT | Loader Found: class com.quew8.gutils.desktop.opengl.services.arb.ARBShaderServiceImpl
v | PRE_INIT | Loader Found: class com.quew8.gutils.desktop.opengl.services.def.DefaultShaderServiceImpl
v | PRE_INIT | Looking At: class com.quew8.gutils.desktop.opengl.services.arb.ARBShaderServiceImpl
v | PRE_INIT |     Is Applicable: true
v | PRE_INIT |     Precedence: 2
v | PRE_INIT |     Setting As Top Implementation
v | PRE_INIT | Looking At: class com.quew8.gutils.desktop.opengl.services.def.DefaultShaderServiceImpl
v | PRE_INIT |     Is Applicable: true
v | PRE_INIT |     Precedence: 1
v | PRE_INIT |     Setting As Top Implementation
v | PRE_INIT | Looking At: class com.quew8.gutils.desktop.opengl.services.NoShaderServiceImpl
v | PRE_INIT |     Is Applicable: true
v | PRE_INIT |     Precedence: -1

And then from running it from the Jar.

Quote
v | PRE_INIT | URL passed to URLClassLoader[0] = jar:file:/.../StellarColony.jar!/.../ARBShaderServiceImpl.jar
v | PRE_INIT | URL passed to URLClassLoader[1] = jar:file:/.../StellarColony.jar!/.../DefaultFramebufferServiceImpl.jar
v | PRE_INIT | URL passed to URLClassLoader[2] = jar:file:/.../StellarColony.jar!/.../DefaultShaderServiceImpl.jar
v | PRE_INIT | URL passed to URLClassLoader[3] = jar:file:/.../StellarColony.jar!/.../EXTFramebufferServiceImpl.jar
v | PRE_INIT | Loader: java.util.ServiceLoader[com.quew8.gutils.desktop.opengl.services.ShaderServiceImpl]
v | PRE_INIT | Looking At: class com.quew8.gutils.desktop.opengl.services.NoShaderServiceImpl
v | PRE_INIT |     Is Applicable: true
v | PRE_INIT |     Precedence: -1
v | PRE_INIT |     Setting As Top Implementation

Obviously the difference between these is the URLs and the fact that the loader doesn't find any services (the NoShaderServiceImpl is loaded outside of the ServiceLoader in my own code)

So my question is: has anyone else experienced this and can anyone shed some light on why it is happening?

Thank you in advance.
17  Discussions / General Discussions / Re: Java Swing GUI Creator on: 2014-07-16 13:40:46
JavaFX I think is a pretty decent way to go. Tons of features, a lot of which are purely "make the coders life easier" features like the whole properties library. But the important thing here is that it has an XML format called FXML like Android's, with Java controllers (but you can access elements straight from in-class fields you define rather than looking them up from ids, so one up on Android) and there is a very decent FXML editor (coded with JavaFX of course) which I think is easier to use than any other GUI editor I've used.

I'm not particularly sure why JavaFX is having such a slow adoption but if there is a reason then that reason is the downside.
18  Game Development / Game Mechanics / Re: 2D Rigid Body Rope Physics on: 2014-07-15 20:26:57
There certainly is.

vx = w * cos(theta)
vy = -w * sin(theta)


Where w is angular velocity and v is tangential velocity. You may notice that position and angle share the same relationship as angular velocity and velocity. Just a little aside because it makes me smile to see maths work.
19  Game Development / Game Mechanics / Re: 2D Rigid Body Rope Physics on: 2014-07-13 12:11:01
OK, I just felt like trying this out for myself; really there is something very satisfying at watching a ball swing back and forth on a string. So here: http://pastebin.java-gaming.org/d0bb2981a0e14 (I don't know how to embed JGO pastebins). I made it using LWJGL so if you don't use LWJGL, then you won't have the libraries and natives to run it and you probably won't understand the rendering parts of it. But the simulation bits should still help.

Now as soon as I had it, I realized that the thing just kept swinging infinitely so I had to add in a little (very) simplistic friction. That is the " - ( av * FRICTION_COEFFICIENT / mass )" term in the SwingingBody.update() method. That friction bit is the only reason the mass of the body affects the motion.

One last thing - it is very crude in places. I was trying to do it quickly, and shortly whilst making it self-contained. Sorry.
20  Game Development / Game Mechanics / Re: 2D Rigid Body Rope Physics on: 2014-07-13 10:48:02
Sure, so you use angular acceleration and velocity to calculate the angle as in my code snippet, then you can use trig to work out the actual position.

Essentially

px = cx + r * cos(theta)
py = cy - r * sin(theta)

Where p is the position of the swinging body, c is the centre of the swing where the rope is attached, r is the length of the rope and theta is the angle.

Edit: Fixed, because stuff falls down, not up.
21  Game Development / Game Mechanics / Re: 2D Rigid Body Rope Physics on: 2014-07-11 09:28:06
Great.

In answer, no I would keep things in terms of position and linear velocity and make this a special case scenario. I have an in-progress 3D space sim where I have to work with linear and angular (about the centre of mass) motion to model forces properly, but that is really the only time you would have to work with angular motion under "normal" circumstances. There is certainly no sense in you doing it here.

One more thing I would say is that make sure the angle in this code is either always clockwise or always anti-clockwise. I can't work it out in my head but I'm 80% sure that you could end up with someone swinging to the top instead of the bottom.

Edit: No I'm wrong. cos(theta) == cos(360 - theta) since cos() is symmetrical about x = 180. So it doesn't matter whether it's clockwise sometimes and not others.
22  Games Center / Showcase / Re: Craft King - sandbox/mining game on: 2014-07-10 13:31:52
Ah right, well if you want more people to buy the full version, I suggest making it more clear what people in the free version are missing out on because last I checked the descriptions if the full and free version on Google Play were exactly the same. No mention in game either.

The only thing I am not liking so much is the combat. It doesn't feel like you are hitting something; the knock back helped but enemies were jumping all over the place anyway; so my other suggestion is some combat particle effects like blood spilling or something. If you don't want to go too gory then a hit animation would probably work as well but I understand that is more work, especially if your "art-creator" is tired.

And thanks for the screen orientation thing. Much appreciated. Keep up the good work.
23  Game Development / Game Mechanics / Re: 2D Rigid Body Rope Physics on: 2014-07-10 10:00:11
OK, I will give you a quick example, but I will also explain myself a bit which I think will help more. And sorry, I forget that pretty basic mechanics generally aren't taught in schools (in England I had to do an A-Level in physics to be taught about angular velocity and even then it was only very basic).

Angular velocity is a bit of a hard thing to get your head around if you aren't used to it. So you can think of velocity as the speed and direction in which position is changing (rate of change of position if you're big on calculus) and angular velocity is the speed and direction (in this context clockwise or anticlockwise) in which an angle is changing. That angle can be that of a body rotating on its centre of mass, or that of a body in circular motion about a point (as we have here). So what velocity is to position, angular velocity is to angle and what acceleration is to velocity, angular acceleration is to angular velocity.

So a "normal" to a line is a direction which is perpendicular to that line. (In 3D you can also get a normal to a face, which is a direction perpendicular to that face). Example:



So if we have a rope with a guy on the end, then the normal to the rope is the tangent to the circular path the guy is going to swing in. Ie it is the direction he will travel in at that moment in time which we call the tangential velocity. (aT in the previous post stood for tangential acceleration).



In that diagram, v is the tangential velocity. Ignore the centripetal force thing.

So now, my code example. I'm going to write a SwingingBody class with an update() method which takes the delta time for the current frame as a parameter. It uses euler integration to compute the current angle of swing. Things I'm leaving out are a way to render it and any collision detection/handling.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
public class SwingingBody {
    public static final float g = 9.81; //Constant for average gravitational acceleration at the surface of the Earth.

    private float angle = 0; //The angle between the rope and the horizontal.
   private float av = 0; //angular velocity
   private float r; //The radius of the swing - the length of the rope.

    public void update(float delta) {
        float aa = g * GMath.cos(angle) / r;
        av += ( aa * delta );
        angle += ( av * delta );
    }
}


Three notes about this code:
1) I have used a function called GMath.cos(), this is meant to be a regular cos function accept that it takes a float as a parameter and returns a float as well. I don't know what framework you're using so I just used my own framework.

2) Generally we work with delta in milliseconds, however the constant for g I have given is in metres per second squared. So you must either divide delta by 1000 to get it in seconds or divide g by 1000,000 to get it in metres per millisecond squared.

3) Sorry about the fancy definition for g, I'm a physicist at heart.

Hope this helps.
Quew8
24  Discussions / Miscellaneous Topics / Re: Naming things on: 2014-07-09 18:24:14
Personally I'm always renaming huge swathes of my code because I come up with better names. The joy of working on your own with an IDE is that you can do stuff like that.
25  Java Game APIs & Engines / OpenGL Development / Re: Somehow using GL_REPEAT on a sub-texture in a sprite-sheet? on: 2014-07-09 18:18:12
I agree with @Riven, the only problem (that I can see) is that the uMin, uMax etc variables would have to be passed as uniforms. This means that you could only batch together draws of the same sub-image rather than of the same texture, which I think is quite a big part of the bonus from using texture atlases. Still better than individual textures though.

The only way around this (that I can see) is to use texture atlases but as @wessles says, they are only so useful.
26  Games Center / Showcase / Re: Craft King - sandbox/mining game on: 2014-07-09 14:15:00
I've played for a little bit and it is beautifully polished.  The one question I have is: what is the difference between the free and paid versions? Obviously there is the 1 character \ 1 world limit and I guess no adverts on the paid version but is there anything else?
27  Game Development / Game Mechanics / Re: 2D Rigid Body Rope Physics on: 2014-07-09 12:24:38
Well I have no idea about simulating a fluid rope, but a rigid strut type thing is simple enough. Here is a little I worked out scribbling on paper (which means it ain't my fault if something is wrong, it is the paper's fault).

So as with most angular motion questions, the maths is easier if you work in terms of angles. This might make the simulation harder or it might not, but it is what I am doing here.

So taking theta to be the angle between the horizontal and the rope, then the angle between the vertical and the rope is 90 - theta, and hence the angle between the normal and the vertical is also theta.

Then we can say that the magnitude of the resultant acceleration on the body, at = g * cos(theta)

Then a simple matter of using the formula for angular acceleration to give angular acceleration, alpha = g * cos(theta) / r where r is the length of the rope.

Not sure how helpful this will be. If you are using euler integration in your simulation then you're sorted (apart from maybe converting it into a more linear thing. If that is the case I'd be happy to help).
28  Games Center / Showcase / Re: Craft King - sandbox/mining game on: 2014-07-08 13:03:14
Please, please, please, set the orientation to "sensor landscape" instead of "landscape." It isn't your fault (the Google sdk/Eclipse plugin does not make it clear and I think different devices respond differently) and you are by no means the only one who does this (big devs do it too; example: a recent update to the 4od app means you have to browse programs in fixed orientation but you can watch them in either. WTF?) but it really annoys me. I don't know why non-sensor landscape even exists.

Sorry to rant without even mentioning your game (I can't try it now because sitting at my desk with my tablet charging, the cable isn't long enough to flip it so your game is upside down).
29  Game Development / Newbie & Debugging Questions / Re: Minimal Translation Distance too short? on: 2014-07-07 22:56:51
So just scale up the minimum translation distance by 1.1. Or 1.01. or 1.001. Large enough that it works, small enough that it isn't too noticeable.
30  Games Center / Cube World Projects / Re: Texturing a VBO? on: 2014-06-11 19:42:33
Just to let you know @NegativeZero

Quote
When an error occurs, the error flag is set to the appropriate error code value. No other errors are recorded until glGetError is called, the error code is returned, and the flag is reset to GL_NO_ERROR.
Pages: [1] 2 3 ... 12
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

atombrot (28 views)
2014-08-19 09:29:53

Tekkerue (25 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (15 views)
2014-08-16 06:20:21

Tekkerue (22 views)
2014-08-16 06:12:11

Rayexar (61 views)
2014-08-11 02:49:23

BurntPizza (39 views)
2014-08-09 21:09:32

BurntPizza (31 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38

BurntPizza (67 views)
2014-08-03 02:57:17
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!