Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (541)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (603)
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 ... 38
1  Java Game APIs & Engines / Engines, Libraries and Tools / [libGDX] Transparent decals on: 2014-11-05 21:12:45
Hey guys!

I'm having this weird problem with decals in libGDX. Here's an example (rendering decals underneath trees):


I was hoping to make some nice shadows though.

This is how I am drawing the decals:
1  
2  
decalBatch.add(shadow);
decalBatch.flush();


This is how the batch is set up:
1  
2  
groupStrategy = new CameraGroupStrategy(rCamera, new ZStrategyComparator());
decalBatch = new DecalBatch(groupStrategy);


This was following instructions found on http://stackoverflow.com/questions/25312161/libgdx-andorid-black-background-on-transparent-decalsprites

The actual image I'm rendering looks like this (format is RGBA8888):


So, any ideas?
2  Game Development / Newbie & Debugging Questions / Tweening a rotation, rotating the wrong way sometimes on: 2014-10-25 22:35:35
Hey guys!

I am storing a rotation in degrees, and I am tweening this to animate rotation.
I have a problem with tweening from 0 -> 270 degrees for instance, in which case the object is rotating the longer way around.
It should just count downward through 0 to 360, because that is the shortest path. How can I approach this problem?

I am using the Universal Tween Engine by the way, in case there is a built-in solution.

Thanks in advance.
3  Game Development / Game Mechanics / Re: [jPCT] 3D vector math problem on: 2014-10-25 22:07:27
I found the problem, for anyone searching the web in the future. The culprit is the camDirection.normalize() call in getDirection().
4  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Library to make a 2d game look 3d? on: 2014-10-05 18:40:11
You can choose almost any library for 3D graphics, and then choose an orthographic projection.
You will still have to learn how to make basic 3D, but your game renders are going to look really neat and 2.5D-ish. Learning OpenGL is not a necessity for this though.

  • LibGDX has a decent scene graph for 3D, but I felt that it fell short in lighting (it's under development). Maybe you don't find this a problem. No OpenGL needed.
  • JME definitely doesn't fall short in functionality, and you can definitely render what you need. It might be overkill though. No OpenGL needed.
  • jPCT is a simple 3D API. It doesn't feature orthographic projection though, which may be a problem for you. No OpenGL needed.
  • LWJGL is "just" an OpenGL binding, meaning that you'll be geting dirty with the GL yourself.
  • JOGL I have never used, but I figure it should be very similar to LWJGL.

There are other 3D libraries that I know nothing about, but maybe someone else does?? Anyway, they might be of interest to you.
  • Ogre4j
  • Java3D
  • Bindenlicht
  • 3DzzD
  • Jake2
  • Ardor3D
  • Xith3D
5  Game Development / Game Mechanics / [jPCT] 3D vector math problem on: 2014-10-05 17:33:48
I implemented a camera behavoir that I need. The camera will look at a point, rotate around it, and move in the direction that it's facing (not including height). It works great! However, when moving forwards (in the facing direction), the camera never goes "spot on" in the right direction. It always strays a little to the right. This is really frustrating.

I'm using jPCT, and the coordinate system is as follows:
 X-axis points to the right.
 Y-axis points downwards.
 Z-axis points into the screen (depth).

The camera behavoir is as follows.
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  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
131  
132  
133  
134  
135  
136  
137  
138  
139  
140  
141  
142  
143  
144  
145  
146  
147  
148  
149  
150  
151  
152  
153  
154  
155  
156  
157  
158  
159  
160  
161  
162  
163  
164  
165  
package com.jd247.model;

import com.threed.jpct.Camera;
import com.threed.jpct.SimpleVector;

/**
 * Utility used to view a World. This object can transform a Camera with the {@link #apply(Camera)} function.
 * This has the limitation of only being able to look at the World in a 45 degree angle.
 * Its coordinates represents the center of its view, and not it's actual position.
 *
 * @author Mads Peter Horndrup
 */

public class WorldCamera {
   
   /** Vector along the z-axis. */
   private static SimpleVector zDirection = new SimpleVector(0f,0f,1f);
   
   /** Vector along the reverse y-axis. */
   private static SimpleVector reverseYDirection = new SimpleVector(0f, -1f, 0f);
   
   /** Vector that has no length */
   private static SimpleVector zero = new SimpleVector(0f, 0f, 0f);
   
   /** Tile coordinates in the plane */
   private float x = 0f;
   private float z = 0f;
   
   /** Camera's angle around the y-axis, in radians. */
   private float angle = (float)(Math.PI * 2f - Math.PI * 0.25f);
   
   /** Distance from the camera's focus to the actual camera on the xz-plane*/
   private float radius = 150f;
   
   /** How many tiles per second the WorldCamera should move */
   private float moveSpeed = 1f;
   
   /** How fast the WorldCamera will rotate, in radians per second */
   private float rotationSpeed = 1f;
   
   /** How many GL-units per tile */
   private int tileSize;
   
   /**
    * The direction this WorldCamera is currently facing.
    * This field only serves to avoid defragmentation with repetitive use of {@link #getDirection()}
    */

   private SimpleVector cameraDirection;
   
   /**
    * @param tileSize How many GL units per tile in the game.
    */

   public WorldCamera(int tileSize) {
      this.tileSize = tileSize;
   }
   
   /**
    * Transforms the given Camera to match the WorldCamera. This adjusts position, direction and up.
    * @param camera   Camera that will the transformed to match this WorldCamera.
    */

   public void apply(Camera camera) {
      // Set the camera's position to the default.
      camera.setPosition(zero);
     
      // Set the camera's direction and up to the default.
      camera.setOrientation(zDirection, reverseYDirection);
     
      // Rotate around the camera's own y-axis.
      camera.rotateY(angle);
     
      // Rotate 45 degrees downwards around the camera's own x-axis.
      camera.rotateX((float)(-0.25f*Math.PI));
     
      // Set the cameras position, based on radius and angle.
      camera.setPosition(
            (float)(Math.sin(angle)*radius),
            (float)(-radius),
            (float)(-Math.cos(angle)*radius));
     
      // Translate camera to look at its coordinates instead of (0, 0, 0)
      camera.setPosition(
            camera.getPosition().x+x*tileSize,
            camera.getPosition().y,
            camera.getPosition().z+z*tileSize);
   }
   
   /**
    * Rotates the WorldCamera around its viewpoint, and around the y-axis.
    * @param angle   How many seconds that has passed.
    */

   public void rotate(float delta) {
      this.angle += delta*rotationSpeed;
      if (this.angle > 2*Math.PI) {
         this.angle = 0;
      }
      if (this.angle < 0) {
         this.angle = (float)(2*Math.PI);
      }
   }
   
   /**
    * Moves the WorldCamera forward in the direction it's pointing.
    * @param delta   How many seconds that has passed.
    */

   public void moveForward(float delta) {
      x += getDirection().x * moveSpeed * delta;
      z += getDirection().z * moveSpeed * delta;
   }
   
   /**
    * Moves the WorldCamera backwards in the direction it's pointing.
    * @param delta   How many seconds that has passed.
    */

   public void moveBackward(float delta) {
      x -= getDirection().x * moveSpeed * delta;
      z -= getDirection().z * moveSpeed * delta;
   }
   
   /**
    * Moves the WorldCamera sideways to the right.
    * @param delta
    */

   public void moveSidewaysRight(float delta) {
      SimpleVector moveAxis = getDirection().calcCross(reverseYDirection);
     
      x += moveAxis.x * moveSpeed * delta;
      z += moveAxis.z * moveSpeed * delta;
   }
   
   /**
    * Moves the WorldCamera sideways to the left.
    * @param delta
    */

   public void moveSidewaysLeft(float delta) {
      SimpleVector moveAxis = getDirection().calcCross(reverseYDirection);
     
      x -= moveAxis.x * moveSpeed * delta;
      z -= moveAxis.z * moveSpeed * delta;
   }
   
   /**
    * Gives this camera a new moving speed.
    * @param speed   The new speed, in tiles per second.
    */

   public void setMoveSpeed(float moveSpeed) {
      this.moveSpeed = moveSpeed;
   }
   
   /**
    * Gives this camera a new rotation speed.
    * @param rotationSpeed   The new rotation speed, in radians per second.
    */

   public void setRotationSpeed(float rotationSpeed) {
      this.rotationSpeed = rotationSpeed;
   }
   
   /**
    * @return Unit vector in the direction the WorldCamera is currently facing
    */

   public SimpleVector getDirection() {
      cameraDirection = new SimpleVector(zDirection);
      cameraDirection.rotateY(angle);
      cameraDirection.rotateX((float)(-0.25f*Math.PI));
      return cameraDirection.normalize();
   }
}


I think the problem comes from assembling the direction-vector in WorldCamera#getDirection(), or from moving along said vector in WorldCamera#moveForward() or WorldCamera#moveBackward().

SimpleVector comes form jPCT, by the way.

Any ideas as to why this might be happening?
6  Games Center / WIP games, tools & toy projects / Re: BlockBasher - My first game in Java 2D. on: 2014-07-12 07:13:09
Sure. I do see the splash with the title and directions. I still don't see the score, though.

If I make the paddle move before shooting the ball, it glitches out a little. I also seems that the paddle once again can go through the sides.
It looks like you implemented what I described, however it feels weird. It may just be a too high maximum velocity, or too much velocity given when pressing a button. Smiley
7  Games Center / Showcase / Re: Tess on: 2014-07-09 22:17:35
Really awesome job! What tools were used to create this? How do the scripts work? Roll Eyes They seem compiled.
8  Games Center / WIP games, tools & toy projects / Re: BlockBasher - My first game in Java 2D. on: 2014-07-09 21:18:16
Hi! Nice game. I played it for a bit, and now I have some feedback for you. Smiley

I could not see my score throughout the game, even though the picture you posted shows it in the corner. That bummed me out a bit.
It seems that the controls offer no aim, making the ball go in the same pattern throughout the entire game. I suggest finding the ball's new direction based on where it hit on the paddle. While on the subject of the ball's direction, I noticed in your code that the ball does not posses a velocity - only a position. I think you could simplify your code by introducing a velocity vector to the ball, instead of storing this information in temporary variables in the main class. This change would also make changing the balls direction much easier. Everyone wins. Cheesy

If you do the same thing to your paddle, you could make it control very differently. Right now it's very tight, and responds with immediate effect. A velocity vector could add a heavier feel to it, making the paddle more difficult to stop, or change direction. This would make the game a bit more challenging.

Your code looks really neat, although there are some things I do not quite understand. One of these things, is the need for x2 and y2 variables. They could easily be replaced by a getter, adding only an extra calculation. I think that is worth the saved complexity.

The black background is a little bit dull, and I think it would be a shame not to generate at least something. Even a gradient would make it no much prettier. Remember bubble struggle? That game only had some gradients for backgrounds and it worked perfectly, making each level memorable.

There are tons of ways to improve a game like yours, but I think you did a good job. Your code does what you meant it to do, and it does so in a clear fashion. Good job on the game.  Smiley
9  Discussions / General Discussions / Re: Copying files with java!? on: 2014-07-07 12:24:58
Instead of specifying the path using %appdata%, you should instead try doing the following:
1  
System.getProperty("user.home")

This will get you to C:/Users/GNecro1 in the case of Windows. From here, you can go into the AppData folder.

EDIT: Awww. I was ninja'd. Sad
10  Discussions / General Discussions / Re: What kinds of experiences does everyone here have with 3d in Java? on: 2014-07-05 20:54:00
I have used both LWJGL and LibGDX. Both were similar experiences due to both havin bindings to underlying OpenGL, except LibGDX has more features like texture loading and so on.
 
I found it extremely difficult to do anything productive in 3D, due to problems like the gimbal lock. That problem lead to the realisation that math like complex numbers and quaternions were needed to do the things I wanted with 3D, thus making progress difficult. Generally, I am not very experienced in 3D math at all, so this transition was extremely hard for me.
 
Another thing to keep in mind is that you are probably going to learn OpenGL. Transitioning into OpenGL from the simplicity of Graphics#drawImage() is also not a very easy one to make. Consider viewports, frutrums, batching calls to the GPU, FBO's, VBO's, matrix transformations. Gah.

I ended up deciding that I was better off with 2D, until my education (I'm studying math and physics) would turn in the direction of 3D vectors and complex numbers. Luckily for me, this happens in September '14. I have tried using OpenGL multiple times though, and I feel that I got a bit farther each time. So as with any new hard skill, keep trying. Tongue
11  Game Development / Performance Tuning / Re: Efficient Fog of War on: 2014-07-03 21:58:09
Have you even tried this and timed it? 10 000 tiles is almost nothing.

I have not. I will come back though. Expect necro-threading in a year or two. Tongue

One easy optimization I can spot:

Do you need to calculate the circles every time?
If it is tile based and all the circles are the same size, couldn't you store the light in an array?
A 6x6 array as you keep saying Wink

I don't need to, no. This would remove quite a few calculations. Thanks!
12  Game Development / Performance Tuning / Re: Efficient Fog of War on: 2014-07-03 20:55:29
That's nothing. You're prematurely optimizing. Test it, time it and if it's slow fix it. The only thing you should optimize right now is possibly pooling your GridPoint2 instances so you don't generate as much garbage.

The pooling is easily fixable. Thanks for the suggestion, by the way. Smiley

I know I should not prematurely optimize, although I would like a solution that scales a little bit better than this does. I know my game is not going to be able to run the levels I would like it to, if I do not fix this.

I imagine the final product to have levels the size of 512^2, or even 1024^2. I seriously doubt a 256^2-size world would be any fun to explore. This is a building game, akin to Warcraft I. That's a lot of tiles. In this world there would be actors running around. Not one or two, but 50 or 80. Each with a lighting distance of 3, that is (80 * (3*2)^2) 2880 tiles to light up. The player would then have made around 10 buildings, each taking up 4 * 6 tiles. Each of the tiles also light up the world around them, in a circle with a radius of 3. That is another 240 checks through the getCirclePoints code, checking another 8640 tiles. I don't have time for 11520 checks, even if I limit it to once every movement cycle. This means the game is just not feasible.

Even if this is not possible, I want to get as close as I can. How can this be faster? 

13  Game Development / Performance Tuning / Re: Efficient Fog of War on: 2014-07-03 13:25:50
How large area are we talking about here? How many tiles per actor? How many actors?

For the map, 256 * 256. Each actor will light up a circle of radius 3 around it, meaning 6 * 6 tiles will be checked. There are many Actors, since each tile with a building also will light up tiles.
14  Game Development / Performance Tuning / Re: Efficient Fog of War on: 2014-07-03 08:11:07
I am actually having the same problem with my game:P

But consider this:

1: Is your light changing every frame? If not you could save some time by only calculating it when it changes.
2: Do you have a performance problem with the way you're doing it? Seriously I would like to know Tongue

Alright, only frames that has updates to the fog of war will recalculate it. If this calculation proves costly, this will result in lag-spikes every time the fog of war updates.
Currently, I have no problems. However, I have not tried a real scenario with many units moving on a large map. This means I actually don't know how well this scales. It does not seem like it would, though.

I am assuming it is 2D.

You are correct!

First of all, you shouldn't need to search through every tile, you should just check the tiles being rendered on the screen.

I actually do need to update more than is shown on the screen. The fog is not merely aesthetic - I plan to use the info in AI.

you can just recheck the fog of war when an actor moves.

That's true. Thank you.

you could only update the fog of war in locations where an actor moves, instead of checking every actor within view every time it updates, you could have only the tiles around the actor to update.

I don't see how this would work, seeing as the circle of vision might overlap with other nearby actors. I cannot simply fill the circle around a dead Actor with fog, because some other entity might have shared some of that vision. I hope this makes sense.

if your using shaders, you could just send an array of vectors, and create lights around the points, with the rest of the tiles being black / darkened.

I think this still poses the same problem. I don't use shaders, but I still need to know which tiles are visible in the model.


I fixed it.
15  Game Development / Performance Tuning / Efficient Fog of War on: 2014-07-02 12:31:42
Hi!

I'm implementing fog of war into my tile based game. It's chunky, meaning that a tile either has the fog, or does not have the fog.
Every frame I set all tiles to "not visible". Then, I loop through all the entities, lighting up circles of tiles around them. For the circle, I use this algorithm:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
public class CircleAlgorithm {
   
   private ArrayList<GridPoint2> pointList = new ArrayList<GridPoint2>();
   
   public List<GridPoint2> getCirclePoints(int x, int y, int radius) {
      pointList.clear();
      for(int j = -radius; j <= radius; j++) {
         for(int i = -radius; i <= radius; i++) {
            if(i*i+j*j <= radius*radius + radius* 0.8f) {
               pointList.add(new GridPoint2(x+i, y+j));
            }
         }
      }
      return pointList;
   }
}


I know it look shady, but it produces really good looking circles for its low complexity. I fear this method of having, and maintaining fog of war is not the best. Here's an overview of the task, each frame:
  • Loop through entire map, setting "not visible" on each tile.
  • Loop through all Actors, light up circle (r=3) around the Actor
  • The "lighting up" procedure loops through 6*6 tiles, for a radius 3 circle.

I would very much like some input as to how this can be improved! I ruled out only updating the changing parts (as opposed to recalculating every point every frame), because a lot of the vision from actors close to eachother overlap. Because of this, I can not simply "turn off" the circle of vision around an actor.

Maybe I am missing something.
16  Game Development / Artificial Intelligence / Re: How to implement N-Opt in Genetic Algorithm To Solve the Travelesman Problem? on: 2014-06-22 19:27:20
You're just attempting to find a path through waypoints?  If so, forget genetic.  Heck even forget shortest path.

His problem is to find the shortest path through all waypoints and back. I believe that is the minimum criteria.
17  Game Development / Game Play & Game Design / Re: Creating good game UI on: 2014-06-14 22:02:48
Check what some the UI libraries do! Swing, scene2d.ui, TWL, nifty, you name it. They are open source Smiley For drag and drop functionality, check out scene2d.ui's DragAndDrop class, as well as Target.
18  Game Development / Newbie & Debugging Questions / Re: Should I use Java Observer? on: 2014-06-11 14:47:06
I am not sure how I would apply the Command pattern in a sense that I get the same result as the Observer.

That's not what I intented to communicate at all, so that is probably why it does not make any sense. I meant that while you are having fun applying design patterns to games, the command pattern might be a good pattern to get to know. Unrelated to the issue of the thread. Roll Eyes

As it stands I simply have my CollisionHandler hold observers, which are the classes that handle sound, animation and scoring. Then when a certain collision happens, notify everything it just happened.

Oh. I understood that you were going to notify a PhysicsHandler of some description, that would then take care of the physics part of your game. I would advise against using an Observer to handle any kind of physics.
19  Game Development / Newbie & Debugging Questions / Re: Should I use Java Observer? on: 2014-06-11 14:08:52
I see no problem with the Observer pattern in this instance. I use it my own games to notify the underlying systems such as sound, music and statistics logging.

I do not know if it is a good idea to let the physics depend on entities being Observable though, because in order for the entities to register the state change they have to perform some physics calculation. I fear that this might lead to having half of the physics code stuck inside an Observable, and the other half stuck inside an Observer, and I am not sure that is an ideal situation.

I suggest (for the physics only) that you update the model from outside the model. Still, make it Observable for the things not directly related to it, but for core functionality like the physics in a pong game, I really would not do it.

Side note: If you are having fun with design patterns consider the Command pattern for your simple games. I know it is a little bit of a hassle, but it allows for great replay-functionality as well as aids AI development.

Side note two: Have you seen this excellent free e-book?
20  Game Development / Shared Code / Re: Scene2D replacement for Window on: 2014-06-11 11:40:59
Window was one of the first widgets in scene2d.ui and was built in a simple way. scene2d.ui has evolved a lot since then and Window is probably overdue for a rewrite. It shouldn't be too hard to write your own, as you found. When building an app with scene2d.ui, don't hesitate to build widgets specifically for your application.

I would be extremely grateful for an "official" rewrite of the Window, as I did run into some design problems with the one I threw together. Especially since I could not make the vanilla Window work in a neat fashion to save my life. Sorry.  Sad
I would request pushing this to the git, only the quality of this code is not so good. I would have loved to override Table#add() and Table#row(), among a few other hacky odd things. Eh. Roll Eyes

Anyway, I shared this so that people have the option to save that development time should they be unhappy with the current Window. Suggestions as to how to improve this code is very welcome.
21  Discussions / Miscellaneous Topics / Re: [Girls] How to completely block them from our lives? on: 2014-06-10 20:31:44
You do not have to put up with people you do not like in your freetime. It is your time - do what you want to do.
That said, girls can be just as cool as guys. My girlfriend likes programming, and we play games together. They exist. Go find her.

Alternatively, if you like the company of yourself there is nothing wrong in wanting just that. I like being alone, and I am sure I am not the only one in this thread feeling this way.
22  Game Development / Shared Code / Scene2D replacement for Window on: 2014-06-10 20:05:50
I was very unhappy with how Window works in scene2d.ui. I think it was purposefully made without any dependency on the other Widgets, however that decision makes the window difficult to use and extend.

Here is the exact problem I had with Window, if you have not tried it.
The title and side-buttons easily end up behind the content in the Window, and the Window can be dragged even when clicking buttons inside the content area.

So I made a version of it where only the top of the window can be dragged, and the elements behave according to table-layout. The title is no longer an awkwardly rendered BitmapFontCache, but a Label.

Here's the code (Frame is the interesting one):
MovableTable on PasteBin
Frame on PasteBin

Here is a demo of the following code for the Window in scene2d.ui:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
private void createAndShowGUI(Stage stage) {
      window = new Window("Jeg er et vindue",app.getSkin());
      window.setTitleAlignment(Align.left);
      window.padTop(25f);
     
      ImageButton close = new ImageButton(app.getSkin(), "closeDialog");
      window.getButtonTable().add(close);
     
      stage.addActor(window);
     
      TextButton textButton;
      for (int i = 0; i < 25; i++) {
         textButton = new TextButton(Integer.toString(i), app.getSkin());
         window.add(textButton);
         if ((i + 1) % 5 == 0) {
            window.row();
         }
      }
      window.pack();
}



Here is a demo of the Frame (the so-called improvement):
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
private void createAndShowGUI(Stage stage) {
      window = new Frame("Jeg er et vindue",app.getSkin());
     
      stage.addActor(window);
     
      TextButton textButton;
      for (int i = 0; i < 25; i++) {
         textButton = new TextButton(Integer.toString(i), app.getSkin());
         window.addContent(textButton);
         if ((i + 1) % 5 == 0) {
            window.rowContent();
         }
      }
      window.pack();
}



Constructive criticism is VERY welcome!!

I am quite unhappy with the way dragging was limited to just the top of the Frame, but I was out of ideas. I am also quite unhappy with the fact that Window requires both ImageButtonStyle, and LabelStyle as well as MovableTableStyle.
23  Games Center / WIP games, tools & toy projects / Re: Zombie Nauts [0.1.0] on: 2014-06-04 21:50:22
One of the Vlambeer guys once said that if you're making a 2D shooter, you should make the bullets as big as your chest.

He said a a lot of good things about making action games.

<a href="http://www.youtube.com/v/AJdEqssNZ-U?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/AJdEqssNZ-U?version=3&amp;hl=en_US&amp;start=</a>
24  Game Development / Networking & Multiplayer / Re: Client threads in a thread-per-client online game on: 2014-06-02 09:30:39
Since I'm having trouble with Threads using blocking IO with Swing, I'm jumping to LibGDX with Kryonet. I have one question however.

Is a single thread enough for both the clients networking and it's UI updates? I know this is not possible with blocking IO, but is Kryonet sufficiently fast for my framerate not to drop dramatically?
25  Game Development / Networking & Multiplayer / Re: Client threads in a thread-per-client online game on: 2014-05-31 03:57:54
I don't have a real answer for you, but I will say that you will save yourself a lot of time and hair if you use a working third party solution like Kryonet.

Thanks for suggestion, but I already have used KryoNet once before. I would like to try using the low-level Sockets and get a feeling for what is going on under the hood.

26  Game Development / Networking & Multiplayer / Client threads in a thread-per-client online game on: 2014-05-31 03:48:15
I heard the old paradigm is the new thing, so I abandoned NIO for now.

That is the best practise for Threads on the client, when using standard java Sockets? One thread for UI, and one for networking? Should I just reference the networking Thread in the UI-instance?

How would they communicate? Adding packets to a thread-safe queue for sending to the server, and then looping checking if there is something to be read from the InputStream? Is it okay to have both input and output on the same thread?

How would this networking thread work? I can't just loop (apparently) because reading from the inputstream will block.

So how is this done? Examples and pseudocode are appriciated Smiley
27  Game Development / Newbie & Debugging Questions / Re: How do you guys name builds, betas, etc. on: 2014-03-01 10:44:19
If you simply count, it's really easy to auto-update the version number from inside your build-script. Tongue
28  Discussions / General Discussions / Re: GPU acceleration on: 2014-03-01 10:16:17
I don't get it. How is this different from what our bindings to OpenCL/OpenAL/OpenGL offers?
29  Discussions / General Discussions / Re: Considering Java for game development, looking for brains to pick on: 2014-01-21 09:21:16
Why do you want to use Java instead of PHP? If it's for server communications, I find that PHP and Java can easily talk to eachother.

I find that it's just easier and cheaper to find shared hosting with PHP, than Java.
30  Game Development / Game Mechanics / Re: Loading and storing card images on: 2014-01-21 08:16:24
Starting with the assumption that "the game will contain too many cards to load into ram at once" might be a bad idea.
How big is a single card texture, in terms of memory usage?

Are you storing entire cards, or just the artwork? For less ram usage, you can load in just the artwork and the text by itself, and render the assembled cards.
Pages: [1] 2 3 ... 38
 

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

The first screenshot will be displayed as a thumbnail.

Mr.CodeIt (24 views)
2014-12-23 03:34:11

rwatson462 (55 views)
2014-12-15 09:26:44

Mr.CodeIt (45 views)
2014-12-14 19:50:38

BurntPizza (89 views)
2014-12-09 22:41:13

BurntPizza (112 views)
2014-12-08 04:46:31

JscottyBieshaar (83 views)
2014-12-05 12:39:02

SHC (92 views)
2014-12-03 16:27:13

CopyableCougar4 (100 views)
2014-11-29 21:32:03

toopeicgaming1999 (160 views)
2014-11-26 15:22:04

toopeicgaming1999 (159 views)
2014-11-26 15:20:36
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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
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!