Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (534)
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 4
1  Game Development / Performance Tuning / Re: Taming Java GC to prevent stutter, an in-depth post on memory management on: 2014-04-24 12:28:48
Some of those complex collision detection functions can be a nightmare on the GC to the point where I modified some of them to use local floating point x,y,z values and static reusable Vector3 objects and manual math where applicable. A complete nightmare to write and even a bigger nightmare to maintain, it makes for some of the ugliest code, however, for sake of performance... I'm even looking for openCL alternatives for some of those functions.
2  Discussions / General Discussions / Re: 30 vs 60 vs 120 FPS on: 2014-03-20 03:45:37
I can notice the difference between 60 and 120 but only during competitive gameplay and only if the monitor is running at 120Hz.
3  Discussions / General Discussions / Re: Programmer jokes on: 2014-03-20 03:39:07
99 little bugs in the code
99 bugs in the code
Fix one bug, compile it again
101 little bugs in the code.

101 little bugs in the code
101 bugs in the code
Fix one bug, compile it again,
103 little bugs in the code.
4  Game Development / Newbie & Debugging Questions / Re: From immediate mode to VBO mode LWJGL (basic) on: 2013-10-15 07:49:49
perhaps this post will help.

http://www.java-gaming.org/topics/simple-vertex-array-immediate-drawer/30852/view.html

take same concept and apply VBO instead of VA
5  Discussions / General Discussions / Re: Off-Topic: Java and Framework Alternatives - 'Friendly' Discussion. on: 2013-09-29 16:05:38
I've recently used Unity 3D and must say, for an engine so hyped its missing quite a few critical features required to make great games, I've found it average at best.

I much rather the flexibility of writing an engine from scratch, at least I know what I'm getting for my time investment.

Currently looking at implementing sparse voxel octrees as a java framework, which is fun, interesting and pretty darn exciting!
6  Game Development / Performance Tuning / Re: Concurency in 3d engine. on: 2013-09-29 13:37:04
I used a similar strategy in one of my experiments. For every loop, there will be a thread for the render and a thread for the logic, both running concurrently. Once logic is complete, you buffer all the needed data as "read only" which the render thread will then access, this way the logic thread will move onto the next loop while the render thread grabs the current frame data and renders it. If incase one is running ahead of time, ie, a render thread is still rendering previous frame data as this frame is complete, the logic thread will stall and wait for the render thread to complete. Using this method means that a total time taken for a single frame is the same time as the thread which takes longer to compute.
7  Discussions / General Discussions / Re: What You Do When You are Burnt Out on: 2013-09-15 16:39:50
When I'm burnt out, I go play a good game of dota with mates. If I'm burnt out of dota, I just write programming tutorials.
8  Game Development / Newbie & Debugging Questions / Re: Vectors! on: 2013-09-03 07:50:31
Velocity is a vector which has both "direction" and "speed"

You find the direction by normalizing the Velocity vector, and the speed is the magnitude or the length of the vector.

If you have a 2D sprite at position V1 = <x1, y1> and want to move it a 2D position with vector V2 = <x2, y2> you can find the velocity vector for movement by doing the following

velocity = V2 - V1

float speed = velocity.magnitude
Vector direction = velocity.normalize

I hope that explains things a bit =]
9  Discussions / Miscellaneous Topics / Re: Blogs? on: 2013-08-14 11:08:42
My Devblog in my Signature  Cool
10  Game Development / Articles & tutorials / Triangle Intersection Tests on: 2013-08-08 13:47:14
Hello JGO Community. No I'm not dead, just taking a small Hiatus from Java Game Development!

I come today to share some source code I've been working on for various methods using the Unity framework. Originally I wrote the methods in C#, however for the sake of this tutorial I've converted them in Java just for you! (well not really, I just like Java)

This tutorial is a direct follow up from my previous tutorial for basic collision detection found in the following link http://www.java-gaming.org/topics/basic-collision-detection/27326/view.html.

The methods presented in this tutorial are for processing and intersecting 3D triangles, you will find this useful when creating things such as advanced decal frameworks or object slicers which could work for both 2D and 3D.

