Thursday, May 22, 2008

Shaping worlds

For the last couple of days I've worked on the tools for shaping the world. As my goal for 0.5.3 is to have a better world which shows off all the new media the first step is to alter the world to allow for more expansive forests and far away mountains. There's been a terrain editor in Ember for some time, but it has been very rudimentary and lacked some features which would make it easier to alter the world. One of these features was the ability to alter more than one terrain point at once. I've now added the ability to set a "radius" in the editor. That will alter all terrain points around the one that the user interacts with. This is very helpful since it allows us to quickly raise and lower large swaths of land.

When I started fiddling with that I found a couple of bugs in the terrain code which prevented it from working as smooth as I wanted. As I've squashed those bugs the editing is becoming much more smoother. I also found that the way the terrain is reloaded is very inefficient. Currently we unload the whole terrain page and then load it again. However, all that we change is just the height data, so it would be much more efficient to tell the engine just to recalculate the affected meshes from updated data. I've done some changes to the code which allows for this much more efficient approach, and it's beginning to look good. There's still a problem with the LOD calculation not being correctly updated, but that shouldn't be too hard to fix. All in all this will allow for the ability to quickly create a whole new world from a blank slate of terrain. Very exciting stuff.
Post a Comment