Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (495)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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 ... 67
1  Discussions / General Discussions / Re: Performance Test for the Voxel Thing on: 2014-08-30 16:55:08
Phenom II x6 1055T @ 3.36GHz,
8GB ram @ 1280MHz
Win 7 x64
HD 5870 @ stock

uncapped: 95-105 fps
2  Discussions / General Discussions / Re: Performance Test for the Voxel Thing on: 2014-08-28 14:52:25
56-61fps

Hard to tell if the drops are simply timing inaccuracy, or if it's actually failing to hit the fps cap.

Phenom II x6 1055T @ 3.36GHz,
8GB ram @ 1280MHz
Win 7 x64
HD 5870 @ stock

Didn't need to increase vm memory
3  Game Development / Newbie & Debugging Questions / Re: Lost my CODE! on: 2014-08-13 23:44:29
Anything recoverable from your Windows 'Previous Versions' ?
4  Game Development / Networking & Multiplayer / Re: 10 Player(instanced) 3D Game, would TCP Suffice? on: 2014-07-17 09:39:20
If you have client side prediction, you'll be able to get away with the latency spikes inherent to TCP's packet retransmission method.

If you're doing lockstep without prediction, you'll need UDP. Instead of retransmission, have redundancy through duplication; every packet sent by the client contains everything that occurred since the last ack.
5  Discussions / General Discussions / Re: What's with unorganized code? on: 2014-06-24 10:28:26
Disorganised...
6  Discussions / Miscellaneous Topics / Re: Can any wireless usb connect to a router on: 2014-06-20 17:31:50
£15 gets you an 8 port gigabit switch; the number of ethernet ports on your router shouldn't be the reason* for opting for wifi.

*mobility & convenience on the other hand are perfectly reasonable justifications for wifi.
7  Game Development / Newbie & Debugging Questions / Re: Creating a chunk-based custom binary file format on: 2014-05-27 10:09:27
As I started to work on this, I noticed that I can't come up with a good way to write chunks into byte arrays, then output the byte arrays using DataOutputStream.

You're going to have to be more specific; what is the problem?

All I can suggest is that you look at the file format specification for a popular chunk based format, I'd suggest PNG (section 4.7 onwards); it's straight forward and well documented.
8  Game Development / Performance Tuning / Re: Questions about Java4k Code on: 2014-05-16 11:12:01
A class member requires a constant pool entry, and larger bytecode to access.

That said, once obfuscated these two are equivalent:

1  
2  
3  
4  
static final int a = 0;
run() {
final int b = 0;
}
9  Discussions / General Discussions / Re: Oracle wins copyright for the Java APIs on: 2014-05-09 22:48:44
/facepalm.

Their need to use similes to define their case tells you all you need to know about lawyers.... they know nothing about programming.

So, what next? Microsoft to sue the various Linux DirectX emulation layers?

10  Game Development / Performance Tuning / Re: Is there a logical reason to stuff 2D array data into one? on: 2014-05-06 12:26:17
Going back to the original question...

Quote
Is there a logical reason to stuff 2D array data into one?

If your game logic can be implemented more simply with a 1D array, then there is most definitely a good reason.

Pixel operations for example, can often be performed irrespective of axis coordinates, thus the algorithm will look a lot neater if the data is manipulated as a flat array (avoiding the need for nested loops).
11  Game Development / Performance Tuning / Re: Parallel insertion sort for almost sorted data sets on: 2014-05-01 09:45:09
So teleporting entities from one end of the domain to the other would be a catastrophe for the efficiency of this algorithm.
Cylindrical/toroidal coordinate systems are a big no no then!
12  Game Development / Performance Tuning / Re: Parallel insertion sort for almost sorted data sets on: 2014-04-30 08:09:35
Just from a quick skim of your initial diagrams, I'm curious what the algorithm does when an element belongs in a chunk that isn't a neighbouring chunk?
Eg if an element supposed to be in the last chunk,  was placed in the first.

Are the overlaps rechecked until the list is completely sorted?
13  Game Development / Newbie & Debugging Questions / Re: moving a generalPath on: 2014-04-19 22:31:38
Graphics.translate(x,y) or Graphics2D.translate(tx,ty)

The latter being equivalent to Graphics2D.setTransform(AffineTransform.getTranslateInstance(tx,ty))
14  Game Development / Newbie & Debugging Questions / Re: Can you randomly bitwise shift an integer left or right? on: 2014-04-13 11:31:31
Shifts are defined for all inputs

Just not what you might expect* Grin
*right-hand operand is truncated to 5 bits(for an int shift) or 6 bits (for a long shift).

I came a cropper of this behaviour some time ago.
15  Game Development / Newbie & Debugging Questions / Re: Advice on a faster way to check every pixel in an image. on: 2014-04-12 18:04:50

Not when you're loading 10~ of these sheets (depending on the spritesheet it needs to grab) about 300~ times... /snip

You're reloading the same image multiple times?
16  Game Development / Newbie & Debugging Questions / Re: Gradient fill a BufferedImage on: 2014-04-12 17:54:37
You googled for it?
http://lmgtfy.com/?q=gradient+fill+java
17  Game Development / Performance Tuning / Re: Pixel Array Manipulation vs. Multiple DrawImage Calls on: 2014-04-07 12:10:09
The answer to the question depends on where the images are being drawn to.

... and from.
18  Game Development / Newbie & Debugging Questions / Re: My most inefficient way of implementing running texts. How to optimize? on: 2014-04-05 22:22:10
Thanks. I see a lot of unfamiliar classes being used, but the font setup and attributes portion looks easy to understand.

What is Inset? What does it do?

Insets
19  Game Development / Newbie & Debugging Questions / Re: Why a NaN variable is not equal to Double.NaN? on: 2014-04-02 10:54:25
autoboxing + NaN = potential for much pain
20  Game Development / Newbie & Debugging Questions / Re: Parse a string to a *packed* Integer. (0xFFFFFFFF) on: 2014-04-02 00:27:35
Wow, that decode() behaviour really is a nasty gotcha.
First bug reported against it...... 15 years ago.  Undecided

Even worse are Integer's parseInt & valueOf methods, as they make no mention of any special behaviour or limitation relating to integer values >0x7FFFFFFF.
21  Discussions / Miscellaneous Topics / Re: new computer purchase advice on: 2014-04-01 08:09:08
I'd just like to reiterate how invaluable having an SSD is, especially in a development environment.

The sweet spot at the moment is 256GB, which if you hunt around for a good price, can be had for ~£75.
22  Game Development / Newbie & Debugging Questions / FilterOutputStream the most useless class in the JDK? on: 2014-03-27 12:54:59
I fell into the exact same trap as Riven did (here).

What is the point of this class existing if the default method implementations are so stupid :/

FilterInputStream is similarly flawed in that read(byte[]) invokes read(byte[],offset,len), resulting in it invoking your subclass implementation potentially causing unintended behaviour.
There's a hint in the javadoc that this flawed behaviour is to compensate for a stupid implementation in FilterInputStream's known subclasses:
Quote
It is important that it does
     * <i>not</i> do <code>in.read(b)</code> instead;
     * certain subclasses of  <code>FilterInputStream</code>
     * depend on the implementation strategy actually
     * used.

These Filter classes should be such trivial wrapper implementations it boggles my mind how they ended up having such convoluted & downright broken behaviour.

They should both be deprecated, and flagged with a big "DO NOT USE THESE CLASSES, THEY'RE FUNCTIONALLY USELESS/BROKEN" warning.
23  Game Development / Networking & Multiplayer / Re: Good latency proxy? (TMnetsim causing stream corruption!) on: 2014-03-24 02:42:29
What does it mean for the code to be "bytecode injecteD"? Sounds painfull Wink

bytecode instrumentation / code weaving.
24  Discussions / General Discussions / Re: How to make a JFrame's background transparent? on: 2014-03-23 19:30:57
Google is your friend:

http://docs.oracle.com/javase/tutorial/uiswing/misc/trans_shaped_windows.html

:edit:

Looks like Oracle made a booboo; the jnlp link for the 3rd example (ShapedWindow) is wrong.
25  Discussions / General Discussions / Re: 30 vs 60 vs 120 FPS on: 2014-03-23 19:30:12
I think if one day we'll have VR with working eye-tracking, high frame-rates will be a lot less computationally demanding. Even at proper resolutions for VR (like 4K or even 8K).

Your eyes only see sharply at just about 2 degrees. Outside of that it all quickly becomes a blur. You brain does the rest to make you think it's all sharp.

At a 100 degrees FoV at 8K resolution, that's like 88*88 pixels per eye that need the best quality rendering, and that's with 8K resolution (i.e. 7680*4320) .
Outside of those 88*88 pixels, you can increasingly (and quickly) drop resolution, AA, texture resolution, shader quality etc.
This might be a bit of an oversimplification, but I suppose even today's PCs should be able to handle that at at least 60fps.
But good eye-tracking will be key here.

I doubt that will ever happen.
Besides the obvious problem of what to do when you have multiple observers, you'd also need absolutely insane response times for the eye not to register the low resolution/quality peripherial areas when moving focal point.

Bypassing the eye entirely & patching into the optic nerve is the next logical step IMO, though I can't even begin to imagine how that would feel to the user.
26  Game Development / Networking & Multiplayer / Good latency proxy? (TMnetsim causing stream corruption!) on: 2014-03-23 15:22:49
I'm currently writing an unofficial multiplayer mod for the game Starsector. (great game btw! and a bargain for $10)

