Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (601)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (649)
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 ... 33
1  Game Development / Shared Code / Re: Extremely Fast sine/cosine on: 2015-07-27 11:01:37
I have to manage the cursor to make sure it doesn't look up a value outside the LUT, and his doesn't actually require this.

Isn't that being managed inside the code, which would just mean that he's managing it "better"?  Wink

I'm assuming the radian value inputs will remain accurate all the way up to Float.MAX_VALUE. Is this true?

I doubt it.  At some point your cursor (oscillator phase?) will surely become of sufficient magnitude that the phase increment effectively becomes a no-op?  Even before it becomes a no-op, it will become less accurate.  I wonder how long it takes for that to become audible?

Yay! Looks like this discussion will result in a significantly faster FM synthesis processing algorithm for me to use.  Grin

[OT] would love to see the code for the algorithm if you're up for sharing it (in another thread)?  Trying to get my head around FM (well, I assume you're actually doing PM?) at the moment.
2  Discussions / Miscellaneous Topics / Re: What's your favorite OS and why? on: 2015-07-14 15:06:12
Oh, and multi-monitor support is quite bad in Ubuntu.

Huh, what?  Generally found this really good.

I also like the Unity desktop Wink

Finally I'm not the only one!  Grin
3  Discussions / General Discussions / Re: Oracle are winning in the 'copyright an api' legal fight on: 2015-07-02 07:58:49
If copying the entire api is not possible, then compatibility is broken.

Not necessarily, because interoperability would come under fair use.  Interesting in this case is that Google deliberately designed Android not to be compatible ...

Obviously this is silly, but this chain of thought seems consistent with oracle's and some of your arguments.

My only argument is that it's a somewhat arbitrary line deciding that code can be copyright but API's can't, as if they exist in some vacuum from each other.

Incidentally it seems at some point Google tried to argue that code shouldn't be copyrightable either, only patentable.  Oh joy!  See, neither side is right in this argument but both sides may (inadvertently) f**k things up even more than they are already.  Wink

I'm on neither side - I'm sitting on the fence munching popcorn.
4  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-07-01 14:46:38
Bought a hosting server on Digital Ocean,

Depending what you're building on there, I'd recommend Cloudways or something similar - managed hosting on top of Digital Ocean.  The lower tier has no mark-up.  Of course, Cloudways are focused primarily on PHP, so you might have to hunt around for a service providing the platform you want.  Unless you have a particular desire to manage the entire server stack yourself, it's a good way to concentrate on the important stuff.
5  Discussions / General Discussions / Re: Oracle are winning in the 'copyright an api' legal fight on: 2015-07-01 12:47:20
Surely it's quite the opposite though; the API can *only* be expressed in one form,

That's a tautological argument.  The process(es) which the API expresses could be expressed in another form as a different API.

a precise set of class, field & method signatures.

And documented behaviour!  Without that the API is pretty much worthless.  With that, in particular in the specification of behaviour between components, you start to get the expression of the idea (IMO).
6  Discussions / General Discussions / Re: Oracle are winning in the 'copyright an api' legal fight on: 2015-07-01 11:18:42
....but processes are not subject to copyright.

Much as I dislike quoting Wikipedia

copyright for computer programs prohibits not only literal copying, but also copying of "nonliteral elements", such as program's structure, sequence and organization. These non-literal aspects, however, can be protected only "to the extent that they incorporate authorship in programmer's expression of original ideas, as distinguished from the ideas themselves."

What I'm saying is that an API could embody all of the expression of the idea, where the implementation of each individual method (the code) is trivial / only expressible in one form and therefore can't be copyrighted.
7  Discussions / General Discussions / Re: Oracle are winning in the 'copyright an api' legal fight on: 2015-07-01 10:52:28
I really don't see how APIs can be copyrighted; they're not an expression of an idea,

I agree with @ags1 and @princec.  In quite a lot of my code, particularly the public facing API's, often more work goes into creating the API than into its implementation.  Individual method behaviour is defined by the API, and individual method implementations can often be trivial.  It is the API that defines the process and therefore the API that is the expression of the idea.  Actual code is "just" an implementation detail.  Wink
8  Discussions / General Discussions / Re: Oracle are winning in the 'copyright an api' legal fight on: 2015-07-01 08:42:32
Ethically, making it first open source and then suing someone for seemingly using it appropriately,

At which point your argument breaks down because the case has nothing to do with it being open source, but if it had been that Android derived from OpenJDK this would have been using it inappropriately, in that Google has no right (ethically or legally) to change the license.

