Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (603)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  Space prototype thing  (Read 7823 times)
0 Members and 1 Guest are viewing this topic.
Offline dishmoth
« Posted 2009-10-25 14:00:14 »



This work-in-progress (the bastard offspring of the Community Project from earlier in the year) might one day become a 'Space' game.

Click and hold with the mouse to turn.  Click and hold inside the targetting circle to move forward.

I haven't had much experience with OpenGL (JOGL2 specifically) so feel free to tell me of any errors or glitches.  Also, I haven't made any attempt to optimize the code at this stage, so my apologies if it's really slow on some hardware.  (Frames-per-sec and other debug information appears in the Java console window if that's open.)

Any feedback welcome.

Simon

Update: The original version may crash on some machines.  This version should be more reliable, but it may run a bit slower.

Update 2: Source code (uses JOGL2).

Online Abuse

JGO Knight


Medals: 14


falling into the abyss of reality


« Reply #1 - Posted 2009-10-25 14:10:30 »

Webstart fails to launch.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
java.lang.reflect.InvocationTargetException
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at com.sun.javaws.Launcher.executeApplication(Unknown Source)
   at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
   at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
   at com.sun.javaws.Launcher.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ExceptionInInitializerError
   at javax.media.opengl.awt.GLCanvas.<clinit>(GLCanvas.java:78)
   at Space.MainWindow.<init>(MainWindow.java:120)
   at Space.MainWindow.main(MainWindow.java:41)
   ... 9 more
Caused by: javax.media.opengl.GLException: No profile available: [GL2, GL2ES2, GL2ES1, GLES2, GLES1, GL2GL3, GL3]
   at javax.media.opengl.GLProfile.<clinit>(GLProfile.java:750)
   ... 12 more

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline SimonH
« Reply #2 - Posted 2009-10-25 15:21:53 »

Webstart fails to launch.
Same here...  Undecided

People make games and games make people
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline CommanderKeith
« Reply #3 - Posted 2009-10-25 15:33:43 »

Worked here, great graphics. Very nice and soft and anti-aliased. Planets look cool, coming along nicely  Cool

Offline dishmoth
« Reply #4 - Posted 2009-10-25 15:51:35 »

Webstart fails to launch.

1  
javax.media.opengl.GLException: No profile available: [GL2, GL2ES2, GL2ES1, GLES2, GLES1, GL2GL3, GL3]


I hate computers.

Okay, assuming that the error message is pointing the finger at my use of GLProfile, I've cut-and-pasted bits of code at random from the JOGL2 demos.  And moved some of the lines of the JNLP file around for good measure.

Maybe it will work now.  And maybe it won't.

Either way, thanks for giving it a go.

Simon

Offline SimonH
« Reply #5 - Posted 2009-10-25 15:57:39 »

And maybe it won't.
Undecided It now briefly opens a blank window then just crashes out...

People make games and games make people
Offline teletubo
« League of Dukes »

JGO Ninja


Medals: 48
Projects: 4
Exp: 8 years



« Reply #6 - Posted 2009-10-25 15:58:13 »

Undecided It now briefly opens a blank window then just crashes out...

the same here

Online Abuse

JGO Knight


Medals: 14


falling into the abyss of reality


« Reply #7 - Posted 2009-10-25 16:06:41 »

Works for me now  Cheesy

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline dishmoth
« Reply #8 - Posted 2009-10-25 16:07:53 »

Undecided It now briefly opens a blank window then just crashes out...

Ah, well that's a great improvement. Tongue

I can't think of any other loose connections to wiggle at the moment.  I'll have to try debugging on a different machine.

Sorry for the inconvenience.

Simon

Offline sloesp

Senior Newbie





« Reply #9 - Posted 2009-10-25 16:10:16 »

It works fine for me. Looks totally awesome! Sort of Frontier-ish. Keep it up! 
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline indexunknown

Junior Devvie





« Reply #10 - Posted 2009-10-25 16:29:45 »

Update seems to run without a pause for both logic and graphics.
Online kappa
« League of Dukes »

JGO Kernel


Medals: 81
Projects: 15


★★★★★


« Reply #11 - Posted 2009-10-25 16:41:04 »

works great for me, nice work.
Offline adon_y_coya

Senior Newbie





« Reply #12 - Posted 2009-10-25 16:42:40 »

Works fine - no glitches or pauses. Good work!
Offline dishmoth
« Reply #13 - Posted 2009-10-25 17:57:57 »

Update seems to run without a pause for both logic and graphics.
I'm not sure what you mean by this.  Is the application hogging the CPU?  (I'm using the Animator class in the same way that the JOGL demos do, and I assume that that's yielding as necessary.)
Simon

Offline dishmoth
« Reply #14 - Posted 2009-10-25 18:12:04 »

Undecided It now briefly opens a blank window then just crashes out...
Debugging the old-fashioned way...
I've added some extra output statements to the code.  If anyone can tell me the last line to appear in the Java console window before the crash then I'll be one (tiny) step closer to fixing the problem.
Thanks,
Simon

Offline indexunknown

Junior Devvie





« Reply #15 - Posted 2009-10-25 18:42:19 »

Cpu at 100% and Gpu at 99% which means that the built in timing doesnt work.
Offline dishmoth
« Reply #16 - Posted 2009-10-25 19:59:32 »

Cpu at 100% and Gpu at 99% which means that the built in timing doesnt work.

Ah, okay.  Thanks for the feedback.

I'll see if I can do anything to fix that.  (The Animator class does seem to be yielding regularly, but maybe there's something else I'm doing wrong.)

Thanks
Simon

Offline moogie

JGO Ninja


Medals: 15
Projects: 6
Exp: 10 years


Java games rock!


« Reply #17 - Posted 2009-10-25 21:19:10 »

works well for me as well (win xp 32bit java 1.6.0_13)

not too sure about the control interface, but i guess it is something to get used to Tongue

Looks very nice! i dont think i would want to be on those planet spinning that fast tho.... would get flung off!

Java4k RIP 2014
Offline Galaxy613

Senior Newbie





« Reply #18 - Posted 2009-10-26 03:22:27 »

Works here. (Win7, 64bit)

I really like. Smiley Get some basic trading, combat, and upgrading, and I dare say you'll have a fun little space game on your hands! I really like the looks of it so far so keep going!

Programming since 2001 (Technically Tongue )
Uses: BlitzMax, Java, C++
Computers: W7 Desktop and a Triple Booting Netbook.
Offline dishmoth
« Reply #19 - Posted 2009-10-26 08:31:00 »

Looks very nice! i dont think i would want to be on those planet spinning that fast tho.... would get flung off!
Thanks for the comments.  It's okay, the aliens have very sticky feet!

I like seeing lots of spinning planets all bunched up together.  If the Laws of Physics don't like it, they can find some other game to bother. Roll Eyes

Simon

Offline Mike

« JGO Spiffy Duke »


Medals: 87
Projects: 1
Exp: 6 years


Java guru wanabee


« Reply #20 - Posted 2009-10-26 10:46:16 »

can't start it, it crashes in the webstart with the following message:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
java.lang.reflect.InvocationTargetException
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at com.sun.javaws.Launcher.executeApplication(Unknown Source)
   at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
   at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
   at com.sun.javaws.Launcher.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.UnsatisfiedLinkError: no nativewindow_jvm in java.library.path
   at java.lang.ClassLoader.loadLibrary(Unknown Source)
   at java.lang.Runtime.loadLibrary0(Unknown Source)
   at java.lang.System.loadLibrary(Unknown Source)
   at com.sun.nativewindow.impl.NativeLibLoaderBase.loadLibraryInternal(NativeLibLoaderBase.java:199)
   at com.sun.nativewindow.impl.NativeLibLoaderBase.access$000(NativeLibLoaderBase.java:50)
   at com.sun.nativewindow.impl.NativeLibLoaderBase$DefaultAction.loadLibrary(NativeLibLoaderBase.java:88)
   at com.sun.nativewindow.impl.NativeLibLoaderBase.loadLibrary(NativeLibLoaderBase.java:126)
   at com.sun.nativewindow.impl.NativeLibLoaderBase$1.run(NativeLibLoaderBase.java:133)
   at java.security.AccessController.doPrivileged(Native Method)
   at com.sun.nativewindow.impl.NativeLibLoaderBase.loadNativeWindow(NativeLibLoaderBase.java:131)
   at com.sun.nativewindow.impl.jvm.JVMUtil.<clinit>(JVMUtil.java:53)
   at javax.media.opengl.GLProfile.<clinit>(GLProfile.java:625)
   at Space.MainWindow.<init>(MainWindow.java:122)
   at Space.MainWindow.main(MainWindow.java:41)
   ... 9 more


