Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (707)
Games in Android Showcase (206)
games submitted by our members
Games in WIP (781)
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
1  Java Game APIs & Engines / Java 2D / Re: Acceleration for 2D rendering on: 2005-05-13 03:41:48
I changed the dimensions of the Images in use to powers of 2, which completely solved the problem. All rendering is now nice and fast.

Did using pow2 images give any speed increase or did it just fix the problem?
2  Java Game APIs & Engines / Java 2D / Re: Weird resolution problem on: 2005-05-13 00:46:21
I think a window / frame might give a zero width or height if they're requested before it is shown.
THis is just a guess.
You could maybe try doing a pack() before calling getWidth()?
3  Java Game APIs & Engines / Java 2D / Re: Relative Consistency across Resolutions on: 2005-05-12 05:28:28
Okay I've tried doing some scaling using jsut AffineTransorm and the results weren't so good for text.
I drew a string in a panel and then did the same on another panel with a 4d/5d scaling AffineTransform.
The size of the text changes okay, but it was rendered way too bold in the smaller version.
I tried setting a whole bunch of RenderingHints but that didn't fix the problem.

An idea I'd thought of was Rendering everything to a back buffer way bigger than the original resolution (e.g. x2 in each dimension) and then doing a scaled drawImage to get it onto the screen.
I think this would get me good consistency but I'm thinking the performance might suck doing interpolation from a massive image 50 times a second.

Any opinions on whether this is a good idea or bad?
4  Java Game APIs & Engines / Java 2D / Re: Relative Consistency across Resolutions on: 2005-05-11 23:15:58
OK, I'll give some of the ideas so far a go and see how things turn out.

Thanks for the help.

If anyone has any other, different ideas, or more information, please keep posting!  Smiley


5  Java Game APIs & Engines / Java 2D / Re: Relative Consistency across Resolutions on: 2005-05-11 02:48:47
Couldn't you just use:


at the start of your rendering method to scale up/down the image as desired?

I probably could - sounds like a nice, simple solution.
(I really am new to Java2D in this regard!)
This would require me to store the original resolution with the file, but that could work alright.

I assume that, if I use a transform, the drawing is done in the target coord system, after the coordinates are transformed, rather than drawn and then scaled?
Do you know if, internally, it will use doubles to represent the transformed coordinates?
If so, is this going to make straight lines look a bit funny? Like, anti-aliased into the next row/column a bit?

And how does a Transform work with Fonts?
Will it scale a 14 point font to 13.2555 or something?
Or will it draw the string and then scale it down?
And, whatever it does, will it look nice, or will it look like it's been scaled?  Wink

Thanks for help so far!
6  Java Game APIs & Engines / Java 2D / Re: Relative Consistency across Resolutions on: 2005-05-10 05:53:05
What you want is resolution independence. Take a look at java.awt.GraphicsConfiguration.getDefaultTransform() and getNormalizingTransform().

In the ideal world, all you'd need to do is to use these two methods to set the transform on your Graphics2D object, and your rendering will be scaled appropriately.


The bad news is that afaik in Sun jdk getDefaultTransform always returns identity. And if we were to fix it to return the correct transform based on the screen dpi, we'd probably break many applications which aren't DPI-aware.

It sounds like you're saying I should use getDefaultTransform() and getNormalizingTransform() except they're not implemented properly? Or they're okay, but I have to combine them, not just rely on the default transform? I'm not sure if you are saying this is a possible solution or that it is a theoretical solution that won't actually work, or won't look very good? If it's one of the latter, do you have any other suggestiongs?  Cheesy


Of course, you'd still need to make sure that you have different image banks for different DPI, since just scaling them won't look good.

