My little world-renderer

[quote]I was wondering if you’d be interested in donating/licensing you terrain code for a project I’m working on.

You can visit my early project work for Manly Mayhem at my site. Let me know if you’re interested.
[/quote]
I visited your site, and it seems to me your engine needs way more detail on the ground than my engine can deliver. For now you can only set 1 (one!) terrain-color every 4x4m. So it might be possible to make use of this engine for anything farther than a couple of meters, where you do your own rendering of high-detail streets 'n stuff.

But: I’m not licensing anything at the moment, as I don’t license buggy code :wink:

The application dies for me after it has loaded the resources and tries to start the world rendering.

mandrake linux 10.0
gf2 with nvidia drivers version 1.0-6111 (latest)

[quote]The application dies for me after it has loaded the resources and tries to start the world rendering.

mandrake linux 10.0
gf2 with nvidia drivers version 1.0-6111 (latest)
[/quote]
Could you please take a look in:
<user.home>/debug.log (My CrashAlert-dialog shows the actual path)
and post its contents?

Thank you so much :slight_smile:

For anybody not afraid of getting a major headache: :stuck_out_tongue:

http://home.hccnet.nl/s.balk/screens/so_stereo.png

Cross your eyes. This is an ingame option :slight_smile: (disabled!) Quite nice 3d effect, but I guess I need some special glasses first.

Update - New version uploaded:

  • fixed all gfx-bugs at the egde of near/far-terrain
  • terrain-data on server not getting swapped anymore

I’m crashing on Windows XP, dual 1.7GHz Xeon, GeForce FX5200

Same as what Dr Bizzar0 describes.

There is nothing in the log at/after the crash point:

[00d:00h:00m:00s:000ms] <<-- Log started at: Tue Oct 26 22:56:36 EDT 2004 -->>
[00d:00h:00m:00s:019ms] Printing to console: yes
[00d:00h:00m:00s:032ms] SecurityManager: com.sun.javaws.security.JavaWebStartSecurity
[00d:00h:00m:00s:035ms] - Java VM Info: Java HotSpot™ Client VM v1.5.0-b64 by Sun Microsystems Inc.
[00d:00h:00m:00s:043ms] - Operation System: Windows XP v5.1 (x86)
[00d:00h:00m:00s:049ms] - Timer accuracy: 0.004656ms
[00d:00h:00m:00s:050ms] - Available Memory: 508MB
[00d:00h:00m:00s:051ms] Initing AWT…
[00d:00h:00m:00s:261ms] Invoke: com.skips.base.awt.jogl.DirectDisplay.createFrame()
[00d:00h:00m:00s:262ms] Invoke: com.skips.base.awt.jogl.DirectDisplay.createCanvas()
[00d:00h:00m:03s:562ms] - JOGL version: 1.1.0-b04
[00d:00h:00m:03s:563ms] - OpenGL vendor: NVIDIA Corporation
[00d:00h:00m:03s:563ms] - OpenGL version: 1.5.1
[00d:00h:00m:03s:564ms] - OpenGL renderer: GeForce FX 5200/AGP/SSE2
[00d:00h:00m:03s:565ms] - OpenGL texture-units: 4
[00d:00h:00m:03s:565ms] Invoke: com.skips.engine.client.renderer.LoginRenderer.init()
[00d:00h:00m:03s:879ms] Invoke: com.skips.engine.client.renderer.LoginRenderer.reshape()
[00d:00h:00m:23s:997ms] Invoke: com.skips.engine.client.renderer.LoadingRenderer.init()
[00d:00h:00m:23s:998ms] Invoke: com.skips.engine.client.renderer.LoadingRenderer.reshape()
[00d:00h:00m:45s:928ms] Invoke: com.skips.base.util.HighLevel.gc() -> 2932KB freed in 1248ms
[00d:00h:00m:45s:964ms] Invoke: com.skips.engine.client.renderer.WorldRenderer.init()
[00d:00h:00m:45s:966ms] Invoke: com.skips.engine.client.renderer.WorldRenderer.reshape(0, 0, 640, 480)
[00d:00h:00m:45s:967ms] Done loading!

