SSwift terrain system - improvements

Blitz3D Forums/Blitz3D Programming/SSwift terrain system - improvements

slenkar(Posted 2004) [#1]
What would you like to see in SSwift's terrain system no.2?

He was saying before that no-one buys it so maybe we could give him some ideas to improve it.

Id like to see support for tilable terrains for big worlds.(if it hasnt got that already!)


jfk EO-11110(Posted 2004) [#2]
I am working with indoor scenes most times these days, so it's no surprise that I don't buy a terrain system. But at least I have just ordered his Shadow system.

For Terrains I'd like to see something more. What I would really like to see was an automatic landscape generator that takes clima-data as parameters and creates a complete vegetation. Then, the landscape is saved as a Mesh. The designer can then remove some trees and place buildings etc. in the landscape. This whole thing should also support some kind of LOD optimation, so huge worlds would be possible.


Magitta(Posted 2004) [#3]
And the voxel terrains would be awesome. Then we'd be able to create cliffs and wicked exotic scenery.


ckob(Posted 2004) [#4]
well if he had a website up with more screenshots and a betetr demo showing the engine as well as an editor I think more people would buy it.


Canali(Posted 2004) [#5]
I bought the system so I guess I'am able to express a wish list :)

As system is great and very functional.
IMHO it has only two problems:

- the gaps between the meshes (it happens between meshes that have different detail);

- the fact that the terrain you obtain is not affected by any light (ambient, spot, omni, etc...)

I would also add that the author is very very kind and helped me to use it giving me even external tools to calculate lightmaps.

All in all I can only reccomend it.


sswift(Posted 2004) [#6]
Thank you for the kind comments!

The terrain system has now been updated so that normals are correctly calculated for all tiles, enabling the use of dynamic lights with the terrain.

Anyone who hae purchased the system and would like the new version should email me. (Please do not post request here.)


Canali(Posted 2004) [#7]
Can confirm the the new systems works *perfectly* with lights.

C'mon guys, you should really give it a try.
;)


slenkar(Posted 2004) [#8]
Canali how about you let us have a look at a screenshot of what you are doing?
or Swifty release a terrain example with the Blitz mario demo so we can walk about the landscapes


Canali(Posted 2004) [#9]
I'll surely do that Slenkar.
But since it's just two weeks I'm coding on B3D, would be of little use.

In few days (2) I'll leave for vacation, but you can bet that, as I'll work on my project a little more when I'll return, I'll show something.

All I can say is that the terrain system of SSwift wors very well, and is really highly customizable.

Load how many brushes as you want, use a lightmap (or easily texture the terrain using all the available texture-levels), organize easily the polycount so you can keep a good framerate even with LARGE maps, and all the code is very well commented, so is easy to put the hand and make our own fixes.

It has now only a little flaw, but is described in the author page, so you know what you get.

And the price is really affordable.

I think that the fact is that people often don't know what to do and wait inspiration from demos.
And this, imho, is a mistake.

Is eaqsy to understand what this terrain system offers, now it's to you to understand what you need for your project.

Cheers.

PS: And sorry for my porr english, but I'm Italian ;)


sswift(Posted 2004) [#10]
Slenkar:

You can walk around the terrain in the demo I already released, what does it matter if you're walking around it as mario or not?


slenkar(Posted 2004) [#11]
its been a while since I used the demo,forgot about that,

cant seem to work out how to download it again,


sswift(Posted 2004) [#12]
Left click this link, then left click link that appears on resulting page.

http://lightning.prohosting.com/~sswift/swift-terrain-system.zip


Mike V(Posted 2005) [#13]
I'm "on the market", so to speak, for a good terrain system and I like the seamless nature of the Swift system as the game I'm envisioning would make excellent use of a seamless world setup (no, it's not a MMORPG :-p). I'm curious about a few things though...

1. Control over the terrain:
Basically, how much control do you have over the terrain in this system? Is there support for holes in the ground so you can build "into" it for things like caves and the like?

2. How is texturing handled:
Is it a deal of a single, large color map with a detail texture tiled across it? Or, is it like the Torque engine system where you have layers of textures that can be painted, erased, blended by height, slope, etc? Or is it just arbitrary tiling of textures across the surface?

3. #2 sorta ties into this.. what kind of support is there for blending from one texture set into another? For example.. Running through an open field would have greens and some browns for dirt/grass.. then you enter a forest area where you'd have leaves and some green, mossy texturing going on perhaps.. then the terrain leads into a boggy area, so now you have dark, muddy and murky textures, before heading into a mountainous area... and so forth.. How is this handled? Again, I know this ties into #2 as it's dependent on how the texturing is handled, but it's an additional detail I'm curious about.

4. Placement of objects:
I don't mean random scattering of trees, boulders, etc.. I mean deliberate placement of structures, buildings and the like? How is this handled? How much "hands-on" access do you get to such objects to make sure they're positioned, scaled, rotated and such as you want them?

Overall, I like the looks/sound of the terrain engine in and of itself.. but it's the integration with all the other elements that come into a play within a complete game environment that I'm concerned about.. Thanks!


sswift(Posted 2005) [#14]
http://www.blitzbasic.com/logs/userlog.php?user=963&log=270


Is there support for holes in the ground so you can build "into" it for things like caves and the like?



There is no native support for holes.

You could manually create meshes for those tiles which you want to have holes though.

Type TerrainTile

	Field Current_Detail_Level

	Field TileHeightmap.Heightmap		; The heightmap which this terrain tile uses.
										; More than one tile may use the same heightmap.

	Field Mesh[TERRAIN_DETAIL_LEVELS]	; This is a list of pointers to the entities which represent each detail level of this
										; terrain tile.  The detail levels are 64, 32, 16, 8, 4, and 2.
End Type 


Here is the type where all terrain tiles are stored. As you can see, it's very simple. The system is desgiend to allow you to either load a heightmap and have all the tiles created automatically, or allow you to manually create the tiles and all their detail levels yourself.

Then the system automatically picks the right detail levels and displays the tiles that are near enough the camera.

So you could load a heightmap and the replace some of the tiles with your own custom tiles that have caves. You could create those in a 3D package and import them. You would have to create several levels of detail though. You probably would want to just delete all the polygons inside the entrance at the lower detail levels since the player would be too far away to see in anyway.


Is it a deal of a single, large color map with a detail texture tiled across it? Or, is it like the Torque engine system where you have layers of textures that can be painted, erased, blended by height, slope, etc? Or is it just arbitrary tiling of textures across the surface?



The terrain is made of "tiles". Each tile can use any texture you have loaded. This texture will be stretched across the whole tile. The size you choose for the tiles determines how much the texture is stretched. I set the default to be a good balance between having the texture at a decent resolution, and not having too many tiles visible at once.

These textures also can be flipped on each axis seperately, so you can reuse textures that transition between one surface and another.

The tiles can also have a lightmap applied. The system will allow you to automatically stretch this lightmap over all your tiles.

It would be trivial for you to make it also apply a detail texture to each tile, though I'm not sure how good this would look, as each tile would have to have the same detail texture all the way across it, and then if you changed detail textures at the next tile it would be obvious unless you changed the detail texture slowly across multiple tiles.



Running through an open field would have greens and some browns for dirt/grass..



You can load multiple textures, so you can apply different textures to different tiles to achieve this in much the same way as you would in a 2D game.



4. Placement of objects:



The way my system works is quite simple. You call a function to load a heightmap, and call a function to turn that into a terrain. Then you call another function to apply the texture you want to each tile of the terrain. Then you call a function to apply the lightmap.

Once you've done all this you won't see anything on the screen. You call a function in your main loop, and pass it the location of the camera. The function then chooses which tiles to make visible, and selects the appropriate detail level.

Where you go from there is up to you. You can load objects and place them by using a function that tells you the height at any point on the terrain. By using getting three heights, you can calculate the angle of the terrain in a particular area using a cross product, and use that to angle your objects if you wish.

It works pretty much the same way as the terrains in Blitz. The system will not interfere with the rest of your program in any way. It just makes the terrain appear on the screen.

To make the player walk over the terrain, just get the height at his current position, and move him up to it if he is below it.


It's far from perfect, and if I coded another system I might do things differently, but each method has its own limitations. The method I chose here works pretty well, and is pretty easy to use. Other methods would be a lot harder to use but might get you better looking results.


If you have not checked out the demo, you should. And you can try out the tile texture stuff if you run in windowed mode so you can see the mouse and click on the terrain. I don't remember the hotkeys for changing tile textures... pgup/dn I think... ... I think I either mention them in the demo, or on that page I linked to.


slenkar(Posted 2005) [#15]
Is it a lot faster than a blitz terrain?


Canali(Posted 2005) [#16]
Yeah, and can handle much larger thanks to a LOD system.


sswift(Posted 2005) [#17]
It can do a terrain of the same size as a Blitz terrain but with greater detail, or less detail at a higher speed, or the same detail with a greater view distance. And in all cases it allows much greater texture detail.


Canali(Posted 2005) [#18]
Hi SSwift, did u fix the gaps "problem" in it?
I tought it could be easy to you since it occurs just when meshes with different detail join.

I guess U cuold also improve it to support an "infinite" scrollable terrain to obtain something like Morrowind terrain.
No one did it and it could meke ur system much much more interesting for coders/buyers.

Cheers!


sswift(Posted 2005) [#19]
Canali:

No, I didn't. There has never been enough interest in the system to justify making major changes. I sell only one shareware license every two months. Even if improving it doubled interest, that would still only be one sale per month. Just not anywhere near enough to justify the massive amount of time and effort, given almost nobody is willing to pay more than $20 for my systems. :-)

Also, removing seams would be difficult, add a lot of complexity to the system, and change the way the system works drastically enough that certain people might find the way they want to use the terrain system no longer works.

My original plan was to adjust the vertices at the seams in realtime, but that turned out to be much too slow. The only other possible way to fix them, would be to maybe make X copies of each tile, to handle each case of resolution difference in adjoining tiles.

In other words, one mesh for if the tile to the north is lower in resolution, one mesh for if it is higher in resolution, one mesh for equal in resolution. Going all the way around the four sides, we find we need 16 different combinations, times 3... 48 different tiles, just to get rid of one set of seams around one tile!

So that method is unworkable. There's already the apparent problem of too many meshes in video ram to contend with, so we don't want to compound that.