EDIT: It started the second time I clicked on the button and I saw the world, after less than a second java.exe crashed though.

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Offline SimonH
« Reply #21 - Posted 2009-10-27 03:14:41 »

Debugging the old-fashioned way...
I've added some extra output statements to the code.  If anyone can tell me the last line to appear in the Java console window before the crash then I'll be one (tiny) step closer to fixing the problem.
Hmm... difficult with webstart as console vanishes after crash (isn't there a way to keep that open? Man, I hate webstart!)
Seems to generate 3 planet textures OK, then crash out either during or immediately after the 4th...

People make games and games make people
Offline dishmoth
« Reply #22 - Posted 2009-10-27 09:48:24 »

Quote from: Mickelukas
can't start it, it crashes in the webstart with the following message:

Well, the first crash looks like it's probably Webstart's fault rather than mine.  That's clearly not the case for the second crash though.

Quote from: SimonH
Seems to generate 3 planet textures OK, then crash out either during or immediately after the 4th...

Interesting...  It's getting further than I'd feared at least.  (It starts rendering pretty much immediately after generating the 4th texture.)

Just to rule out any obvious JOGL2 issues, do you have any problems running the demos?

Simon

Offline SimonH
« Reply #23 - Posted 2009-10-27 14:03:58 »

Just to rule out any obvious JOGL2 issues, do you have any problems running the demos?
No problems with the demo...
Running your app from the command line does generate this astonishingly helpful error log;
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
#
# An unexpected error has been detected by Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x04579ad0, pid=1636, tid=2044
#
# Java VM: Java HotSpot(TM) Client VM (10.0-b22 mixed mode, sharing windows-x86)
# Problematic frame:
# C  [nvoglnt.dll+0x1a9ad0]
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

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

Current thread (0x03c98400):  JavaThread "AWT-EventQueue-0" [_thread_in_native, id=2044, stack(0x040b0000,0x04100000)]

siginfo: ExceptionCode=0xc0000005, reading address 0x0c55a7cc

Registers:
EAX=0x05076418, EBX=0x04ef00c0, ECX=0x05076428, EDX=0x40082e00
ESP=0x040ff5d8, EBP=0x00000000, ESI=0x0c55a7cc, EDI=0x00000002
EIP=0x04579ad0, EFLAGS=0x00010246

Top of Stack: (sp=0x040ff5d8)
0x040ff5d8:   06253b0c 00000000 04ef00c0 0457a0c9
0x040ff5e8:   00000005 00000000 00000000 00000005
0x040ff5f8:   062537cc 0457afd7 00000005 00000004
0x040ff608:   062537cc 06253300 04ef00c0 00000000
0x040ff618:   00000001 062534a4 06253408 00000008
0x040ff628:   04e35e00 00000004 04462ea7 00000000
0x040ff638:   04405af2 04ef00c0 06253300 26cf8740
0x040ff648:   03c98400 04ef00c0 040ff668 04407ad5

Instructions: (pc=0x04579ad0)
0x04579ac0:   89 10 83 c0 04 29 7c 24 14 8d a4 24 00 00 00 00
0x04579ad0:   66 8b 0e 66 03 cd 66 89 08 66 8b 56 02 66 03 d5


Stack: [0x040b0000,0x04100000],  sp=0x040ff5d8,  free space=317k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [nvoglnt.dll+0x1a9ad0]

[error occurred during error reporting (printing native stack), id 0xc0000005]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
v  ~BufferBlob::Interpreter
v  ~BufferBlob::Interpreter
.....etc.

There's lots and lots more (13K in all) of the same sort of gobbledygook which I had to trim off to fit this post. Am I missing something obvious or is webstart a big pile of smelly pants?
Can't you get it running as an applet? I want to see it working!  Cry

People make games and games make people
Offline Mike

« JGO Spiffy Duke »


Medals: 87
Projects: 1
Exp: 6 years


Java guru wanabee


« Reply #24 - Posted 2009-10-27 18:13:53 »

Worked fine on my home computer, no issues at all Smiley

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Offline dishmoth
« Reply #25 - Posted 2009-10-27 18:38:19 »

Running your app from the command line does generate this astonishingly helpful error log;
[...]
There's lots and lots more (13K in all) of the same sort of gobbledygook which I had to trim off to fit this post. Am I missing something obvious or is webstart a big pile of smelly pants?
Can't you get it running as an applet?

Hmm, I'm not fluent in gobbledygook, but that looks like it's a Java crash rather than a Webstart crash.  I don't know if running as an applet would help.  (Are applets better at reporting error logs than Webstart?  I've no particular reason for using Webstart rather than an applet, just inertia.  Although being able to resize the window is probably a good thing for this project.) 

Quote
I want to see it working!  Cry

Okay, let's try this.  I'm speculating that the crash is something to do with vertex buffers (no real reason for thinking that, just guessing wildly).  So I've temporarily uploaded a version (my original code for testing) that draws triangles one-by-one.

It's incredibly slow now.  But it might just work!

And if it doesn't work then I'll just bang my head against the wall until I am enlightened.

Cheers,
Simon

Offline SimonH
« Reply #26 - Posted 2009-10-27 19:33:26 »

Are applets better at reporting error logs than Webstart?
Only in as much that for a browser-based applet the console stays open after a crash.
And if it doesn't work then I'll just bang my head against the wall until I am enlightened.
Your walls are safe - it works now! ~20-60fps full screen
Looks very nice - almost as nice as mine!  Tongue
I agree that the controls need tweaking though; my mouse finger gets tired so quickly nowadays...
How about WSAD for pitch/roll & up/down for throttle, with the option to click on the screen to align the ship to that spot - much like you can with the stations now but anywhere on the sky. That way you could cruise with just the occasional click to change course - but controls can always be tweaked later...
For almost no extra CPU you could have other 'planet systems' as billboard images in the distance and only switch to full 3D when you get close enough (switching the system you're leaving from 3D to billboard at the same time).

It's pretty close to what I had in mind for the community project - sod the realism, make it pretty and playable!
Thumbs up! Hack in a trading screen from the 'dock' button, prettify the lasers, add a few explosions and you've got a game!

People make games and games make people
Offline dishmoth
« Reply #27 - Posted 2009-10-27 22:34:49 »

Quote from: SimonH
Your walls are safe - it works now! ~20-60fps full screen

Yippee!

Quote
Looks very nice - almost as nice as mine! 

Did you continue working on that?  Last version I saw was looking good.
Actually, I'm a little surprised not to have seen other spins-offs from the Community Project showing up here...

Quote
I agree that the controls need tweaking though; my mouse finger gets tired so quickly nowadays...

Okay, the votes are in and the controls need changing.  I think I'll try to keep it as just mouse plus one button, but we'll see what happens.

Quote
For almost no extra CPU you could have other 'planet systems' as billboard images in the distance and only switch to full 3D when you get close enough

Distant systems and, just visible, worm holes leading to them...  Maybe, we'll see.

Quote
It's pretty close to what I had in mind for the community project - sod the realism, make it pretty and playable!

Amen to that!  (Real pity the Community Project never came to anything.  Ah well, I guess that's how all such internet collaborations end up.)

Quote
Thumbs up! Hack in a trading screen from the 'dock' button, prettify the lasers, add a few explosions and you've got a game!

Yep, just give me an evening or two to finish it off. Roll Eyes

But first I've got to work out why those vertex buffers are giving me such trouble. Huh

Cheers,
Simon

Offline dishmoth
« Reply #28 - Posted 2009-10-28 22:17:48 »

To try and pin down the cause of the crashes, I've uploaded this version with everything enabled except the buffer objects (my chief suspects for the problem).

Could someone who saw crashes in the original version try running the new version for me?

Much obliged,
Simon

Offline teletubo
« League of Dukes »

JGO Ninja


Medals: 48
Projects: 4
Exp: 8 years



« Reply #29 - Posted 2009-10-28 22:50:21 »

now I get only a blank screen ... no crash, but nothing else than the blank screen

Pages: [1] 2
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

rwatson462 (31 views)
2014-12-15 09:26:44

Mr.CodeIt (23 views)
2014-12-14 19:50:38

BurntPizza (50 views)
2014-12-09 22:41:13

BurntPizza (84 views)
2014-12-08 04:46:31

JscottyBieshaar (45 views)
2014-12-05 12:39:02

SHC (59 views)
2014-12-03 16:27:13

CopyableCougar4 (57 views)
2014-11-29 21:32:03

toopeicgaming1999 (123 views)
2014-11-26 15:22:04

toopeicgaming1999 (114 views)
2014-11-26 15:20:36

toopeicgaming1999 (32 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org 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‑gaming.org
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!