Author Topic: Advanced Map Geometry.  (Read 850 times)


  • Guest
Advanced Map Geometry.
« on: 7 October 2011, 13:23:06 »
Yes, that's right. Another thread about maps. By me.....Sorry  :-[.

But seriously this is the only thing about Glest which I dislike. It would almost be perfect if this and a couple of other things were fixed, and it would probably be up to graphical standards of a comerical game. My main beef with the map geometry  is that it is made up of simple squares,which means there can't really be any complex angles or cool shapes. It makes everything extremely boring and fake.  Basically the only way the terrain will ever look any realistic is if we implement.... Triangles!

I've been looking at how other terrain engines to it... Heres a picture of 0 A.D (Yes, I'm comparing to that again  ::).)
(P.S Here is the code for it (I think, lol)
This is just me playing around in the editor.

And heres how the tiles look:

As you can see the tiles all warp and grow into anything, and behave more like a mesh. I could be wrong but I think the the triangles flip when necessary to conform better.... If this was implemented then it would be a much better solution than MG's cliffs (and would look a heck of a lot nicer too, no offense MG devs). It would also allow things such as bumpy looking surfaces.

I see this as not a feature... but something Glest will have to do inorder not to fall behind the times and become forgotten. This, along with bigger ground textures and bump maps on surfaces... GAE would pretty much be the best looking, open source, RTS engine out there ;).
« Last Edit: 7 October 2011, 13:40:21 by Psychedelic_hands »


  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Advanced Map Geometry.
« Reply #1 on: 8 October 2011, 04:22:16 »
I love triangles, mate. They really have it figured out.

In all honesty, subdividing the cells into triangles probably could improve the surfaces considerably, but how would it be done without a large change to the map editor/map format? I wonder if there's any way triangles could be used to make curved paths, islands, edges etc... Landmass, probably, but paths (with surfaces)?
Edit the MegaGlest wiki:

My personal projects:


  • Guest
Re: Advanced Map Geometry.
« Reply #2 on: 8 October 2011, 12:02:48 »
In 0 A.D. the terrain triangulation has nothing to do with the map format or editor - the maps are just a 2D heightmap of square tiles, and the triangulation is computed automatically by the renderer. OpenGL can't render non-planar quads anyway, and the drivers will split it into triangles in a random direction, so we're just doing that triangulation explicitly so we can control the choice of direction.

The relevant code is GetTriangulationDir which chooses between the two triangulation directions for a tile based on its corner heights (using a heuristic that seems to make hills and valleys look alright).