Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (683)
Games in Android Showcase (196)
games submitted by our members
Games in WIP (751)
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 ... 39
1  Game Development / Artificial Intelligence / Re: Python or other scripting language for simple AI? on: 2016-07-25 16:18:37
Check out Jython. There are many scripting alternatives for the JVM, or JavaScript is built in.  You can even live-compile Java.  This is great if you want to let users edit stuff.  However, IMO this will not cut down on code, because you'll be adding loads of boilerplate and a great deal of complexity.  If it's just for you, I'd stick with Java - it isn't that much more verbose.   Wink
2  Discussions / General Discussions / Re: Oracle proposes deprecation of CMS in Java 9 on: 2016-07-17 10:05:49
G1 performed particularly badly for me - halving framerates in Battledroid. Not sure why.

Yes, performed terribly for me on any low-latency stuff last time I tried, but that was a while ago, and it is still improving.

My best performance from a real-time perspective still seems to be with -Xincgc (incremental CMS) and that was deprecated in Java 8.  Time to embrace the brave new world!  persecutioncomplex
3  Discussions / General Discussions / Re: Oracle proposes deprecation of CMS in Java 9 on: 2016-07-17 09:33:01

Flicking through the mailing list links linked from there makes me feel fairly optimistic about the situation.  a) G1 is likely to improve in that time with focus from Oracle on areas it is outshined by CMS, and b) it looks like a group of developers (Red Hat, Google, etc.) will take on CMS in OpenJDK and rather than stagnate it might actually get better.  The latter in particular is good to see - OpenJDK needs to keep growing bigger than Oracle.

@Hydroque - why not stop trolling and go and use Rust or something?  Wink
4  Game Development / Newbie & Debugging Questions / Re: getters and setters vs public vars on: 2016-07-11 17:28:04
@nsigma :
I think those are called builder classes, I've tried to make some of those before I dropped box2d, and with libgdx, that's how the Vector2 class was made... allows for multiple operations to be performed on single lines of code.  Never had much luck making those types of classes myself.

No, they're not builder classes, although builder classes usually use a similar fluent API (see https://en.wikipedia.org/wiki/Fluent_interface )  Unlike builders, these methods are used to modify an existing object rather than create a new one - they're still getters and setters.  My point was that you don't have to follow the JavaBean conventions.  I use the same principle for animations too -

1  
property.to(5, 0.75).in(3, 1.5).easing(easeIn, easeOut);
5  Game Development / Newbie & Debugging Questions / Re: getters and setters vs public vars on: 2016-07-11 09:41:13
I almost always use getters and setters, even for final variables unless they're static. However, don't assume using methods for set / get requires you to use JavaBean conventions.  Sometimes a fluent API can be more legible and less verbose.

eg. the audio coding API in Praxis LIVE uses setter / getter methods like -

1  
2  
3  
4  
5  
6  
7  
8  
Osc frequency(double hz) {
  // validate value or invalidate cached data !!
  this.hz = hz;
  return this;
}
double frequency() {
  return this.hz;
}


Which allows for code like -

1  
osc.waveform(SAW).frequency(440).gain(0.4);


If you're doing a lot of updating based on the existing value, you could even override the setter with a method that accepts a function -

1  
osc.frequency(hz -> hz*2);
6  Games Center / WIP games, tools & toy projects / Re: Praxis LIVE v2 - hybrid visual IDE for creative coding on: 2016-06-15 17:21:09
@Hydroque - Praxis LIVE has been out of alpha and very stable for a good while now.  It is not, and never will be, an alternative to Eclipse - it's aims are very distinctly different.

Thanks @ra4king

Quick question: what is "Steampunk VJ-ing"?

Well, Steampunk VJ-ing. Just seemed appropriate for a Victorian-looking device that allows you to play with video FX.  Grin
7  Games Center / WIP games, tools & toy projects / Re: Praxis LIVE v2 - hybrid visual IDE for creative coding on: 2016-06-14 19:32:55
If anyone here is in the Montreal area, I'm doing a Praxis LIVE workshop this Thursday evening (June 16th), looking particularly at video, live-coding Java and Processing integration.

https://www.facebook.com/events/194747680919971/

I'm also doing another workshop in Oxford (back in UK!) on Sunday June 26th as part of this.

And here's a recent video demonstrating support for audio and visual live coding - best viewed full screen!

<a href="http://www.youtube.com/v/c1rI6_Lg3eQ?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/c1rI6_Lg3eQ?version=3&amp;hl=en_US&amp;start=</a>