For sake of this tutorial, I assume that you have a working Vector2 and Vector3 library. If you don't, libraries such as LibGDX or LWJGL provide one for you. Depending on how you layout your code, you may need to perform some light modifications, otherwise it should work by simply copy pasting the code into your Java projects.

The method presented below is for finding the closest point between a triangle and a point. Very useful method in certain situations.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
// for triangle a-b-c return a point q in triangle that is closest to p
public static Vector3 closestPtPointTriangle(Vector3 p, Vector3 a, Vector3 b, Vector3 c) {
   // Optimized version as found in book Real time collision detection
  // b - a
  Vector3 ab = Vector3.subtract(b, a);
   
   // c - a
  Vector3 ac = Vector3.subtract(c, a);
   
   // p - a
  Vector3 ap = Vector3.subtract(p, a);
   
   float d1 = Vector3.Dot(ab, ap);
   float d2 = Vector3.Dot(ac, ap);
   
   if (d1 <= 0.0f && d2 <= 0.0f) {
      return a;  
   }
   
   // p - b
  Vector3 bp = Vector3.subtract(p, b);
   
   float d3 = Vector3.Dot(ab, bp);
   float d4 = Vector3.Dot(ac, bp);
   
   if (d3 >= 0.0f && d4 <= d3) {
      return b;  
   }
   
   float vc = d1 * d4 - d3 * d2;
   
   if (vc <= 0.0f && d1 >= 0.0f && d3 <= 0.0f) {
      float v = d1 / (d1 - d3);
     
      // a + (ab * v)
     return Vector3.add(a, Vector3.multiply(ab, v));
   }
   
   // p - c
  Vector3 cp = Vector3.subtract(p, c);
   
   float d5 = Vector3.Dot(ab, cp);
   float d6 = Vector3.Dot(ac, cp);
   
   if (d6 >= 0.0f && d5 <= d6) {
      return c;  
   }
   
   float vb = d5 * d2 - d1 * d6;
   
   if (vb <= 0.0f && d2 >= 0.0f && d6 <= 0.0f) {
      float w = d2 / (d2 - d6);
     
      // a + (ac * w)
     return Vector3.add(a, Vector3.multiply(ac, w));
   }
   
   float va = d3 * d6 - d5 * d4;
   
   if (va <= 0.0f && (d4 - d3) >= 0.0f && (d5 - d6) >= 0.0f) {
      float w = (d4 - d3) / ((d4 - d3) + (d5 - d6));
     
      // b + w * (c - b)
     return Vector3.add(b, Vector3.multiply(Vector3.subtract(c, b), w));
   }
   
   float denom = 1.0f / (va + vb + vc);
   float vn = vb * denom;
   float wn = vc * denom;
   
   // a + ab * vn + ac * wn
  // this can be done with one line
 
   Vector3 abvn = Vector3.multiply(ab, vn);
   Vector3 acwn = Vector3.multiply(ac, wn);
   
   // return result
  return Vector3.add(a, Vector3.add(abvn, acwn));
}


Below is a quick method to check if a point p is in a triangle defined by points a-b-c

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
// check if point p is in triangle a-b-c
public static boolean pointInTriangle(Vector3 p, Vector3 a, Vector3 b, Vector3 c) {
   // bring triangle to p coordinate frame
  Vector3 pa = Vector3.subtract(a, p);
   Vector3 pb = Vector3.subtract(b, p);
   Vector3 pc = Vector3.subtract(c, p);
   
   float ab = Vector3.Dot(pa,pb);
   float ac = Vector3.Dot(pa,pc);
   float bc = Vector3.Dot(pb,pc);
   float cc = Vector3.Dot(pc,pc);
   
   if (bc * ac - cc * ab < 0.0f) return false;
   
   float bb = Vector3.Dot(b,b);
   
   if (ab * bc - ac * bb < 0.0f) return false;
   
   return true;
}


