



Throwing an earth chunk and getting a part of this would be weird in it's own way...

We don't have a function to read which texture a material has, neither is that passed to the chunks which are created, but that should be relatively easy to do. (C4Object.cpp:2877) But you also need an extended version of InsertMaterial (C4Landscape.cpp:1256) to specify the texture (And probably of DrawMaterialQuad and some other functions). I don't see a reason that I couldn't do that, just a question: Should I pass around the texture names per String or per Index (by allowing script access to C4TextureMap::GetIndex)?

We don't have a function to read which texture a material has, neither is that passed to the chunks which are created, but that should be relatively easy to do. (C4Object.cpp:2877) But you also need an extended version of InsertMaterial (C4Landscape.cpp:1256) to specify the texture (And probably of DrawMaterialQuad and some other functions). I don't see a reason that I couldn't do that, just a question: Should I pass around the texture names per String or per Index (by allowing script access to C4TextureMap::GetIndex)?

Well, the material number is an internal value which can change, too. (With savegames, e.g.) We pass it around anyway, because it's a lot faster than copying a string every time.

> We pass it around anyway, because it's a lot faster than copying a string every time.
It isn't. The difference between a String and an Integer for this is in the noise, while the added robustness is significant.
Well, see it the other way: If you made a bunch of earth chunks from different sources and threw it all together, would you want the result to be a pixely intermingling of all the different earth kinds you used? From an aesthetical point of view, I think the newly inserted pixels should just adapt to their immediate surroundings.
That should be a straightforward engine change, as well. You'd just have to insert a bit of randomness so it doesn't end up producing hard lines.
That should be a straightforward engine change, as well. You'd just have to insert a bit of randomness so it doesn't end up producing hard lines.
You are confusing me. The landscape shader is coloring pixels all the time? Each pixel has a material and a texture, both can be pretty much chosen as you wish, as long as there aren't more than 127 material-texture combinations total. An earth pixel getting inserted could quickly check surrounding pixels and derive the texture to use from that.
Edit: This is what I mean.
Edit: This is what I mean.
Ah, okay. I thought you were talking about a random color like in the old SetLandscapePixel(). Textures are fine, of course.
The randomness I was talking about is that it shouldn't have a fixed order like always giving priority to material directly below, as that would produce a straight vertical line. With choosing randomly from pixels around as my patch should do, it should give you a more natural random-walk line when you spray earth over a texture switch. I'll probably test that later today.


As for using one material per texture, that's just unnecessarily complicates scripts. Unlike Clonk 4, we can have one material per distinct gameplay element and should finally reap the advantages of that simplification.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill