dynamically changing terrain type?

davidlallen

Deity
Joined
Apr 28, 2008
Messages
4,743
Location
California
In Dune Wars, I am trying to implement something like Hell Terrain. If you are familiar with the Dune books, the Fremen have a project to transform the desert planet back into a wetter planet by terraforming it. As they build wind traps and plant desert grasses, the planet gets greener. This is kind of like Hell Terrain, except instead of making things worse it makes things better.

I have the terrain types inserted and my python code is able to use setTerrainType(newtype, true, true) to cause the new terrain to appear. However, the new terrain does not blend correctly as you can see from this screenshot. The edges of the new terrain are straight lines with no blending.

Clearly this works correctly in FFH. Is there some extra step I should take beyond setTerrainType to get the dynamically changed terrain to blend?
 
It doesn't really have something to do with coding but the art. Terrains that normally are not together were not coded properly to blend. I've seen something like this in FfH with Burning sands and Marsh.
 
It doesn't really have something to do with coding but the art. Terrains that normally are not together were not coded properly to blend. I've seen something like this in FfH with Burning sands and Marsh.

That is curious. I will double check, but AFAIK the terrains which are not blending are vanilla grass, and a recoloring of vanilla grass. Is there a tutorial/faq which explains a little more about the TextureBlendXX fields in the terrain artdefines? Is there anything else which affects the blending?

EDIT: possible self-help at this link. It is refar, I am sure it is right :-). I will try tonight.
 
Betcha the code doesn't really realize that there is a difference between the two, and just procedes as if they're both regular grass.
 
Deliverator has pointed out the answer. In TerrainInfos, make sure that each terrain has a unique LayerNumber. By copying vanilla grass and renaming it, I had the same layer number twice, and this prevents blending. So this is solved.
 
Back
Top Bottom