Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (732)
Games in Android Showcase (221)
games submitted by our members
Games in WIP (806)
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 ... 41
1  Game Development / Shared Code / Re: Tagged Human JSON (THJSON) Parser on: 2017-07-11 21:49:33
SVN FTW.

For luddites everywhere  Wink

https://help.github.com/articles/support-for-subversion-clients/
2  Java Game APIs & Engines / Java Sound & OpenAL / Re: AudioCue, an alternative to Clip, for 2D games on: 2017-07-04 19:39:18
One aspect which I do NOT know the answer to: how are multiple output lines being handled by the Java implementation that merges SourceDataLines? It could be that what is underlying is already quite efficient. If that is the case, implementing this would be redundant except for situations where there are a limited number of lines allowed, for example, with Raspberry PI (I think FabulousFellini mentioned running across a limit of 8 audio lines in that case.)

It's usually not managed by the java implementation at all, it's managed at the OS level.  That's why it gets flaky across different systems, or even different drivers.  It's also why TinySound got written in the first place.  Merging your feature set with the TinySound mixing could be a really useful little library.  Everything else out there (including Pipes v2 when I finally extricate it from Praxis LIVE) is a lot bigger and less liberally licensed.
3  Java Game APIs & Engines / Java Sound & OpenAL / Re: AudioCue, an alternative to Clip, for 2D games on: 2017-07-04 19:19:52
I would again highly recommend this to anybody who wants a better alternative to TinySound.

If this isn't mixing down to a single line, it's not a better alternative to TinySound!  @philfrei how easy in your architecture would it be for you support that?
4  Discussions / Business and Project Management Discussions / Re: Licensing overwhelm, asking for advice on: 2017-06-29 11:10:47
It's also tough to say there is much of a / any market for Java based audio / engine software that is interfaced via an OOP / Java API.

Considering how many of those already exist (including a pretty powerful one in the JRE), I have to concur!  There are some niche use cases for Java based audio, such as requiring more flexibility than integration with a native tool like SuperCollider can give you, but I doubt you'll ever be able to make any money from it.  It's one of those things where if you make it as free as possible, people might use it, but if you seek to charge for it people will just look elsewhere.

