Hexxagon (LWJGL Applet)

Heres an attempt at a LWJGL Applet, its a board game.

Goal is to take over as much of the board as possible, the one with the most pieces at the end wins.

rules

  1. moving one space will cause you to create a copy there.
  2. moving two spaces away will cause you to jump there.
  3. when moving to a new space any pieces of the other player will be assimilated to your side.

http://kappa.javaunlimited.net/hexxagon/hexxagon.html

is possible to switch to fullscreen mode using the icon in the corner.

let me know how it runs for you or if you experienced any problems.

thx

edit
known bug. doesn’t seem to work with opera.

Runs fine on win2K java1.6 - apart from the scroll bars around the app in window mode…

pretty cool 8) runs well on XP. it’s extremely slow on my Vista machine (Java 6). Full screen work in both cases.

apart from the scroll bars around the app in window mode…

Ye, he forgot some style stuff. (So, you’re using IE then huh?)

Great game, looks really good and has excellent gameplay. The computer caned me though! it so quickly made all my dots blue ??? >:(.

I think the controls could be better - intuitively I tried to drag the peices but that didn’t work.

The negative stuff I’m saying next is not about the game, just crap stuff that happened:

Worked well as an applet, except the start-up was weird - first a weird number 333330000 or something in the bottom-left, then orange java logo animation in the top-right, then the LWJGL logo in the middle… hopefully applets will get less sucky in the future.

When I went full-screen and then tried to exit by pressing escape, the game froze and then the computer froze - had to pull out the plug to restart, alt-tab and ctrl-alt-del didn’t even work.

Win XP, java 1.6, 3ghz, intel integrated graphics card.

I’m really sorry but there is something wrong. After the download, your game had my web browser crashed! I was curious, I wanted to watch your board game. My config is :

  • Mandriva Linux 2007 Powerpack
  • Firefox 2.0.0.3
  • ATI radeon 9250 Pro
  • Xorg driver
    I tested it three times. It displayed “switching the …” very quickly and it crashed.

any crash logs ? - either from x, mandriva or java ?

Didn’t work for me (WinXP, Opera 9.21, Ti4200). It seemed the download stalled at ‘Receiving: hexxagon.jar (10%)’.

Just tried it again, now I got a message:“An error occurred while loading the applet… Fatal error occurred (7): null”.

The console showed the following:
Exception in thread “AWT-EventQueue-1” java.lang.NullPointerException
at org.lwjgl.util.applet.AppletLoader.paint(Unknown Source)
at org.lwjgl.util.applet.AppletLoader.update(Unknown Source)
at sun.awt.RepaintArea.updateComponent(Unknown Source)
at sun.awt.RepaintArea.paint(Unknown Source)
at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread “AWT-EventQueue-1” java.lang.NullPointerException
at org.lwjgl.util.applet.AppletLoader.paint(Unknown Source)
at org.lwjgl.util.applet.AppletLoader.update(Unknown Source)
at sun.awt.RepaintArea.updateComponent(Unknown Source)
at sun.awt.RepaintArea.paint(Unknown Source)
at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Fatal error occured (4): null
Fatal error occured (7): null

I get that under Opera too, it hangs with the LWJGL loading bar at about 10%.

Cas :slight_smile:

seems like its a problem with the way opera handles java applets, have submitted a bug report to them. My best guess is that it is not giving proper permissions to the applet even when you accept the certificate.

I hope it will help you. When some users experienced some crashes on my own game under Vista, they didn’t give me any log file or stack trace. Therefore, I know that this part of the log file is better than nothing (the whole log file was too big to be attached) :

An unexpected error has been detected by Java Runtime Environment:

SIGSEGV (0xb) at pc=0xb43cf545, pid=7944, tid=3033586592

Java VM: Java HotSpot™ Client VM (1.6.0_02-b05 mixed mode, sharing)

Problematic frame:

C 0xb43cf545

If you would like to submit a bug report, please visit:

http://java.sun.com/webapps/bugreport/crash.jsp

--------------- T H R E A D ---------------

Current thread (0x081bec00): JavaThread “AppletLoader.loaderThread” [_thread_in_native, id=8624]

siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0x00000000

Registers:
EAX=0x080e4478, EBX=0xb4a364b8, ECX=0x080e4b18, EDX=0x00000000
ESP=0xb4d0c99c, EBP=0xb4a196d6, ESI=0x080e5d70, EDI=0x10443d09
EIP=0xb43cf545, CR2=0x00000000, EFLAGS=0x00010206

Top of Stack: (sp=0xb4d0c99c)
0xb4d0c99c: b49e556c 080e4b18 00000000 080e5d78
0xb4d0c9ac: 080e4478 b4d0cb1c b4d0cb10 b4d0cb04
0xb4d0c9bc: b4d0cae4 b5308000 00000031 0132189a
0xb4d0c9cc: b4a33260 b4d0cb28 0810df48 b4d0ca2c
0xb4d0c9dc: b4d0cae4 00000000 b4d0cb1c 080d2108
0xb4d0c9ec: 08332498 080e0530 080e4b18 08332498
0xb4d0c9fc: 00000002 080e7970 00000001 00000038
0xb4d0ca0c: 080e5d70 0132189a 00000031 000000b0

Instructions: (pc=0xb43cf545)
0xb43cf535: 01 40 80 33 03 97 00 00 90 00 09 bf 09 3d 44 10
0xb43cf545: 00 22 01 a9 74 ac 05 00 40 00 00 bb 40 7f 00 20

Stack: [0xb4cbd000,0xb4d0e000), sp=0xb4d0c99c, free space=318k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C 0xb43cf545

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j org.lwjgl.opengl.LinuxCanvasImplementation.nFindVisualIDFromFormat(JILorg/lwjgl/opengl/PixelFormat;)I+0
j org.lwjgl.opengl.LinuxCanvasImplementation.findVisualIDFromFormat(ILorg/lwjgl/opengl/PixelFormat;)I+14
j org.lwjgl.opengl.LinuxCanvasImplementation.findConfiguration(Ljava/awt/GraphicsDevice;Lorg/lwjgl/opengl/PixelFormat;)Ljava/awt/GraphicsConfiguration;+7
j org.lwjgl.opengl.AWTGLCanvas.(Ljava/awt/GraphicsDevice;Lorg/lwjgl/opengl/PixelFormat;Lorg/lwjgl/opengl/Drawable;)V+6
j org.lwjgl.opengl.AWTGLCanvas.(Ljava/awt/GraphicsDevice;Lorg/lwjgl/opengl/PixelFormat;)V+4
j org.lwjgl.opengl.AWTGLCanvas.(Lorg/lwjgl/opengl/PixelFormat;)V+8
j org.lwjgl.opengl.AWTGLCanvas.()V+8
j util.AppletGameContainer$ContainerPanel.(Lutil/AppletGameContainer;Lutil/AppletGameContainer$Container;)V+6
j util.AppletGameContainer.init()V+120
j org.lwjgl.util.applet.AppletLoader.switchApplet()V+91
j org.lwjgl.util.applet.AppletLoader.run()V+180
j java.lang.Thread.run()V+11
v ~StubRoutines::call_stub

--------------- P R O C E S S ---------------

Java Threads: ( => current thread )
0x08335400 JavaThread “Image Animator 2” daemon [_thread_blocked, id=8628]
0x08334800 JavaThread “Image Fetcher 1” daemon [_thread_blocked, id=8627]
0x08333c00 JavaThread “Image Fetcher 0” daemon [_thread_blocked, id=8626]
0x082a0c00 JavaThread “AppletLoader.animationthread” [_thread_blocked, id=8625]
=>0x081bec00 JavaThread “AppletLoader.loaderThread” [_thread_in_native, id=8624]
0x08360400 JavaThread “AWT-EventQueue-5” [_thread_blocked, id=8623]
0x0815e800 JavaThread “thread applet-org.lwjgl.util.applet.AppletLoader” [_thread_blocked, id=8619]
0x0834a000 JavaThread “AWT-EventQueue-0” [_thread_blocked, id=8616]
0x08333800 JavaThread “AWT-Shutdown” [_thread_blocked, id=8615]
0x0816c000 JavaThread “Direct Clip” daemon [_thread_blocked, id=8073]
0x0814d800 JavaThread “Java Sound Event Dispatcher” daemon [_thread_blocked, id=8000]
0x082fc800 JavaThread “Thread-3” [_thread_in_native, id=7962]
0x082f2000 JavaThread “Thread-2” [_thread_blocked, id=7959]
0x082ee400 JavaThread “traceMsgQueueThread” daemon [_thread_blocked, id=7955]
0x082ed800 JavaThread “CacheCleanUpThread” daemon [_thread_blocked, id=7954]
0x082d1400 JavaThread “AWT-XAWT” daemon [_thread_blocked, id=7953]
0x080bdc00 JavaThread “Java2D Disposer” daemon [_thread_blocked, id=7952]
0x08086800 JavaThread “Low Memory Detector” daemon [_thread_blocked, id=7950]
0x08085000 JavaThread “CompilerThread0” daemon [_thread_blocked, id=7949]
0x08083c00 JavaThread “Signal Dispatcher” daemon [_thread_blocked, id=7948]
0x0807ac00 JavaThread “Finalizer” daemon [_thread_blocked, id=7947]
0x08079c00 JavaThread “Reference Handler” daemon [_thread_blocked, id=7946]
0x08051c00 JavaThread “main” [_thread_in_native, id=7944]

Other Threads:
0x08070400 VMThread [id=7945]
0x08088000 WatcherThread [id=7951]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
def new generation total 960K, used 522K [0x8c070000, 0x8c170000, 0x8c550000)
eden space 896K, 51% used [0x8c070000, 0x8c0e2bd8, 0x8c150000)
from space 64K, 99% used [0x8c150000, 0x8c15fff8, 0x8c160000)
to space 64K, 0% used [0x8c160000, 0x8c160000, 0x8c170000)
tenured generation total 4896K, used 3493K [0x8c550000, 0x8ca18000, 0x90070000)
the space 4896K, 71% used [0x8c550000, 0x8c8b9650, 0x8c8b9800, 0x8ca18000)
compacting perm gen total 12288K, used 3770K [0x90070000, 0x90c70000, 0x94070000)
the space 12288K, 30% used [0x90070000, 0x9041eb88, 0x9041ec00, 0x90c70000)
ro space 8192K, 73% used [0x94070000, 0x946506f0, 0x94650800, 0x94870000)
rw space 12288K, 57% used [0x94870000, 0x94f61d68, 0x94f61e00, 0x95470000)

Worked great on WindowsXP, Internet Explorer 6, Nvidia TNT2.

Extremely fustrating gameplay (I think I am just bad at boardgames).

I thought the LWJGL applet loader looked pretty cool.

Got one Exception that did not affect gameplay:


Sat Aug 25 18:31:47 BST 2007 ERROR:Failed to initialise controllers
org.lwjgl.LWJGLException: Failed to initialise controllers
	at org.lwjgl.input.Controllers.create(Controllers.java:61)
	at org.newdawn.slick.Input.initControllers(Input.java:729)
	at util.AppletGameContainer$Container.initApplet(Unknown Source)
	at util.AppletGameContainer$ContainerPanel.initGL(Unknown Source)
	at org.lwjgl.opengl.AWTGLCanvas.paint(AWTGLCanvas.java:306)
	at sun.awt.RepaintArea.paintComponent(Unknown Source)
	at sun.awt.RepaintArea.paint(Unknown Source)
	at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: net/java/games/input/ControllerEnvironment
	at org.lwjgl.input.Controllers.create(Controllers.java:38)
	... 16 more
Sat Aug 25 18:31:47 BST 2007 INFO:Controllers not available

Ah I remember this from the old DOS shareware days! Fun game.

Works fine in Mac OS X, except that it breaks tabbed browsing in Firefox (but I think all LWJGL/JOGL applets do that)

How about a framecap? It does use a lot of processor as is. People have annoying CPU fans in their laptops, you know :slight_smile:

congratulations for this nice applet !
I noticed that the sound doesn’t come back when I tried a second round against the computer player. but that sounds good! :wink:

Looking really Slick :wink:

Worked fine on FF 2.0, XP, jre1.6.0_02

Tried player vs player first and thought the A.I. would have a difficult time beating a human player as it ressembles something a bit like the game Go (which most ai algorithms have a hard time with)… but I got my ass kicked the first time! :-X

thx for the feedback, have capped the fps now, should use alot less cpu.

not quiet sure what you mean have tried in firefox and tabs seem to continue to work correctly, i tried in linux and win, could be a mac thing.

thx for pointing that out, have now found and fixed this.


http://192.18.37.44/forums/Smileys/classic/grin.gif

Would be nice to have a ‘hint’ option suggesting the best move - the AI’s just a bit too good for me!

[quote]not quiet sure what you mean have tried in firefox and tabs seem to continue to work correctly, i tried in linux and win, could be a mac thing.
[/quote]
Yeah, it’s a Firefox on Mac thing.

It still crashes. :frowning: