Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (616)
Games in Android Showcase (173)
games submitted by our members
Games in WIP (659)
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 ... 6
1  Games Center / WIP games, tools & toy projects / Re: TinyChess on: 2015-08-18 12:13:55
You should implement castling as this is a basic move in chess.

You should try to have some basic idea of positioning ie
  • knights to the centre
  • rooks on open files
  • number of squares controlled by a piece
  • pawns to the centre
  • doubled pawns are generally bad
  • king far away from centre
also remember it's not the number of pieces but their value ie a queen is approx 9 pawns. Does it look ahead at all - I'm guessing not at the moment?
2  Games Center / WIP games, tools & toy projects / Re: TinyChess on: 2015-08-18 09:52:53
I'm impressed you can get it down to 60kb! It makes reasonably intelligent moves but I guess the small size of the program rules out much positional logic. This got it a little unstuck as after a dozen moves it was down a piece, had tripled pawns and it's king was stuck in the middle of the board. I couldn't work out how to castle which did nearly loose me a piece. I also had to start out as black as it wouldn't show the board when I tried playing as white.

I do know how difficult it is writing a chess program though - here's mine if you care to try it out Smiley

3  Games Center / Showcase / Re: New (old style) arcade game - Alien Swarm on: 2015-05-14 15:10:29
I would like to see something replace those life/weapon/shield buttons though, it just seems to break the theme.

Running the game via the .jar means I just have a black screen, but the game still plays, perhaps -Dsun.java2d.noddraw=true isn't set by default when running the .jar. If I run it via the .bat, it draws in a very grainy way, perhaps a low color depth screen mode is being selected, even when effects is set to off.
I've just altered the program to take bit depth into account when deciding the resolution. You'll need to download the zip again. Hopefully it will be less grainy now. You will still have to click the bat file to run the program unless you specify the nodraw option in the command line.
4  Games Center / Showcase / Re: New (old style) arcade game - Alien Swarm on: 2015-05-14 13:42:03
I've just finished a rewrite of the game and I think I've just about finished it now  Roll Eyes
  • It now runs at a higher resolution and has a number of better images
  • Trophies are awarded and you're shown which trophies you've earned in the moving splash screen
  • You can scroll through the various splash screens with cursor left and right
  • There is a global high score for each of the 6 levels
  • The aliens have better fire power with two types of explosive fire
  • There are nice sliding icons telling you useful info
  • More particles
  • More stuff but I can't remember what I've done

It would be nice to know:
  • if the game runs at full screen for people
  • is it too easy/too hard
  • do the levels and trophies make sense
  • does the high score system make sense
  • any other suggestions

Download the zip or just go to it's home page.

Cheers Mike
5  Discussions / General Discussions / Re: Java and GPU's on: 2015-03-14 20:02:19
Many thanks for the info.
I'll try it out.
6  Discussions / General Discussions / Re: Java and GPU's on: 2015-03-14 18:02:48
It depends on what you're talking about. Java2D? JOGL? libGDX? Something else?
Just the standard drawImage method.

I wouldn't say there is 1 best resolution, but rather the native resolution of the screen is the best.
But different computers & monitors have different resolutions. My 24" monitor has 1920x1080 while my Linux laptop is 1366x768 while my old netbook is 1024x600. If the game adapts to different res then obviously the game difficulty changes. I was kind of hoping that someone could just say "you just need res NxN and it will work perfectly everywhere". At least that's what I was hoping.

That's strange, I've never seen that before and a Google search didn't yield any results. Maybe a code sample?
The code is quite simple stuff
   public final Font Charfont = new Font("Impact", Font.BOLD, 30);
   og.setFont( Charfont );
   og.drawRect( x,y+10,120,40 );
   og.drawString("Set up", x+26, y + 40 );

