jME - Terrain test

Hi all,

My turn to show something I guess. Here’s a little demo of the terrain engine in the game engine I’m writing. The game engine is called jME and is built on top of LWJGL.

The terrain engine is pretty basic right now, some of the features are:

Dynamically fractal generated terrain
Geomipmapping
Procedural dynamic texture mapping
Slope lighting for shading.
detail texture mapping
skybox
water

The demo generates a new terrain every time you run it. The terrain is a combination of Fault Fractal and Partical Deposition fractal.

Frame rate may not be that great. Right now I only get about 100 FPS on a P4 2.4 Geforce 3, there is lots of optimizations that could be done, but I’m not worrying about that now.

Terrain pop-up is really bad right now, I plan on implementing geomorphing soon to help with that.

Also, let me mention that the sky box textures were “borrowed” from game tutorials. :slight_smile:

The terrain textures are also not all that appropriate and probably would improve the visual quality a bunch if I found better textures.

I only made a windows batch file to run it, but it SHOULD run on all supported LWJGL platforms. Just use the jme.jar and demo.jar with the appropriate lwjgl jar.

Controls are:

move: W,A,S,D
Mouse looks
7 switch to wireframe mode
8 switch to fill mode
ctril-P take a screenshot.

Let me know what you think. Be gentle please…

http://www.mojomonkeycoding.com/files/jme/jMEdemo.zip

Does not work for me, just says:

C:\jME Demo>java -cp .;lib\jme.jar;lib\demo.jar;lib\lwjgl.jar; -Djava.library.path=lib test.TestMain
Jun 5, 2003 2:40:27 PM monkey.system.PropertiesIO
INFO: PropertiesIO created
Jun 5, 2003 2:40:27 PM monkey.system.PropertiesIO load
WARNING: Could not load properties: java.io.FileNotFoundException: properties.cfg (The system cannot find the file specified)

Hmmm interesting. It is supposed to pop up a dialog for you to select the resolution after which it will create the properties file. The warning is just letting you know that one doesn’t exist.

You don’t get a dialog window at all?

Runs fine here @ about 130fps (more or less) (P4HT@3.2Ghz, Radeon 9700pro). Can’t select the 640*480 mode and can’t run it in fullscreen (the using-swing-component-before-trying-LWJGL-fullscreen-bug i recently mentioned in the Cosmic Trip thread…i’m getting used to it… :P).

Edit: How many polys does the average terrain have in your demo (I mean the whole terrain and without the geomipmapping)?