https://youtu.be/c1rI6_Lg3eQ
8  Java Game APIs & Engines / JavaFX / Re: JavaFX For Pixel Games on: 2016-06-02 18:19:49
Well, Swing didn't die... it's still pretty bloody good, but you know, for ordinary desktop applications... not so much for fancy things.

But that's really what we want in the JDK.  Fancy things belong elsewhere, but a basic usable UI toolkit for desktop applications should be in there.  Swing may not be dead, but it's kind of on life support.  It needs some support for more modern features.  Why Snoracle had to go with revolution over evolution I don't know.  Something a bit more like PureSwing might have been good?!
9  Java Game APIs & Engines / JavaFX / Re: JavaFX For Pixel Games on: 2016-06-02 10:12:02
And yes, Oracle should seriously spin off JavaFX into a separate project, and throw a lot more engineers at it.

JavaFX (OpenJFX) always has been a separate project.  In some ways it might have done better if it was part of OpenJDK / JavaSE.  Still, I doubt you'll see Oracle throwing engineers at it, if anything (check out Future of JavaFX thread on openjfx mailing list, etc.) it seems to be the opposite with Oracle focus on browser and cloud.

Internal dependencies may at least improve because they have to make it work with Jigsaw.  Wink

Double vs what?  If some things should really be integers I agree with you - if we're talking double vs float it's double every time!
10  Java Game APIs & Engines / JavaFX / Re: JavaFX For Pixel Games on: 2016-06-02 09:24:01
@princec, was going to say similar (about no longer supported - why does insert quote no longer work on FireFox!  Sad )

JavaFX is no longer supported by Oracle in their ARM Java downloads, which means the one that comes with the Pi is old and missing features / bug fixes.  However, there are community builds of OpenJFX available for Pi that (AFAIK) will work with the Oracle JVM - http://chriswhocodes.com/  I would expect Pi to get, if it hasn't already, a package for OpenJFX at some point ... but

Other than that, in JavaFX you can basically do everything you could in Swing + much more.

Except that you can't, although for games you're probably OK.  Still, again I agree with @princec that there's some trivial stuff that just makes it not interesting for me right now.  Having just got back from NetBeans Day the topic of JavaFX came up a few times in conversation, and I don't recall anyone being that positive about current situation, and I get the feeling development is not far off stalled.  I kind of agree with this post - https://www.codenameone.com/blog/should-oracle-spring-clean-javafx.html
11  Discussions / General Discussions / Re: Interesting proposals: Java 9 and beyond on: 2016-05-29 09:14:02
Multiple inheritance of state...always had multiple inheritance of type and the line is abit blurred with recent(ish) additions.

Well, we've now got multiple inheritance of behaviour - doesn't feel that blurred.  Smiley
12  Games Center / WIP games, tools & toy projects / Re: TreeML markup language on: 2016-05-27 11:02:28
I like tabs because they don't require as many keypresses ... to type in the first place.

The crux of the issue is that most people who works with space indented projects (and I don't currently work with anything Java or otherwise that doesn't use spaces) has their editor set up to output spaces when the tab key is used.

I'm currently working on something with lots of YAML, and I don't disagree with the "nasty and dirty" comment, but for me using tabs is even more of a PITA because of the above issue.
13  Games Center / WIP games, tools & toy projects / Re: TreeML markup language on: 2016-05-27 09:44:14
Standard Java style is tabs, not spaces.

er, no it isn't, unless it's changed since this http://www.oracle.com/technetwork/java/javase/documentation/codeconventions-136091.html

Indentation is 4 spaces - tabs must be set to 8 spaces.  Which means you either have all spaces or a mix, but it's not possible just with tabs.  The default NetBeans formatting is definitely based on 4 spaces.
14  Games Center / WIP games, tools & toy projects / Re: TreeML markup language on: 2016-05-27 09:21:43
What's wrong with tabs?

Because every project I work on or with uses spaces by convention.  Standard Java style is spaces, or spaces and tabs (yuck!).  This means my editors and IDE are set to output spaces by default.  Even @ags1 mentioned he uses spaces everywhere else and has to put an exception in his IDE to output tabs instead for this.  IMO, that's where this falls down and becomes less useful.

I also agree with @princec that whitespace as a syntactical feature is horrible (although I don't on spaces - who codes in a proportional font - you'll be using Comic Sans next)