On the PC the text appears perfectly centred in the rectangle, on Linux it's off to the side. Thinking about it, it may be the fonts that are wrong - but I would of thought if you specify a particular font then you'd get that font.
7  Discussions / General Discussions / Java and GPU's on: 2015-03-14 16:21:31
When Java draws an image does it store the image on the GPU so when the image is redrawn it requires minimal processing or does it move the image file back and forth between the CPU and the GPU? Just curious really.

Also what is the best resolution to produce full screen games in? Obviously there's a cross over between high res and speed but do all screens support all resolutions? Is there a standard res that works on everything? even on steam? I only ask because the last game I did was 640 x 480 and I definitely had issues on some PC's.

Another odd thing I found was that text appeared in slightly the wrong place when running on Linux machines - it was as if the xy position was for the top left of the text on windows but the bottom left when running on Linux. This caused my image boxes and associated text to look crappy on Linux. I ended up using an image for the text instead of drawString. Thoughts?
8  Game Development / Newbie & Debugging Questions / Re: Issue with changing screen res in windows aero = black screen. on: 2015-01-08 12:54:34
Thanks for looking. Did you try clicking the bat file or the jar? The bat file normally gets round the black screen issue but just not for aero.
9  Game Development / Newbie & Debugging Questions / Re: Issue with changing screen res in windows aero = black screen. on: 2015-01-08 08:56:53
I asked one of my more knowledgeable users about the drivers on his PS and he replied:
I posted the bat file along with a link to the themeswitcher program I used in it in the thread. Feel free to use it or adjust as needed if you want to include a separate bat file for others with the problem.

It's not a graphics driver issue but something to do with the aero interface and how it introduces transparency etc. for the desktop since windows 7 no longer supports 8 bit settings under aero (also default lowest resolution is 800x600 unless you go into advanced settings and have it display all modes ) -- due to this somehow windows selects the wrong color palette when the game is launched resulting in a weird looking display ( like the photo I posted in the thread ) - Many older games experience the same problems and for many of them there are registry settings that can be done to reset which palette is used to fix it but since this game uses JAVA it does not have the registry keys or ID for compatibility to make that change like you can for an .exe ( see this thread for a discussion about the registry change for older games - )

I've run into the problem on a couple other older games but they had updates released (not sure what the update did but it might be making the registry adjustments  :dunno ) - After reading a few articles on it I came across one for Wireshock that mentioned :

Modern PCs default to 32-bit true color graphics locally, but 256-color is
widely used to make remote desktops quicker and less bandwidth hungry. Hey,
even 16-color modes are used, and there's no reason Wireshark needs thousands
of colors even with colorized packet lists.

Note: If you want to test this with hardware and/or a Remote Desktop client
that doesn'
t let you set low color depth, save the .rdp file, open it in a text
editor and set "session bpp:i:8". Note also that on Windows 7 you don't want an
aero theme with 256 colors; choose something like the Windows Classic theme

So decided to try the Basic Theme and that fixed the problem - Not sure how else to fix it but this works and with the bat file it just slows the game launch by a few seconds so isn't a big deal here. ( Not sure if any other Java programmers might know of a fix other than switching the theme back and forth but you might check some of the JAVA forums. )

I'd like to say I fully understand the issue (or the answer) but I don't.


PS sorry for entering the centre quote as code but I can't see how to indent that part or change it's colour to make it clear it's a separate piece.
10  Game Development / Newbie & Debugging Questions / Re: How to instal Java 8 over 7 on: 2015-01-07 21:58:29
I must admit I think we have different definitions of the phrase "easy to use" Smiley
I was hoping to download a tool, click on my jar and magically get an exe I could give out.
I read your post a few times and I'll admit I'm not sure how to proceed.
11  Game Development / Newbie & Debugging Questions / Re: Issue with changing screen res in windows aero = black screen. on: 2015-01-07 21:55:42
So people need to have the latest drivers to achieve 640x480 resolution gaming? Huh
12  Game Development / Newbie & Debugging Questions / Issue with changing screen res in windows aero = black screen. on: 2015-01-07 10:14:49
I'm trying to release a new version of my game and I'm getting a few issues. A knowledgeable user emailed me to say

