Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (408)
games submitted by our members
Games in WIP (293)
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 ... 26
1  Games Center / WIP games, tools & toy projects / Re: Meeting Point - Digital Prisoners on: 2013-05-23 11:37:03
Pretty amazing. Must have been a challenge to connect all those odd bits of technology. Congrats for pulling it off.

Thanks!  Grin Not too much of a challenge in that Praxis LIVE was designed for connecting all these odd bits of technology together (mind you, writing that has been a challenge at times!  Wink )

Did you have any trouble with vandalism?

No, but it was well staffed when on site.  Also, I think it managed to appeal to those who might otherwise have wanted to cause trouble.

Do you think people enjoyed it because it's similar to the console dance games?

Possibly.  It's not something anyone specifically mentioned, and the age range of people having a go (2~72) might belie that.  Our interest is in creating things that are quite playful, intuitive and open-ended - there's no right or wrong way to play, which is different to the console games I've seen at least.

Were people shy to try it?

Not for long!  Lots of people said there's no way they'd be up for it, and most were lining up to have a go after 10 min.  Grin

How does the music work?

Currently the project has five different 'scenes', though it's something we intend to expand on.  Three of the scenes don't have interactive sound, only visuals, and use a variety of sample loops (mostly taken from old tracks of mine) and sequenced somewhat randomly / generatively.

There are two scenes with interactive sound.  The record scratching one tracks the horizontal position of the dancer and maps it to the speed and direction of the sample (actually position is mapped to acceleration in speed, which feels more natural).  The other scene, which I'm less happy with currently, is in the video between the logos at the end.  Each dancer has four 'strings' which trigger different guitar samples, and can pluck them from moving back and forth.

That answer your question?  This video shows some of the audio stuff in Praxis LIVE, but rather than binding a GUI to parameters, we're taking movement signals from the video pipelines.  NB. This is an oldish video now, some of the editing stuff has been improved recently.

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





2  Discussions / General Discussions / Re: Blogpost about Java for Game Programming on: 2013-05-21 17:57:03
These benchmarks should java being between 2-37x slower than GCC, and GCC is a hunk of junk.

No they don't!   Roll Eyes  It's 1x-2x processing time and 1x-37x memory usage.  What did you say about compact earlier?  Wink
3  Games Center / WIP games, tools & toy projects / Meeting Point - Digital Prisoners on: 2013-05-21 15:54:52
Thought I'd share a few details of a recent project I've been involved in.  Whether you're entirely happy with this being classed as a "game" depends on whether you think all games need to have goals, high-score tables, or be playable on your PC - needless to say, I don't!  Wink



About

At Digital Prisoners we're interested in creating interactive things for people to play with out in the real world.  Meeting Point is a large-scale interactive projection designed for an urban public space. It uses two infra-red cameras mounted at opposite sides of the space, custom computer software and a large-scale projector.  The work allows the two participants to interact with each other and, through motion detection, with the other audio and visual elements of each section.  For example, the record scratching section allows them to control the spin on screen and the sound of the record by moving from side to side.

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

Technical Details

Most importantly, it's Java-based!  Smiley

  • This project was built with Praxis LIVE (also in my sig). It is the sort of project Praxis LIVE was designed for.
  • The main projection uses Praxis' OpenGL pipeline, which uses LWJGL and some (heavily forked) code from libGDX. This makes quite a lot of the custom (live) coding support for GLSL and Java.
  • Video input uses two infra-red CCTV camera, USB capture devices (ran out of PCI slots!  Wink ) and GStreamer bindings.  Each video stream is actually split into two using the V4L2loopback module ...
  • One stream from each camera goes to the OpenGL pipeline.  A second stream from each camera goes into a software pipeline that does motion detection, which is used to pass parameters to control audio and visual elements in each scene.
  • The audio processing is pure Java using Praxis LIVE's audio FX (most of the effects code is up at https://github.com/jaudiolibs/)
  • The whole thing is projected using a 10,000 lumen Sanyo projector.

If you want to know anything else about the implementation, please ask below.



I wasn't sure the best place to post this.  Almost put it in Showcase, as it is a finished project and kind of qualifies as a game.  However, it doesn't entirely meet the criteria of "a casual visitor should be able to play your game without any trouble".  Of course, if you've got a large space and a spare £4k (projector hire ain't cheap!) we'd be happy to bring it to you for a few days.  Grin
4  Game Development / Newbie & Debugging Questions / Re: [SOLVED]how to load file depending on the folder where the Jar exists on: 2013-05-18 12:28:07
Okay, I had a bit of trouble fixing Guardian II using the code mentioned above, and decided to post the fix I found in case someone has the same problem.

1  
String jarDirectory = new File(SomeClass.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()).getParent();


It returns the directory containing the jar.

For a moment I thought you were just repeating what I wrote above  Wink , but I see what you're trying to do.

Two questions (not tried it)
- why use getPath() rather than construct the File from the URI returned from toURI()?
- why not use getParentFile() to return a File representing the directory?
5  Java Game APIs & Engines / OpenGL Development / Re: Shader Program Fatal Error on: 2013-05-18 12:17:24
https://github.com/Harris6310/Dragonshire/blob/master/src/dragonshire/graphics/Texture.java#L58 ?

Your texture doesn't appear to have an alpha channel - shouldn't that be GL_RGBA?
6  Java Game APIs & Engines / OpenGL Development / Re: Shader Program Fatal Error on: 2013-05-17 15:15:49
At a guess, you haven't enabled blending?
7  Game Development / Newbie & Debugging Questions / Re: [SOLVED]how to load file depending on the folder where the Jar exists on: 2013-05-14 12:37:21
Then you should just rely on getClass().getClassLoader().getResource<AsStream>(String). That's the best option as it loads relative to the root of the JAR.

Which isn't the same thing!

Mind you, as the OP says, he might be better off putting the level files in the JAR - depends if he wants it to be user editable / extendable.
8  Game Development / Newbie & Debugging Questions / Re: Simple Parsing Question on: 2013-05-13 20:29:42
You're trying to call split() on an array!  You need to use a second loop through the tempTwo array.
9  Game Development / Newbie & Debugging Questions / Re: [SOLVED]how to load file depending on the folder where the Jar exists on: 2013-05-13 11:00:41
It's usually safe to assume the jar will be launched from the directory it is in.
...
Is there a way to fix this or do we have to stop relying on user.dir?

To assume makes an ass of u and me!  Grin

Don't assume that the JAR is launched from the directory it is in.  That assumption will break in interesting ways.  If your program relies on the directory its JAR is in and not the directory the user is in, don't use user.dir - there's a clue in the name!  Tongue
10  Game Development / Newbie & Debugging Questions / Re: how to load file depending on the folder where the Jar exists on: 2013-05-13 10:42:45
This could actually just be an OpenJDK error
I could never reproduce that quirk.

You guys are misinterpreting what the user.dir property is meant to represent.  It is the current working directory, not the directory where the program resides.  For example, if you run a command in the shell (eg. ls) you want it to list the files in the working directory, not the directory where the ls command resides.  If anything's quirky it's probably Windows Java behaviour here.

One way to answer the OP's question may be to use
SomeClass.class.getProtectionDomain().getCodeSource().getLocation()
.  Obviously SomeClass should be a class in the JAR you're looking for.

See more http://stackoverflow.com/questions/2837263/how-do-i-get-the-directory-that-the-currently-executing-jar-file-is-in
11  Game Development / Newbie & Debugging Questions / Re: Game Versioning or Numbering on: 2013-05-09 10:21:39
I do my personal versions by date...
...
<GameName><Month><Day><Year>

If you go with something like this, I'd highly recommend doing <Year><Month><Day>, and always using two digit numbers (or 4 for year if you're planning on your code being used into the next century  Wink ).

ie. <GameName>-130509

That way it is always incrementing and sorts correctly 'alphabetically' - don't underestimate how useful those two features can be!

12  Discussions / General Discussions / Re: AWESOME particle system on: 2013-04-29 11:07:58
I also tried the code and although it compiled it just didn't do anything.

You try dragging with the right mouse button?  I thought it was broken too until I looked at the code.

Another reason why you should stay the hell away from java2D. It is not at all consistent on computers.

Except that the vast majority of this is not Java2D, it's direct pixel manipulation, which is highly consistent across computers.  This would probably perform better if he switched to an active rendered buffer strategy for the final blitting.
13  Java Game APIs & Engines / Java Sound & OpenAL / Re: Cant get background music to work? on: 2013-04-28 14:52:37
No, got any links or code to it?

Try searching!   Roll Eyes http://www.java-gaming.org/topics/need-a-really-simple-library-for-playing-sounds-and-music-try-tinysound/25974/view.html

An obvious weirdness in your code would appear to be that the constructor is calling itself.
14  Game Development / Game Mechanics / Re: Game Freezes for Duration of Sounds on: 2013-04-24 12:30:34
Never use a Thread per sound, or open multiple lines at the same time - it'll break or play badly on a variety of systems.  If you don't want to get into handling sound mixing yourself, check out TinySound or other libraries on here.
15  Game Development / Newbie & Debugging Questions / Re: Typecasting in render method? on: 2013-04-18 21:15:27
You can use translate(double tx, double ty) together with bilinear interpolation to preserve subpixel movement inside an image but the edges won't be affected.