Incidentally, speaking of SuperCollider and license, it's interesting that Processing's new sound library is based on Methcla - that's a potentially more lightweight and better licensed option for games. 
5  Discussions / General Discussions / JCrete? on: 2017-06-29 10:43:43
Seen as hardly anyone goes by their real name on here!  Grin  Anyone else going to be at JCrete this year?
6  Java Game APIs & Engines / Java 2D / Re: Java2D physics engine? on: 2017-04-15 17:11:32
I used it for one of my experiments a while back ( https://www.youtube.com/watch?v=-M2RoOZKhNQ )

I love that you posted that video from the future!  Grin
7  Game Development / Newbie & Debugging Questions / Re: JFrame starting up slow on: 2017-04-15 17:00:33
I'm not using text anywhere else.

This is (probably) why then.  As I said, text rendering can take a little time to set up.  You could try rendering some text somewhere prior to showing your JFrame and see if that masks the issue.
8  Game Development / Newbie & Debugging Questions / Re: JFrame starting up slow on: 2017-04-13 08:46:57
Are you using text anywhere else?  Is that setFont() call definitely commented out when it's still slow?  Setting up text rendering and initialising a font can take a little bit of time.
9  Game Development / Shared Code / Re: All-Integral Alpha Compositing Using Bitwise Operators - Also New to JGO! on: 2017-04-08 11:52:19
Nice!  This old thread might interest you too - http://www.java-gaming.org/topics/some-new-blendmodes-add-multiply-overlay-etc/24529/view.html - mostly bitwise operation and multiplication.
10  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-04-06 16:47:07
Made an up-to-date video of AMEN $ Mother Function - live-coded Java lambda.  Done two gigs in the last few weeks with this too - one in Oxford, one in Athens.

<a href="http://www.youtube.com/v/SgE9POc5BdA?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/SgE9POc5BdA?version=3&amp;hl=en_US&amp;start=</a>
11  Java Game APIs & Engines / Java Sound & OpenAL / Re: Sound tool recommendations and/or javax.sound problems on: 2017-04-06 16:45:06
Wish to encourage this. (Not the sense of persecution/paranoia, but the release of a better Java audio library.)

I'm going to be working full-time for a while on Praxis LIVE and related media libraries, so this just might happen!

Maybe it would be good to start a wish list/feature list of a minimal but genuinely useful library?

A none-obvious, but key one for me, is that it's lock-free.  This is one of the reasons I don't use Beads.  And also why I haven't yet extracted some of the code out of Praxis LIVE, because outside of the environment it's not so easy to work with - however, good use of lambdas / method references in an API might make this not too painful.
12  Java Game APIs & Engines / Java Sound & OpenAL / Re: Sound tool recommendations and/or javax.sound problems on: 2017-04-06 10:11:35

Beads is great, but has the potential issue of being GPL, unlike Minim - http://code.compartmental.net/tools/minim/  Beads has a better architecture in my opinion, but I'm also biased because I contributed the audio IO from Praxis LIVE to it!  Wink

Also, probably better to compile Beads from source as there's been a variety of changes since the last release.  https://github.com/orsjb/beads
13  Java Game APIs & Engines / Java Sound & OpenAL / Re: Sound tool recommendations and/or javax.sound problems on: 2017-04-06 09:54:10
I do not know how TinySound handles this. It seems to me he has some provision for fading in and out smoothly, but I am not up on specifics of using this library.

Doesn't look like TinySound does gain interpolation either.  Sad

Other libraries to look at would be Minim and Beads, both of which are well known in the Processing community, but will work with just Java.

One day I'll get around to exporting the pure Java audio library from Praxis LIVE ...  persecutioncomplex
14  Discussions / General Discussions / Re: C++/Java Engine without GC in graphics on: 2017-03-27 13:14:53
Well, I can halve my frame rate just by turning on G1GC...

Anyone can halve the rate of anything by turning on G1GC  persecutioncomplex   Grin

Seriously, I hope they improve things a lot by the time Java 9 is out the door.
15  Discussions / General Discussions / Re: C++/Java Engine without GC in graphics on: 2017-03-27 10:18:24
You won't gain any immediate advantage just because you use C/C++.

Well, you'll probably gain an immediate disadvantage!  Wink  Yes, well written C/C++ might outperform Java, but you've got to get there first - it's easy to write C/C++ that underperforms Java.

And GC is probably not as much of an issue as you think it is.

As for "script" in Java ...  Undecided
16  Game Development / Game Play & Game Design / Re: Graphics Backend Abstraction on: 2017-03-25 12:46:46
What is a ServiceLoader? How would that work with my enums? What kind of advantages are there here?

It's the standard method built into the JDK for an abstraction to find an implementation without having any dependency on it. eg https://docs.oracle.com/javase/8/docs/api/java/util/ServiceLoader.html

What I mean is that you build an initialization step into the abstraction API that looks up implementations at runtime using ServiceLoader. This usually involves an implementation of a provider class.  That in itself isn't specific to your enums.  As part of that initialization the abstracted API (eg. code in the enum or same package) queries the provider implementation for each int value and caches it in the required enums.  The implementations do not have to initialize the enums themselves, or know anything about what mechanism you're using to cache the constant mapping.  You manage the mechanism, initialization order, etc. in one place rather than many.

The code @Archive posted where each backend has to call back into each enum, know all the possible values, do things in the right order, etc. becomes tiresome quickly the more the API expands and the more backends you have.
17  Game Development / Game Play & Game Design / Re: Graphics Backend Abstraction on: 2017-03-24 18:37:35
If you're going to have the variables inside the enums for speed, I'd use ServiceLoader to lookup the required implementation at runtime and request the underlying values from it, rather than have the implementation have to configure the enums itself - that's ... yuck!  persecutioncomplex
18  Game Development / Game Play & Game Design / Re: Graphics Backend Abstraction on: 2017-03-24 15:06:44
Because evidently an EnumMap is just a wrapper around an array indexed with ordinal() anyway, and using EnumMap has too much overhead, bad cache coherency and will need autoboxing of the integer constants to fit them in.

That was my point, that you were reinventing it without knowing whether it's actually a bottleneck.  True, if you're mapping to int you've got the unboxing.  Where's the bad cache coherency come from in there though?  From the Integer?  I guess you need an EnumIntMap then!   Smiley  Few around.
19  Game Development / Game Play & Game Design / Re: Graphics Backend Abstraction on: 2017-03-24 11:34:18
My proposed solution would be to have the enum--->constant mapping in the backends instead. A hashmap is gonna be way too slow, but a simple array indexed by ordinal() could work.

er ... EnumMap!

OK, so I need to write more text  Roll Eyes  Why would you use an array indexed by ordinal() over an EnumMap?
20  Game Development / Newbie & Debugging Questions / Re: JavaFX audio not working properly? on: 2017-03-21 19:36:21
Well, this comment is amusing - wonder if that's still the up-to-date source?!  Roll Eyes  Good to hear AudioClip in JavaFX is just as broken as the JavaSound one then.
21  Game Development / Performance Tuning / Re: ArrayList$Itr and Escape Analysis on: 2017-03-06 13:57:03
Are you in a position to try / use Java Mission Control?  According to various things I've read, including the article you linked to, this can analyse without switching off escape analysis.
22  Discussions / General Discussions / Re: Programmer jokes on: 2017-02-05 18:50:51
Psssssst! beat ya!  Grin
23  Discussions / General Discussions / Re: Programmer jokes on: 2017-02-05 18:49:32
@DarkCart or from the other side  Grin ...

<a href="http://www.youtube.com/v/gLDFQ_IhnDc?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/gLDFQ_IhnDc?version=3&amp;hl=en_US&amp;start=</a>
24  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Advantages of Ant? on: 2017-01-29 13:09:53
IME having external dependencies in a build is a bit like building your castle on sand. The build must always succeed. Discuss.
This is actually only a mild problem with maven and gradle. If you want to see this problem in an apocalyptic scope, use npm Shocked

Yes, experienced the npm hell!  Angry From what I remember you have to specify an exact version for dependencies to build against in Maven so that every build is reproducible.  That is how to handle external dependencies IMO.  The problem @princec outlines should not be possible with Maven.

 ... oh, and while I maintain a number of libraries that use Maven for build, my main project uses Ant for reasons similar to @gouessej and I really can't be bothered trying to find workarounds. Make of that what you will.  Grin
25  Game Development / Newbie & Debugging Questions / Re: LibGdx, Eclipse and Gradle about hotSwap on: 2017-01-19 14:19:32
When you attach a debugger to your application (in your case Eclipse is the debugger client), the JPDA client can issue a request (over the JDWP / Java Debug Write Protocol) to redefine a class

More specifically, it allows you to redefine the code of a method.  You cannot change the structure of a class - add fields / methods, change method arguments, etc.

Oracle's HotSpot and OpenJDK support it)

Well, as they're one and the same thing ...  Grin  usually
26  Game Development / Newbie & Debugging Questions / Re: getting rid of "instanceof" on: 2017-01-15 12:12:00
This solved the "instanceof" dilemma immediately. Now when I process a collision it is more like this:

1  
2  
3  
4  
5  
public void visit(BallStateNormal visitable) {
      Ball ball = (Ball) visitable.getMob();
      brick.bounceBall(ball);
                //
}


hmm .. removing the instanceof and having a blind cast is not improving things!  Doing instanceof -> cast, using visitors, pattern matching or heterogenous containers are all about filtering a collection of entities at runtime for those that are a / have a particular capability.  If you have a blind cast like that you either know at compile time the type returned, in which case that's what the method should return, or you're making an assumption that is overriding compile time checks and will eventually blow up on you at runtime.

@Abuse may be right that generics are the way to go here.  Although your concrete subclasses probably don't want to be generic or you're likely to end up needing to know genetic types at runtime (a PITA!).  So, something along the lines perhaps of BallStateNormal extends AbstractMobState<Ball>

However, also don't forget that overridden methods in Java can return a more specific subtype, so visitable.getMob() on BallStateNormal could return Ball already without generics.
27  Discussions / Suggestions / Re: Add a link to the embedded youtube video on: 2017-01-13 17:57:07
The YouTube embeds seem to work fine for me without Flash at all?!  HTML5 player in Chromium on Ubuntu.
28  Game Development / Newbie & Debugging Questions / Re: getting rid of "instanceof" on: 2017-01-13 12:16:54
@cylab - I use that "pattern" a lot, but then it's basically the same as the Lookup mechanism in the NetBeans platform.  Not sure if it's the fastest approach, but it's definitely one of the nicer ones.  Smiley

Incidentally, getHandler() could also return Optional to not require the supports() method, or you could even pass a consumer into a utility method on entity that does that for you. Hey, I like keeping the logic code succinct and less error prone.  Grin 

1  
2  
3  
entities.forEach(e -> e.getHandler(PoisonGasEffect.class).ifPresent(h -> h.onPoison(1)));

entities.forEach(e ->  e.with(PoisonGasEffect.class, h -> h.onPoison(1)));
29  Game Development / Newbie & Debugging Questions / Re: getting rid of "instanceof" on: 2017-01-12 16:45:42
I don't get the "breaking encapsulation" part here.

Well, from GoF -

Quote
Visitor's approach assumes that the ConcreteElement interface is powerful enough to let visitors do their job. As a result, the pattern often forces you to provide public operations that access an element's internal state, which may compromise its encapsulation.

In general of your examples I prefer the behaviour in the entities (your last example), but they all have their places. Also, instanceof is not likely to be the slowest - enum would probably be slower (have seen a benchmark of that somewhere). Incidentally, the pattern matching style approach to your instanceof example could be something along the lines of -

1  
2  
3  
entities.forEach(e -> when(e)
        .is(Monster.class, m -> m.kill())
        .is(Player.class, this::updatePlayer);
30  Game Development / Newbie & Debugging Questions / Re: getting rid of "instanceof" on: 2017-01-12 13:03:18
I agree with @princec. The code linked to by @nsigma is nothing but instanceof-in-disguise wrapped in Java 8 to make it less intelligible.

But done in a less verbose, safer and compile-time-checkable way!  It's getting closer to smart casts in Kotlin (eg. https://kotlinlang.org/docs/reference/typecasts.html)

I generally agree with the bulk of what you've said by the way - this is always for edge cases.
Pages: [1] 2 3 ... 41
 
Archive (407 views)
2017-04-27 17:45:51

buddyBro (588 views)
2017-04-05 03:38:00

CopyableCougar4 (1046 views)
2017-03-24 15:39:42

theagentd (1078 views)
2017-03-24 15:32:08

Rule (1052 views)
2017-03-19 12:43:22

Rule (1035 views)
2017-03-19 12:42:17

Rule (1027 views)
2017-03-19 12:36:21

theagentd (1166 views)
2017-03-16 05:07:07

theagentd (1122 views)
2017-03-15 22:37:06

theagentd (835 views)
2017-03-15 22:32:18
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
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!