Praxis LIVE has a similar-ish format for its patch files, except the syntax is based on Tcl and so uses braces for structure.  I have some similar parser code (though there's no way @KaiHH is writing a JavaCC grammar for it!  Wink )
15  Games Center / WIP games, tools & toy projects / Re: TreeML markup language on: 2016-05-26 13:40:10
Nice! ... but, tabs?  Undecided  Doesn't everyone else set their IDE and text editor to output spaces instead of tabs?  persecutioncomplex
16  Game Development / Newbie & Debugging Questions / Re: Optimizing FBO's on: 2016-05-19 10:04:48
(e.g. it does two texture lookups at vTexCoord),

And most blur filters will blur the alpha channel too anyway, so why not return vColor * sum?
17  Game Development / Newbie & Debugging Questions / Re: [Solved][Libgdx] How do I blend textures? (like Flash) on: 2016-05-16 13:46:28
But if it's not overlay, what is it? And why did it work?

It's a weird (lighter) version of Multiply, which would normally be -

1  
batch.setBlendFunction(GL20.GL_DST_COLOR, GL20.GL_ONE_MINUS_SRC_ALPHA)


That assumes the source (sprite) is pre-multiplied alpha or opaque (otherwise you can't do Multiply).  Multiplying the destination by SRC_ALPHA is unlikely going to match any of the Photoshop / Flash blend modes, because they tend towards a no-op as the source becomes transparent, whereas in that case a transparent source would erase the destination (ie. 0 * DST).

In this case, for opaque pixels you're effectively doing

1  
batch.setBlendFunction(GL20.GL_DST_COLOR, GL20.GL_ONE)


which is Multiply and Add together ((SRC * DST) + DST).  The reason it may look similar to you is that Overlay is defined as a brighter Multiply operation (2 * SRC * DST) where the source colour is below half.  It's not Overlay, but depending on the colours in your source image may be close enough.
18  Game Development / Newbie & Debugging Questions / Re: [Solved][Libgdx] How do I blend textures? (like Flash) on: 2016-05-16 11:03:59
Well it's not the wrong one either, so whatever it is, I'm not complaining! Cool

If the effect works for you, fine.  But it's not "useful for people lurking Google searches" because you're replicating a wrong answer to your question!
19  Game Development / Newbie & Debugging Questions / Re: [Solved][Libgdx] How do I blend textures? (like Flash) on: 2016-05-16 07:47:03
^^^ There is no way that is Overlay!  Wink
20  Game Development / Newbie & Debugging Questions / Re: [Libgdx] How do I blend textures? (like Flash) on: 2016-05-15 09:16:52
You could "just" copy the shader files and classes from the libgdx source to your project and add your blend function.

Bear in mind that to do custom blending in a shader you need to do multi-texturing with an additional texture having a copy of the destination region of the sprite - you cannot read the existing pixel colour from a shader.

Example for additive blend:
1  
2  
Gdx.gl.glBlendEquation( GL20.GL_FUNC_ADD );
Gdx.gl.glBlendFunc( GL20.GL_SRC_ALPHA, GL20.GL_ONE );


I highly recommend you use pre-multiplied alpha if you want to do lots of different blending or you can soon run into trouble.  In which case the above additive blending would be -

1  
Gdx.gl.glBlendFunc( GL20.GL_ONE, GL20.GL_ONE);


Without shaders using the built-in blend function you can at least cover normal blending, additive blending, subtract blending, and multiply blending.

These slides from an NVidia talk about their blending extension is worth a flick through too (and check out slide 16 if you're questioning my position on pre-multiplied alpha!  Wink )

http://www.slideshare.net/Mark_Kilgard/blend-modes-for-opengl
21  Game Development / Newbie & Debugging Questions / Re: Sound on Debian Jessie Linux on: 2016-04-26 20:26:16
because the sound works when no other programs are open.

OK, that means it's reverting to using the direct ALSA device, which is exclusive - only one application can access this at a time.  PulseAudio should be the default audio device.  Which means either -

a) OpenJDK is using the direct ALSA device for Applet audio output (really, you shouldn't be using these methods for audio - use JavaSound or check out TinySound if you want something simpler on top).

or, b) someone has changed the configuration of OpenJDK on that machine not to use PulseAudio.
22  Game Development / Newbie & Debugging Questions / Re: Sound on Debian Jessie Linux on: 2016-04-26 15:59:37
Just to double check, because I'm not sure what you mean when you say you are using AWT's sound. AFAIK, there is no play() method for audio in the AWT library.

There's one in Applet.  I think it might be using JavaSound under the covers anyway, but doing anything with Applet seems pointless in this day and age.  Grin

... hmmm, that JavaDoc says nothing happens if the audio clip cannot be found!  Are you sure you're finding the URL of the file correctly?
23  Java Game APIs & Engines / OpenGL Development / Re: LWJGL 3 vs JOGL on: 2016-04-26 15:48:06
I switched from LWJGL (2) in Praxis LIVE v1 to JOGL in Praxis LIVE v2, because I switched rendering library from (a fork of) libGDX to Processing.  In general I'd suggest the library support around whichever binding you choose is more important than the binding itself.

I'd also say I'm becoming more in favour of JOGL's non-static approach <ducks for cover  Grin >.  This is worth a read in that context - https://jogamp.org/wiki/index.php/Why_Instance_Design  I made similar choices for similar reasons in bindings for a native audio library that I maintain.

24  Game Development / Newbie & Debugging Questions / Re: Sound on Debian Jessie Linux on: 2016-04-24 15:10:32
I'm using the newest Java update ...

Oracle or OpenJDK?  IIRC the Oracle one doesn't include PulseAudio support.

and just playing audio with audio.play() in AWT.

Why would you do that?
25  Discussions / Miscellaneous Topics / Re: lambdas rant on: 2016-04-11 09:07:42
I'm using lambdas only where readability is more important than performance

Well, if that's the case in practice, they've failed!  (not used them yet - still targeting JDK 7 compatibility  persecutioncomplex )

Quote from: roquen
The last I heard JVM lowering invokedynamic was much more expensive than they thought it would be.

But that's still only a one time hit?
26  Discussions / General Discussions / Re: Core Java Syntax on: 2016-03-20 10:50:42
I'm not a fan of fluent style stuff myself

You must really hate Java 8 then?!  Tongue

Have to say I really am a fan of this if done well.  To me it's the opposite issue to above - reducing verbosity increasing legibility.  And it's not like you have to use it anyway.

Mind you, the fluent stuff (or any method call) on the end of a constructor does look daft.  To each his own.  Wink
27  Discussions / General Discussions / Re: Vulkan 1.0 Release on: 2016-03-18 12:09:23
@princec - ah, good point!  I was more wondering what the runtime performance differences might be between the OpenGL ES headless mode and the full OpenGL X11 one (having read recently that it's now in public beta)  Wasn't thinking about boot time.
28  Discussions / General Discussions / Re: Vulkan 1.0 Release on: 2016-03-18 11:18:59
I am eagerly awaiting LWJGL on the Pi (headless?)

Any idea what the (longer term) benefit would be to having it headless?
29  Game Development / Newbie & Debugging Questions / Re: Video playing in game on: 2016-03-17 13:02:23
Like @Cero I'm not personally interested in Android as a platform.  However, there is a GStreamer build for Android, and JNA should also work, so in theory you should be able to get it to work with a bit of effort.

https://gstreamer.freedesktop.org/download/

There is also a tutorial for using GStreamer on Android via NDK, but then you have to write a bit of C code too - http://docs.gstreamer.com/display/GstSDK/Android+tutorials
30  Discussions / General Discussions / Re: Core Java Syntax on: 2016-03-17 12:50:33
That will not work because the compiler does not know what type var would be if you use it as method parameter.

I know. I was being sarcastic!  Grin
Pages: [1] 2 3 ... 39
 
orrenravid (202 views)
2016-07-16 03:57:23

theagentd (274 views)
2016-07-11 14:28:54

Hydroque (359 views)
2016-07-06 05:56:57

Hydroque (514 views)
2016-07-03 08:52:54

GrandCastle (385 views)
2016-07-01 09:13:47

GrandCastle (379 views)
2016-07-01 09:09:45

CopyableCougar4 (432 views)
2016-06-25 16:56:52

Hydroque (409 views)
2016-06-22 02:17:53

SwampChicken (374 views)
2016-06-20 13:22:57

SwampChicken (301 views)
2016-06-20 13:22:49
Making a Dynamic Plugin System
by Hydroque
2016-06-25 00:13:25

Java Data structures
by BinaryMonkL
2016-06-13 21:22:09

Java Data structures
by BinaryMonkL
2016-06-13 21:20:42

FPS Camera Tutorial
by Hydroque
2016-05-22 05:40:58

Website offering 3D Models specifically for games for free
by vusman
2016-05-18 17:23:09

Website offering 3D Models specifically for games for free
by vusman
2016-05-09 08:50:56

Website offering 3D Models specifically for games for free
by vusman
2016-05-06 11:10:21

Website offering 3D Models specifically for games for free
by vusman
2016-04-29 12:56:17
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!