Below is a method of intersecting a line made by two vectors. The intersection point can also be computed. The method will return false if no intersection occurs.
Method also very useful for performing ray-triangle intersections.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
// for triangle a-b-c, intersect the line made by p-q and store intersection point in r
// returns true if intersected, or false if no intersection occurs
public static boolean intersectLineTriangle(Vector3 p, Vector3 q, Vector3 a, Vector3 b, Vector3 c, Vector3 r) {
   // Bring points to their respective coordinate frame
  Vector3 pq = Vector3.subtract(q, p);
   Vector3 pa = Vector3.subtract(a, p);
   Vector3 pb = Vector3.subtract(b, p);
   Vector3 pc = Vector3.subtract(c, p);
   
   Vector3 m = Vector3.Cross(pq,pc);
   
   float u = Vector3.Dot(pb,m);      
   float v = -Vector3.Dot(pa,m);
   
   if (Math.signum(u) != Math.signum(v)) {
      return false;
   }
   
   // scalar triple product
  float w = Vector3.Dot(pq, Vector3.Cross(pb,pa));
   
   if (Math.signum(u) != Math.signum(w)) {
      return false;
   }
   
   float denom = 1.0f / (u + v + w);
   
   // r = ((u * denom) * a) + ((v * denom) * b) + ((w * denom) * c);
  Vector3 compA = Vector3.multiply(a, u * denom);
   Vector3 compB = Vector3.multiply(b, v * denom);
   Vector3 compC = Vector3.multiply(c, w * denom);
   
   // store result in Vector r
  r.x = compA.x + compB.x + compC.x;
   r.y = compA.y + compB.y + compC.y;
   r.z = compA.z + compB.z + compC.z;
   
   return true;
}


Before we proceed with our next method, we are going to define a Plane in 3D. So what is a plane?

A plane can be considered to be an entity which has a position and a direction that extends to and from infinity. It is very useful in certain intersection tests and with some creativity, it can be used to create interesting bounding volumes in code.

Below is how we will define our Plane

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
public class Plane {
   
   public Vector3 n;
   public float d;
   
   public Plane(Vector3 direction, Vector3 position) {
      this.n = direction;
      this.d = Vector3.Dot(n,position);
   }
}


Notice how we don't store position directly? The precomputed floating point d is actually more useful for us when performing intersection tests against this Plane which will soon become apparent.

Lets create our first intersection test - A line vs a Plane test, below is the code

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
// intersect the line a-b with plane p and store result in q
// returns true or false if intersection is found
public static boolean intersectLinePlane(Plane plane, Vector3 a, Vector3 b, Vector3 q) {
   Vector3 ab = Vector3.subtract(b, a);
   
   float t = (plane.d - Vector3.Dot(plane.n, a)) / Vector3.Dot(plane.n, ab);
   
   // floating point errors common here - use own delta values as needed
  if (t >= -0.0001f && t <= 1.0001f) {
      // q = a + t * ab
     q.set(Vector3.add(a, Vector3.multiply(ab, t)));
     
      return true;
   }
   
   return false;
}


And as always, a cheap method exists to see which side a point lies on the Plane. This can be used to early-out most intersection tests before proceeding with expensive mathematics stuff.

1  
2  
3  
4  
5  
// check to see where the point p lies on plane
public static boolean sideOfPlane(Plane plane, Vector3 p) {
   // some bloody math errors here again, modify with delta values as needed
  return Vector3.Dot(plane.n, p) >= plane.d - 0.001f;  
}


I am going to end this tutorial with something very interesting. A concept of Barycentric coordinates, which is a very powerful tool that can be used for both intersection tests and more importantly interpolation inside a 3D triangle.

