My little world-renderer

Hi java devs!

After a lot of late-night-coding, I finally got some results that I dared to post on this forum. :slight_smile:

(Edit: see Reply for webstart-link)

It’s basicly a terrain-renderer for now, but I’m pretty happy with it. All terrain and trees you see are streamed (in realtime) from a game-server, using my own RMI-impl. (works, almost!) My own database-impl. does the registration and login-part. This is actually my first attempt making anything in OpenGL (using JOGL) and it’s as optimized as I could possibly make it.

For now you can walk around, fly around and crawl a bit… oh, and drive an invisible car (camera tilts 'n stuff).

I’m still busy getting the serverside-code a bit more stable, so until it gets better there won’t be much uptime :stuck_out_tongue:

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

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

  • 6000 trees, 750m high-detail LODed terrain / items, 2000m low-detail terrain, 18MB RAM usage (?!!) @ 50fps (ATi 9700 pro, P4 2.4GHz)

Oh, viewport is 16:9, you’ll get used to it before you know it, trust me :wink:

Almost forgot: Inspiration came from WurmOnline ;D you gotta play it to believe it ™

Okay, uh, as this forum is “Your games here”, I just have to… :wink:

Webstart:
http://62.251.124.32/launcher.jnlp (please report all bugs ;))

Insane requirement: Java 1.5 / 5.0 !!

To login, just type a name and a password ingame. nothing fancy, that’s the registration.

Note: server can be offline any moment, it’s my dev-comp.

Quick guide:

  • Press left mouse button to walk, move mouse to turn
  • WASD: movement
  • R: autorun
  • M: show map + indicator (worth the try!)
  • Scrollwheel: change height/speed
  • ALT: regain control over the mouse (is invisible)
  • ESC / Alt-F4: quit
  • F: make the sun resuming / suspending movement (BAD color interpolation)
    Update:
  • V: toggles water-reflection
  • for changing near-terrain range: (500…1000m) -> HOME (more), END (less) , default = 750m
  • for changing far-terrain range: (1000…4000m) -> PAGEUP (more), PAGEDOWN (less), default = 2000m

And eh, don’t fly (scrollwheel up) too fast, streaming the terrain that fast is insane and will lag the server (48kb/s uplink)

Very nice !
Runs like a charm here, no lag, no bugs.
What are you going to do with that engine ?

Chman

Hi Chman!

Thanks for your feedback! ;D

Been checking the logs and was quite happy to see someone login (clicking the link and got the game running)! :o

About the purpose of this engine, i was thinking about Paintball actually, something unique, ofcourse with vehicles to travel the great distances (8x8km) in which small playareas (300x300m) with dense trees and bushes, maybe buildings to make it a little more fastpaced. But all that can change if someone has a better idea :slight_smile:

The engine is still not rendering the border of high/low detail correctly (flickers a bit). :-[

Edit: I would really like to hear from people who cannot get it started, as many Launch the game (click the link), but never login to the game-server. Stacktraces are worth a million :slight_smile:

Fixed the normals for far-terrain (were completely wrong)

Enhanced the far-terrain texcoords a bit:

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

Can you say green ? :o Not everything is this smooth, there are really rough areas (check the ingame map: M)

very cool screenshots! Can you make the borders of the hills anti-alias?

I couldn’t run it myself as I got some error about glEnable(): INVALID_ENUMS I think it what I saw. It said to check the log files in the “game directory” but I don’t know where that is.

Thanks a lot for that. I notice quite a few people try to get in, but just can’t.

Do you have the JWS-console open?
If so, could you copy and paste the log shown there?
That would really help me, as glEnable(…) + INVALID_ENUM could be anything (I’m affraid)

so grateful :slight_smile:

Btw: the game use 3 multi-texture-units, but will work (eh, should work) on cards that only support 2 multi-texture-units (minimum)

I tried, but since it was locked up, it wouldn’t let me copy anything :frowning:

I uploaded a new version, that actually writes the debug-info to a file.

The new crash-dialog will tell you where to find the file.

Hope this helps :slight_smile:

Here’s my log! I suggest making a new directory for the game to help keep things organized as debug.log in my home directory is a bit cluttery and ambiguous.

[00d:00h:00m:00s:000ms] <<-- Log started at: Mon Oct 25 19:44:13 EDT 2004 -->>
[00d:00h:00m:00s:006ms] Printing to console: yes
[00d:00h:00m:00s:006ms] SecurityManager: com.sun.javaws.security.JavaWebStartSecurity
[00d:00h:00m:00s:007ms] - Java VM Info: Java HotSpot™ Client VM v1.5.0-b64 by Sun Microsystems Inc.
[00d:00h:00m:00s:007ms] - Operation System: Windows XP v5.1 (x86)
[00d:00h:00m:00s:009ms] - Timer accuracy: 0.003632ms
[00d:00h:00m:00s:010ms] - Available Memory: 508MB
[00d:00h:00m:00s:011ms] Initing AWT…
[00d:00h:00m:00s:123ms] Invoke: com.skips.base.awt.jogl.DirectDisplay.createFrame()
[00d:00h:00m:00s:123ms] Invoke: com.skips.base.awt.jogl.DirectDisplay.createCanvas()
[00d:00h:00m:01s:639ms] - JOGL version: 1.1.0-b04
[00d:00h:00m:01s:655ms] - OpenGL vendor: Intel
[00d:00h:00m:01s:656ms] - OpenGL version: 1.3.0 - Build 4.14.10.3865
[00d:00h:00m:01s:656ms] - OpenGL renderer: Intel 855GM
[00d:00h:00m:01s:656ms] - OpenGL texture-units: 4
[00d:00h:00m:01s:657ms] Invoke: com.skips.engine.client.renderer.LoginRenderer.init()
[00d:00h:00m:02s:411ms] Exception in thread “Logic”: net.java.games.jogl.GLException "glGetError() returned the following error codes after a call to glEnable(): GL_INVALID_ENUM "
[00d:00h:00m:02s:441ms] - net.java.games.jogl.DebugGL.checkGLGetError(DebugGL.java:13705)
[00d:00h:00m:02s:441ms] - net.java.games.jogl.DebugGL.glEnable(DebugGL.java:2840)
[00d:00h:00m:02s:442ms] - com.skips.engine.client.renderer.LoginRenderer.init(LoginRenderer.java:119)
[00d:00h:00m:02s:443ms] - net.java.games.jogl.impl.GLDrawableHelper.init(GLDrawableHelper.java:68)
[00d:00h:00m:02s:443ms] - net.java.games.jogl.GLCanvas$InitAction.run(GLCanvas.java:214)
[00d:00h:00m:02s:443ms] - net.java.games.jogl.impl.windows.WindowsGLContext.makeCurrent(WindowsGLContext.java:162)
[00d:00h:00m:02s:443ms] - net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.makeCurrent(WindowsOnscreenGLContext.java:110)
[00d:00h:00m:02s:444ms] - net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:254)
[00d:00h:00m:02s:444ms] - net.java.games.jogl.GLCanvas.displayImpl(GLCanvas.java:208)
[00d:00h:00m:02s:444ms] - net.java.games.jogl.GLCanvas.display(GLCanvas.java:75)
[00d:00h:00m:02s:444ms] - com.skips.engine.client.engine.Logic$1.run(Logic.java:31)
[00d:00h:00m:02s:445ms] - com.skips.base.util.LossyTimer.run(LossyTimer.java:106)
[00d:00h:00m:02s:445ms] - java.lang.Thread.run(Unknown Source)
[00d:00h:00m:08s:003ms] Invoke: com.skips.base.awt.jogl.DirectDisplay.dispose()

1st attempt bombed out when I selected a depth != current screen depth.

One weird thing is that the FPS went UP the more “items” were in view. So near the bottom of the mountains the fps was ~20-30 at the top it went all the way up to 60. This was running fullscreen 1280x800x32.

System is a Compaq X1000 based laptop. PM 1.4ghz, 512MB RAM, Radeon 9000ish 32MB.

OpenGL renderer: Intel 855GM

It crashes on the line that enables a vertex-array, which is a pretty basic feature AFAIK.

Hm… without vertex-arrays you don’t get far-terrain, and no trees. With that gfx-chip you most likely get 5fps for terrain only, after I make a workaround that doesn’t use vertex-arrays. Aww.

It might be a driver-thingy (try updating) but I highly doubt that will solve it.

Anyone an idea how to fix this in a proper way?
(putting every tree in a DisplayList is probably not going to help much: slow)

[quote]1st attempt bombed out when I selected a depth != current screen depth.
[/quote]
Could you tell me the ‘bomb out’-message? :slight_smile:
I never expected that really.

[quote]One weird thing is that the FPS went UP the more “items” were in view. So near the bottom of the mountains the fps was ~20-30 at the top it went all the way up to 60. This was running fullscreen 1280x800x32.
[/quote]
When you are close to trees, they have a higher-poly-count (4 triangles instead of 1) so performance may suffer a bit. When you climb a mountain, you might see more trees, but they are all further away and only 1 triangle (that don’t need internal depth-sorting either).

I guess that explains it :slight_smile:

Nice to see an ATi 9000ish card gives a reasonable framerate as well. (although i have no idea how much trees were rendered, which is shown top-left)

Going to bed now (02:00h). Will keep the server up and running, as long as it lasts ;D

When selecting 16 bit fullscreen while desktop is 32 bit…

Description: glGetError() returned the following error codes after a call to glGetIntegerv(): GL_INVALID_ENUM

[00d:00h:00m:00s:000ms] <<-- Log started at: Mon Oct 25 20:09:36 EDT 2004 -->>
[00d:00h:00m:00s:036ms] Printing to console: yes
[00d:00h:00m:00s:036ms] SecurityManager: com.sun.javaws.security.JavaWebStartSecurity
[00d:00h:00m:00s:037ms] - Java VM Info: Java HotSpot™ Client VM v1.5.0-rc-b63 by Sun Microsystems Inc.
[00d:00h:00m:00s:037ms] - Operation System: Windows XP v5.1 (x86)
[00d:00h:00m:00s:040ms] - Timer accuracy: 0.004191ms
[00d:00h:00m:00s:040ms] - Available Memory: 508MB
[00d:00h:00m:00s:041ms] Initing AWT…
[00d:00h:00m:00s:268ms] Invoke: com.skips.base.awt.jogl.DirectDisplay.createFrame()
[00d:00h:00m:00s:269ms] Invoke: com.skips.base.awt.jogl.DirectDisplay.createCanvas()
[00d:00h:00m:00s:612ms] Invoke: com.skips.base.awt.jogl.DirectDisplay.enterFullScreenMode()
[00d:00h:00m:02s:175ms] Exception in thread “Logic”: net.java.games.jogl.GLException "glGetError() returned the following error codes after a call to glGetIntegerv(): GL_INVALID_ENUM "
[00d:00h:00m:02s:176ms] - net.java.games.jogl.DebugGL.checkGLGetError(DebugGL.java:13705)
[00d:00h:00m:02s:176ms] - net.java.games.jogl.DebugGL.glGetIntegerv(DebugGL.java:4403)
[00d:00h:00m:02s:176ms] - com.skips.engine.client.renderer.LoginRenderer.init(LoginRenderer.java:97)
[00d:00h:00m:02s:177ms] - net.java.games.jogl.impl.GLDrawableHelper.init(GLDrawableHelper.java:68)
[00d:00h:00m:02s:177ms] - net.java.games.jogl.GLCanvas$InitAction.run(GLCanvas.java:214)
[00d:00h:00m:02s:177ms] - net.java.games.jogl.impl.windows.WindowsGLContext.makeCurrent(WindowsGLContext.java:162)
[00d:00h:00m:02s:177ms] - net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.makeCurrent(WindowsOnscreenGLContext.java:110)
[00d:00h:00m:02s:177ms] - net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:254)
[00d:00h:00m:02s:178ms] - net.java.games.jogl.GLCanvas.displayImpl(GLCanvas.java:208)
[00d:00h:00m:02s:178ms] - net.java.games.jogl.GLCanvas.display(GLCanvas.java:75)
[00d:00h:00m:02s:178ms] - com.skips.engine.client.engine.Logic$1.run(Logic.java:31)
[00d:00h:00m:02s:178ms] - com.skips.base.util.LossyTimer.run(LossyTimer.java:106)
[00d:00h:00m:02s:178ms] - java.lang.Thread.run(Unknown Source)

Nice one, but i got some artifacts with your LOD system as you can see on the screenies and some general clipping errors.

http://mitglied.lycos.de/evilteddy/something_online2.jpg

In the first i wondered about why i have some graphics lags when i wander around the hills. But as i startet to fly the fps raised and after this the framerate also keeps high while walking on the hills.

And i like the sun rise :slight_smile: looks cool, even if it is pretty simple yet.

My Specs
Athlon 2400+
Radeon 9600XT (128MB)
256MB DDR (will be updated in this week, so i will post new infos about the framerate)

Evil-Devil: That screen shot loks like crap. If you take a look at what was posted in the start of the thread, that’s exactly what mine looked like. Yours looks like the texture blending necessary for the seamless LOD tiling doesn’t work. I too did see some missing tiles, but they were not as bad as what you see. Do you have any of the ATI control panels configured weird?

Those screenshots look really cool, I’ll try the webstart link later this evening when I get home.

I was wondering if you’d be interested in donating/licensing you terrain code for a project I’m working on. However I only need to render an area of about 2km x 2km and the terrain will be more of an urban environment rather than open fields etc.

You can visit my early project work for Manly Mayhem at my site. Let me know if you’re interested.

Andy.

I get flashing white quads at the transistions between LODs for some frames. Difficult to capture it in a screenshot…it somehow looks like the shot above, but not exactly. That’s on a X800XT-PE using the latest drivers.

