Introducing … TerrainModule

Sounds boring, doesnt it?

Well, it probably is. But that doesn’t mean I can’t get excited about it, because it’s replacing our old and trusty warhorse of a terrain engine with something that’s less likely to turn your computer into radioactive slag every time someone decides to smooth an area of your sim.

There’s some important changes to how Terrain is handled internally in OpenSim – or to be more correct, how it isnt. Previous versions of OpenSim have relied on the internal terrain engine – this has been a problem because you could not replace it easily, and it was tied pretty heavily into the core of OpenSim. The new engine promises to be more flexible, as you can still operate the sim without it, it’s also closer to the OpenSim spirit of being modular — you can swap individual brushes and rewrite them without major effort.

Over the next few weeks, I aim to write a few more interesting terraforming brushes (my ultimate goal will be to write a series of erosion simulating brushes) and also rebuild part of how the console commands operated.

What the effect on you today will be

  • The terrain console commands will not work. You can still load and save terrain, but you need to use the new ‘script terrain save <filename>’ and ‘script terrain load <filename>’ operations. The other commands have not been implemented just yet.
  • Terrain operations should be faster. Particularly things which apply ‘Area of Effects’ such as select-drag-apply functions.
  • Smoothing and Flattening should no longer freeze the sim when using a debug build.
  • We will be able to support terraforming individual parcels, by the parcel, using the cutout bitmap in the next few days.

So, for developers – if you want to write your own brushes, it’s pretty simple. Take a look in the “Environment/Modules/Terrain” folder to see the directories “FloodBrushes” and “PaintBrushes” — flood brushes are ones that apply to an area (such as smoothing a selection), paint brushes are ones that you can drag across the terrain (such as raising or lowering normally). Brushes are passed a copy of the sim’s ITerrainChannel, and are expected to modify that channel. Please dont create temporary channels if you can avoid it, as creating and destroying channels is computationally very expensive.

Moving on – console commands. Part of the problem with the old Terrain Engine console commands were, they weren’t exactly the best things to document as they were heavily oriented towards how the engine speaks with the old Channel classes, and not how a user should speak to the engine. When I recreate these, I am thinking more along the lines of a rigid programming API interface, which can be self-documenting (ie min vals, max vals, etc) plus also be programmatically accessible, say for the purpose of remote admin. This is going to take a bit more thinking – but it is on the agenda.

Adam out!


One Response to “Introducing … TerrainModule”

  1. Morning Deerhunter Says:

    Hi – an easily accessible list of “script terrain” commands would be appreciated.
    Is there one anywhere?

    So far I have:
    script terrain select – select a region to change…

    script terrain load – does this work with png or other filetypes?
    script terrain save

    script terrain fill – or other value

    There must be more but I havent found them yet!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: