City Editor 2.0 / Terrain editing

Published April 16, 2007
Advertisement
For the last 3 days I've been working on "version 2.0" of the in-game city editor. I've written the terrain, and the codepath for the new editor esentially from the ground up in the last 72 hours.

I'm very happy with how it's turning out...I have probably got another day of work left, re-integrating the roads & buildings into the maps and making it easy/fun to use the road & building placement tools.

So yea, the editor is integrated into the game client, and can be accessed from the main menu. I really think that if I spend a few days and come up with an integrated custom city browser, people will be even more likely to create custom maps/cities. The user would be able to upload their custom cities to one of my servers and browse through other's uploaded cities. Maybe that's just a pipe dream, I've got a lot of other stuff to focus on right now....but I think it might be crucial in extending the life of the game.

In addition to making the map sizes totally variable, cities 4X bigger than before are now possible...maybe even several cities on a single map seperated by some empty terrain. Lots of things are possible now...


Oh yes...I also have a video you can watch of the terrain creation process [grin] It's already a lot of fun [for me at least]. Though there are still some slight visual artifacts in this vid...

Download City/Map Editor work in progress video [25MB MPEG]


Keep in mind this is just a bare-bones terrain system I have tried to keep it as simple as possible while still making it general enough to re-use for future projects [the underlying code that is]. I've also touched-up the water rendering shader using somewhat odd way of rendering the sun's reflection. It looks pixelated in screenshots but in motion it appears to shimmer. It still needs some work tho.

The terrain textures are blended inside the pixel shader based on the height of the pixel. I was going to blend based on the steepness of the terrain, but the height ended up being enough.

I could tesselate the terrain geometry a lot more, there is no dynamic LOD going on here. The terrain grid is fixed to the size of the tile system in-game. I invalidate/re-build the terrain's vertex and index buffers on-edit. The game maintains 500+ FPS on a standard size map, with 2 real-time 1k^2 shadow maps, and real-time water reflections [On my Geforce 8800 [grin]]. When the GUI aspects are rendered the framerate drops ~100 per-window...the GUI rendering is painfully un-optimized...but I've got other things to worry about.

And here are the screenshots...



Note the 500+ FPS...






Shots of the terrain/water @ various times of day...


First WIP screenshot of the new editor...


Progress...


""




HIGH RES...


- Danny
0 likes 4 comments

Comments

ViLiO
Looks absolutely breathtaking and it is incredible how quickly you were able to get it up and running

Would you be willing to share some of the details on your day/night cycle? I've been looking a lot at atmospheric scattering lately but nothing I've read/implemented really covers night time and your sky is some of the nicest I've seen [smile]

All the best,
ViLiO
April 16, 2007 06:57 AM
dgreen02
Hey thanks a lot [grin]. No real-time atmospheric calculations here...just a bunch of hand painted 1D lookup textures converted into arrays as a pre-processing step :-) A seperate one for nearly every aspect of the sky...from cloud color, sun color, ambient, fog, etc.

The sky background is an actual 2D texture, I scroll the U coord on the skydome. The colors still need tweaking though, I think the morning sky is too "pink"...[grin]

- Danny
April 16, 2007 07:21 AM
Todo
Excellent work, so keep it up! Three questions:

* did you base the rendering of the sky on the well-known ATI paper about skylight scattering?
* what does the option "Do Grid Z-Test" mean?
* is the water plane one continuous plane or does it get cut at the shorelines?

Thanks a lot and can't wait to play this beast :-).

EDIT: scratched the first :-)
April 16, 2007 07:58 AM
dgreen02
"Do Grid Z test" enables Z buffering on the Grid that is overlayed on the map. Maybe I should label it something else?

Yes the water is perfectly culled to the terrain in real-time. It's not just a single plane across the level. If any neighbor heightmap values are below the water level, the tile is flagged as "having water".

I should have shown that in the video...maybe in the next one :-D

- Danny

*Edit actually here ya go -


April 16, 2007 12:08 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement