The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: Leartin on February 27, 2016, 08:18:10 PM

Title: ground objects with variable position like trees, groundobj with slopes
Post by: Leartin on February 27, 2016, 08:18:10 PM
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)
Title: Re: ground objects with variable position like trees
Post by: prissi on February 27, 2016, 10:38:45 PM
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?
Title: Re: ground objects with variable position like trees
Post by: Leartin on February 28, 2016, 08:18:01 AM
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.
Title: Re: ground objects with variable position like trees
Post by: prissi on February 28, 2016, 11:27:45 PM
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.)
Title: Re: ground objects with variable position like trees
Post by: Leartin on February 29, 2016, 04:29:54 AM
That's what I assumed, but sadly it did not work when I tested it.
Title: Re: groundobj with slopes do not (ground objects with variable position like trees)
Post by: Leartin on March 15, 2016, 09:21:03 AM
I think something got messed up here. The title does not make much sense now.
Title: Re: ground objects with variable position like trees, groundobj with slopes
Post by: prissi on March 15, 2016, 11:41:50 PM
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.
Title: Re: ground objects with variable position like trees, groundobj with slopes
Post by: prissi on March 16, 2016, 10:41:30 PM
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.
Title: Re: ground objects with variable position like trees, groundobj with slopes
Post by: Leartin on March 17, 2016, 08:27:30 PM
(http://i84.servimg.com/u/f84/18/49/73/70/muhaha10.png)

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

Title: Re: ground objects with variable position like trees, groundobj with slopes
Post by: prissi on March 17, 2016, 08:56:28 PM
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.
Title: Re: ground objects with variable position like trees, groundobj with slopes
Post by: Leartin on March 17, 2016, 09:08:23 PM
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


(http://dl.dropbox.com/s/6144ura89xs9k8u/shorerocks.png)
(slopes in magenta to keep track, of course for actual needs to be deleted)
Title: Re: ground objects with variable position like trees, groundobj with slopes
Post by: prissi on March 18, 2016, 09:12:36 PM
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.
Title: Re: ground objects with variable position like trees, groundobj with slopes
Post by: gauthier on March 20, 2016, 12:11:56 PM
This looks amazing  ;D ... and some more work to do for pak128  :-X :P