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 (404)
games submitted by our members
Games in WIP (289)
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 ... 13
1  Game Development / Newbie & Debugging Questions / Re: C++ to Java and unsigned int64? on: 2013-03-13 15:50:53
This won't work in java as there is no unsigned 64 bit integer. Using a regular signed long would usually work fine but you are doing addition and using all 64 bits which includes the sign bit. You could use java BigInteger but it will be slow and I suspect this is purely a performance hack so I suggest you just replace it with whatever you are actually trying to do.
2  Game Development / Shared Code / Re: ReadWriteCollection for entities on: 2013-03-08 04:19:43
I must say Riven since you started working for Cas you have been making some pretty cool stuff. This coupled with that continuations lib is giving me all sorts of ideas about simulating massive populations of all sorts of things. 
3  Java Game APIs & Engines / Java 2D / Re: VSync on: 2012-11-13 04:47:16
So I tried using JavaFX and AnimationTimer as it appeared a likely candidate (you don't specify the time delta) and it worked perfectly, vsync at last. Like requestAnimationFrame() you get one call per monitor refresh (verified by changing the refresh rate) and animation looks lovely and smooth!
Hopefully it's fairly cross platform and works the same way in a browser plugin.

I am still using Java2D to draw my scene to a buffer and copying it to a JavaFX WriteableImage every frame. Not particularly efficient but better than running at 300fps.
4  Java Game APIs & Engines / Java 2D / Re: VSync on: 2012-11-12 07:44:26
All the Graphics2D methods take double precision values and there is a full set of double precision Shape objects for the draw(Shape) method. Even if you stuck to the regular Graphics calls that take ints you can use the Graphics2D double precision translate to draw at floating point coordinates.

I think I might try to mock up a quick example applet to demonstrate the problem (and test how often ExtendedBufferCapabilities is available).
5  Java Game APIs & Engines / Java 2D / Re: VSync on: 2012-11-11 18:46:49
Quote
Also, I don't think anyone really has the time to go and watch an hour long video hoping to find wth your are talking about. Maybe you have like amazing eyes or something because I really have never seen these "artifacts" you are talking about when properly double buffering.
Most of the relevant information about the problem is is in the first 10 minutes or so. The rest about profiling in chrome.

Quote
hmmm...if you are referring to the very jerky motion when you move an object slow in java2D that is because it does everything in ints.
No Java2D uses doubles and you can turn on different interpolation modes to get sub-pixel image interpolation, however this doesn't really help unless you are updating at much higher rate than the refresh rate of the monitor. If you update at 300fps moving objects by very small amounts each time your positions will only be out by ~3ms which is probably not noticeable. The downside of this 4/5 of the frames you generate are never shown so it's a pretty massive waste of CPU. Also this doesn't work with up-scaled pixel art type graphics (the type I am doing at the moment) as you are typically moving objects ~ at 1/2 pixels per frame and can't use sub-pixels.

Quote
Then try out either LWJGL or JogAmp.
I would prefer not to do this because it does impose a number of barriers to people trying my game, but it may be the only option. One downside is that setVSyncEnabled is not guaranteed to work either so it may not be much help.

An option I was considering was using javascript to call requestAnimationFrame() and drive each new frame from the browser itself but I'm not sure how reliable this would be or how much overhead it would create

6  Java Game APIs & Engines / Java 2D / Re: VSync on: 2012-11-11 01:01:26
Artifacts (like tearing) are not the problem. The problem is to achieve smooth motion VSYNC is essential.

Say you have a character moving across the screen at 1 pixel per frame. You have no idea when the frame will be actually be displayed it could be up to 16ms (at 60 Hz) from the point you calculate it. So even though you might create a series of frames with positions 1,2,3,4,5,6 they could be displayed like 1,2,2,4,5,5,6 depending on the relative timing of the show() and the vsync.

People don't tend realize how much of a difference it makes until they see the same thing done right. Done wrong it just looks a bit amateurish but you can't quite put your finger on the problem. The second you see it done properly it just looks so much better.

For a good explanation (and why vsync is the only real solution) of the problem I suggest watching:
<a href="http://www.youtube.com/v/hAzhayTnhEI?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/hAzhayTnhEI?version=3&amp;hl=en_US&amp;start=</a>

7  Discussions / Miscellaneous Topics / Re: What's your favorite game. on: 2012-11-10 07:41:44
Zelda: Ocarina of Time has been my answer without hesitation for a long time. However assuming I could sever any nostalgic attachment I think Space Chem might be my current favourite.
8  Java Game APIs & Engines / Java 2D / Re: VSync on: 2012-11-10 01:58:26
So I tried the ExtendedBufferCapabilities and it works like a charm, beautiful smooth movement, so I think I'll just wrap it in some exception handling and hope it makes it into Java 8.

Edit: Unfortunately it only works if my laptop is using an external monitor... In fact the createBufferStrategy with page flipping doesn't work either in this case (throws the same AWTException),  Sad

9  Java Game APIs & Engines / Java 2D / Re: VSync on: 2012-11-09 23:22:49
I've been waiting for quite some time for the equivalent of javascript requestAnimationFrame() but nobody seems to care that much about it for Java2D. Hopefully JavaFX takes off and it becomes important enough to add. If anyone doesn't realize why it matters I suggest having a browse at: http://www.jankfree.com/



10  Java Game APIs & Engines / Java 2D / Re: VSync on: 2012-11-09 22:59:38
I saw that but note it's in the sun namespace so not officially part of the JDK. I assume it's something you can enable with vm args.

11  Java Game APIs & Engines / Java 2D / Re: VSync on: 2012-11-09 22:54:21
I am using a BufferStrategy, it doesn't help because the show() doesn't wait for the vsync, so it's very easy to get 1 frame displayed twice and then a frame skipped on the next cycle. Missing a single frame is actually quite noticeable.

The only way to get properly smooth motion is to have 1 frame per monitor refresh any other way looks glitchy.
12  Java Game APIs & Engines / Java 2D / VSync on: 2012-11-09 22:42:49
I know this has been asked multiple times but does anyone know if there is a way yet to synchronize to the VSYNC pulse for Java2D. There is simply no way to get smooth motion without it and I can't find any information on how to do it.
I found some references to an API being added in 7 but nothing on the API itself. Is there anything in JavaFX?
13  Games Center / Contests / Re: Liberated Pixel Contest - Anyone taking part? on: 2012-07-02 18:33:32
The art phase is done and there is some pretty useful stuff, code phase has stated.
14  Games Center / Contests / Re: Liberated Pixel Contest - Anyone taking part? on: 2012-06-18 23:52:55
The style guide is done (an interesting read) and the art phase has begun. Already a ton of useful stuff.
15  Discussions / General Discussions / Re: Who do you use for your web hosting? on: 2012-06-10 22:24:01
I decided to go with WebFaction as 123systems seemed a bit sketchy. So far I'm impressed, FTP uploads are much faster and more reliable than they were on Godaddy and the control panel is pretty nice.
Thanks for the recommendations!

16  Discussions / General Discussions / Re: Who do you use for your web hosting? on: 2012-06-08 17:13:03
123systems.net seems really cheap, I didn't realize you could get a VPS for that price. Might have to give them a go.
17  Discussions / General Discussions / Who do you use for your web hosting? on: 2012-06-07 20:17:21
I have been with godaddy since I created my site years ago. Overall they haven't been too bad (after you get through the initial having to opt-out of 100 useless paid add-ons). I've been planning to migrate away from them for ages but never got round to it.
It's really hard to find a cheap hosting company that doesn't look dodgey as hell so I thought I would ask you guys who you use and what you think of them. I have been looking into doing more server-side stuff lately and am not really keen on PHP (the only option for GoDaddy economy) so I'm after a server that has at least Python and preferably Java servlets (if it doesn't double the price).

