Jump to content


my engine


  • You cannot reply to this topic
4 replies to this topic

#1 AXP

    New Member

  • Members
  • Pip
  • 2 posts

Posted 12 October 2007 - 03:16 PM

Hi all,

I have posted this to an other forum as well, but I would like to share the information also with the DevMaster community.

I whould like to introduce my OpenGL game (engine): Flower King.

I am writing this engine since 2002 in my (very) spare time, as a hobby.
It was originally started as a computer-graphics lab exercise at the University.

It is a first-person, collection game. Not a shooter.
It has a simple story: You are Hugo and you have to collect flowers.
Some of them are protected by dogs,
they can attack you when you are in the dog's garden area. You can use your rocket (that is on your back) for a short fly, for example for escaping from attacking dogs.

However, the gaming experience is not my goal.
It is more an experiment, for writing an engine. I am trying out different effects and techniques that might help to complete my dream:
to have an environment (with nice terrain, houses, trees and other vegetation) where you can freely walk through and also fly a bit.
Important is the total freedom in the movement.

It was inspired on an old OpenGL (or maybe IRIS GL?) demo I have seen on a computer fair at the early 1990's, running on a SiliconGraphics Indigo workstation. In this demo, a small city was rendered and the user could freely move around, without restrictions. Flying over the area was also possible.
Also the old DOS game "Stunt Island" (from Disney Interactive) was an inspiring factor.

It is not a finished project.

Features implemented so far:

- terrain engine, based on terrain blocks (chunks). Heighmap has dimension 1024x1024.
- discrete level-of-detail for terrain blocks. This is not the Chunked-LOD algorithm by T.Ulrich but there are a few similarities to it (f.e. the crack-filling technique to avoid gaps due to T-junctions at block boundaries).
My algorithm is an easy view-dependent but static-LOD technique for terrain chunks (currently, two LOD levels are pre-computed for each chunk),
with a workaround against cracks (gaps) that arise at block boundaries with T-junctions.
- terrain blocks are rendered as VBO index-arrays (or VertexArrays if VBOs are not supported)
- terrain texturing is based on 3 textures which are combined together (in GLSL fragment program) based on terrain slope.
Based on the terrain-texturing tutorial from www.delphi3d.net (Tom Nuydens).
- frustum and occlusion culling for terrain blocks (using HW occlusion queries in an asynchronous process).
Some hint in the book "More OpenGL Game Programming" helped me.
- water rendering with DuDv maps, caustics and full world reflection. Implemented using GLSL.
(Thanks for GameTutorials.com for the idea (HeightMap Tutorial 6)).
- world-renderer part can render 3DS (using Lib3DS) and Milkshape-models (see the description for scene rendering below)
- skeletal-animated milkshape objects also supported (so far, the dogs are animated models)
- static level-of-detail for world objects (at the time, some houses have 3 different LOD variants)
- collision detection for some world-objects (mostly houses), using the ColDet library (not 100% perfect)
- particle system (smokes at the chimneys)
- level editor which allows populating the objects onto the scene
- skybox (static)
- sound effects and background music (using the FMOD library)
- menu system using textured font
- in-game text rendering using FreeType
- user movement is based on forces and gravity
- written in C++

I have experimented with the following techniques for scene (world-object) rendering:
- Simple frustum culling (this mode is used in the level-editor-mode)
- VBOs (and as fallback: VertexArrays if vbo is not supported) with index-buffers, for rendering the whole scene in a few calls, iterating through all materials (-> each material has its own VBO (vertex + index-buffers), for minimizing state changes).
- Octree (each octree-node can have maximum 20 objects) which is probably the best technique for this engine (-> model-LOD (and fade-out) can be applied while rendering the objects of the visible nodes).

I'm currently working on:
- More intelligent terrain LOD technique.
I'm investigating the chunked-lod algorithm by Tatcher Ulrich and other algorithms as well (f.e. SOAR and its variants).
- object-rendering optimizations: creating LOD for all objects, using billboards when the objects are in distance (especially for trees, bushes, ...). These billboards should be generated automatically to save a lot of manual work.

ToDos (a lot more could be done but here the most important ones):
- shadows (I have experienced with HW shadow-mapping, dual-paraboloid shadow-mapping and shadow volumes. I have had the most success with the shadow-volume algorithm (as in Doom3) but it worked only for 100% error-free, closed objects)
- lightmap for terrain
- detail-texturing for the terrain (detail-textures should be used around the camera, and only base texture at distant areas, as in Oblivion)
- water refraction (with fresnel term), that is, combine underwater terrain with water reflections
- underwater fog (an easy task)
- better transition between ocean and skybox texture (at the horizon)
- terrain paging (for non-island levels) and/or terrain reuse at the end-of-the-world. In general: solving the end-of-the-world problem
- from the gaming perspective:
- more world objects, additionally level design
- better AI for the dogs (A* path-finding),
- more complex story,
- compass to help finding the closest flower,
- dog-feed or cat for drawing off the attention of dogs, ...

To see some screenshots, go to
http://flowerking.ne...creenshots.html

To download the game (windows binaries):
http://flowerking.net.tf/download.html

Homepage of the game: http://flowerking.net.tf

On my GeForce 6800GS, it performs between 80 and 200 FPS,
on older machines (without OcclusionCulling / VBO support) the performance ist much slower and the visual appearance could be poor (no roads / water due to missing GLSL support).

Note that I'm not a game-programmer (and not a level designer). I am only an OpenGL fan and 3D graphics programming is only my hobby.
(Currently I have a job in the telecommunication industry.)
So some of the features in this engine are possibly out-dated, but I have very few time to work on this project.
Of course, I would like to try to keep the engine as current as possible.
I don't want to make money from this (at the moment. Maybe in the future).
I can also release the source-code for the game (currently only a binary version is available on the website).

I would be glad to hear some comments about this engine (so far, I have got only very little feedback on it).
What are your opinions, which features should be improved, what is missing to achieve better visual experience, what direction should I go for improving the features/gameplay, ...
Also bug reports and performance informations are welcome (press F twice while playing, for interesting infos) !


kind regards,
AXP

Some screenshots:

Posted Image
Posted Image
Posted Image

#2 Reedbeta

    DevMaster Staff

  • Administrators
  • 4979 posts
  • LocationBellevue, WA

Posted 12 October 2007 - 07:16 PM

Neat concept, and it looks very cool, especially the water reflection. Did you do all the artwork yourself?

I think the sunlight could be a bit brighter (it kind of looks like it's about to rain...). Also having shadows would really increase the immersiveness of the environment (I know that's next on your todo-list). For shadows cast by sunlight I'd recommend using perspective shadow mapping - have you looked into that technique at all?

Also, you mentioned that the roads don't show up on older hardware due to missing GLSL support - could you elaborate a bit? How are you rendering the roads?
reedbeta.com - developer blog, OpenGL demos, and other projects

#3 J22

    Member

  • Members
  • PipPip
  • 92 posts

Posted 13 October 2007 - 06:55 AM

"Friends don't let friends try to implement PSM". I would further recommend checking out cascaded shadow mapping.

#4 AXP

    New Member

  • Members
  • Pip
  • 2 posts

Posted 13 October 2007 - 10:42 PM

Reedbeta said:

Neat concept, and it looks very cool, especially the water reflection. Did you do all the artwork yourself?

I think the sunlight could be a bit brighter (it kind of looks like it's about to rain...). Also having shadows would really increase the immersiveness of the environment (I know that's next on your todo-list). For shadows cast by sunlight I'd recommend using perspective shadow mapping - have you looked into that technique at all?

Also, you mentioned that the roads don't show up on older hardware due to missing GLSL support - could you elaborate a bit? How are you rendering the roads?

Thanks for the tips.

No, the models are found on the net, I have only manipulated some of them a bit (mostly the material properties). I am not a good graphician.
Also, the levels are only example levels, they don't have any concept. The level design could be done probably more better, but I spent only a few time on this task. (Note: everybody are welcome to design new levels or alter the existing ones.)

Yes, I am also not happy with the object lighting, I will check the sunlight parameters. (ideal would be perhaps some HDR technique).

I checked the LISPSM algorithm and it is a very promising technique, but I think I will begin with a simpler approach (projective shadow textures). As the light source is not moving in my engine, a lot of work can be precomputed.
However, as a long-term plan, some PSM or Cascaded SM are the ideal candidates.

About the roads: I mean the "soft" roads on the first level (Sunny Island), these are in fact one of the three texture layers which are blended together as defined in the texture-coverage map (see screenshots below). Originally, this was done with texture-combiners but as I learned GLSL, I moved this part to the shader level becouse it is more simple and efficient. Since then, the terrain multitexturing is disabled on older graphic cards (in this case, one simple texture is repeated on the whole terrain).

Screenshot from level "Sunny Island" with some roads:
Posted Image
The coverage map for this level:
Posted Image

The stone roads on level 2 are normal world-objects.

kr,
AXP

#5 Shakedown

    New Member

  • Members
  • Pip
  • 3 posts

Posted 30 October 2007 - 02:43 AM

Hey looks good, keep it up!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users