Submitted by , posted on 19 March 2004

Image Description, by

This screenshot shows my tile based terrain editor I have been working on the last 3 months for the University of Twente (the Netherlands). It was a free project I opted to do for 4 study points, for the people who don't know what that means... it means I should spend 160 hours on it. I guess there is no need to say that I didn't make it in these 160 hours, but it was fun. The code is written in C++ using OpenGL for rendering. It also uses a virtual file system so that all data can be stored in a single data file. (The filesystem does support more files and automatically uses the most recent file in case of 2 files with the same names distributed in more that one data file)

I actually made 2 different versions. The first one was inspired on the Warcraft (R) III Reign of Chaos (tm) world editor, but as it turned out this required me to create special tile textures and since I am not an artist... (I finished it though). The second version, inspired on the Command & Conquer (R) Generals (tm) world editor, enabled me to take a picture, make it tileable and plug it in. It allows you to specify over how many tiles the textures should repeat to make the tiling among different sorts virtually invisible.

Terrain editor features:

- Every operation is based on a brush, the green/blue thing in the top left of the image. The brush has a solid (green) and feathered (blue) portion, which are both adjustable in range. The solid part fully applies the effect used (by the specified strength of the effect) and the feathered part does this only partially, which results in nice looking terrains without much effort. The brush is currently available in 2 shapes: round and square.

- Elevation manipulation of the terrain mesh using the brush can operate in 5 modes, the blue icons on the top right of the image from left to right: Raise the terrain, Lower the terrain, Plateau the terrain (set it at the specified elevation level), Smooth the terrain and Noise the terrain (usefull for creating terrain that is not too smooth, it is terrain remember)

- Tiles can have different textures applied that blend over into eachother. In contrary to the "bug"/"feature" limit of 3 way blend in the Command & Conquer (R) Generals (tm) world editor I can blend all possibe layers (5 for the people who know how it works).

- All operations can be undone/redone

- Terrain can be saved/loaded ofcourse

- Camera can pan, zoom-in, zoom-out and rotate around the terrain.

- The terrain is lit. The lighting is both per vertex lighting and lightmap lighting which both can be enabled/disabled separately. The color of the light can be changed to make the terrain appear in the night etc. The lightmapping is quite fast, generation of 1,000,000 lumels costs about 3-4 seconds on my computer (1400Mhz AMD Athlon). I created a special algorithm for it since normal raytracing algoritms took in the order of minutes. Lightmaps can be saved for the game (but this is not yet supported in the editor). The shadows gets less opaque as they get further removed from the point that created them.

- Rendering the terrain is quite fast because I precalculate the visible data using a blend between Quadtree and Octree and store the visible data in efficient rendering formats. This is only updated whenever the camera moves, yielding framerate up to 500+ fps (on an ATI Radeon 8500 LE, rendering the number of tiles you would see in a game: 400 tiles that is, using multiple layers)

This project was basically thought up because I would really really like to work in the game industry and this was a way to gain some more experience on that subject. Therefore everything, from features to rendering speed, is game oriented.

Well that is about all there is about it... please let me know what you think of it, thank you in advance.

Ebor Jan Folkertsma

Image of the Day Gallery



Copyright 1999-2008 (C) FLIPCODE.COM and/or the original content author(s). All rights reserved.
Please read our Terms, Conditions, and Privacy information.