There is no “Crash Alert Dialog” it gets to that point and the window disappears along with the Java Console window…

Ah there is a HotSpot crash log…

An unexpected error has been detected by HotSpot Virtual Machine:

EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x05301ad9, pid=3908, tid=2660

Java VM: Java HotSpot™ Client VM (1.5.0-b64 mixed mode, sharing)

Problematic frame:

C 0x05301ad9

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

Current thread (0x0337f3b0): JavaThread “Logic” daemon [_thread_in_native, id=2660]

siginfo: ExceptionCode=0xc0000005, reading address 0x00000000

Registers:
EAX=0x043e5d24, EBX=0x048300c0, ECX=0x00000000, EDX=0x0000002a
ESP=0x03d6f828, EBP=0x3f719a2c, ESI=0x00000000, EDI=0x00000000
EIP=0x05301ad9, EFLAGS=0x00010246

Top of Stack: (sp=0x03d6f828)
0x03d6f828: 0000002a 048300c0 00000000 00002e56
0x03d6f838: 6975d85e 048300c0 043e5d20 00000000
0x03d6f848: 0000002a 0337f3b0 048300c0 03d6f88c
0x03d6f858: 26da5d68 0000002a 05301a70 6954e004
0x03d6f868: 0000000c 00000000 00000000 00002e80
0x03d6f878: 26da5d68 03cd36f5 00000007 00000000
0x03d6f888: 00002e80 03d6f8c4 00a7826f 0337f46c
0x03d6f898: 03d6f8e0 00000007 00000000 00002e80

Instructions: (pc=0x05301ad9)
0x05301ac9: 89 78 14 8b 35 bc 65 83 04 8b f9 c1 e7 04 03 f7
0x05301ad9: 8b 3e 8b 6e 04 89 78 18 89 68 1c 8b 7e 08 8b 6e

Stack: [0x03d30000,0x03d70000), sp=0x03d6f828, free space=254k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C 0x05301ad9

[error occurred during error reporting, step 120, id 0xc0000005]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j net.java.games.jogl.impl.windows.WindowsGLImpl.glDrawArrays(III)V+0
j net.java.games.jogl.DebugGL.glDrawArrays(III)V+7
J com.skips.engine.client.world.Terrain.renderFar(Lnet/java/games/jogl/GL;)V
v ~OSRAdapter
J com.skips.engine.client.world.Terrain.process(Lnet/java/games/jogl/GL;)V
v ~OSRAdapter
j com.skips.engine.client.world.World.render(Lnet/java/games/jogl/GL;)V+8
j com.skips.engine.client.renderer.WorldRenderer.display(Lnet/java/games/jogl/GLDrawable;)V+149
j net.java.games.jogl.impl.GLDrawableHelper.display(Lnet/java/games/jogl/GLDrawable;)V+29
j net.java.games.jogl.GLCanvas$DisplayAction.run()V+11
J net.java.games.jogl.impl.GLContext.invokeGL(Ljava/lang/Runnable;ZLjava/lang/Runnable;)V
j net.java.games.jogl.GLCanvas.displayImpl()V+45
j net.java.games.jogl.GLCanvas.display()V+1
j com.skips.engine.client.engine.Logic$1.run()V+12
j com.skips.base.util.LossyTimer.run()V+25
j java.lang.Thread.run()V+11
v ~StubRoutines::call_stub

Thanks for that dump! :-*

I located some potentionally evil code related to the glDrawArray failure:

I enabled VERTEX, NORMAL, COLOR, TEXCOORD - ARRAY, while only providing pointers for 3 of them.

Sometimes I skipped NORMAL, sometimes COLOR. So much for the explaination :wink:

