Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (569)
Games in Android Showcase (154)
games submitted by our members
Games in WIP (618)
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 ... 292
1  Java Game APIs & Engines / Java Sound & OpenAL / Re: Circular Buffers with OpenAL on: 2015-04-12 23:22:03
Tell me which part of the docs (that you actually read) is unclear to you.

Even a tiny bit of trial and error gets you quicker answers than forum posts.

First decouple your 'feature' from OGG and circular buffers. Just play a tiny chunk of audio samples (say, a sine-wave) and try to use the aforementioned methods to play it indefinitely, without using OpenAL's looping. You'll quickly figure out how it works. (and if not, read the docs)
2  Java Game APIs & Engines / Java Sound & OpenAL / Re: Circular Buffers with OpenAL on: 2015-04-12 23:07:07
you enqueue buffers with:

once a buffer has been played, you are 'notified' through the return value of:
3  Java Game APIs & Engines / Java Sound & OpenAL / Re: Circular Buffers with OpenAL on: 2015-04-12 23:03:22
What about the OpenAL documentation for these methods is unclear? Undecided
4  Discussions / General Discussions / Re: Does Internet cost matter to you? on: 2015-04-09 07:56:16
Last time I had to deal with pricing based on my (95) percentile of bandwidth usage, was for a dedicated server. Interesting to see such pricing schemes reached the consumer market.
5  Game Development / Newbie & Debugging Questions / Re: Textured Greedy Mesh on: 2015-04-08 16:34:26
If you are willing to let go of your spritesheet, you can look at GL_TEXTURE_2D_ARRAY, where your texcoords have three dimensions (namely: u,v, layerIndex), where you pick your sprite with the layerIndex.

This allows repeating of sprites as per your demand. Limitation is that all sprites in the array must have the same dimensions, but with tile textures that's common. A workaround would be scaling-up-to-fit, or using multiple texture arrays, if you have distinct sets of dimensions.
6  Games Center / Featured Games / Re: [Slick2d] Retro-Pixel Castles > Now on Steam! < on: 2015-04-07 22:46:47
Line 300 and line 1745, in

   public Color getBackground() {
      FloatBuffer buffer = BufferUtils.createFloatBuffer(16);
     GL.glGetFloat(SGL.GL_COLOR_CLEAR_VALUE, buffer);

      return new Color(buffer);

   public void pushTransform() {
      FloatBuffer buffer;
      if (stackIndex >= stack.size()) {
         buffer = BufferUtils.createFloatBuffer(18);
      } else {
         buffer = (FloatBuffer) stack.get(stackIndex);
     GL.glGetFloat(SGL.GL_MODELVIEW_MATRIX, buffer);
      buffer.put(16, sx);
      buffer.put(17, sy);

most peculiar Stare
7  Games Center / Featured Games / Re: [Slick2d] Retro-Pixel Castles > Now on Steam! < on: 2015-04-07 20:59:59
Have you consided mipmapping your graph?

Generally the most effective optimisation strategy is discarding the majority of your data persecutioncomplex
8  Games Center / Featured Games / Re: [Slick2d] Retro-Pixel Castles > Now on Steam! < on: 2015-04-07 20:53:41
I might slap the tail from this thread on the RPC game thread later. DONE Yawn

Having said that, binary search is cache trashing galore. Given your access patterns, it might be faster to do a linear search from the tail of the array, or a binary search on the last X elements, if that fails, a binary search on the range before it. In the end memory bandwidth (and cache trashing) is probably your bottleneck, making these quirky, hackish tricks worthwhile.

Everybody knows binary search scales O(log n), but given the characteristics of modern CPUs, it at one point takes a nose dive, once the working set doesn't fit into cache anymore, and nearly every memory access is a cache miss.

Now, ocourse, this all is meaningless without your current performance numbers, your data models and the characteristics of your maps... which means we're mostly making bad assumptions about whatever it is your dealing with.

On that note, if you find out PriorityQueue is a poor fit, and BinaryHeaps seem tempting... keep in mind d-ary heaps (which are like binary heaps, but have d children, where d is a constant, >= 2) which are theoretically slower, but due to better memory management (less cache misses) outperform BinaryHeaps in almost every case... or so they say.

9  Games Center / Featured Games / Re: [Slick2d] Retro-Pixel Castles > Now on Steam! < on: 2015-04-07 18:36:17
@Rayvolution: use a PriorityQueue for the open list. It is much faster than inserting values into a sorted array.
10  Game Development / Newbie & Debugging Questions / Re: [libGDX] How to draw an outline around sprite when behind another image on: 2015-04-07 18:30:55
@SHC: then the outline also shows on non-occluded parts of the sprite. Flipping the depth-func in the 'post-processing' step would do the trick.
11  Games Center / Featured Games / Re: State of Fortune on: 2015-04-07 07:43:43
float y = float(f > 1.0 && f < 2.0); //BRANCH!

what about:
float y = float((f > 1.0) & (f < 2.0))

12  Discussions / General Discussions / Re: Does Internet cost matter to you? on: 2015-04-05 13:47:23
Is internet cost even by data anymore (atleast in America)? I don't pay for my internet (being 16 and all) but I'm pretty sure my parents just pay a flat rate for internet speed. It may he different in other countries but I don't really care about how much data I consume.
That's not quite how it works. An ISP (Internet Service Provider) needs to maintain an infrastructure to provide adequate bandwidth to customers. If data traffic surges, the ISP has to invest in hardware. These costs are spread over the customers, which means your flatrate plan gets more expensive, or your bandwidth/FUP is affected. Advances in hardware capability and efficiency offset this increase in price. If everybody were to reduce their data traffic by 80% it would create a shockwave through the industry (where service/content-providers would immediately jump in to find new ways to utilize this vast untapped existing infrastructure).

TL;DR: you do care Pointing
13  Discussions / General Discussions / Re: Does Internet cost matter to you? on: 2015-04-05 13:16:45
Most textual content (html, plain text, email) is gzipped already.
Media (audio, video) is highly compressed already.

What is your ingenious plan to cut down datatraffic by 80%?
14  Games Center / WIP games, tools & toy projects / Re: Reveal The Picture (TestVersion) on: 2015-04-05 12:29:53
The thing is that this is realistic. If you start out with a ball moving in a direction that is a multiple of 45deg, and you bounce it against axis aligned surfaces, the ball will always bounce off in a direction that is a multiple of 45deg.

If you add gravity (or any external force), then you'll see arbitrary angles, but even in that case, when the surface normals are axis aligned (multiples of 90deg) you can flip the velocity along an axis and the physics will be correct.

If you want to bounce off arbitrary angles (say, bouncing off circles), then you have to look into how to reflect a vector along a (surface) normal.
15  Games Center / WIP games, tools & toy projects / Re: Reveal The Picture (TestVersion) on: 2015-04-05 12:19:38
As long as the surface normal is axis aligned, the math is pretty trivial. As per your example: you can ignore the 30deg angle, and just flip the velocity on the x-axis, once you collide with a surface which normal is (+1, 0, 0). It's the same for any normal, ofcourse - aligned or not: reflect the vector using the surface normal. It's just that in this case we can shortcut the math handling the reflection, and simply do:
ball.velocity.x *= -1

16  Games Center / WIP games, tools & toy projects / Re: The Terminal Angel Disease - 2D Indie RPG (new Demo V3 w/ QuestChicken avlbl!) on: 2015-04-05 09:46:35
Unlocked rusty lock due to foretold activity.
17  Game Development / Newbie & Debugging Questions / Re: (Solved-ish have more questions) Randomly Generated Objects that do not Overlap? on: 2015-04-04 18:11:10
BurntPizza: your design will not produce uniform density.

Take the set of points that is in the lowest 10% of the radius: these will be spread over a circle with an area 1% of the full circle.
Take the set of points that is in the highest 10% of the radius: these will be spread over a ring with an area 19% of the full circle.

18  Game Development / Newbie & Debugging Questions / Re: Avoiding JOGL Artifacts on: 2015-04-02 22:49:17
How are you calculating the vertices?
19  Game Development / Newbie & Debugging Questions / Re: Avoiding JOGL Artifacts on: 2015-04-02 22:20:40
Make sure all triangle vertices and edges line up. The vertices have to be bitwise identical. As for edges: adjacent triangles have to share edges (meaning: the two vertices that the two triangles have in common, must be bitwise identical).

A setup like this will cause rendering artifacts: (I'm using quads for simplicity)
|___|    |

because the bigger quad does NOT share all edges with its neighbours: it has independent edges that merely overlap. After several matrix transformations the center of the two short edges and the center of the long edge have slightly deviated, causing the rendering artifacts.
20  Discussions / General Discussions / Re: Concurrency Library on: 2015-03-31 17:28:10
Disruptor was developed for a system dealing with financial transactions, where messages are tiny and abundant, and microsecond latency can cost a fortune. Their core logic is single threaded on 1 node. Their bottlenecks are not usually found in game-engines, where typical tasks take a lot longer than mere micro-seconds.

Sidenote: Why isn't the false sharing issue fixed in ABQ? It seems trivial to add object field padding to force seperate cache lines for these fields.
21  Game Development / Newbie & Debugging Questions / Re: Best Practise - Quad Trees on: 2015-03-30 15:56:28

I pushed it back to the sane realm. Pointing
22  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-03-30 07:25:08
ASCII alt-codes aren't cross-platform.

I honestly did not know this, guess that explains why other java games (like minecraft) use characters like the &.
It's all bits at one point. Once it's compiled, your String.indexOf('§') will just work. Load & save your text-files with the UTF-8 charset, and it's as cross-platform as it will ever be. There is no reason to limit yourself to ASCII. Having said that, I'd use ♥ as a delimiter.
23  Game Development / Newbie & Debugging Questions / Re: Trouble making VBO rendering easier on: 2015-03-30 01:05:40
I see your point. The 'static context' is not relevant actually, it's just a matter of whether the OpenGL context is current. You are correct in pointing out that it is highly unlikely that the OpenGL context is current at the time the static block is executed, and such code should be frowned upon regardless of whether one can guarantee (it's deterministic, mind you) a context is current. Anyway, enough derailing Emo
24  Games Center / WIP games, tools & toy projects / Re: Imp City, build an underground empire on: 2015-03-29 23:29:49
These extraordinarily long dumps may not be the way to cultivate a fan base Pointing
25  Game Development / Newbie & Debugging Questions / Re: Trouble making VBO rendering easier on: 2015-03-29 20:21:04
You can't call glGenBuffers() in a static context.
I'm confused. What exactly do you mean?
26  Games Center / WIP games, tools & toy projects / Re: Battle Tank 3 --- an old school style RTS WIP on: 2015-03-27 21:01:19
The percentage number is calculated by  power consumption/amount of power avaliable, if the number is above 100%, then your production speed is reduced by half.

The inverse is more intuitive. Show 400% instead of 25%, so that you get into trouble when the ratio is lower than 100%.
27  Game Development / Newbie & Debugging Questions / Re: OSX 10.10 seems to have broken my games on: 2015-03-26 18:21:33
A lack of crash reports is rather ambiguous as a statistic  Pointing  Kiss
28  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-03-26 18:16:32
Whatever you do, don't get tempted into feature-creeping your way into something that resembles HTML or UBB code... it's good as it is, I tell ya.
29  Game Development / Networking & Multiplayer / Re: Managing when the server should send which data on: 2015-03-17 13:27:17
if a network loop gets too complex, its a bad network loop.
Anything 'too' is bad, sure, that's an easy argument. Simplifying too much is also 'bad'. Without proper context such statements are meaningless. In this case the additional complexity is caused by bugs in NIO, for which workarounds are needed until they are solved. This is not a case of 'too complex', this is a case of 'complexity for reliability'. If reliability is not a concern, then you are absolutely right: KISS.

99% of errors can be avoided putting "critical" operations on the selector-thread :

- create/close channels
From your replies it seems you were not aware of the blocking nature of SocketChannel.close(). This API 'peculiarity' is enough to slow a busy server to a crawl, when performed on the network-thread. Your workaround with SO_LINGER is rather dangerous, because if the timeout expires, the pending TCP packets are dropped. You might not care, but the other end surely does: think of an http-response being truncated, leaving the browser in limbo.

Closing sockets on 1 worker-thread is a bad idea, as it adds a significant delay to initiating a channel closure, in case the worker-thread is dealing with a slow peers, or simply a lot of them, queued up. Therefore: a threadpool is mandatory.

That KryoNet doesn't have these workarounds is more of a worry than an reassurance.

You can wave these problems and their (library provided) solutions away, but that doesn't mean you won't run into them eventually.

The specification of NIO is nice, simple and consise - the implementation is not as 'battle hardened' as one would expect. You need an abstraction layer to be able to take advantage of it - preferably 3rd party. Either that, or you'll have to fix all these issues in your own code, when they break your game network I/O, over and over again.

How you treat/explain NIO is how it is supposed to work, indeed, but sadly that's not relevant in the real world, where services have to run for months without degrading performance and/or interruption.
30  Game Development / Networking & Multiplayer / Re: Managing when the server should send which data on: 2015-03-16 20:52:32
basil_: bare NIO is quite buggy. I woudn't advice it to anybody but experts. There are several critical bugs in Selector, most commonly observed is the issue of accept() no longer blocking, causing rapid firing, with no selected keys. You could work around this issue by introducing sleeps, but the Selector gets in a worse and worse state, making Selector.accept() consume extraordinary amouts of CPU power, while effectively doing nothing useful. The only way to recover is to hoist all your active connections to a new Selector, until that one breaks too. Rinse and repeat.

A networking loop gets as complex as its developer is experienced. I like to compare it with a game loop: the problem at hand looks trivial, but eventuallly you end up with a hundred lines of code that merely handles timing. Same for networking, but then worse. Oh, did you know closing a TCP connection actually blocks... threadpool here we come!

Long story short: use a library, where all these experts have scratched their head to solve thing you don't want to encounter.
Pages: [1] 2 3 ... 292
Riven (22 views)
2015-04-16 10:48:47

Duke0200 (35 views)
2015-04-16 01:59:01

Fairy Tailz (27 views)
2015-04-14 20:13:12

Riven (28 views)
2015-04-12 21:36:37

bus hotdog (45 views)
2015-04-10 02:39:32

CopyableCougar4 (46 views)
2015-04-10 00:51:04

BurntPizza (46 views)
2015-04-06 22:06:58

ags1 (51 views)
2015-04-02 10:58:48

Riven (49 views)
2015-04-01 18:27:05

ags1 (66 views)
2015-03-31 10:55:12
How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

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