For example, lets say you wish to cut a Quad made from two triangles with a line. All easy enough, and now you are left with a problem of generating new UV coordinates for the intersection points. As it turns out, if we have a triangle (A,B,C) that has UV coordinates (UVA,UVB,UVC) we can work out "weight" values u,v,w for triangle A,B,C so that for any point P on or in triangle A,B,C will have new UV coordinates of UVP = UVA * u + UVB * v + UVC * w.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
// compute the barycentric coordinates of triangle a-b-c in regards to point p and store result in references u-v-w respectively
// where u = uvw[0], v = uvw[1], w = uvw[2], make sure array uvw is length 3.
public static void barycentric(Vector3 a, Vector3 b, Vector3 c, Vector3 p, float[] uvw) {
   Vector3 m = Vector3.Cross(Vector3.subtract(b, c), Vector3.subtract(c, a));
   
   float nu;
   float nv;
   float ood;
   
   float x = Math.abs(m.x);
   float y = Math.abs(m.y);
   float z = Math.abs(m.z);
   
   // compute areas of plane with largest projections
  if (x >= y && x >= z) {
      // area of PBC in yz plane
     nu = triArea2D(p.y, p.z, b.y, b.z, c.y, c.z);
      // area of PCA in yz plane
     nv = triArea2D(p.y, p.z, c.y, c.z, a.y, a.z);
      // 1/2*area of ABC in yz plane
     ood = 1.0f / m.x;
   }
   else if (y >= x && y >= z) {
      // project in xz plane
     nu = triArea2D(p.x, p.z, b.x, b.z, c.x, c.z);
      nv = triArea2D(p.x, p.z, c.x, c.z, a.x, a.z);
      ood = 1.0f / -m.y;
   }
   else {
      // project in xy plane
     nu = triArea2D(p.x, p.y, b.x, b.y, c.x, c.y);
      nv = triArea2D(p.x, p.y, c.x, c.y, a.x, a.y);
      ood = 1.0f / m.z;
   }
   
   uvw[0] = nu * ood;
   uvw[1] = nv * ood;
   uvw[2] = 1.0f - uvw[0] - uvw[1];
}

// helper function used to compute triangles barycentric coordinates
public static float triArea2D(float x1, float y1, float x2, float y2, float x3, float y3) {
   return (x1 - x2) * (y2 - y3) - (x2 - x3) * (y1 - y2);  
}


Like mentioned above, I've used the same methods to create two Editor extensions for Unity in C#, one being a Slicer Framework (ability to slice objects) and another a Decal Framework (ability to place decals on any object surface). More details if interested can be found in my blog!

Being a Java coder by heart I thought this would be a good place to share some of the source, and hopefully some of you readers will find it useful for your applications!

Any feedback, comments, critics are all welcome  Grin
11  Discussions / Miscellaneous Topics / Re: Dota 2 giveaway ;) on: 2013-03-06 14:06:33
Because my pudge play is amazing!  Grin
12  Discussions / Miscellaneous Topics / Re: Dota 2 giveaway ;) on: 2013-03-06 01:37:51
I also have 26 keys to give away... feel free to add me [VEGN] DrHalfway, or send me your steam username and i'll add you =]
13  Game Development / Game Mechanics / Re: Question about rotated bounding rectangles on: 2013-02-05 02:40:03
I personally use SAT for Rotated bounding box collisions, it is very fast and accurate and it can be expanded for collision detection between rotated 3D boxes and polygons. Although for 3D, it is commonly better to use an algorithm called GJK (Gilbert–Johnson–Keerthi) which will outperform SAT for most 3D cases.
14  Discussions / General Discussions / Re: Your major past/future accomplishments on: 2013-01-23 02:50:39
I want to create something new
15  Game Development / Shared Code / Re: Java Continuations and GreenThreads on: 2013-01-08 04:00:20
I'm writing to express my thoughts on how awesome this really is. This library opens up a whole new dimension for game logic writing. I'll be adding this library into my engine very soon! (with credits of course!)  Grin
16  Discussions / Jobs and Resumes / Re: How to write a University Entrance Portfolio? on: 2013-01-07 05:12:53
I apologise if I'm coming off as rude or arrogant, but going to a CS degree and completing it successfully should warrant that the student is a competent software developer. Its not about how much theory you know or where you can get your knowledge from, the end result doesn't change, the student should be a competent software developer.

The ghosts of Alan Turing, John Von Neumann, and Edsger Dijkstra are going to visit you tonight.