A) They didnt image this usage - Seemingly impossible and or very stupid

There's a reason Java ME is GPL without the classpath extension.  And likewise, a reason that the ARM version of HotSpot isn't open-source.  Wink
9  Discussions / General Discussions / Re: Oracle are winning in the 'copyright an api' legal fight on: 2015-06-30 15:15:01
Yeah I think there is no right but both are wrong in their own positions, as I said before Cheesy

True, so you did  Wink  this OTOH I disagree with you on ...

I know it is kind of stupid but if you want to use Java on a mobile you're supposed to use Java ME and for Java ME you have to pay royalties. Google worked around that saying that a mobile these days is powerful enough to run a normal Java or better said not to use Java but Dalvik / ART on the mobile and "cross-compile" the Java bytecode to Dalvik bytecode.

Had Android development started later and had Google been happy with GPL w/CPE, they could have used OpenJDK as the basis for Android.  The GPL doesn't allow field of use restrictions, so Oracle couldn't do anything about that.

I'm surprised sometimes Google hasn't re-based Android's Java API on top of a fork of OpenJDK.  I don't see that the license change would affect their business model that much, and they're already using GPL (without CPE) code in the OS.
10  Discussions / General Discussions / Re: Oracle are winning in the 'copyright an api' legal fight on: 2015-06-30 14:50:06
Yes, because the FSF never went after anyone for GPL violations!  Tongue

Actually there is no GPL violation. The CPE keeps the APIs (which will be linked into your program) out of the GPL necessity to redistribute your own code as GPL. It is kind of like a LGPL for the Java Standard API. The internal implementation inside the Dalvik-/Android-Runtime is no OpenJDK code but partly taken from the old Apache Harmony project (which obviously is ASL2 licensed) and partly self written by Google. So no violation at all, and the FSF hunts GPL violations down, see router vendors in the past.

Yes, I know!  My point kind of skipped by you there  Wink  I was pointing out that @CommanderKeith's suggestion that this case is about Google copying an open-source project is incorrect.  Had they used OpenJDK (and GPL w/CPE), which would also have required said time machine, there wouldn't be a case because of the API permission you mention. 

I mentioned FSF because they're quite supportive of Google's position, but had Google instead forked OpenJDK and placed it under ASL2, then FSF would have been clearly backing Oracle.  I tend to agree with @princec that there isn't really a "right" in all this.
11  Game Development / Newbie & Debugging Questions / Re: JNI threading > JNIEnv memleaks on: 2015-06-30 14:36:18
The good news is that the JVM uses TLS caching too;

But not AFAIK automatic thread detachment using TLS destructors, or a least it didn't, which is a shame!

DetachCurrentThread is never called; the expectation is that native threads will be few and as long-lived as the application.

That's a bit of an arbitrary viewpoint, although it might be true for the majority of use cases with LWJGL.  Using a native media library for video inter-titles is one obvious case where it might not be though, as it's likely to start a new media callback thread each time.
12  Discussions / General Discussions / Re: Oracle are winning in the 'copyright an api' legal fight on: 2015-06-30 14:21:48
They are suing Google for copying an open source project. Seems pretty obvious to me that google is right and oracle is wrong.

Edit: Assuming that google kept to the terms of the open source license agreement, which I think they did.

Yes, because the FSF never went after anyone for GPL violations!  Tongue

If Google had actually forked off OpenJDK under the GPL w/CPE then there wouldn't be the hint of a case.  This is partly because Google wanted to control the ecosystem.  It may also be due to the lack of a time machine.
13  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-06-30 10:30:56
Seems like there's a lot of audio coding going on at the moment - I'm most of the way through completing the live audio coding element of Praxis LIVE - link up FX and live code DSP, all without a break in the sound.

Of course, progress is slowed by the fact that I keep getting distracted making bleepy noises!  Grin
14  Game Development / Newbie & Debugging Questions / Re: JNI threading > JNIEnv memleaks on: 2015-06-30 10:00:57
i do cos i'm running into
s (after creating thousands of short-living threads) and try to fix it.
Forgive me if i seem like I'm being a pain.  How are thousands of short-lived threads being created?

For thread read Thread.  This issue is caused by the creation of thousands of Thread objects that proxy the same (or a few) native threads.
15  Game Development / Newbie & Debugging Questions / Re: JNI threading > JNIEnv memleaks on: 2015-06-30 09:52:21
TL;DR - switch to using JNA  Wink