"The new version will not work under Windows 7 64 bit (not sure about 32 bit) with the Aero theme -- It distorts the 256 color palette or goes to a black screen. Found a way to get around it by changing the Desktop Theme to windows Basic (which turns off Aero and it's effects)"

Can I get round this in code as it seems a bit much to expect users to have to do this?

I have a bat file that runs the program using

java -jar -Dsun.java2d.noddraw=true AlienSwarm.jar

and this seemed to fix things for me but obviously not for him.

Game is here if it helps.

Cheers Mike
13  Game Development / Newbie & Debugging Questions / Re: How to instal Java 8 over 7 on: 2015-01-06 21:00:49

I'm quite willing to give it a try.
Is your tool easy to use (for a novice)?
My OS is Win7.
I have a standard jar. There's no file access etc. My jar runs fine on Java7 (I assume it would run on 8 but I'm guessing here).
The app gets called with "java -jar -Dsun.java2d.noddraw=true AlienSwarm.jar" which fixes a problem with some drivers not working at 640x480 res.

I d have Ubuntu running on a laptop but the game won't run in full screen mode on my laptop for some annoying reason plus the sound never seems to work properly in Linux.


"Java - write once, run anywhere" - Yeh, right...   Roll Eyes
14  Game Development / Newbie & Debugging Questions / Re: How to instal Java 8 over 7 on: 2015-01-06 13:13:39
You didn't get what OP is asking. He is asking how he can install Java 8 over Java 7, he wants to upgrade not downgrade.
Actually I just want people to be able to play the game with as few problems as possible. I don't care too much how I do it. This is what I've tried so far:

  • I initially started with applets but they became unfashionable and people said web start was the way forward.
  • I genuinely thought web start was the bees knees as it installed on user PC's, I could still release updates and I could set java versions etc, etc. Then they changed the licensing/security thing and it effectively meant I couldn't use it.
  • I then tried as a java application but users genuinely just wanted an exe.
  • I could only create the exe's with help and obviously it will only run on PC's doing this.
  • I'm now trying the jar application approach again but I'm getting issues with users having different versions of java.

I really just want people to be able to click the game and be able to run it without issues.


"Java - write once, run anywhere" - Yeh, right...  Roll Eyes
15  Game Development / Newbie & Debugging Questions / How to instal Java 8 over 7 on: 2015-01-06 09:06:17
I recently released a new version of a game I was writing and someone replied that it won't run with his Java 8.

I tried installing the latest JDK on my Win 7 PC. It said it loaded fine. I then tried to see whether it was running fine with
java -version
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)

So am I running Java 8?
Will users with Java 7 now not be able to play?
Is there a simple solution?

Cheers Mike
16  Discussions / General Discussions / Re: Java & Linux Chromebook: problem running my application in fullscreen on: 2014-08-13 20:04:32
The exclusive fullscreen mode of AWT has been broken under GNU Linux for several years. Most of the time, depending on the window manager, I still get the task bar above the fullscreen window.

How does it fail? Please can you give us more details?
It wouldn't bother me too much having a small task bar - it's obviously not perfect but it's better than the little 640 x 480 window I'm getting at the moment. I should of said what's currently happening shouldn't I Roll Eyes

oh, you are using Graphics2D ?
I'm just using
for( DisplayMode dm : device.getDisplayModes() ) {
            if (   dm.getWidth() >= ScreenWidth
               && dm.getHeight() >= ScreenHeight
               && dm.getBitDepth() >= 16
               && dm.getRefreshRate() >= 60 ) {

               try {
                  if ( device.isFullScreenSupported() ) {
                     if ( device.isDisplayChangeSupported() ) {
                        device.setDisplayMode( dm );
               } catch ( Exception e ) {


to get the full screen which works on most windows screens but then I usually also call the jar with the following which tends to make it work for nearly all the windows screens I've tried (even my own 24" wide screen). It doesn't seem to have any effect on Linux.
java -jar -Dsun.java2d.noddraw=true AlienSwarm.jar

I use double buffering and paint, drawImage etc to build the screens.
17  Discussions / General Discussions / Java & Linux Chromebook: problem running my application in fullscreen on: 2014-08-13 17:19:58
I have my Java game I wanted to put on my chromebook. It works at 640 x 480 resolution and then adjusts the screen mode using device.getDisplayModes(). This works fine on most monitors but for some reason fails on my chromebook. The above method tells me it does have that resolution.

Any idea what I have to do?
18  Discussions / General Discussions / Re: Fewer end users? on: 2014-03-28 10:20:16
So do I get a nice concise argument for why they shouldn't remove Java from their systems for when moderators on that site suggest they do? Preferably in a way that Joe public (and I) can understand. Or should I just accept that the only way I can release software is as an exe and expect Joe public to download a new runtime for each install.
19  Discussions / General Discussions / Re: Fewer end users? on: 2014-03-27 13:37:50
Ended up just going Steam-only for simplicity's sake.
Is there a guide on how to do this. How much efforts required? You mentioned C++ before. What restrictions are in place? is there a sort of Steam emulator?
20  Discussions / General Discussions / Re: Fewer end users? on: 2014-03-27 12:58:27
Or even more to the point...why care about what people think?
tell that to Betamax
21  Discussions / General Discussions / Re: Fewer end users? on: 2014-03-27 12:19:18
We've been down that road before, having 100mb downloads is not a problem that needs solving in this day and age of high bandwidth.
Perhaps. I know if I saw a download for a little game that was 100MB then I'd probably move on. I guess we're all different. I know for my server I have to pay for bandwidth (I believe 20GB a month) which would mean at max I could only every have 200 downloads a month and that's not taking into account general usage of the site. I wonder what the cost of running this site might be if the average download here became 100MB?
22  Discussions / General Discussions / Re: Fewer end users? on: 2014-03-27 12:00:07
Perhaps we should have a little tutorial on how to bundle things as an exe. I've posted on here asking how to do this but I'll admit I find the various tools a bit (actually very) confusing. I guess it would be too much to expect the java compiler to optionally produce an exe for various OS. I assume this would be way more compact than producing 100MB downloads that play noughts and crosses.
23  Discussions / General Discussions / Fewer end users? on: 2014-03-26 20:54:08
I'm an advisor on a PC forum and I've noticed a strong dislike of Java these days. Here's an example from one of today's threads:
"I still strongly feel most people would be better off without Java and, if they have software that depends on Java, replace it with software that doesn't require it. It may require buying some of the software needed and/or learning how to use new software (granted, that can be daunting) but that is better than leaving one's computer vulnerable to attack. "
Is anything being done to reverse this general opinion? I know Java 8 has Lamda expressions but perhaps 8.1 might have something that will encourage users to trust Java again.

PS I advise on PC builds and not on Java
24  Discussions / General Discussions / Re: JDK 8 is released on: 2014-03-20 16:49:25
That's all well and good but if you've already spent time creating the damn things then you want them to continue working. What you don't want is the language to suddenly change and make all your stuff either obsolete or so difficult to run that any rational end user would simply give up. I also don't want to have to rewrite my code just so they can continue working with whatever flash in the pan technology is introduced with each time. I believe most languages, including Java, try to ensure that, once you write a program, it will stay working in future versions. That's not the case here.

Webstart suited me great because a user could run an application from the web and/or install it on his desktop with a nice icon. Additionally, I could offer updates and these would be passed out to users meaning I don't have to worry about umpteen different versions of the program being active at the same time. The user didn't need a degree in IT to run them either. As a final benefit I didn't have to send out anything from my server unless there was an software update so I had less bandwidth issues.

I could embrace ASM.js or Emscripten (whatever they are) but who's to say they won't be just as obsolete in a years time. I simply want some stability. If I had a set of features that worked well (webstart) then I don't want all that capability to just disappear over night. It took me quite a while to embrace webstart because I wanted to make sure I wouldn't have the rug pulled from underneath me. I guess I didn't wait long enough  Sad

Perhaps in a few years I might understand what lamda expressions are or I might even find some rational use for them. For the moment you'll have to forgive me that I'm not jumping up and down for joy with the latest Java version  Undecided
25  Discussions / General Discussions / Re: JDK 8 is released on: 2014-03-20 12:30:21
If you need some help to get rid of those warnings, let me know. I agree with you but I'll probably have to buy a "trusted" certificate Sad
I tried to PM you but you don't seem to have that facility. What is possible regarding all the warnings? Should I start another thread?
26  Discussions / General Discussions / Re: JDK 8 is released on: 2014-03-19 20:28:06
That can never happen. The whole concept of trusting arbitrary code to run without asking permission (as it does when you just happen across it on a web page for example) is about the worst idea ever conceived.
But if it's running within the sandbox then does it matter?

If I download an exe of the web and run it (after virus scanning etc) then I get fewer warnings then when I try to run a sandboxed Java app ... go figure.

EDIT: I'm fine with it asking permission but surely if you click the webstart icon then doesn't that kind of imply you want to run the program. What I object to is all the warnings that show up.
27  Discussions / General Discussions / Re: JDK 8 is released on: 2014-03-19 20:03:20
I used to release little games as applets and I thought Java was great. I then turned to webstart where people could run your stuff from their desktop. I thought Java was great. Then they released 7.21 which made applets and webstart programs show up with huge security warning popups. These programs stayed entirely within the sandbox but Java doesn't seem to trust itself. I could pay for a certificate (and that's assuming they'll give me one) but I just look upon it as extortion.

It's nice to see that they're doing another release but personally I'd put "having programs run without loads of warning popups" higher on the priority list than whatever "lamda expressions" are.
28  Discussions / General Discussions / Re: Jar not working? on: 2014-03-19 19:40:32
He mentioned that he'd updated his OS (on apple) and it must have upset Java. He then uninstalled Java and re-installed and things worked again. I'm not sure why this would of happened but at least I have an answer if anyone else has the same issue. Thanks for helping.
29  Discussions / General Discussions / Re: Jar not working? on: 2014-03-16 12:38:19
I'll ask him and get back.
30  Discussions / General Discussions / Re: Jar not working? on: 2014-03-16 11:55:06
I'm confused then. My (not so IT literate) apple friend sent me the following error and said it just wouldn't run on apple.


PS - I'd just like to say thanks to you all for replying so fast - I'd didn't expect any responses for a few days!
Pages: [1] 2 3 ... 6
Coldstream24 (16 views)
2015-09-03 00:41:28

Andrew_3ds (26 views)
2015-09-01 19:08:10

afikri (17 views)
2015-08-31 09:30:22

afikri (25 views)
2015-08-31 09:30:07

afikri (13 views)
2015-08-31 09:27:24

afikri (16 views)
2015-08-31 09:26:40

Roquen (30 views)
2015-08-29 11:30:54

GamerC4 (36 views)
2015-08-22 20:38:50

GamerC4 (33 views)
2015-08-22 20:37:18

GamerC4 (40 views)
2015-08-22 20:37:01
HotSpot Options
by Roquen
2015-08-29 11:33:11

Rendering resources
by Roquen
2015-08-17 12:42:29

Rendering resources
by Roquen
2015-08-17 09:36:56

Rendering resources
by Roquen
2015-08-13 07:40:51

Networking Resources
by Roquen
2015-08-13 07:40:43

List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30 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!