Oh, and it remembers me why i’m hating Quake: For bringing this !/(&"&/!"%&%$!%&"/!("##** W,A,S,D controls to the world…;D

Without geomipmapping there is 263,169 triangles.

[quote]Oh, and it remembers me why i’m hating Quake: For bringing this !/(&"&/!"%&%$!%&"/!("##** W,A,S,D controls to the world…
[/quote]
I apologize with all my heart. :slight_smile:

It doesn’t work for me on redhat 9 as it report invalid pixel depth ::slight_smile:

I’ve running in 24 bit colour mode - I guess this is the same as windows 32 bit mode?

Nope, that’s my fault. I forgot about 24 bit pixels in linux and therefore throw an exception if it is anything other than 16 or 32. I’ll fix that.

thanks

nice ;D

Works now, 30(70-90 when run in 800-600-24)+ fps on a geforce 2mx athlon 900 mhz

BUT:
when closing down:
2003-jun-06 00:19:09 monkey.texture.TextureManager deleteAll
INFO: Deleting All Textures

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : 11 occurred at PC=0x4D9DD740
Function=[Unknown.]
Library=(N/A)

NOTE: We are unable to locate the function name symbol for the error
just occurred. Please refer to release documentation for possible
reason and solutions.

Current Java thread:
at org.lwjgl.opengl.CoreGL.isTexture(Native Method)
at monkey.texture.TextureManager.deleteAll(TextureManager.java:350)
at monkey.texture.TextureManager.reset(TextureManager.java:400)
at test.TestMain.cleanup(TestMain.java:291)
at monkey.AbstractGame.start(AbstractGame.java:73)
at test.TestMain.main(TestMain.java:295)

Dynamic libraries:
08048000-0804e000 r-xp 00000000 03:4c 530667 /usr/java/j2sdk1.4.2/jre/bin/java
0804e000-0804f000 rw-p 00005000 03:4c 530667 /usr/java/j2sdk1.4.2/jre/bin/java
40000000-40015000 r-xp 00000000 03:4c 242863 /lib/ld-2.3.2.so
40015000-40016000 rw-p 00014000 03:4c 242863 /lib/ld-2.3.2.so
40017000-4001f000 r-xp 00000000 03:4c 482687 /usr/java/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so
4001f000-40020000 rw-p 00007000 03:4c 482687 /usr/java/j2sdk1.4.2/jre/lib/i386/native_threads/libhpi.so
40020000-40024000 rw-s 00000000 03:4c 98858 /tmp/hsperfdata_dala/4089
40024000-40027000 r–s 00000000 03:4c 67136 /usr/java/j2sdk1.4.2/jre/lib/ext/dnsns.jar
40027000-40029000 r–s 00000000 03:4c 480340 /misc/downloads/jME Demo/lib/demo.jar
40029000-4002a000 r-xp 00000000 03:4c 560527 /usr/X11R6/lib/X11/locale/lib/common/xlcUTF8Load.so.2
4002a000-4002b000 rw-p 00000000 03:4c 560527 /usr/X11R6/lib/X11/locale/lib/common/xlcUTF8Load.so.2
4002b000-40036000 r-xp 00000000 03:4c 64109 /lib/tls/libpthread-0.34.so
40036000-40037000 rw-p 0000a000 03:4c 64109 /lib/tls/libpthread-0.34.so
40039000-4003c000 r-xp 00000000 03:4c 240102 /lib/libdl-2.3.2.so
4003c000-4003d000 rw-p 00002000 03:4c 240102 /lib/libdl-2.3.2.so
4003e000-40433000 r-xp 00000000 03:4c 195682 /usr/java/j2sdk1.4.2/jre/lib/i386/client/libjvm.so
40433000-4044f000 rw-p 003f4000 03:4c 195682 /usr/java/j2sdk1.4.2/jre/lib/i386/client/libjvm.so
40461000-40473000 r-xp 00000000 03:4c 240106 /lib/libnsl-2.3.2.so
40473000-40474000 rw-p 00011000 03:4c 240106 /lib/libnsl-2.3.2.so
40476000-40497000 r-xp 00000000 03:4c 64107 /lib/tls/libm-2.3.2.so
40497000-40498000 rw-p 00020000 03:4c 64107 /lib/tls/libm-2.3.2.so
40498000-404a8000 r-xp 00000000 03:4c 227707 /usr/java/j2sdk1.4.2/jre/lib/i386/libverify.so
404a8000-404aa000 rw-p 0000f000 03:4c 227707 /usr/java/j2sdk1.4.2/jre/lib/i386/libverify.so
404ac000-404b7000 r-xp 00000000 03:4c 240112 /lib/libnss_files-2.3.2.so
404b7000-404b8000 rw-p 0000a000 03:4c 240112 /lib/libnss_files-2.3.2.so
404b8000-404d8000 r-xp 00000000 03:4c 227681 /usr/java/j2sdk1.4.2/jre/lib/i386/libjava.so
404d8000-404da000 rw-p 0001f000 03:4c 227681 /usr/java/j2sdk1.4.2/jre/lib/i386/libjava.so
404da000-404ee000 r-xp 00000000 03:4c 227708 /usr/java/j2sdk1.4.2/jre/lib/i386/libzip.so
404ee000-404f1000 rw-p 00013000 03:4c 227708 /usr/java/j2sdk1.4.2/jre/lib/i386/libzip.so
404f1000-41e74000 r–s 00000000 03:4c 306523 /usr/java/j2sdk1.4.2/jre/lib/rt.jar
41ebe000-41ed4000 r–s 00000000 03:4c 307457 /usr/java/j2sdk1.4.2/jre/lib/sunrsasign.jar
41ed4000-41fae000 r–s 00000000 03:4c 307456 /usr/java/j2sdk1.4.2/jre/lib/jsse.jar
41fae000-41fbf000 r–s 00000000 03:4c 307398 /usr/java/j2sdk1.4.2/jre/lib/jce.jar
41fe7000-41ff4000 r–s 00000000 03:4c 67137 /usr/java/j2sdk1.4.2/jre/lib/ext/ldapsec.jar
41ff4000-41ffb000 r-xp 00000000 03:4c 339809 /usr/lib/libgcc_s.so.1
41ffb000-41ffc000 rw-p 00007000 03:4c 339809 /usr/lib/libgcc_s.so.1
42000000-4212f000 r-xp 00000000 03:4c 64101 /lib/tls/libc-2.3.2.so
4212f000-42132000 rw-p 0012f000 03:4c 64101 /lib/tls/libc-2.3.2.so
42134000-4268d000 r–s 00000000 03:4c 307399 /usr/java/j2sdk1.4.2/jre/lib/charsets.jar
4c913000-4cb13000 r–p 00000000 03:4c 450807 /usr/lib/locale/locale-archive
4cd17000-4cdd3000 r–s 00000000 03:4c 65777 /usr/java/j2sdk1.4.2/jre/lib/ext/localedata.jar
4cdd3000-4cdef000 r–s 00000000 03:4c 67143 /usr/java/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar
4cdef000-4ce05000 r–s 00000000 03:4c 480341 /misc/downloads/jME Demo/lib/jme.jar
4ce05000-4ce25000 r–s 00000000 03:4c 480343 /misc/downloads/jME Demo/lib/lwjgl.jar
4ce25000-4ce8c000 r-xp 00000000 03:4c 372846 /usr/java/lwjgl/lib/liblwjgl.so.0.0.0
4ce8c000-4ce8e000 rw-p 00066000 03:4c 372846 /usr/java/lwjgl/lib/liblwjgl.so.0.0.0
4ce90000-4cea0000 r-xp 00000000 03:4c 227704 /usr/java/j2sdk1.4.2/jre/lib/i386/libnet.so
4cea0000-4cea1000 rw-p 0000f000 03:4c 227704 /usr/java/j2sdk1.4.2/jre/lib/i386/libnet.so
4cea4000-4ceb1000 r-xp 00000000 03:4c 608387 /usr/X11R6/lib/libXext.so.6.4
4ceb1000-4ceb2000 rw-p 0000c000 03:4c 608387 /usr/X11R6/lib/libXext.so.6.4
4ceb2000-4cf8e000 r-xp 00000000 03:4c 608377 /usr/X11R6/lib/libX11.so.6.2
4cf8e000-4cf91000 rw-p 000db000 03:4c 608377 /usr/X11R6/lib/libX11.so.6.2
4cf91000-4d040000 r-xp 00000000 03:4c 245264 /usr/local/lib/libstdc++.so.6.0.0
4d040000-4d044000 rw-p 000af000 03:4c 245264 /usr/local/lib/libstdc++.so.6.0.0
4d049000-4d04f000 r-xp 00000000 03:4c 227705 /usr/java/j2sdk1.4.2/jre/lib/i386/libnio.so
4d04f000-4d050000 rw-p 00005000 03:4c 227705 /usr/java/j2sdk1.4.2/jre/lib/i386/libnio.so
4d050000-4d31b000 r-xp 00000000 03:4c 227622 /usr/java/j2sdk1.4.2/jre/lib/i386/libawt.so
4d31b000-4d330000 rw-p 002ca000 03:4c 227622 /usr/java/j2sdk1.4.2/jre/lib/i386/libawt.so
4d356000-4d3a9000 r-xp 00000000 03:4c 227702 /usr/java/j2sdk1.4.2/jre/lib/i386/libmlib_image.so
4d3a9000-4d3aa000 rw-p 00052000 03:4c 227702 /usr/java/j2sdk1.4.2/jre/lib/i386/libmlib_image.so
4d3aa000-4d3b0000 r–s 00000000 03:4c 496255 /usr/lib/gconv/gconv-modules.cache
4d3b0000-4d3b8000 r-xp 00000000 03:4c 608385 /usr/X11R6/lib/libXcursor.so.1.0
4d3b8000-4d3b9000 rw-p 00007000 03:4c 608385 /usr/X11R6/lib/libXcursor.so.1.0
4d3be000-4d3c5000 r-xp 00000000 03:4c 608401 /usr/X11R6/lib/libXp.so.6.2
4d3c5000-4d3c6000 rw-p 00006000 03:4c 608401 /usr/X11R6/lib/libXp.so.6.2
4d3c6000-4d414000 r-xp 00000000 03:4c 608409 /usr/X11R6/lib/libXt.so.6.0
4d414000-4d418000 rw-p 0004d000 03:4c 608409 /usr/X11R6/lib/libXt.so.6.0
4d418000-4d41c000 r-xp 00000000 03:4c 608411 /usr/X11R6/lib/libXtst.so.6.1
4d41c000-4d41d000 rw-p 00004000 03:4c 608411 /usr/X11R6/lib/libXtst.so.6.1
4d41d000-4d425000 r-xp 00000000 03:4c 608375 /usr/X11R6/lib/libSM.so.6.0
4d425000-4d426000 rw-p 00007000 03:4c 608375 /usr/X11R6/lib/libSM.so.6.0
4d426000-4d43a000 r-xp 00000000 03:4c 608371 /usr/X11R6/lib/libICE.so.6.3
4d43a000-4d43b000 rw-p 00013000 03:4c 608371 /usr/X11R6/lib/libICE.so.6.3
4d43d000-4d4f7000 r-xp 00000000 03:4c 227665 /usr/java/j2sdk1.4.2/jre/lib/i386/libfontmanager.so4d4f7000-4d511000 rw-p 000b9000 03:4c 227665 /usr/java/j2sdk1.4.2/jre/lib/i386/libfontmanager.so4d526000-4d52d000 r-xp 00000000 03:4c 608407 /usr/X11R6/lib/libXrender.so.1.2
4d52d000-4d52e000 rw-p 00006000 03:4c 608407 /usr/X11R6/lib/libXrender.so.1.2
4d52e000-4d54a000 r-xp 00000000 03:4c 560525 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2
4d54a000-4d54c000 rw-p 0001c000 03:4c 560525 /usr/X11R6/lib/X11/locale/lib/common/ximcp.so.2
4d6cf000-4d706000 r-xp 00000000 03:4c 227698 /usr/java/j2sdk1.4.2/jre/lib/i386/libjpeg.so
4d706000-4d707000 rw-p 00036000 03:4c 227698 /usr/java/j2sdk1.4.2/jre/lib/i386/libjpeg.so
4d809000-4d912000 rw-s 00000000 00:04 30736385 /SYSV00000000 (deleted)
4e085000-4e18c000 rw-s 00000000 00:04 0 /SYSV00000000 (deleted)
4e18c000-5618c000 rw-s d0000000 03:4c 39881 /dev/nvidia0
56501000-56554000 r-xp 00000000 03:4c 227631 /usr/java/j2sdk1.4.2/jre/lib/i386/libcmm.so
56554000-56556000 rw-p 00052000 03:4c 227631 /usr/java/j2sdk1.4.2/jre/lib/i386/libcmm.so

Heap at VM Abort:
Heap
def new generation total 2688K, used 1366K [0x44710000, 0x449f0000, 0x44bf0000)
eden space 2432K, 53% used [0x44710000, 0x44856828, 0x44970000)
from space 256K, 23% used [0x44970000, 0x4497f3c8, 0x449b0000)
to space 256K, 0% used [0x449b0000, 0x449b0000, 0x449f0000)
tenured generation total 34640K, used 27993K [0x44bf0000, 0x46dc4000, 0x48710000)
the space 34640K, 80% used [0x44bf0000, 0x46746698, 0x46746800, 0x46dc4000)
compacting perm gen total 7168K, used 6953K [0x48710000, 0x48e10000, 0x4c710000)
the space 7168K, 97% used [0x48710000, 0x48dda5d8, 0x48dda600, 0x48e10000)

Local Time = Fri Jun 6 00:19:09 2003
Elapsed Time = 59

The exception above was detected in native code outside the VM

Java VM: Java HotSpot™ Client VM (1.4.2-beta-b19 mixed mode)

An error report file has been saved as hs_err_pid4089.log.

Please refer to the file for further information.

Avbruten (SIGABRT)

Something is wrong with my pointer when calling gl.isTexture and gl.deleteTextures… I need a linux machine to work on. Not having that issue on any of the windows boxes, but have seen it before.

Cool! :smiley:

Worked great on my system.
I find fractal generated terrains very interesting. I did something like that myself too a long time ago on an Atari ST (so obviously not nearly as cool looking and sophisticated as this).

A few suggestions:

  • I think you forgot to do a Display.resetDisplayMode() when exiting from full screen. (Display mode is now left in the mode you choose for the demo).

  • Make the terrain truly endless, since it’s fractal based.

  • Make the sky box a ‘true’ skybox (keep it at a fixed location relative player, only rotating according to your view direction).

  • Do something about that pop up (ah yes you mentioned that already ::))

  • Maybe you could try to reduce the artefacts (you know, the blockyness where water meets land), I think by increasing the z-buffer.

Are you planning on releasing the engine, maybe even with sources? That would be great :slight_smile:

Greetings,
Erik

[quote]Oh, and it remembers me why i’m hating Quake: For bringing this !/(&"&/!"%&%$!%&"/!("##** W,A,S,D controls to the world…
[/quote]
I thank god on my knees that they didn’t choose the controls of your jpct demo ::slight_smile: :stuck_out_tongue:

Thanks for the suggestions erik, I’ll keep them in mind and try to incorporate them in the future. I do plan on releasing it with source when I feel that it does something that people will want to make use of it. My goal is to abstract away all the gl stuff. For instance to create that terrain, it’s simply a matter of creating a new Geomipmap object and calling it’s render and update methods. Anyways, thanks for the suggestions I think they are very good ones.

musta been my work computer, cause it works fine at home. P4 2g, ati M9 video card. Get about 125fps on average whatever resolution i do. Fluctuates from 80-250fps.

nathan

Somebody had to say this (they are based on DESCENT controls btw. At least that’s how i played it) ;D

WASD rocks, ESDF is even better.

Doesn’t work, didn’t see the error.