Hosting CompanyPlanCost (per month)GoodBadWould I reccomend
Godaddy.comEconomy Linux$5.99Realtively cheap/reliableHorrible corporate giant, PHP OnlyNot really
18  Discussions / General Discussions / Re: Oracle vs Google on: 2012-05-07 22:09:05
Given the jury instructions were to assume that API's are eligible for copyright there is really no way they could find that google hadn't infringed. I also think that if API's can be copyrighted the fair use defense doesn't make much sense (they copied a substantial portion of the API). It would probably have been better to have a complete verdict of infringement + no fair use and then have the Judge rule that API's can't be copyrighted (something he has indicated he will be deciding).
19  Discussions / General Discussions / Re: Rasberry Pi stuff... on: 2012-05-03 19:11:49
Seems Oracle are actively working on this:

http://hardware.slashdot.org/story/12/05/03/1553230/javafx-runs-on-raspberry-pi

20  Discussions / General Discussions / Re: Oracle vs Google on: 2012-04-17 22:19:03
I would love to know why the negotiations broke down over licencing java. It would seem Google did see this coming so I hope they have a strategy for how to deal with it.
21  Game Development / Game Play & Game Design / Re: Good 8-bit music synthesizer? on: 2012-04-16 23:29:50
I've done a ton of standalone synths for music  but not really much for games. With music synths it's ok to use 90% of the CPU getting it to sound really good but this isn't really an option with games. The closest would be the super cut-down one I did for Java4K here.
22  Discussions / Miscellaneous Topics / Re: 0x10c on: 2012-04-13 20:11:43
When he first announced the project I thought the virtual cpu idea was plain weird and didn't make a whole lot of sense in a game. Why not just include a scripting language that would be far more efficient to run and easier to code for?
But having seen the gigantic instant community that has sprung up around it and people talking about learning programming just to play the game I am both baffled and somewhat in awe.

