News:

SimuTranslator
Make Simutrans speak your language.

ground objects with variable position like trees, groundobj with slopes

Started by Leartin, February 27, 2016, 08:18:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Leartin

Title pretty much says it.
Some little details simply don't require a full tile, and would work a lot better the way trees do.
Now of course, you could just define these objects as trees, but that means they spawn and despawn on their own, appear much more often in forests.
So the request is a new object which is based on a tree, but stripped of pretty much everything trees do - no spawning, no forests, no age and growing. Just created once at map generation with the rest of the ground objects, placed with a random offset on the tile.
An additional nice to have would be to a parameter for a maximal offset, so objects which require a bigger area would spawn slightly further away of the tile edge to avoid placement outside of the tile (would probably be great for trees as well)

prissi

Trees are very different from any thing else on the map, since they are so much more than anything else. Hence basing something on trees is a bad idea.

However, how about ground object with an optional range for offsets (and default zero range for compatibility). Wouldn't do that the same trick?

Leartin

I can see two differences:
1) there can never be more than one gound object on one tile. So it's either a patch of flowers or a little monolith, but never a monolith in a patch of flowers.
2) ground objects are not placed on slopes.

Both things that would be nice to have. But assuming adding the offset to the current ground object is relatively easy compared to creating a new object type, it seems good enough. And to me, it would make sense to seperate ground objects from ground textures, so maybe something like that can come at a later time to allow ground objects on alternate ground textures anyway.

prissi

I think there is code for groundobj on slopes (as part of the preparation for cliff on the water).

Ok, just looked, it was limtied to 16 slopes. If there are 80 images (empty ones "-" count too) defined, then the groundobj displays slopes. Hence climate=water and slope images makes a cliff already possible (given a high enough groundobj density.)

Leartin

That's what I assumed, but sadly it did not work when I tested it.

Leartin

I think something got messed up here. The title does not make much sense now.

prissi

There is a maximum left, hence my typing did not appear in the title.

But I checked and the climate=water does indeed not work. The whole beach concept is really messed up, as the transparent water is only available with non slopes beaches.

prissi

r7701 now suuports shores (groundobj with cliamte=water) as well as groundobj with slopes. If there is a empty image for a certain slope, it will not be built there.

Moreover, support is incomplete, i.e. you can delete the shore objs and they will not respawn. Consider this support rather a hack for testing until proper display routines are integrated into the ground.

Leartin



So far, it works perfectly fine for me. Wonderful addition. (Though my execution is not so wonderful yet xD)


prissi

May I get the graphics? I have just an ugly symbol I use for testing. I would like to intergrate it properly into the ground.

Leartin

I did not get too far, only 4 graphics exist yet, but you can have those. EDIT: Done with test graphics


obj=ground_obj
name=cliff
copyright=Leartin
cost=100000
DistributionWeight=10
seasons=1
climates=water
Image[39,42,48,51,66,69,75,78][0]=image/cliff.<$0/16>.<$0%16>,-100,0
Image[31-32,34,61-62][0]=image/cliff.<$0/16>.<$0%16>,100,0
Image[0-79][0]=image/cliff.<$0/16>.<$0%16>,0,10



(slopes in magenta to keep track, of course for actual needs to be deleted)

prissi

Ok, following system:
obj=ground
name=shore
Image[0][0]=-
Image[slope][snow]=-

Image 0 will be never used.

Additionally you can have sporadic groundobj at beaches. Those are groundobj with climate water

I consider this finished for now to have something for testing.