Could you please test version v0.0.15_12? :slight_smile:

Update:

  • filtered displaymodes to only show the modes with the current depth

It’s fixed! Works great.

relief

Thanks for feedback again, very valuable!

~~

Major issue now is serverside swapping again… makes streaming-data max out at 3KB/s while it could be 2MB/s (network), takes some time to get everything in RAM again, then it works great.

i got my addition 512MB DDR RAM :slight_smile: The world does not lack like with 256MB RAm, much RAM is very good to have ^^.
Framerate was at the same range in fullscreen mode. Average fps rate was 50-60
Hope the artifacts are gone in the next version :slight_smile:

I’m facing a dilemma here…

About 75% of the people who click the launcher.jnlp link never login to the game-server. As my game is setup to login to the game-server in a breeze, I’m wondering what goes wrong.

I perfectly understand, that after people probably installed java 1.5 for this, then downloaded the renderer which just crashed at their first try, will not take the effort to (register on this forum?) and type a reply, including the stacktrace from either de debug.log file or the console. It’s just too much.

I can however send the same data that is written to a file, straight to the game-server for debugging purposes. The question is: isn’t that frowned upon, seen as spyware?

Could ask the user at a crash whether or not the debug-log should be uploaded to the game-server.

Is option 1 not-done ?

My other PC I click on the jnlp, but somewhere along the way it goes poof. Not a warning dialog because of OpenGL or nothing…

It has dual monitors, but that does not affect other OpenGL apps.

I never worked with a dual-screen system unfortunately. What I know is that I use getDefaultScreenDevice() and put the window on the screen with: setLocationRelativeTo(null) . Maybe that combination is wrong, but it’s so hard to test with only 1 monitor :-/

Edit: did you have a file generated called:
<user.home> /debug.log
If so, could you please post it? 8)

Nope, no file. I don’t think it’s even running.

Could anyone reply at the dilemma I posted (last entry at prev page) ? Very easy to miss unfortunately :frowning:

Lots of games do this, just make sure you put a big notice on saying you’re going to do it.

Kev

Skippy: This is a demo so I doubt it would be frowned upon. What I would do is as other have said, just bring up a dialog awt or game based doesn’t matter that says debug info will be sent to server with a checkbox that is checked by default. That way people can choose not to send data.

Excuse me for the lack of progress here, but I’m a bit busy :-/

I did the crash-report thing, that sends data to the server, optimized a bit, fixed weird bugs (thx to the crash-reports) and did a quick-hack to implement water-reflections (clipping/flipping terrain).

New key: [v] (toggle water-reflection).
Little screenshot:

http://home.hccnet.nl/s.balk/screens/so_water.png

I hope I’ll be able to host the game-server at my other computer (the one without virtual ram) to prevent the extreme bad swapping behaviour when streaming terrain and trees.

Sometimes terrain is still messed up, but it should be a little better :wink:

I hope I can work on my renderer a bit more in the future… it needs me (and grass) :slight_smile:

btw, Is there a downloadable source code available for you world renderer client and/or serverapp?

This renderer may one day be used in a commercial game that I’m writing at the moment (no expectations of making any money here ;D). I am afraid that releasing the sourcecode just like that may have some undesirable side-effects.

If I would ever release it, I would first clean the code a bit, atm it lacks documentation and it’s spread over 27 packages, rougly 27.500 lines of code. Providing that ‘as is’ wouldn’t be very usefull I guess.

Oh, always nice when people are interested in my code :slight_smile:

If you would like to hear how I handled certain specific problems, I’d be happy to share some solutions ofcourse!

a couple of optimisations i would suggest are caching where you’ve been, if not everywhere, maybe just in the last 3 kilometres or so you’ve walked, so that the server doesn’t have to keep re-sending data you’ve downloaded before… and giving priority to the closest tiles to the player when streaming, as i can easily outrun the streaming terrain and stand still, and watch as the detail chases after me.