I get visits from time to time, some more pleasant than others  Cheesy
17  Discussions / Jobs and Resumes / Re: How to write a University Entrance Portfolio? on: 2013-01-07 04:42:59
I apologise if I'm coming off as rude or arrogant, but going to a CS degree and completing it successfully should warrant that the student is a competent software developer. Its not about how much theory you know or where you can get your knowledge from, the end result doesn't change, the student should be a competent software developer.

At the end of the day, it is also the students responsibility to seek further knowledge in their field and not rely solely on what a university teaches.

Now here is fact, what percentage of students coming out of a CS course at said university are considered to be competent software developers?

I've been given a link in an e-mail which is a very good read (from my recent applications for a job)

http://www.supercoders.com.au/blog/stuffyoumustknowobjectoriented.shtml
18  Discussions / Jobs and Resumes / Re: How to write a University Entrance Portfolio? on: 2013-01-07 03:05:21
What ENTER score did you get? CS at RMIT (if you're in Melbourne) is 70 something for entry. They do also take into consideration of your high school subjects, for example, my ENTER was bad because of my English, I barely passed, only thing that really got me into CS was my good scores in mathematics subjects.

Other good university options for CS is Swinburne University and Monash University, I probably wouldn't go anywhere near Melbourne University for CS, too theoretical, too much crap, not enough stuff to get you ready for the real world. I've got friends who came out of that university with good grades who can't tell the difference between an abstract class and an interface.
19  Games Center / WIP games, tools & toy projects / Re: WIP - Halfway Game Engine on: 2012-12-20 12:40:10
=0

Well, my only regret is putting in so much time on that logo... I'm not an artist, so that logo took me 8 hours.
20  Games Center / WIP games, tools & toy projects / WIP - Halfway Game Engine on: 2012-12-20 02:57:36
Hello JGO Community

I think its time to introduce the little project we have been working on in the past year, we have dubbed the project as the "Halfway Game Engine" or HGE for short.

The story behind this project is fairly straightforward, its about two uni students who have been good friends since high school to get together, make an engine and potentially make a few games to be launched. Our names are David Arayan (myself) and Matthew Jackson.

Unfortunately the project failed, after a year of solid hard work we ran out of time to be able to make anything we would consider worthy for launch. Whilst the engine is working properly, my initial development calculations were quite far off which stretched the development to a full year. Regardless, it was very good experience for both of us, and we hope it will help us in our future prospects.

Now my friend is graduated and I still have one year to go for uni. I've decided to make this post because the HGE is not dead, I will be committing my spare time for next year in polishing the HGE to be submitted potentially as an open source project, and who knows, maybe later in life we may continue where we left off this year.

Without further to do, I'll be posting a few screen shots of the HGE aswell as go through what it can/can't do and what my plans are for it in the future.

Currently the Engine comes with a "World Editor" which was developed primarily by Matthew and of course the Engine primarily developed myself.

What the engine can do?

One click generates an eclipse project for either PC or Android
Collision Detection – AABB, OBB, Circle
Collision Detection Broadphase – Quadtree, Octree, Grid
Rendering – 2D sprite rendering, dynamic movement, dynamic color change, uses immediate mode openGL
Particles – Flexible particle system integrated with the renderer to produce a number of effects
Scene Manager – an entity management system that manages sounds, music, gameobjects and more.
Math Library – mathematics utility library, includes Vector2 and Vector3 classes aswell as Matrix2x2 Matrix3x3 Matrix4x4 and Quaternion classes.
Pooling – mainly taken care of by the scene manager, pooling ensures the garbage collector for android stays happy.
GUI manager – a manager system built specifically for managing GUI elements, including clickable buttons and labels which can either be in camera (local) space aswell as world (entity) space.
Supports Android deployment version 1.5 +
Generic Containers – tailor made generic containers for use in engine, including linked lists, dynamic arrays, pools, stacks and queues. Optimised for android (so GC stays happy)
Utility – including bitflags, interpolators, jukebox (for music), stopwatch and particle factory with pre-defined effects.
Other – Automatic atlas packing and rendering filters via the World Editor. #declare tags in script editor to control source output, debug mode.

What the engine can't do?

No 3D rendering as of yet
Rendering does not support shaders as of yet

Now that the feature set it complete, i'd like to show some screen shots. Because the Engine is just code, and posting a screenshot of code is pretty meaningless, i'll post screenshots of the World Editor aswell as two games which were in development.

The logo


The editor in action, this is the Invaders Must Die game


Invaders Must Die - A PC/Android Tower Defence Game (WIP)


Memory Game - A random sequence of pictures is given, you must remember at set time and enter answer when ready, it increases in difficulty and gives a score based on accuracy and time taken (WIP)


In coming weeks, i'll try to complete the TD game and as soon as playable version is available, i'll post a link in this thread. In meantime, you can follow the development of HGE (if you wish) at my blog http://davidarayan.wordpress.com/.

Thank you for reading  Grin
21  Game Development / Newbie & Debugging Questions / Re: Whats stopping people from changing code in the client application on: 2012-12-17 05:14:11
You will find that some of the best methods for everything is known by everyone. This also goes true for encryption algorithms. In my opinion, if some method is kept a secret, then it obviously has a huge flaw that can be exploited by knowing the said method. Valve is very good with their anti-cheat systems, wouldn't mind working for them at some point (if I can get lucky enough for an interview, and then there's the question of passing the interview).
22  Game Development / Newbie & Debugging Questions / Re: Whats stopping people from changing code in the client application on: 2012-12-17 03:17:51
A good server cannot assume that the data sent by the client is correct, checks on data is always needed in some way or form.

Think of a client/server hosting a game with 12 people. Everyone is playing legit except for one player, who modifies the data packet for character "speed" or "location" before data is sent to server. If the server does not do a range validity check on this variable, it will simply distribute it to every client, the result is a speed hack, being able to either move extremely fast or "warping" mechanics. However if the server performs a validity range check on variable, which can be up to a certain logical tolerance, client hacks like these would be fairly meaningless.

Solving problems like these involves a lot of effort. The example above is very simple to implement, however, how would you be able to detect aim bots? how do you know its an aim bot and not a truly talented player? does an algorithm exist to catch these things? maybe some kind of complex pattern recognition algorithm running for every client server side?

As you can see, the problem itself increases. Implementing such methods for catching cheaters also takes performance away from the server, so the server will need to be fast enough to be able to run these tests in a timely manner.
23  Discussions / General Discussions / Re: OGRE4j? on: 2012-12-13 03:56:26
OGRE4j is a JNI binding for OGRE. OGRE by definition is a rendering engine, although from what i've read, it has libraries which are essential for all game engines. You will probably have to extend it further if you would like to use it as a game engine.
24  Game Development / Newbie & Debugging Questions / Re: LWJGL and Rendering Objects based on co-ordinates on: 2012-12-12 13:56:54
for an MMORPG the most difficult thing is NOT the renderer, but rather building a solid and robust server-client framework. You will need to take into consideration about user security, be able to defend against misc attacks, prevent cheating. Its a HUGE undertaking.

You will first need to master -

Network Programming
Thread Programming (Concurrency)
Database Programming
Capable of design and implementation of very large scale software - primarily what I refer to as "Runtime" software.
Security - Encryption

And i'm only beginning the list, and this is only the server architecture, think about the client side for the moment. You will need to implement Scene Management, Rendering, Collision Detection, Math libraries, Particle Systems and the list goes on.

Not trying to discourage you or anything, but I think you are underestimating the depth and knowledge (and time) needed in order to implement these kinds of systems.

Start small, a good starter ambitious project is mobile development. Go grab libGDX, read some documentations and start making tower defence, or pong. In fact, if you manage to make a good tower defence game, then you have probably achieved what 90% of us in this forum probably couldn't (although we are more than capable).

For networking, open up eclipse and make a console based chat app, have server be able to accept multiple clients, be able to handle reconnection and be able to kick any user from chat room. This will teach you the basics of network programming and basic threading.