For simplicity* I'm making the game simulation(and fp) deterministic, syncing the peers, and transmitting just user-originated events using a lock-step model, with input delay appropriate to the latency between peers.
*(simplicity is of paramount importance because the entire mod is going to be bytecode injected, meaning there are practical limitations upon how much of the codebase I can interact with.)

To this end I created a prototype to test how well the lock-step model handles at various latencies. (using the tool TMnetsim as a latency proxy)
It seemed to work fine with low latencies, but exhibited weird data corruption at higher latencies.
After much hair pulling I determined it couldn't possibly be my code, and wrote the below code as a sanity test to confirm TMnetsim is a useless piece of crap.

So 2 questions:

1) The below code should work perfectly, right? (obviously with the relevant ports redirected)
2) As TMnetsim appears to be a piece of unreliable crap, can anyone suggest a good tool for introducing semi-realistic latency between connections? (I could of course write one... but given the plethora of multiplayer games surely such tools already exist?!)

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
import java.io.IOException;
import java.net.Socket;

public class Client {

   public static void main(String[] args) throws IOException {
      Socket s = new Socket("localhost", 9665);

      new Thread(new SocketReader(s)).start();

      new Thread(new SocketWriter(s)).start();
   }

}

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {
   public static void main(String[] args) throws IOException {
      Socket s = new ServerSocket(9765).accept();

      new Thread(new SocketReader(s)).start();

      new Thread(new SocketWriter(s)).start();
   }

}

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  
import java.io.DataInputStream;
import java.io.IOException;
import java.net.Socket;

class SocketReader implements Runnable {

   Socket s;

   public SocketReader(Socket s) {
      this.s = s;
   }

   @Override
   public void run() {
      try {
         DataInputStream dis = new DataInputStream(s.getInputStream());
         int counter = 0;

         while (true) {
            int val = dis.readInt();
            if (val != counter) {
               throw new RuntimeException("stream corruption! Expected: " + counter + " received: " + val);
            }
            counter++;
         }
      } catch (IOException e) {
         // TODO Auto-generated catch block
        e.printStackTrace();
      }
   }

}

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  
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;

class SocketWriter implements Runnable {

   Socket s;

   public SocketWriter(Socket s) {
      this.s = s;
   }

   @Override
   public void run() {

      try {
         DataOutputStream dos = new DataOutputStream(s.getOutputStream());
         int counter = 0;
         
         while (true) {
            dos.writeInt(counter);
            counter++;
         }
      } catch (IOException e) {
         // TODO Auto-generated catch block
        e.printStackTrace();
      }
   }

}
27  Discussions / Java Gaming Wiki / Re: Anonymous/Local/Inner class gotchas on: 2014-03-11 07:57:04
Why would anyone do that :/
28  Game Development / Newbie & Debugging Questions / Re: [Solved] Smooth transition between angles on: 2014-03-10 03:15:25
If you kept everything as vectors, it'd be a lot neater.
You'd just examine the sign of the determinant (cross product) of the 2 vectors to know if one is to the left, or right of the other.

pseudo code something like:
1  
2  
3  
4  
determinant = (b.x - a.x)*(c.y - a.y) - (b.y - a.y)*(c.x - a.x);
if(determinant>0) turnLeft();
else if(determinant<0) turnRight();
else fire();
29  Discussions / General Discussions / Re: Someone brought up an interesting topic regarding the new JDK8 default methods. on: 2014-02-08 11:48:11
That example that turns the Comparator interface into a Builder feels.... misguided.

Wouldn't it be better to simply add a separate ComparatorBuilder library class?

If the main purpose of default methods is so that existing interfaces can be expanded without breaking binary compatibility, then I feel it's somewhat pointless as most interfaces shouldn't be able to provide a meaningful default implementation.
It'll just result in messy interface bodged with empty implementations and warning comments.
30  Discussions / Miscellaneous Topics / Re: I had an idea involving .gifs! on: 2014-01-07 03:23:17
.mng would be a better choice.
Pages: [1] 2 3 ... 67
 

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

The first screenshot will be displayed as a thumbnail.

Dwinin (28 views)
2014-09-12 09:08:26

Norakomi (57 views)
2014-09-10 13:57:51

TehJavaDev (74 views)
2014-09-10 06:39:09

Tekkerue (38 views)
2014-09-09 02:24:56

mitcheeb (57 views)
2014-09-08 06:06:29

BurntPizza (45 views)
2014-09-07 01:13:42

Longarmx (28 views)
2014-09-07 01:12:14

Longarmx (34 views)
2014-09-07 01:11:22

Longarmx (34 views)
2014-09-07 01:10:19

mitcheeb (40 views)
2014-09-04 23:08:59
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!