OK, I did a load of research to help fix this issue in JNA.  This now uses thread-local storage (pthread_key_create or TlsAlloc) to cache a reference to the JNI info for an attaching thread, and makes use of the TLS destructor to detach the thread from the JVM just before the thread dies.  This behaviour isn't JNA default, but has to be requested - I did some work on it because of a similar issue in binding to a native audio library (JACK audio server <> JNAJack)

JNA code for this is included in here -

Incidentally, the complexity of that code is one reason I'm quite in favour of projects like JNA - fix the problem in one cross-platform library rather than many!

@trollwarrior1 mentioned Android - if this is just for Android then it's easier because you don't have to handle the Windows side and pthread TLS is simpler.  This is mentioned in the Android docs (last paragraph) -

btw - the Thread objects created are very lightweight.  On desktop I did some benchmarking, but while there was a significant performance hit with audio in JNAJack, there was minimal with video in GStreamer-Java - but there's the difference between 24fps and 600+!
16  Java Game APIs & Engines / Engines, Libraries and Tools / Re: YUNPM get frame is black on: 2015-06-29 16:37:56
That's a fancy trip down the rabbit hole, btw.

Been there, done that.  IIRC though it should in this case pass everything to the native conversion loops in one go rather than per pixel, hence blindly hoping that the OP might find it fast enough.  It's a quicker thing to test.

Does YUNPM give any way to specify what color model FFMPEG provides the data?  Easy to modify to BGR?

especially considering that people report factor 1000 slowdowns for some paths in the link you mentioned.

That also mentions some versions of OSX, that makes me think it might refer to the old Quartz renderer - nice and fast in some circumstances, FUBAR in others.
17  Java Game APIs & Engines / Engines, Libraries and Tools / Re: YUNPM get frame is black on: 2015-06-29 15:15:47
I think that triggers an extraordinarily slow path when rendering. persecutioncomplex

Quite possibly, although at worst it's probably* only doing the same byte rearranging you are.  Wink

* probably implies logic in Java2D  persecutioncomplex
18  Java Game APIs & Engines / Engines, Libraries and Tools / Re: YUNPM get frame is black on: 2015-06-29 13:59:39
BufferedImage sadly doesn't have a 3BYTE_RGB type Roll Eyes

hmmm .. possible to make one though (code not tested - based on this)