23  Discussions / General Discussions / Re: Does really game development on Java suck? Why are we still here? on: 2012-04-13 02:34:46
I personally can't stand boost, I'm never quite sure what it's doing and the compile errors can be a nightmare to decipher. I've found Qt to be an excellent alternative, along with a complete nice cross-platform gui library it also has it's own stl/boost equivalent. It has a super fast thread-safe shared memory construct used for strings/images etc.

In Qt:
1  
2  
3  
4  
5  
6  
 QString str;
 QStringList list;

 str = "Some  text\n\twith  strange whitespace.";
 list = str.split(QRegExp("\\s+"));
 // list: [ "Some", "text", "with", "strange", "whitespace." ]
24  Discussions / General Discussions / Re: Does really game development on Java suck? Why are we still here? on: 2012-04-12 16:38:43
Quote
The stages of operator overloading transcendence:
1) I will rage quit if my language gets it.
2) OK, in the narrow case of stuff that interests ME, then it's okay.  Everyone else can go <XXX>!
3) OK, I guess that other people actually do have valid usages.
4) What? How did I ever live without this.

You moved quickly from stage 1 to 2, so all you need to do to get to stage 3 is realize that a future you might be in the "everyone else" category.

I am actually at (and always have been) a "stage" that you didn't mention that consists of the following:

a) I will rage quit if my language gets it.
b) The opinion that operators are part of the definition of the language and should not be redefine-able.
c) The few use cases where it is a good idea should be part of the language definition.
25  Games Center / Contests / Re: Liberated Pixel Contest - Anyone taking part? on: 2012-04-12 16:29:51
So, with the donations the artists will be paid, and the developers are expected to do it for free. What's up with that mindset?
I think there a prizes for winners of both phases. I guess they may need to commission some artwork for the first phase to fill in submission gaps as the second phase is rather dependent on the art generated in the first.
Also I think it somewhat matches the differing mindsets of coders/artists, in my experience artists seem very protective of their work and feel they must be compensated for its use. Programmers on the other hand, tend to have difficulty convincing people to use their code.
26  Discussions / General Discussions / Re: Does really game development on Java suck? Why are we still here? on: 2012-04-11 23:39:05
I love operator overloading. 

Can you give one example where you do like it?  Because you'd never know it given the heated impassioned ranting against all the various instances it that was just put on display here.  Is it just the subset of operators you personally use?

I, for one, love operator overloading in the kind of calculations typically done in shaders. Not much else, oh, and in String concatenation.

Agreed which is why I wouldn't mind seeing a vector math library incorporated into the standard library with appropriately overloaded operators. Interestingly String concatenation is actually a pretty poor example of operator overloading because addition is commutable whereas string concatenation isn't. That said I have gotten so used to it I can live with it (VB uses an '&' operator for string concatenation which is probably a better idea).
27  Games Center / Contests / Liberated Pixel Contest - Anyone taking part? on: 2012-04-11 21:47:37
Love the idea, and I'll definitely have to have a go:

http://lpc.opengameart.org/

28  Discussions / General Discussions / Re: Does really game development on Java suck? Why are we still here? on: 2012-03-30 21:46:46
I'm a big fan of minimalist programming languages. If you want a language that gives you all the rope you want to hang yourself use c++. In my professional career I have seen so many more bad examples (eg  std::io) of operator overloading than good ones. The day Java gets operator overloading is the day I'm looking for a new language.
Currently I am much more limited by my inability to stay focused on a single idea than any issues with my chosen toolset.
29  Game Development / Performance Tuning / Re: Is a busy-wait Thead.yield() a good idea? on: 2012-03-28 17:52:17
This article is quite interesting:

http://www.javamex.com/tutorials/threads/yield.shtml

And it's probably worth testing your sync code on a few platforms to see if the behavior is consistent.
30  Game Development / Performance Tuning / Re: Is a busy-wait Thead.yield() a good idea? on: 2012-03-28 03:48:58
Looks interesting, how well does it work? What is the typical number of sleep(1) calls per frame? How often does it over-sleep and by how much?
Pages: [1] 2 3 ... 13
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Browse for soundtracks 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 (32 views)
2013-05-17 21:29:12

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

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

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

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

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

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

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

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

UnluckyDevil (145 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.152 seconds with 20 queries.