I wish you the best of luck.
25  Discussions / General Discussions / Re: Where are you from? on: 2012-12-07 00:41:43
22, Born in Armenia, living in Australia, family currently in Russia.
26  Discussions / General Discussions / Re: What's your preference is spacing on: 2012-11-29 12:14:46
I always like to use brackets

1  
2  
3  
4  
5  
6  
if (val) {
     System.out.println(val);
}
else {
     System.out.println(val);
}


I actually don't mind all of the styles presented here, If I were just reading code its fine. What I don't like is when people FORCE me to use something else. I think I've had a comment once that the above example is "unreadable" and should be converted into this.

1  
2  
3  
4  
5  
6  
7  
8  
if (val == true) 
{
     System.out.println(val);
}
else
{
     System.out.println(val);
}


ugh  Lips Sealed
27  Game Development / Newbie & Debugging Questions / Re: Collision and Movement on: 2012-11-26 00:29:27
What you're looking for is "Continuous Collision Detection". Its something that is fairly difficult to get right and does add quite a bit of overhead to the Collision Detection. Most game engines have a hard constant of how fast an object is allowed to travel, for example, it does not try to solve a collision for an object travelling at the speed of light for example. Fast objects skipping collisions because they travel too fast is whats called "Tunneling".

For bullets or extremely fast objects like laser beams you might wish to use Ray casting instead. For Continuous collision detection you can approach it in a number of ways.

1) You can construct a polyhedral type volume from the objects previous position and current position, and perform tests to make sure nothing came in between. This scheme can EASILLY become slower than brute forcing everything.

2) You can perform a Raycast from the objects previous position in the direction of current position, if the ray hits anything it means object has missed a collision, you can re-update the objects position to the first object the ray has hit and perform a collision detection as normal.

3) Simply add a hard constant for how fast objects can travel. The maximum distance traveled per collision step should be equal to half the radius of the object. This will ensure object does not miss any collisions. This is the most primitive, simplest and easiest to implement method, and it works very good for platform games that don't require rapid movement.

There are plenty of other ways to do this, just mess around with a couple of schemes and use whichever you like. Collision Detection is a fairly difficult topic and its a nightmare trying to code anything that's even remotely robust, but I hope I gave you some implementation directions  Grin
28  Game Development / Game Play & Game Design / Re: Quadtree-like structure for dynamic / moving Game Objects on: 2012-11-23 14:46:31
I must agree with Riven here

Speaking from a bit of experience, I've created numerous Broadphase detectors, some being more complex than others, such as Quadtrees, Variant of quadtree with ID tracking for nodes (for cache awareness), k-d trees, BSP trees you name it. By far, the best, most robust and fastest solution is Grid, especially for small-medium sized 2D games.

If you're creating an MMO, or want to procedurally create an infinite world of some sorts then yes, the more fancy detectors may be more memory efficient and may be faster, but these cases are very rare, and if you're creating such games you'd probably come up with a specific Hybrid solution for speed anyway rather than a single solution-fits all scheme.

Its late here so I haven't read all the posts, have you considered making your Quadtree/Grid aware of very fast moving objects in order to avoid tunneling? just a thought...
29  Game Development / Newbie & Debugging Questions / Re: Collision detection question on: 2012-11-20 11:26:54
Looks like what you want to do is pixel perfect collision detection, another method is as you described, which is create a complex triangulated mesh, but that seems way too complex for this.
30  Discussions / General Discussions / Re: What do you look like? on: 2012-11-19 13:27:18
You look tense in that photo... first time with a shotgun?  Grin
Pages: [1] 2 3 4
 

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

The first screenshot will be displayed as a thumbnail.

pw (35 views)
2014-07-24 01:59:36

Riven (33 views)
2014-07-23 21:16:32

Riven (21 views)
2014-07-23 21:07:15

Riven (24 views)
2014-07-23 20:56:16

ctomni231 (55 views)
2014-07-18 06:55:21

Zero Volt (47 views)
2014-07-17 23:47:54

danieldean (38 views)
2014-07-17 23:41:23

MustardPeter (43 views)
2014-07-16 23:30:00

Cero (59 views)
2014-07-16 00:42:17

Riven (56 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!