WritableRaster raster = Raster.createInterleavedRaster(
        DataBuffer.TYPE_BYTE, width, height,
        width * 3, // scanlineStride
        3, // pixelStride
        new int[]{0, 1, 2}, // bandOffsets

ColorModel colorModel = new ComponentColorModel(
        new int[]{8, 8, 8}, // bits
        false, // hasAlpha
        false, // isPreMultiplied

BufferedImage img = new BufferedImage(colorModel, raster, false, null);
19  Discussions / Miscellaneous Topics / Re: How to Learn Web Development for Java Programmers on: 2015-06-27 10:14:32
How would you create a new page, say a new blog post, without using a database?

Copy & paste into a new file.  Or use Jekyll ^^ or some other static site generator - if you're using plain HTML files and you decide to change header say, you need to do that in every file.

Onto a different subject, which editor would you guys recommended using for editing HTML/CSS files on Windows?


I've been using the HTML5 support in NetBeans recently and like it.  There's a plugin for Chrome that lets you debug things too - point at something in the browser and highlight the code that creates it, etc.
20  Discussions / Miscellaneous Topics / Re: How to Learn Web Development for Java Programmers on: 2015-06-27 08:59:15
Static sites are a thing, especially for tech blogs these days it seems...

Yes, and definitely not just for tech blogs.  We've also been looking at how to open up client-side editing (with, Cloud Cannon, etc.)  Separation of CMS features and static content is nice, both from a security side (CMS exploits happen in hours!) and for performance.

I'd be tempted to have a look at Jekyll, which is used on GitHub pages.  It's a good way of learning the basics (HTML / CSS / JS) which you need, while offering enough templating functionality to meet your needs for managing a project site / blog.  And you can host it for free too!   Grin

Also, there are some great starter themes out there that you can build on top of, for Jekyll or plain HTML5 - tweaking those is a good way of learning IMO. | |

Eagle-eyed may notice new Praxis LIVE website is derived from Start Bootstrap's Grayscale theme.  I build web stuff for a living, but I'm not averse to some time-saving (and legal) plagiarism!  Wink
21  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-06-27 08:40:14
And I made these assets in Inkscape for my MiniLD game:

Look good, but are the darker sides meant to represent shadows?  Seems odd to me that the white cars are the other way around.
22  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-06-26 15:56:46
Just finished another video of Praxis LIVE in action, this time with 3D, video and some GLSL.

Don't worry, I'm not planning on doing one every day ... and anyway I'm running out of music to put to them!  Grin

<a href=";hl=en_US&amp;start=" target="_blank">;hl=en_US&amp;start=</a>
23  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Java OpenGL Math Library (JOML) on: 2015-06-25 12:00:14
@childofgod somewhere you may have a valid point, but your attitude sucks so I couldn't really be bothered reading between the lines to find out!  Wink

I can't really say it better than @CommanderKeith put it in another recent thread -

Try to give constructive criticism. Comments like this bring down the tone of the forum.
One of the many good things about this community is that people who have nothing nice to say know how to keep it to themselves.

PS. I will partly forgive you because I enjoyed the node.js video.  Smiley
24  Game Development / Performance Tuning / Re: Video frame grabbing to bufferedImage on: 2015-06-25 08:55:57
Yes that's true, I think @nsigma uses a java wrapper on gstreamer, perhaps this:

Yes, that's right, Praxis LIVE uses those GStreamer bindings (and I'm one of the repository admins).  I also use the same native GStreamer libs as Processing is using.  It's great and will do everything I need.  However, it's big too!  It might be overkill for what you need.  The video I posted yesterday in the "What I did today" thread is actually using Praxis LIVE's software pipeline rather than its OpenGL one, so is pretty much doing what you're trying to do.

@Riven 's YUMPM might well be worth looking at.  IIRC it's quite a bit smaller, and though there are potential issues in the approach (around timing, frame skipping, etc.) that might actually suit your purposes better (which are?)

The other obvious link missing is the Java bindings to VLC - - however, they are GPL licensed so may not suit.

And there's obviously JavaFX, which actually uses GStreamer under the hood, but I have no idea how low level you can get with it.

The odd thing that stands out about that API you're using is that it implies it's creating a new BufferedImage every frame.   You ideally want something that will give you direct access to the decoded pixel data.  There is a Swing player in the GStreamer examples which does something similar to what you want - note this code fills the pixels array of the BufferedImage from the passed in native pointer (IntBuffer).
25  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-06-24 16:56:18
Finally got screencasting software set up again, and started some "rough cuts" videos of Praxis LIVE v2 in action - here live Java coding and using annotations to create visual ports and controls.

Of course, even more fun when you start mixing in GLSL on-the-fly too, but you got to start somewhere!  Grin

btw - 1080p on YouTube itself.

<a href=";hl=en_US&amp;start=" target="_blank">;hl=en_US&amp;start=</a>
26  Discussions / General Discussions / Re: Nice dynamic background on: 2015-06-20 10:43:27
Hard to know exactly what you're looking for from a still image, but try browsing a site like Shadertoy.  This might be close to what you want?
27  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-06-17 22:48:27
Tried again (and not overly diplomatically  persecutioncomplex ) to convince Processing devs their blending model is kaput!

Or, IOW, always use pre-multiplied alpha unless you want stupid headaches.  Grin
28  Discussions / Miscellaneous Topics / Re: What IDE colour theme do you use? on: 2015-06-17 22:40:06
Just so the NetBeans users don't feel left out  Wink -

Funnily enough, I don't use it - I prefer the default (light) Nimbus theme in NetBeans itself.
29  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-06-09 14:24:08
Took new Praxis LIVE website live - - no more CMS ftw  Grin

Also been moving documentation over to - really nice service!
30  Discussions / Miscellaneous Topics / Re: What's your favorite OS and why? on: 2015-06-07 10:54:27
... but yeah all you pc master race can now rage Cheesy
To be fair all of those things can be done on PC just fine.

To be fair, all those things were copied off Linux!  Tongue  <cough> Which may in turn have copied them from elsewhere (eg. Amiga)

Sometimes think Apple is that annoying guy who walks into a room full of people who have been partying for hours and says "right, let's get this party started!"  Emo

And about the one useful thing the OP can take from this thread is that most of the software we're all using can run anywhere!  Smiley
Pages: [1] 2 3 ... 33
Jesse (10 views)
2015-07-29 04:35:27

Riven (33 views)
2015-07-27 16:38:00

Riven (16 views)
2015-07-27 15:35:20

Riven (20 views)
2015-07-27 12:26:13

Riven (10 views)
2015-07-27 12:23:39

BurntPizza (28 views)
2015-07-25 00:14:37

BurntPizza (39 views)
2015-07-24 22:06:39

BurntPizza (22 views)
2015-07-24 06:06:53

NoxInc (25 views)
2015-07-22 22:16:53

NoxInc (17 views)
2015-07-22 22:13:39
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

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