[quote]Evil-Devil: That screen shot loks like crap. If you take a look at what was posted in the start of the thread, that’s exactly what mine looked like. Yours looks like the texture blending necessary for the seamless LOD tiling doesn’t work. I too did see some missing tiles, but they were not as bad as what you see. Do you have any of the ATI control panels configured weird?
[/quote]
Don’t blame him, blame me :slight_smile: There are still ‘some’ bugs around. I’ve seen this rendering-errors myself, and I kinda know what is causing them. Just wait for the next update :slight_smile:

[quote]I get flashing white quads at the transistions between LODs for some frames. Difficult to capture it in a screenshot…it somehow looks like the shot above, but not exactly. That’s on a X800XT-PE using the latest drivers.
[/quote]
Same here, IIRC I warned about them in one of my replies here. Should be easy to fix: there is a one-frame lag between switching near-to-far and viceversa.

[quote]When selecting 16 bit fullscreen while desktop is 32 bit…

Description: glGetError() returned the following error codes after a call to glGetIntegerv(): GL_INVALID_ENUM

[00d:00h:00m:00s:000ms] <<-- Log started at: Mon Oct 25 20:09:36 EDT 2004 -->>

[00d:00h:00m:02s:175ms] Exception in thread “Logic”: net.java.games.jogl.GLException "glGetError() returned the following error codes after a call to glGetIntegerv(): GL_INVALID_ENUM "

[00d:00h:00m:02s:176ms] - com.skips.engine.client.renderer.LoginRenderer.init(LoginRenderer.java:97)

[/quote]

gl.glGetIntegerv(GL.GL_MAX_TEXTURE_UNITS_ARB, v);

I think it’s the first GL-call in the app. I once had some nifty filters for that giant list of DisplayModes, but some users didn’t see any options in the list (had a depth of -1…), so I decided to just show everything for now. Seems like it’s a little dangerous though.