Not sure what you're saying there.
I don't know what "image banks" are.
(Yup, I'm a n00b to complex Java 2D work).
If it matters, I'm not intending to have any sprite-like images. There will be large images involved (e.g. 800x600 and up), but everything else will be primitive shapes and text.

I should have mentioned in the original post that the application will be doing animation.
Are scaling-based solutions going to work for animation or is it too costly?
(That's a question for anyone with relevant experience.)
7  Java Game APIs & Engines / Java 2D / Relative Consistency across Resolutions on: 2005-05-10 01:34:49
I'm creating an application which, for lack of a better analogy, is a bit like PowerPoint (in its output, at least).
My intention is to have the resulting graphics appear relatively consistent on any machine.
By this I mean that a box that takes up 1/3 of the drawing area on the machine on which it was created should take up 1/3 of the drawing area on any machine, and a font size that fits 50 "m"s across the creating machine's screen should be adjusted to be 50 ems on any target machine.
I guess you could say it's a little bit like SVG, but I'll probably want the user to be inputting sizes as pixels, or something close, as this is what will make the most sense to them.

I have a couple of different ideas of how to get everything to be relative to the resolution, and I'd like to ask for comments on how people think they might work.
However, I thought I'd ask for ideas of how other people might do this first.

So, how would you make line/shape/font sizes relative to the resolution?
How would you store the sizes?
How would you use them to draw features and text?

I'll post my ideas tomorrow for criticism, but I'm keen to know what other people would do.
8  Java Game APIs & Engines / Java 2D / Re: Image Resizing on: 2005-05-04 03:22:37

And some people find that different way more visually appealing than the latter two.

I use getScaledInstance() in Easy Decal because I tried all the other options (that are standard in J2SE) and they just weren't acceptable. Maybe something to do with the fact that I'm working with pretty small images.
9  Discussions / Miscellaneous Topics / Re: Anyone Work In Japan? on: 2005-01-25 06:29:43
Hey, I'm in Sydney too!

Yeah, you in Manly. I like the idea of your game, and the name of course! Hope you can finish it as I'd love to play.

Back on topic, is anyone in Japan and wants to show me round their workplace?  Embarrassed
10  Discussions / Miscellaneous Topics / Re: Does Java have any text passing caps? on: 2005-01-25 06:27:56

Just thought I would point out that this expression is broken.

Oh, the perils of posting code without testing it.  Tongue
Thanks for pointing that out.

For completeness, an expression containing swpalmer's corrections would look like this:


Notice that, to allow '.' in a character class, I had to escape it with a backslash (\) because '.' is a special character. Same goes for plus, asterix, caret, dollar, etc.
11  Discussions / Miscellaneous Topics / Re: Software development in todays world on: 2005-01-23 18:30:11
If you don't remmember details of your code, you are in same situation as a future code maintenainer.

And it is that horrible experience that has cemented, for me, the importance of writing comments in my code.
Really, sometimes I come back after the weekend and don't know what a piece of code does. (*Strokes greying beard*)
Having comments saves me stacks of time trying to decipher code.
12  Discussions / Miscellaneous Topics / Re: Does Java have any text passing caps? on: 2005-01-21 09:52:27
Scripts as in like a script in some programming language?

In that case, you may want to have a look at JavaCC, which is a parser generator.
So far as I can tell (I've neve used it), you write the grammar for the language you need to parse and JavaCC generates a parser that will parse the grammar for you... into what I don't know.
I also don't know if it generates the parser pre-compile time (i.e. as .java files) or at runtime (as a hierarchy of objeccts).

They do supply grammars for a lot of existing languages, though, including Python (a scripting language).

If you have an assignment to write a parser, however (?), using JavaCC would probably be cheating.  Embarrassed
13  Discussions / Miscellaneous Topics / Re: Software development in todays world on: 2005-01-21 09:44:14
My opinion on self-commenting code: it's bollocks.
In fact, I believe it's one of the 7 excuses of highy lazy people.

Don't get me wrong, though.
I make my code as readable as possible, more so than almost anyone I know.  Cool
I keep my methods small (strive for < 1 screen).
I almost never use abbreviations for names.
I often use really long names that give the full meaning e.g. originalXScaleFactor as opposed to xScale1
I think hard about what I name my methods to make sure they read aloud and make sense (e.g. my logger has a "willLog" method, so you can write logger.willLog(level)).

But no matter how good my code reads, I always comment anything longer than a few lines.
The main reason is that you cannot read code.
You can look at the code, think about it in your head and "translate" it, per se, an then you know what it's doing.
But you always have to translate and this is a time-consuming process.
Comments, on the other hand, need no translation.
They tell you exactly what the code is doing, so you can know by reading one or two lines of English (very quick!).
Alternativey, you can translate ten lines of code in your head, which isn't fast at all, and also requires your brain to work harder.

If you write "readable" code, then comments aren't necessary.
However, they make maintenance and skimming a whole lot quicker, which makes the code "better", in the sense that it is much easier to understand.
14  Discussions / General Discussions / Re: CHeck out my new game - Risk clone on: 2005-01-21 09:23:19
Also, you can use a code obfuscator to protet your code rather than compiling to an exe.
Obfuscating basically messes around with your byte code in a way that doesn't change what the code does but makes it either hard or impossible to decompile (depending on the obfuscator/decompiler combination) and, if it is decompiled, very hard to understand.

Just Google for java obfuscator - there's plenty around and I here some of the free ones are pretty good.
15  Discussions / Miscellaneous Topics / Re: Does Java have any text passing caps? on: 2005-01-21 02:29:29
Regex: some examples will probably help.

Basically, you use it to find stuff within a string.
(Not sure if it works on streams?)

Say I wanted to see if a string ended in "doc", I would use the regex:


The '$' here means "end of string", or "end of line".
Correspondingly, a caret ('^') means start of string/line.

Regular expressions have lots of these special characters.
e.g. '.' (a period) means "any single character"
Putting an asterix (*) after anything means "zero or more of" whatever it followed.
Using a + means "one or more". So:


matches anything that starts with (because of the ^) one or more letter i's.

It gets more powerful as you put things together.
For example, the following expression will (kind of) tell you whether a given string is a valid email address:


They'll also let you find all instances of something in a string, e.g. if you used the pattern:


on the string "Check this if you wish to be notified of replies to this topic.", you'd get two matches.
As I already said, you can also use it to replace the strings that you find with other stuff.

Just note: this is all the power of regular expressions, not Java - Java just includes an implementation regular expressions. Many other languages have them, Perl probably being the most important.

You can get further info on regexs (in Java) at this tutorial and the java.util.regex.Pattern javadoc.

Do you have a specific task or type of task you need to achieve?
16  Discussions / Miscellaneous Topics / Re: Does Java have any text passing caps? on: 2005-01-20 21:36:57
There are also methods to parse all the primitive types from text (e.g. Integer.parseInt()).

Java 5 has a new class java.util.Scanner which is "A simple text scanner which can parse primitive types and strings using regular expressions."

Java also ships with XML-parsing capabilities.
Libraries like Apache Commons Digester can make it really easy (once you understand how it works) to read XML into an object hierarchy.
17  Discussions / Miscellaneous Topics / Re: Gaming jobs in Australia on: 2005-01-19 23:51:08
Must've been NZers. Tongue

I don't know why, but people seem to be scared of hiring New Zealanders.   Wink
18  Discussions / Miscellaneous Topics / Re: Gaming jobs in Australia on: 2005-01-19 11:42:54

Aren't they being outsourced?

Sorry - missed this question.

I believe the opposite is true.
Professional labour is often cheaper in Australia than in other countries, so quite a few OS developers are setting up shops here.
Aussies are also known (so I've heard) for being very hard workers, which is a must-have in the games industry (i.e. a love of pain).
19  Discussions / Miscellaneous Topics / Re: Gaming jobs in Australia on: 2005-01-19 11:38:59

I didn't want to start an OT discussion, but gaming jobs in Melbourne?

My understanding (purely from reading around a bit) is that Melbourne is the centre of Aussie games development, closely followed by Brisbane.
This doesn't mean that there's heaps of it going on in either city, though.

There's definitely game dev courses at Deakin, and I think other places, too.

Here's a list of AU companies that presented at E3 2004:

It doesn't have their locations, but you can follow the links and find out for yourself (which is I think how I came to my previous conclusion).

Why am I still up at 1:43 AM?  Cry

20  Discussions / Miscellaneous Topics / Re: Anyone Work In Japan? on: 2005-01-19 09:35:30
... a nice example being our smallest room (the toilet) is actually the biggest room in a japanese appartement.

Well, if anyone agrees to show me around their office, I'll definitely ask to inspect the toilet.  Cheesy
21  Discussions / Miscellaneous Topics / Re: Anyone Work In Japan? on: 2005-01-19 09:28:32
You live in Melbourne?

Nope - Sydney.
May move to Melbourne to get a gaming job someday, though!  Angry
22  Discussions / Miscellaneous Topics / Re: Do you listen to music when you code? ¬†Which on: 2005-01-19 09:24:11
I have almost all of my CD collection (200+ albums) on MP3 CDs at work.
Used to listen to music constantly at work, but seem to be less the last few months.
Maybe because I moved from the corner of the office to the middle, so there's a lot more talking to listen to.
Also, my headphone's padding has died after 5 years faithful service, which makes them uncomfortable after about an hour.

Music selection: very eclectic, spanning most genres except heavy metal and classical.

Here's some favourites.
Look them up - they're all good!  Cool

Rock: Stone Temple Pilots, Foo Fighters, You Am I
Funk: Parliament, Jamouraqai, G Love And Special Sauce
Pop: Ben Lee, Spearhead, Cat Empire
Dance: Ministry of Sound comps, Pnau
Electronica: Fatboy Slim, Moloko, Lamb
Alternative: Bjork, Regurgitator
Acid Jazz: Down to the Bone, Rebirth of Cool comps, D.I.G., Incognito

As you can see, I like a lot of music.  Tongue

erikd: When I put "Make My Funk the P-Funk" on, I literally jump up and down in my seat - must look quite weird, but who can help it? "You gots to get funked up!"

Matzon: Great station. Had it on 20 minutes now and love every song. Thanks for the tip!
23  Discussions / Miscellaneous Topics / Anyone Work In Japan? on: 2005-01-19 09:06:50
I'm going to be visiting Japan for a few weeks at the start of February (Jan 29 - Feb 12).
I'm wondering if anyone is working with Java in Japan and would be kind enough to give me a tour of their office and show me what they do?

I'm interested to see what the difference is between software development in Australia and Japan.
It would be especially good if I could visit a small (10-50 ppl) company, bu anything might do.
I'm not doing research or anything; just thought it would be an interesting thing to check out while I'm there.

I will be in Tokyo, Oosaka and Hakata over the time.
Please contact me at grlea @ if you would be willing to have me.

Oh yeah, and if anyone wants to suggest stuff I should see in any of those cities, please go ahead!
I basically have two weeks to kill in Japan while my wife is there on business!  Cheesy
24  Discussions / General Discussions / Re: Blu-Ray, Java, Consoles and Java Games on: 2005-01-17 01:59:20
Like he says, here's what he's "imagining".

Hmmm... so many criticisms.  :-/
You're all right, of course: the link is extremely tenuous, and the dream that Java will be deployed on consoles is more than likely exactly that - a dream.
But I'm not in a position to do any more than dream, except maybe to go learn OpenGL for C++....
So dreaming it is!   Grin
25  Discussions / Miscellaneous Topics / Internationlised Log Messages on: 2005-01-17 01:28:00
I have been heavily involved with several logging packages during my time, but had never considered this idea until I read today about someone doing it.

If you do or have done internationalised log messages, it'd be great if you could leave a comment about where, why and how hard/easy it was.
26  Discussions / Miscellaneous Topics / Re: Arrrrrgh, Swing! on: 2005-01-13 22:15:18
Some more resources for anyone still reading this thread, these presentations are great.

For people who think Swing is slow:
"Professional Swing: Threading"

For people with other Swing gripes (L&F, ease-of-use):
"Professional Swing: Creating Polished Applications"
27  Discussions / General Discussions / Re: Blu-Ray, Java, Consoles and Java Games on: 2005-01-13 01:35:04
"The specified thread
  • was not found"

Try this:
28  Discussions / General Discussions / Blu-Ray, Java, Consoles and Java Games on: 2005-01-13 00:17:13
I just made a post on JavaLobby re. a (very small) discussion about Sun become a "contributing member" to Blu-Ray and the likelihood of the standard advocating Java technology.

My feeling is this bodes well for Java games if next gen. consoles switch to Blu-Ray, as they should all then ship with a JRE.

What do other people think?
29  Discussions / Miscellaneous Topics / Re: Arrrrrgh, Swing! on: 2004-12-29 06:57:20
Swing is huge and slow and not very flexible.

That's a pretty derogatory claim to make without any justification.
I'd like to hear why you think this.
For what it's worth, here's why I don't agree with your sentiment...

Yes, Swing is quite large.
It is a large API, has a not-small memory footprint, and can take a while to load when an app first uses it.
However, Sun is working to reduce these problems with every release, and the improvements are noticeable.

Swing is not slow.
Many people have this impression because their limited Swing experience is with poorly-written applications that don't know how to use Swing.
In analog, if I pushed a Ferrari around a race track, that wouldn't make the Ferrari slow. It would make me naive.
It is easy to make a slow Swing application when you know nothing about its threading model.
When you actually know what you're doing, you can write fast, responsive, professional-quality applications on top of swing.
Commercial example: IntelliJ.
There are hundreds more examples of Swing being used in commercial production environments at Swing Sightings.
It wouldn't be being used for real applications if it really was slow.

Lastly, Swing is flexible.
It is extremely flexible!
I can't think of a reason why someone would think it wasn't flexible, so I can't really argue against the point.
But, in terms of flexibility, it is both customisable and extendable.
i.e. there are many places where you can change the specifics of how a Swing component works and, if you need something really different, it's pretty straight-forward to roll your own.
That's one of the very reasons that it's "huge", and also why many people find it complex when they start working with it.
As for me, I've always found a way to do what I want to do.
Sometimes it takes a bit of digging in the API, and understanding some aspect of Swing that I was previously oblivious to, but there's always been a way.

As I said at the top, I really would like to hear why you have the impression of Swing that you have, but my experience of real Swing applications is counter to your claims.
30  Discussions / General Discussions / Re: The Best Game you've Seen!!! on: 2004-12-23 22:57:04
PS - There is a free port of Chip's Challenge called Tile World.

Some freak has also created a whole site dedicated to Chip's Challenge:
Pages: [1] 2 3
Galdo (260 views)
2017-01-12 13:44:09

Archive (428 views)
2017-01-02 05:31:41

0AndrewShepherd0 (887 views)
2016-12-16 03:58:39

0AndrewShepherd0 (825 views)
2016-12-15 21:50:57

Lunch (960 views)
2016-12-06 16:01:40

ral0r2 (1193 views)
2016-11-23 16:08:26

ClaasJG (1293 views)
2016-11-10 17:36:32

CoffeeChemist (1319 views)
2016-11-05 00:46:53

jay4842 (1403 views)
2016-11-01 19:04:52

theagentd (1216 views)
2016-10-24 17:51:53
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55: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!