I missed out that you'll probably need the antialiasing hint too.  That still might not work with drawImage() though.  See this blog post from 2007 - http://weblogs.java.net/blog/campbell/archive/2007/03/java_2d_tricker.html.  Not sure if that's still accurate.  I've seen code in the Java2D implementation that seems to treat blitting sub-pixel positioned images differently.  As you said, unless this is on an accelerated pipeline, it's going to be slow.

I am using interpolation. But I think im using it wrong because I didnt understand anything of that Tongue
1  
playerX += 3.0f*interpolation;


Different meaning (well usage) of interpolation.

1  
g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);

16  Game Development / Newbie & Debugging Questions / Re: Typecasting in render method? on: 2013-04-18 12:01:26
There is no higher accuracy than a pixel accuracy, this is a hardware limitation.

Yes and no.  Both Java2D and OpenGL can use interpolation to give the appearance of sub-pixel accuracy through interpolation.  As the Java2D drawImage calls only take ints, you have to use the form that takes an AffineTransform, and also make sure that interpolation is set to bilinear or bicubic.  Of course, you didn't want this to work quickly, right?  Grin

My thought was that in my class, the playerX and playerY would keep it's "true" float value ... But it looks wrong for some reason.

Depending on your algorithm, using
(int)(playerX + 0.5f)
might be better - will have the effect of rounding.
17  Game Development / Newbie & Debugging Questions / Re: Is this code evil? on: 2013-04-14 12:24:07
Use the builder pattern if you only need to change some of the data. (ie: lots of it is the same as default)
...
Use Big constructors if lots of data is different with every instance.

Your argument would appear to be backwards!  Smiley

Use the builder pattern if lots of data is different with every instance (particularly if that data needs to be known at construction time - eg. immutable state)

Use Big constructors if little data has to be passed in at construction time (ie: lots of it is the same as default, there are few parameters, or you're happy with mutable state / setters)

@ags1: constructors and methods with more than ~3 parameters are... horrible

evil?  Grin
18  Game Development / Newbie & Debugging Questions / Re: Is this code evil? on: 2013-04-13 16:23:49
How about something based on the builder pattern instead?  This would lead to code like below, without lots of specific subclasses.  Makes this potentially easier to customize or switch to an XML / JSON approach later, while keeping your code the same.

1  
2  
3  
4  
5  
6  
7  
Skill fightingBow = Skill.builder()
    .name("Fighting Bow")
    .experienceMultiplier(2)
    .skillCost(SkillCost.linear)
    .lock( new BowTraining() )
    .description("General skill in using bows.")
    .build();


I really like the way they're doing this in JavaFX to provide a clean Java DSL that also translates easily to XML.

PS. Yes, I think your code is evil!  Grin
19  Game Development / Newbie & Debugging Questions / Re: Best way to play audio in java on: 2013-04-10 13:52:59
A "bit of RAM" is pretty much negligible in the 21st century.

Yes, my laptop (which is getting old  Emo ) has 4GB of RAM, which seems to be the low-end these days.  That's enough RAM (excluding swap) to store over 6 hours of stereo audio!  Storing a few minutes of audio at a time in RAM is hardly excessive.   Smiley
20  Game Development / Newbie & Debugging Questions / Re: Use LUA for ingame computers on: 2013-04-09 22:10:36
I probably should have pointed out, that it uses the new 'invokedynamic' instruction from JDK 7.

So does dyn.js - clue in the name!  Wink Not tried it yet. Be interesting to see how it compares with Nashorn. At least you don't need JDK8.
21  Game Development / Newbie & Debugging Questions / Re: Best way to play audio in java on: 2013-04-09 21:48:53
I want to use avoid the usage of libraries entirely, except for maybe if we decide to use mp3.

Then you could just use it as example code to answer your question. Low level audio code is difficult to get right. Primary point is to never use more than one output line, keep it open and mix all your sounds in a single thread to the output line. Ignore Clip as it uses a line per sound.
22  Game Development / Newbie & Debugging Questions / Re: Use LUA for ingame computers on: 2013-04-09 20:16:48
If you mind either waiting until JDK 8 is somehow popular, ... you can use nashorn.

In the end nashorn compiles to java bytecode. It's incredibly fast that way.

Or there's Rhino (JDK 1.4+) or dyn.js (JDK 7+).  They all compile to bytecode.  That does not mean they'll perform equally well!  Compilation to bytecode is not in itself a guarantee of being "incredibly fast".  Wink
23  Game Development / Newbie & Debugging Questions / Re: Best way to play audio in java on: 2013-04-09 18:17:48
http://www.java-gaming.org/topics/need-a-really-simple-library-for-playing-sounds-and-music-try-tinysound/25974/view.html
24  Game Development / Newbie & Debugging Questions / Re: Question about System.gc(); on: 2013-04-08 19:04:12
If you want to keep garbage piles low and prefer short but frequent garbage collections, use the G1:
-XX:+UseG1GC

Still not managed to get that to perform any better (or even as good as) -Xincgc for me.  Must test again sometime though.

The max pause setting may work with other garbage collectors too.
25  Discussions / Miscellaneous Topics / Re: What music do you listen to while you code? on: 2013-04-08 12:35:19
I recommend you go and buy all four Tomahawk albums.

hmm .. tempting!

And while we're on a Mike Patton lovefest - 3 faves of mine.

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

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

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

Mind you, don't think I could code to any of them!  Grin
26  Discussions / Miscellaneous Topics / Re: Best Linux Screen Recorder? on: 2013-04-08 11:56:09
- Modifiable AND redistributable. This is where I begin to disagree.

Projects should only be modified and redistributed if:
a) The project is abandoned. (Which happens a lot)

So, you basically want open-source without the most important benefit that open-source brings?  I thought your first comment was funny - this one's hilarious!  Wink

For a start, how do you define "abandoned" anyway?  On who's say so?

Personally, I'm all for the GitHub approach - fork, fork and fork away.  I think it's highly important that distributors are allowed to fix bugs and add features, and usually they make their way back upstream.

Taking an example of OpenOffice / LibreOffice.  Even before the LibreOffice fork, most Linux distros shipped a modified build of OpenOffice that contained a range of additional features and bug fixes.  Should that not have been allowed?  Should the fork of LibreOffice not have been allowed, despite the fact that this has resulted in the project developing much more rapidly?

Personally, I'm glad you're not making the rules!  Grin
27  Java Game APIs & Engines / Java Sound & OpenAL / Re: Need a really simple library for playing sounds and music? Try TinySound. on: 2013-04-08 11:38:00
I dont wanna be a party pooper... but guys
TinySound only wraps JavaSound
JavaSound is really really bad... There are SO many nice alternatives

Don't want to be a party pooper, but you don't know what you're talking about!  Tongue

There are bits of JavaSound that are really bad, but the direct audio mixers are OK, and about the most low-level way you can interact with the soundcard.  Open device, stream bytes - that's it!  To say that TinySound just wraps JavaSound is rubbish - it provides a range of higher-level functionality on top of the usable low-level bits of JavaSound. 

If you're going to suggest OpenAL as a "nice alternative", then to TinySound maybe, but not the JavaSound direct mixers - OpenAL is a higher level API - you could write a pure-Java equivalent outputting via the JavaSound direct mixers!
28  Game Development / Newbie & Debugging Questions / Re: Question about System.gc(); on: 2013-04-07 20:13:41
Dang!  You didn't buy that RAM for it to actually be used by anything did you?!  Tongue

Seriously, unused RAM is a sign of an unoptimized system.  Let the JVM and the OS manage the RAM for you - it will do a damn sight better job of it.

Take @matheus23's suggestion for command line options to control heap size if you really feel you must.  Just don't use System.gc() - as well as the arguments already put, a full GC is likely to play havoc with MIDI / audio timing too. 
29  Game Development / Performance Tuning / Re: Speeding up Minecraft? on: 2013-04-07 17:13:40
If you are looking to get your performance back on linux playing minecraft, then you have to drop OpenJDK. If you are on Ubuntu...

You comparing like with like there?  ie. OpenJDK 7 with Oracle Java 7?  The default OpenJDK on Ubuntu is 6, but 7 is in the repos.  They shouldn't be that much different in speed - they're practically the same code base. 
30  Discussions / Miscellaneous Topics / Re: Best Linux Screen Recorder? on: 2013-04-07 15:53:01
I like Linux, except that it can't run Paint.NET, and there are no equivalent programs.

Is Pinta any good?

I'm all for available source, just not open source.

I'm sorry, but WTF does that actually mean?

Well, I guess you'd better not be using libGDX or LWJGL, or Eclipse / NetBeans, or Java 7+.  And you'd better not be using a decent web browser to look at this site, or using this site at all.  Wink

I realise this isn't for everything, some open source projects are good, but there is a fair amount of junk out there.

Works both ways!  My number one answer when people ask me what Linux offers that Windows doesn't - No longer having to pay for shit that doesn't work.  We get all our own shit that doesn't work, for FREE!  Grin
Pages: [1] 2 3 ... 26
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Get high quality music tracks for your game!

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

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (107 views)
2013-05-17 21:29:12

alaslipknot (115 views)
2013-05-16 21:24:48

gouessej (144 views)
2013-05-16 00:53:38

gouessej (140 views)
2013-05-16 00:17:58

theagentd (152 views)
2013-05-15 15:01:13

theagentd (136 views)
2013-05-15 15:00:54

StreetDoggy (180 views)
2013-05-14 15:56:26

kutucuk (203 views)
2013-05-12 17:10:36

kutucuk (204 views)
2013-05-12 15:36:09

UnluckyDevil (210 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.253 seconds with 20 queries.